mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
- Action/Rule decoupling work
- Updated web services, SDK and web client where appropraite - Patch added to migrate existing rules - Entire rule service can now be disabled programmatically - Rule service is now disabled during the patching process - StoreEnum and languageEnum types removed from web service interfaces - Multiple rule types now supported in the repo (but not in the UI) - Removed owning node ref from action and rule .. now calculated from methods on the rule service git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@3464 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -100,7 +100,7 @@ public class AddFeaturesActionExecuterTest extends BaseSpringTest
|
||||
assertFalse(this.nodeService.hasAspect(this.nodeRef, ContentModel.ASPECT_CLASSIFIABLE));
|
||||
|
||||
// Execute the action
|
||||
ActionImpl action = new ActionImpl(ID, AddFeaturesActionExecuter.NAME, null);
|
||||
ActionImpl action = new ActionImpl(null, ID, AddFeaturesActionExecuter.NAME, null);
|
||||
action.setParameterValue(AddFeaturesActionExecuter.PARAM_ASPECT_NAME, ContentModel.ASPECT_CLASSIFIABLE);
|
||||
this.executer.execute(action, this.nodeRef);
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2005 Jesper Steen M<>ller
|
||||
* Copyright (C) 2005 Jesper Steen M<>ller
|
||||
*
|
||||
* Licensed under the Mozilla Public License version 1.1
|
||||
* with a permitted attribution clause. You may obtain a
|
||||
@@ -37,7 +37,7 @@ import org.alfresco.util.GUID;
|
||||
* Test of the ActionExecuter for extracting metadata. Note: This test makes
|
||||
* assumptions about the PDF test data for PdfBoxExtracter.
|
||||
*
|
||||
* @author Jesper Steen M<>ller
|
||||
* @author Jesper Steen M<>ller
|
||||
*/
|
||||
public class ContentMetadataExtracterTest extends BaseSpringTest
|
||||
{
|
||||
@@ -102,7 +102,7 @@ public class ContentMetadataExtracterTest extends BaseSpringTest
|
||||
this.nodeService.setProperties(this.nodeRef, props);
|
||||
|
||||
// Execute the action
|
||||
ActionImpl action = new ActionImpl(ID, SetPropertyValueActionExecuter.NAME, null);
|
||||
ActionImpl action = new ActionImpl(null, ID, SetPropertyValueActionExecuter.NAME, null);
|
||||
|
||||
this.executer.execute(action, this.nodeRef);
|
||||
|
||||
@@ -130,7 +130,7 @@ public class ContentMetadataExtracterTest extends BaseSpringTest
|
||||
this.nodeService.setProperties(this.nodeRef, props);
|
||||
|
||||
// Execute the action
|
||||
ActionImpl action = new ActionImpl(ID, SetPropertyValueActionExecuter.NAME, null);
|
||||
ActionImpl action = new ActionImpl(null, ID, SetPropertyValueActionExecuter.NAME, null);
|
||||
|
||||
this.executer.execute(action, this.nodeRef);
|
||||
|
||||
|
@@ -133,8 +133,11 @@ public class ExecuteAllRulesActionExecuter extends ActionExecuterAbstractBase
|
||||
{
|
||||
for (Rule rule : rules)
|
||||
{
|
||||
// Apply the rule to the child node
|
||||
this.actionService.executeAction(rule, child);
|
||||
Action action = rule.getAction();
|
||||
if (action != null)
|
||||
{
|
||||
this.actionService.executeAction(action, child);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -105,15 +105,18 @@ public class ExecuteAllRulesActionExecuterTest extends BaseSpringTest
|
||||
ContentModel.TYPE_CONTENT).getChildRef();
|
||||
|
||||
// Add a couple of rules to the folder
|
||||
Rule rule1 = this.ruleService.createRule(RuleType.INBOUND);
|
||||
Rule rule1 = new Rule();
|
||||
rule1.setRuleType(RuleType.INBOUND);
|
||||
Action action1 = this.actionService.createAction(AddFeaturesActionExecuter.NAME);
|
||||
action1.setParameterValue(AddFeaturesActionExecuter.PARAM_ASPECT_NAME, ContentModel.ASPECT_VERSIONABLE);
|
||||
rule1.addAction(action1);
|
||||
rule1.setAction(action1);
|
||||
this.ruleService.saveRule(folder, rule1);
|
||||
Rule rule2 = this.ruleService.createRule(RuleType.INBOUND);
|
||||
|
||||
Rule rule2 = new Rule();
|
||||
rule2.setRuleType(RuleType.INBOUND);
|
||||
Action action2 = this.actionService.createAction(AddFeaturesActionExecuter.NAME);
|
||||
action2.setParameterValue(AddFeaturesActionExecuter.PARAM_ASPECT_NAME, ContentModel.ASPECT_CLASSIFIABLE);
|
||||
rule2.addAction(action2);
|
||||
rule2.setAction(action2);
|
||||
this.ruleService.saveRule(folder, rule2);
|
||||
|
||||
// Check the the docs don't have the aspects yet
|
||||
@@ -125,7 +128,7 @@ public class ExecuteAllRulesActionExecuterTest extends BaseSpringTest
|
||||
assertTrue(this.nodeService.exists(folder));
|
||||
|
||||
// Execute the action
|
||||
ActionImpl action = new ActionImpl(ID, ExecuteAllRulesActionExecuter.NAME, null);
|
||||
ActionImpl action = new ActionImpl(null, ID, ExecuteAllRulesActionExecuter.NAME, null);
|
||||
this.executer.execute(action, folder);
|
||||
|
||||
assertTrue(this.nodeService.hasAspect(doc1, ContentModel.ASPECT_VERSIONABLE));
|
||||
|
@@ -101,7 +101,7 @@ public class RemoveFeaturesActionExecuterTest extends BaseSpringTest
|
||||
assertTrue(this.nodeService.hasAspect(this.nodeRef, ContentModel.ASPECT_CLASSIFIABLE));
|
||||
|
||||
// Execute the action
|
||||
ActionImpl action = new ActionImpl(ID, RemoveFeaturesActionExecuter.NAME, null);
|
||||
ActionImpl action = new ActionImpl(null, ID, RemoveFeaturesActionExecuter.NAME, null);
|
||||
action.setParameterValue(RemoveFeaturesActionExecuter.PARAM_ASPECT_NAME, ContentModel.ASPECT_CLASSIFIABLE);
|
||||
this.executer.execute(action, this.nodeRef);
|
||||
|
||||
@@ -109,7 +109,7 @@ public class RemoveFeaturesActionExecuterTest extends BaseSpringTest
|
||||
assertFalse(this.nodeService.hasAspect(this.nodeRef, ContentModel.ASPECT_CLASSIFIABLE));
|
||||
|
||||
// Now try and remove an aspect that is not present
|
||||
ActionImpl action2 = new ActionImpl(ID, RemoveFeaturesActionExecuter.NAME, null);
|
||||
ActionImpl action2 = new ActionImpl(null, ID, RemoveFeaturesActionExecuter.NAME, null);
|
||||
action2.setParameterValue(RemoveFeaturesActionExecuter.PARAM_ASPECT_NAME, ContentModel.ASPECT_VERSIONABLE);
|
||||
this.executer.execute(action2, this.nodeRef);
|
||||
}
|
||||
|
@@ -79,7 +79,7 @@ public class ScriptActionExecutor extends ActionExecuterAbstractBase
|
||||
if (nodeService.exists(actionedUponNodeRef))
|
||||
{
|
||||
NodeRef scriptRef = (NodeRef)action.getParameterValue(PARAM_SCRIPTREF);
|
||||
NodeRef spaceRef = (NodeRef)action.getOwningNodeRef();
|
||||
NodeRef spaceRef = this.serviceRegistry.getRuleService().getOwningNodeRef(action);
|
||||
|
||||
if (nodeService.exists(scriptRef))
|
||||
{
|
||||
|
@@ -74,7 +74,7 @@ public class SetPropertyValueActionExecuterTest extends BaseSpringTest
|
||||
public void testExecution()
|
||||
{
|
||||
// Execute the action
|
||||
ActionImpl action = new ActionImpl(ID, SetPropertyValueActionExecuter.NAME, null);
|
||||
ActionImpl action = new ActionImpl(null, ID, SetPropertyValueActionExecuter.NAME, null);
|
||||
action.setParameterValue(SetPropertyValueActionExecuter.PARAM_PROPERTY, ContentModel.PROP_NAME);
|
||||
action.setParameterValue(SetPropertyValueActionExecuter.PARAM_VALUE, TEST_VALUE);
|
||||
this.executer.execute(action, this.nodeRef);
|
||||
|
@@ -73,7 +73,7 @@ public class SpecialiseTypeActionExecuterTest extends BaseAlfrescoSpringTest
|
||||
assertEquals(ContentModel.TYPE_CONTENT, this.nodeService.getType(this.nodeRef));
|
||||
|
||||
// Execute the action
|
||||
ActionImpl action = new ActionImpl(ID, SpecialiseTypeActionExecuter.NAME, null);
|
||||
ActionImpl action = new ActionImpl(null, ID, SpecialiseTypeActionExecuter.NAME, null);
|
||||
action.setParameterValue(SpecialiseTypeActionExecuter.PARAM_TYPE_NAME, ContentModel.TYPE_FOLDER);
|
||||
this.executer.execute(action, this.nodeRef);
|
||||
|
||||
|
Reference in New Issue
Block a user