Enhanced 'beforeCreateChildAssociaton' and 'onCreateChildAssociation' to carry an 'isNewNode' flag.

Fixed Lock and Rules to react correctly to this new information.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6003 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2007-06-18 11:29:00 +00:00
parent 832c1b599e
commit 6e0c406488
9 changed files with 106 additions and 45 deletions

View File

@@ -24,6 +24,7 @@
*/
package org.alfresco.repo.rule.ruletrigger;
import org.alfresco.repo.node.NodeServicePolicies;
import org.alfresco.repo.transaction.AlfrescoTransactionSupport;
import org.alfresco.service.cmr.dictionary.ClassDefinition;
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
@@ -38,10 +39,18 @@ import org.apache.commons.logging.LogFactory;
* We use this specialised trigger for create node beaucse of a problem with the CIFS integration.
* <p>
* The create node trigger will only be fired if the object is NOT a sub-type of content.
* <p>
* Policy names supported are:
* <ul>
* <li>{@linkplain NodeServicePolicies.OnCreateChildAssociationPolicy}</li>
* <li>{@linkplain NodeServicePolicies.BeforeDeleteChildAssociationPolicy}</li>
* <li>{@linkplain NodeServicePolicies.OnCreateNodePolicy}</li>
* </ul>
*
* @author Roy Wetherall
*/
public class CreateNodeRuleTrigger extends SingleChildAssocRefPolicyRuleTrigger
implements NodeServicePolicies.OnCreateNodePolicy
{
/**
* The logger
@@ -55,7 +64,10 @@ public class CreateNodeRuleTrigger extends SingleChildAssocRefPolicyRuleTrigger
this.dictionaryService = dictionaryService;
}
public void policyBehaviour(ChildAssociationRef childAssocRef)
/**
* {@inheritDoc}
*/
public void onCreateNode(ChildAssociationRef childAssocRef)
{
// Only fire the rule if the node is question has no potential to contain content
// TODO we need to find a better way to do this .. how can this be resolved in CIFS??