Replication Definition deletion support + unit test

(Disabled) unit test for edit/save/load/edit/save of replication definitions,
 so that Derek can look at why the node service breaks for this


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@21093 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Nick Burch
2010-07-12 13:57:30 +00:00
parent 0bc430be08
commit d633e6416b
5 changed files with 158 additions and 1 deletions

View File

@@ -91,9 +91,14 @@ public class ReplicationDefinitionImpl extends ActionImpl implements Replication
*/
@SuppressWarnings("unchecked")
public List<NodeRef> getPayload() {
// Retrieve the previous payload
// Could be null, could be a list, or could be a single
// NodeRef (if the list had one entry when saved)
Object payloadO =
getParameterValue(REPLICATION_DEFINITION_PAYLOAD);
// Ensure we always have a list, no matter what
// we got back
List<NodeRef> payload;
if(payloadO == null) {
payload = new ArrayList<NodeRef>();
@@ -104,8 +109,11 @@ public class ReplicationDefinitionImpl extends ActionImpl implements Replication
if(payloadO instanceof List) {
payload = (List<NodeRef>)payloadO;
} else {
// Turn it into a list
payload = new ArrayList<NodeRef>();
payload.add((NodeRef)payloadO);
// And switch to using the list from now on
setParameterValue(REPLICATION_DEFINITION_PAYLOAD, (Serializable)payload);
}
}