cancel
Showing results for 
Search instead for 
Did you mean: 

Define content rule in a custom model?

fx3000se
Champ in-the-making
Champ in-the-making
Can I define a (content) rule in a custom model xml file?
E.g. define a custom folder type which has a rule doing something (preferably invoking a javascript) on all inbound items.
If yes what is the xml-syntax?
3 REPLIES 3

zaizi
Champ in-the-making
Champ in-the-making
Check out the Records Management module for example of bootstrapping custom behaviours / content rules and custom model.

fx3000se
Champ in-the-making
Champ in-the-making
Thanks.
Took the RMS source code and adapted it. Now when the onCreateNode script should be executed I get:
Failed to create new space due to error: Failed to execute script 'alfresco/module/mymodule/script/onCreateNode_myModel.js': ReferenceError: "document" is not defined. (AlfrescoScript#2)
In bootstrap-context.xml I have the following code:
<value>alfresco/module/mymodule/script/onCreateNode_myModel.js</value>
the js-script it is at the given path.
When I use the corresponding line from the RMS module in my bootstrap-context.xml:
<value>alfresco/module/org.alfresco.module.RecordsManagement/script/onCreateNode_rmaFilePlan.js</value>
that script is found and executed…

fx3000se
Champ in-the-making
Champ in-the-making
what do I (additionally) need to do to make the script "visible"?