04-09-2014 07:57 AM
04-09-2014 03:24 PM
04-11-2014 04:50 AM
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
<!– Registration of new models –>
<bean id="someco.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
<property name="models">
<list>
<value>alfresco/extension/model/scModel.xml</value>
</list>
</property>
</bean>
<bean id="managePermissions"
class="org.alfresco.repo.policy.registration.ClassPolicyRegistration"
parent="policyRegistration">
<property name="policyName">
<value>{http://www.alfresco.org}onUpdateProperties</value>
</property>
<property name="className">
<value>{http://www.someco.com/model/content/1.0}doc</value>
</property>
<property name="behaviour">
<bean class="org.alfresco.repo.jscript.ScriptBehaviour" parent="scriptBehaviour">
<property name="location">
<bean class="org.alfresco.repo.jscript.ClasspathScriptLocation">
<constructor-arg>
<value>alfresco/extension/scripts/managePermissions.js</value>
</constructor-arg>
</bean>
</property>
</bean>
</property>
</bean>
</beans>
var scriptFailed = false;
// Have a look at the behaviour object that should have been passed
if (behaviour == null) {
logger.log("The behaviour object has not been set.");
scriptFailed = true;
}
// Check the name of the behaviour
if (behaviour.name == null && behaviour.name != "onUpdateProperties") {
logger.log("The behaviour name has not been set correctly.");
scriptFailed = true;
} else {
logger.log("Behaviour name: " + behaviour.name);
}
// Check the arguments
if (behaviour.args == null) {
logger.log("The args have not been set.");
scriptFailed = true;
} else {
if (behaviour.args.length == 1) {
var childAssoc = behaviour.args[0];
logger.log("Calling manage permissions");
childAssoc.properties["{http://www.alfresco.org/model/content/1.0}description"] = "A definition!";
} else {
logger.log("The number of arguments is incorrect.");
scriptFailed = true;
}
}
04-11-2014 02:10 PM
04-11-2014 04:54 PM
04-13-2014 11:43 PM
logger.getSystem().out("*****");
,it will print log information on tomcat console .04-14-2014 04:53 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.