Big honkin' merge from head. Sheesh!

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3617 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Britt Park
2006-08-27 01:01:30 +00:00
parent e2c66899cc
commit 8031cc6574
322 changed files with 20776 additions and 6550 deletions

View File

@@ -56,6 +56,12 @@ public abstract class RuleTriggerAbstractBase implements RuleTrigger
/** The dictionary service */
protected DictionaryService dictionaryService;
/**
* Indicates whether the rule should be executed immediately or at the end of the transaction.
* By default this is false as all rules are executed at the end of the transaction.
*/
protected boolean executeRuleImmediately = false;
/**
* Set the policy component
*
@@ -96,6 +102,17 @@ public abstract class RuleTriggerAbstractBase implements RuleTrigger
this.dictionaryService = dictionaryService;
}
/**
* Sets the values that indicates whether the rule should be executed immediately
* or not.
*
* @param executeRuleImmediately true execute the rule immediaely, false otherwise
*/
public void setExecuteRuleImmediately(boolean executeRuleImmediately)
{
this.executeRuleImmediately = executeRuleImmediately;
}
/**
* Registration of an interested rule type
*/
@@ -117,7 +134,7 @@ public abstract class RuleTriggerAbstractBase implements RuleTrigger
{
for (RuleType ruleType : this.ruleTypes)
{
ruleType.triggerRuleType(nodeRef, actionedUponNodeRef);
ruleType.triggerRuleType(nodeRef, actionedUponNodeRef, this.executeRuleImmediately);
}
}
}

View File

@@ -35,7 +35,6 @@ public class RuleTriggerTest extends BaseSpringTest
{
private static final String ON_CREATE_NODE_TRIGGER = "on-create-node-trigger";
private static final String ON_UPDATE_NODE_TRIGGER = "on-update-node-trigger";
private static final String ON_DELETE_NODE_TRIGGER = "on-delete-node-trigger";
private static final String ON_CREATE_CHILD_ASSOCIATION_TRIGGER = "on-create-child-association-trigger";
private static final String ON_DELETE_CHILD_ASSOCIATION_TRIGGER = "on-delete-child-association-trigger";
private static final String ON_CREATE_ASSOCIATION_TRIGGER = "on-create-association-trigger";
@@ -93,23 +92,23 @@ public class RuleTriggerTest extends BaseSpringTest
assertTrue(ruleType.rulesTriggered);
}
public void testOnDeleteNodeTrigger()
{
NodeRef nodeRef = this.nodeService.createNode(
this.rootNodeRef,
ContentModel.ASSOC_CHILDREN,
ContentModel.ASSOC_CHILDREN,
ContentModel.TYPE_CONTAINER).getChildRef();
TestRuleType ruleType = createTestRuleType(ON_DELETE_NODE_TRIGGER);
assertFalse(ruleType.rulesTriggered);
// Try and trigger the type
this.nodeService.deleteNode(nodeRef);
// Check to see if the rule type has been triggered
assertTrue(ruleType.rulesTriggered);
}
// public void testOnDeleteNodeTrigger()
// {
// NodeRef nodeRef = this.nodeService.createNode(
// this.rootNodeRef,
// ContentModel.ASSOC_CHILDREN,
// ContentModel.ASSOC_CHILDREN,
// ContentModel.TYPE_CONTAINER).getChildRef();
//
// TestRuleType ruleType = createTestRuleType(ON_DELETE_NODE_TRIGGER);
// assertFalse(ruleType.rulesTriggered);
//
// // Try and trigger the type
// this.nodeService.deleteNode(nodeRef);
//
// // Check to see if the rule type has been triggered
// assertTrue(ruleType.rulesTriggered);
// }
public void testOnCreateChildAssociationTrigger()
{
@@ -287,7 +286,7 @@ public class RuleTriggerTest extends BaseSpringTest
return "displayLabel";
}
public void triggerRuleType(NodeRef nodeRef, NodeRef actionedUponNodeRef)
public void triggerRuleType(NodeRef nodeRef, NodeRef actionedUponNodeRef, boolean executeRuleImmediately)
{
// Indicate that the rules have been triggered
this.rulesTriggered = true;