[英]Is it possible to override/extend onNewFolder in Alfresco?
I'm using Alfresco 5. I have create a custom type (parent type is cm:folder) and added an entry for this type in the Document Library "Create" menu. 我正在使用Alfresco5。我创建了一个自定义类型(父类型为cm:folder),并在“文档库”的“创建”菜单中为此类型添加了一个条目。 I would like to override the default folder create function so that I can do some custom processing.
我想覆盖默认的文件夹创建功能,以便可以执行一些自定义处理。 I would like to create some content within the new folder each time.
我想每次都在新文件夹中创建一些内容。
You can use alfresco behaviour/policies for your requirement. 您可以根据需要使用户外行为/政策。
For creating policy you need to create below things. 要创建策略,您需要创建以下内容。
1.Spring Bean in context file 1.上下文文件中的Spring Bean
2.One class which implements onCreateNode from org.alfresco.repo.node.NodeServicePolicies 2,一个从org.alfresco.repo.node.NodeServicePolicies实现onCreateNode的类
For more information regarding policies read below blog written by Jeff Potts 有关政策的更多信息,请阅读Jeff Potts撰写的以下博客
http://ecmarchitect.com/alfresco-developer-series-tutorials/behaviors/tutorial/tutorial.html http://ecmarchitect.com/alfresco-developer-series-tutorials/behaviors/tutorial/tutorial.html
Apart from behaviour/policies easier option would be using rule and script. 除了行为/策略,更容易的选择是使用规则和脚本。
You can create a rule which will be executed on creation of new folder. 您可以创建一个规则,该规则将在创建新文件夹时执行。
Create alfresco java script which will do processing you required on creation of new folder. 创建alfresco Java脚本,它将执行创建新文件夹时所需的处理。
Hook up script with rule. 用规则连接脚本。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.