mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
Merged HEAD (5.2) to 5.2.N (5.2.1)
126432 jkaabimofrad: Merged FILE-FOLDER-API (5.2.0) to HEAD (5.2) 121870 gjames: Adding copy and move actions to the NodeEntityResource git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@126778 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
47
source/java/org/alfresco/rest/api/model/NodeTarget.java
Normal file
47
source/java/org/alfresco/rest/api/model/NodeTarget.java
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
package org.alfresco.rest.api.model;
|
||||||
|
|
||||||
|
import org.alfresco.service.cmr.repository.NodeRef;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A target object.
|
||||||
|
* @author Gethin James
|
||||||
|
*/
|
||||||
|
public class NodeTarget extends Target
|
||||||
|
{
|
||||||
|
String targetParentId;
|
||||||
|
String name;
|
||||||
|
|
||||||
|
public NodeTarget()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTargetParentId()
|
||||||
|
{
|
||||||
|
return targetParentId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTargetParentId(String targetParentId)
|
||||||
|
{
|
||||||
|
this.targetParentId = targetParentId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName()
|
||||||
|
{
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name)
|
||||||
|
{
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString()
|
||||||
|
{
|
||||||
|
final StringBuilder sb = new StringBuilder("NodeTarget{");
|
||||||
|
sb.append("targetParentId=").append(targetParentId);
|
||||||
|
sb.append(", name='").append(name).append('\'');
|
||||||
|
sb.append('}');
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
}
|
@@ -27,6 +27,8 @@ package org.alfresco.rest.api.nodes;
|
|||||||
|
|
||||||
import org.alfresco.rest.api.Nodes;
|
import org.alfresco.rest.api.Nodes;
|
||||||
import org.alfresco.rest.api.model.Node;
|
import org.alfresco.rest.api.model.Node;
|
||||||
|
import org.alfresco.rest.api.model.NodeTarget;
|
||||||
|
import org.alfresco.rest.framework.Action;
|
||||||
import org.alfresco.rest.framework.BinaryProperties;
|
import org.alfresco.rest.framework.BinaryProperties;
|
||||||
import org.alfresco.rest.framework.WebApiDescription;
|
import org.alfresco.rest.framework.WebApiDescription;
|
||||||
import org.alfresco.rest.framework.WebApiParam;
|
import org.alfresco.rest.framework.WebApiParam;
|
||||||
@@ -127,4 +129,20 @@ public class NodesEntityResource implements
|
|||||||
{
|
{
|
||||||
nodes.deleteNode(nodeId);
|
nodes.deleteNode(nodeId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Action("copy")
|
||||||
|
@WebApiDescription(title = "Copy Node", description="Copy one or more nodes (files or folders) to a new target folder, with option to rename.")
|
||||||
|
public Node copyById(String nodeId, NodeTarget target, Parameters parameters)
|
||||||
|
{
|
||||||
|
return nodes.copyNode(nodeId, target.getTargetParentId(), target.getName(), parameters);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Action("move")
|
||||||
|
@WebApiDescription(title = "Move Node", description="Moves one or more nodes (files or folders) to a new target folder, with option to rename.")
|
||||||
|
public Node moveById(String nodeId, NodeTarget target, Parameters parameters)
|
||||||
|
{
|
||||||
|
return nodes.moveNode(nodeId, target.getTargetParentId(), target.getName(), parameters);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user