diff --git a/config/alfresco/action-services-context.xml b/config/alfresco/action-services-context.xml
index 779f01c5bd..db79de5922 100644
--- a/config/alfresco/action-services-context.xml
+++ b/config/alfresco/action-services-context.xml
@@ -436,4 +436,12 @@
+
+
+
+
+
+ false
+
+
diff --git a/config/alfresco/messages/action-config.properties b/config/alfresco/messages/action-config.properties
index de34139cdb..4f51e5c6fb 100644
--- a/config/alfresco/messages/action-config.properties
+++ b/config/alfresco/messages/action-config.properties
@@ -96,7 +96,16 @@ simple-avm-promote.target-store.display-label=The name of the target AVM store.
avm-revert-store.title=Revert a Single Node in a store.
avm-revert-store.description=This reverts all nodes including and below the argument node to a previous version.
-avm-revert-store.version.display-lable=The version to revert to.
+avm-revert-store.version.display-label=The version to revert to.
+
+avm-revert-list.title=Revert a List of Nodes in a store.
+avm-revert-list.description=This reverts all the nodes included in the list.
+avm-revert-list.version.display-label=The version to revert to.
+avm-revert-list.node-list.display-label=The string encoded list of nodes to revert.
+avm-revert-list.flatten.display-label=Whether to flatten to a staging store after revert.
+avm-revert-list.store.display-label=The name of the store being reverted, only needed if flattening.
+avm-revert-list.staging.display-label=The name of the staging store to flatten to.
+avm-revert-list.flatten-path.display-label=The store relative path that should be flattened.
start-avm-workflow.title=Start a WCM Workflow
start-avm-workflow.description=Starts a workflow expecting an AVM workflow package
diff --git a/source/java/org/alfresco/repo/avm/AVMServiceTest.java b/source/java/org/alfresco/repo/avm/AVMServiceTest.java
index b8711a324a..7b87a5101c 100644
--- a/source/java/org/alfresco/repo/avm/AVMServiceTest.java
+++ b/source/java/org/alfresco/repo/avm/AVMServiceTest.java
@@ -33,9 +33,11 @@ import java.util.TreeMap;
import org.alfresco.model.ContentModel;
import org.alfresco.model.WCMModel;
import org.alfresco.repo.action.ActionImpl;
+import org.alfresco.repo.avm.actions.AVMRevertListAction;
import org.alfresco.repo.avm.actions.SimpleAVMPromoteAction;
import org.alfresco.repo.avm.actions.SimpleAVMSubmitAction;
import org.alfresco.repo.avm.util.BulkLoader;
+import org.alfresco.repo.avm.util.VersionPathStuffer;
import org.alfresco.repo.domain.PropertyValue;
import org.alfresco.repo.security.authentication.AuthenticationComponent;
import org.alfresco.repo.transaction.TransactionUtil;
@@ -229,6 +231,56 @@ public class AVMServiceTest extends AVMServiceTestBase
}
}
+ /**
+ * Test the revert list action.
+ */
+ public void testRevertListAction()
+ {
+ try
+ {
+ setupBasicTree();
+ fService.createAVMStore("area");
+ fService.createLayeredDirectory("main:/a", "area:/", "a");
+ fService.getFileOutputStream("area:/a/b/c/foo").close();
+ List diffs = fSyncService.compare(-1, "area:/a", -1, "main:/a");
+ assertEquals(1, diffs.size());
+ fSyncService.update(diffs, false, false, false, false, null, null);
+ fService.getFileOutputStream("area:/a/b/c/bar").close();
+ diffs = fSyncService.compare(-1, "area:/a", -1, "main:/a");
+ assertEquals(1, diffs.size());
+ final ActionImpl action = new ActionImpl(null,
+ GUID.generate(),
+ AVMRevertListAction.NAME);
+ VersionPathStuffer stuffer = new VersionPathStuffer();
+ stuffer.add(-1, "area:/a/b");
+ String nodeList = stuffer.toString();
+ action.setParameterValue(AVMRevertListAction.PARAM_VERSION, 1);
+ action.setParameterValue(AVMRevertListAction.PARAM_NODE_LIST, nodeList);
+ action.setParameterValue(AVMRevertListAction.PARAM_FLATTEN, true);
+ action.setParameterValue(AVMRevertListAction.PARAM_STORE, "area");
+ action.setParameterValue(AVMRevertListAction.PARAM_STAGING, "main");
+ action.setParameterValue(AVMRevertListAction.PARAM_FLATTEN_PATH, "/a");
+ final AVMRevertListAction revert = (AVMRevertListAction)fContext.getBean("avm-revert-list");
+ class TxnWork implements TransactionUtil.TransactionWork