From 992bd82b9eb8d2f95809e58ede59334c400a6c7a Mon Sep 17 00:00:00 2001 From: Britt Park Date: Fri, 17 Nov 2006 00:57:31 +0000 Subject: [PATCH] Cleaned up a seriously unnecessary ugliness. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@4378 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../org/alfresco/repo/avm/AVMServiceTest.java | 16 ++++++++-------- .../repo/avm/actions/AVMRevertListAction.java | 8 +++----- .../avm/actions/AVMUndoSandboxListAction.java | 9 +++------ 3 files changed, 14 insertions(+), 19 deletions(-) diff --git a/source/java/org/alfresco/repo/avm/AVMServiceTest.java b/source/java/org/alfresco/repo/avm/AVMServiceTest.java index 245d526248..91f2445f2f 100644 --- a/source/java/org/alfresco/repo/avm/AVMServiceTest.java +++ b/source/java/org/alfresco/repo/avm/AVMServiceTest.java @@ -252,11 +252,11 @@ public class AVMServiceTest extends AVMServiceTestBase final ActionImpl action = new ActionImpl(null, GUID.generate(), AVMRevertListAction.NAME); - VersionPathStuffer stuffer = new VersionPathStuffer(); - stuffer.add(-1, "area:/a/b"); - String nodeList = stuffer.toString(); + List> versionPaths = + new ArrayList>(); + versionPaths.add(new Pair(-1, "area:/a/b")); action.setParameterValue(AVMRevertListAction.PARAM_VERSION, fService.getLatestSnapshotID("area")); - action.setParameterValue(AVMRevertListAction.PARAM_NODE_LIST, nodeList); + action.setParameterValue(AVMRevertListAction.PARAM_NODE_LIST, (Serializable)versionPaths); action.setParameterValue(AVMRevertListAction.PARAM_FLATTEN, true); action.setParameterValue(AVMRevertListAction.PARAM_STORE, "area"); action.setParameterValue(AVMRevertListAction.PARAM_STAGING, "main"); @@ -304,10 +304,10 @@ public class AVMServiceTest extends AVMServiceTestBase final ActionImpl action = new ActionImpl(null, GUID.generate(), AVMUndoSandboxListAction.NAME); - VersionPathStuffer stuffer = new VersionPathStuffer(); - stuffer.add(-1, "area:/a/b/c/bar"); - String nodeList = stuffer.toString(); - action.setParameterValue(AVMUndoSandboxListAction.PARAM_NODE_LIST, nodeList); + List> versionPaths = + new ArrayList>(); + versionPaths.add(new Pair(-1, "area:/a/b/c/bar")); + action.setParameterValue(AVMUndoSandboxListAction.PARAM_NODE_LIST, (Serializable)versionPaths); final AVMUndoSandboxListAction revert = (AVMUndoSandboxListAction)fContext.getBean("avm-undo-list"); class TxnWork implements TransactionUtil.TransactionWork { diff --git a/source/java/org/alfresco/repo/avm/actions/AVMRevertListAction.java b/source/java/org/alfresco/repo/avm/actions/AVMRevertListAction.java index 56a5aac67d..c5b3099e82 100644 --- a/source/java/org/alfresco/repo/avm/actions/AVMRevertListAction.java +++ b/source/java/org/alfresco/repo/avm/actions/AVMRevertListAction.java @@ -8,7 +8,6 @@ import java.util.List; import org.alfresco.repo.action.ParameterDefinitionImpl; import org.alfresco.repo.action.executer.ActionExecuterAbstractBase; -import org.alfresco.repo.avm.util.VersionPathUnstuffer; import org.alfresco.service.cmr.action.Action; import org.alfresco.service.cmr.action.ParameterDefinition; import org.alfresco.service.cmr.avmsync.AVMDifference; @@ -62,9 +61,8 @@ public class AVMRevertListAction extends ActionExecuterAbstractBase protected void executeImpl(Action action, NodeRef actionedUponNodeRef) { int revertVersion = (Integer)action.getParameterValue(PARAM_VERSION); - String packedNodes = (String)action.getParameterValue(PARAM_NODE_LIST); - VersionPathUnstuffer unstuffer = new VersionPathUnstuffer(packedNodes); - List> versionPaths = unstuffer.getVersionPaths(); + List> versionPaths = + (List>)action.getParameterValue(PARAM_NODE_LIST); List diffs = new ArrayList(); for (Pair item : versionPaths) { @@ -99,7 +97,7 @@ public class AVMRevertListAction extends ActionExecuterAbstractBase getParamDisplayLabel(PARAM_VERSION))); paramList.add( new ParameterDefinitionImpl(PARAM_NODE_LIST, - DataTypeDefinition.TEXT, + DataTypeDefinition.ANY, true, getParamDisplayLabel(PARAM_NODE_LIST))); paramList.add( diff --git a/source/java/org/alfresco/repo/avm/actions/AVMUndoSandboxListAction.java b/source/java/org/alfresco/repo/avm/actions/AVMUndoSandboxListAction.java index fbec29615b..06ff6aeb2f 100644 --- a/source/java/org/alfresco/repo/avm/actions/AVMUndoSandboxListAction.java +++ b/source/java/org/alfresco/repo/avm/actions/AVMUndoSandboxListAction.java @@ -8,12 +8,10 @@ import java.util.List; import org.alfresco.repo.action.ParameterDefinitionImpl; import org.alfresco.repo.action.executer.ActionExecuterAbstractBase; import org.alfresco.repo.avm.AVMNodeConverter; -import org.alfresco.repo.avm.util.VersionPathUnstuffer; import org.alfresco.service.cmr.action.Action; import org.alfresco.service.cmr.action.ParameterDefinition; import org.alfresco.service.cmr.avm.AVMNodeDescriptor; import org.alfresco.service.cmr.avm.AVMService; -import org.alfresco.service.cmr.avmsync.AVMSyncService; import org.alfresco.service.cmr.dictionary.DataTypeDefinition; import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.util.Pair; @@ -49,9 +47,8 @@ public class AVMUndoSandboxListAction extends ActionExecuterAbstractBase @Override protected void executeImpl(Action action, NodeRef actionedUponNodeRef) { - String packedNodes = (String)action.getParameterValue(PARAM_NODE_LIST); - VersionPathUnstuffer unstuffer = new VersionPathUnstuffer(packedNodes); - List> versionPaths = unstuffer.getVersionPaths(); + List> versionPaths = + (List>)action.getParameterValue(PARAM_NODE_LIST); for (Pair item : versionPaths) { AVMNodeDescriptor desc = fAVMService.lookup(-1, item.getSecond(), true); @@ -80,7 +77,7 @@ public class AVMUndoSandboxListAction extends ActionExecuterAbstractBase { paramList.add( new ParameterDefinitionImpl(PARAM_NODE_LIST, - DataTypeDefinition.TEXT, + DataTypeDefinition.ANY, true, getParamDisplayLabel(PARAM_NODE_LIST))); }