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)
126368 jkaabimofrad: Merged FILE-FOLDER-API (5.2.0) to HEAD (5.2) 119796 jvonka: FileFolder API - NodeApiTest - add tests (+ve & -ve) for create folder RA-635 git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@126713 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -31,11 +31,12 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
import org.alfresco.rest.framework.resource.UniqueId;
|
||||
import org.alfresco.service.ServiceRegistry;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.StoreRef;
|
||||
import org.alfresco.service.cmr.security.NoSuchPersonException;
|
||||
import org.alfresco.service.cmr.security.PersonService;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
@@ -49,6 +50,7 @@ import org.apache.chemistry.opencmis.commons.data.PropertyData;
|
||||
* @author Gethin James
|
||||
* @author janv
|
||||
*/
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class Node implements Comparable<Node>
|
||||
{
|
||||
protected NodeRef nodeRef;
|
||||
@@ -142,15 +144,29 @@ public class Node implements Comparable<Node>
|
||||
return userInfo;
|
||||
}
|
||||
|
||||
@UniqueId
|
||||
public NodeRef getNodeRef()
|
||||
{
|
||||
return nodeRef;
|
||||
private String getNodeRefAsString(NodeRef nRef) {
|
||||
return (nRef != null ? nRef.getId() : null);
|
||||
}
|
||||
|
||||
public void setNodeRef(NodeRef nodeRef)
|
||||
private NodeRef getStringAsNodeRef(String nRefString) {
|
||||
if(! NodeRef.isNodeRef(nRefString))
|
||||
{
|
||||
return new NodeRef(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE, nRefString);
|
||||
}
|
||||
else
|
||||
{
|
||||
return new NodeRef(nRefString);
|
||||
}
|
||||
}
|
||||
|
||||
public String getId()
|
||||
{
|
||||
this.nodeRef = nodeRef;
|
||||
return getNodeRefAsString(this.nodeRef);
|
||||
}
|
||||
|
||||
public void setId(String id)
|
||||
{
|
||||
this.nodeRef = getStringAsNodeRef(id);
|
||||
}
|
||||
|
||||
public Date getCreatedAt()
|
||||
@@ -222,14 +238,14 @@ public class Node implements Comparable<Node>
|
||||
this.aspectNames = aspectNames;
|
||||
}
|
||||
|
||||
public NodeRef getParentId()
|
||||
public String getParentId()
|
||||
{
|
||||
return parentNodeRef;
|
||||
return getNodeRefAsString(parentNodeRef);
|
||||
}
|
||||
|
||||
public void setParentId(NodeRef parentNodeRef)
|
||||
public void setParentId(String parentId)
|
||||
{
|
||||
this.parentNodeRef = parentNodeRef;
|
||||
this.parentNodeRef = getStringAsNodeRef(parentId);
|
||||
}
|
||||
|
||||
public Boolean getIsFolder()
|
||||
@@ -265,13 +281,13 @@ public class Node implements Comparable<Node>
|
||||
}
|
||||
|
||||
Node node = (Node)other;
|
||||
return EqualsHelper.nullSafeEquals(getNodeRef(), node.getNodeRef());
|
||||
return EqualsHelper.nullSafeEquals(getId(), node.getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(Node node)
|
||||
{
|
||||
return getNodeRef().toString().compareTo(node.getNodeRef().toString());
|
||||
return getId().toString().compareTo(node.getId().toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user