As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
<bean id="onUpdateDoc" class="org.alfresco.repo.policy.registration.ClassPolicyRegistration" parent="policyRegistration"> <property name="policyName"> <value>{http://www.alfresco.org}onContentUpdate</value> </property> <property name="className"> <value>{http://www.alfresco.org/model/content/1.0}content</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/onUpdateNode.js</value> </constructor-arg> </bean> </property> </bean> </property> </bean>
<?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'> <beans> <bean id="avmNodeService" class="org.alfresco.repo.avm.AVMNodeService" init-method="init"> <property name="dictionaryService" ref="dictionaryService" /> <property name="avmService" ref="avmLockingAwareService" /> <property name="policyComponent" ref="policyComponent" /> <property name="invokePolicies" value="true" /> </bean> </beans>
<bean id="avmNodeService" class="org.alfresco.repo.avm.AVMNodeService" init-method="init"> <property name="dictionaryService" ref="dictionaryService" /> <property name="avmService" ref="avmLockingAwareService" /> <property name="policyComponent" ref="policyComponent" /> <property name="invokePolicies" value="true" /> </bean> <bean id="onUpdateAVMDoc" class="org.alfresco.repo.policy.registration.ClassPolicyRegistration" parent="policyRegistration"> <property name="policyName"> <value>{http://www.alfresco.org}onContentUpdate</value> </property> <property name="className"> <value>{http://www.alfresco.org/model/wcmmodel/1.0}avmcontent</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/onContentUpdate.js</value> </constructor-arg> </bean> </property> </bean> </property> </bean>
public ChildAssociationRef createNode( NodeRef parentRef, QName assocTypeQName, QName assocQName, QName nodeTypeQName, Map<QName, Serializable> properties) throws InvalidNodeRefException, InvalidTypeException { // AVM stores only allow simple child associations. if (!assocTypeQName.equals(ContentModel.ASSOC_CONTAINS)) { throw new InvalidTypeException(assocTypeQName); } String nodeName = assocQName.getLocalName(); Pair<Integer, String> avmVersionPath = AVMNodeConverter.ToAVMVersionPath(parentRef); int version = avmVersionPath.getFirst(); if (version >= 0) { throw new InvalidNodeRefException("Read only store.", parentRef); } String avmPath = avmVersionPath.getSecond(); // Invoke policy behavior. // invokeBeforeUpdateNode(parentRef); // invokeBeforeCreateNode(parentRef, assocTypeQName, assocQName, nodeTypeQName); // Look up the type definition in the dictionary. TypeDefinition nodeTypeDef = dictionaryService.getType(nodeTypeQName); // Do the creates for supported types, or error out. try {