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)
126351 jkaabimofrad: Merged FILE-FOLDER-API (5.2.0) to HEAD (5.2) 118825 jkaabimofrad: RA-655: manual merge of SFS module to FILE-FOLDER-API. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@126696 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -46,6 +46,11 @@ public class Document extends Node
|
||||
{
|
||||
private ContentInfo contentInfo;
|
||||
|
||||
// instance init block
|
||||
{
|
||||
this.isFolder = Boolean.FALSE;
|
||||
}
|
||||
|
||||
public Document() {
|
||||
super();
|
||||
}
|
||||
@@ -64,76 +69,76 @@ public class Document extends Node
|
||||
}
|
||||
}
|
||||
|
||||
public Boolean getIsFolder()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public ContentInfo getContent()
|
||||
{
|
||||
return contentInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "Document [contentInfo=" + contentInfo.toString() + ", nodeRef="
|
||||
+ nodeRef + ", name=" + name + ", createdAt=" + createdAt
|
||||
+ ", modifiedAt=" + modifiedAt + ", createdBy=" + createdBy
|
||||
+ ", modifiedBy=" + modifiedBy + "]";
|
||||
}
|
||||
public void setContent(ContentInfo contentInfo)
|
||||
{
|
||||
this.contentInfo = contentInfo;
|
||||
}
|
||||
|
||||
// TODO for backwards compat' - set explicitly when needed (ie. favourites)
|
||||
private String mimeType;
|
||||
private BigInteger sizeInBytes;
|
||||
private String versionLabel;
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "Document [contentInfo=" + contentInfo.toString() + ", nodeRef="
|
||||
+ nodeRef + ", name=" + name + ", createdAt=" + createdAt
|
||||
+ ", modifiedAt=" + modifiedAt + ", createdBy=" + createdBy
|
||||
+ ", modifiedBy=" + modifiedBy + "]";
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
// TODO for backwards compat' - set explicitly when needed (ie. favourites)
|
||||
private String mimeType;
|
||||
private BigInteger sizeInBytes;
|
||||
private String versionLabel;
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
public String getMimeType()
|
||||
{
|
||||
return mimeType;
|
||||
}
|
||||
public String getMimeType()
|
||||
{
|
||||
return mimeType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
public BigInteger getSizeInBytes()
|
||||
{
|
||||
return sizeInBytes;
|
||||
}
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
public BigInteger getSizeInBytes()
|
||||
{
|
||||
return sizeInBytes;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
public String getVersionLabel()
|
||||
{
|
||||
return versionLabel;
|
||||
}
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
public String getVersionLabel()
|
||||
{
|
||||
return versionLabel;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
public void setMimeType(String mimeType)
|
||||
{
|
||||
this.mimeType = mimeType;
|
||||
}
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
public void setMimeType(String mimeType)
|
||||
{
|
||||
this.mimeType = mimeType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
public void setSizeInBytes(BigInteger sizeInBytes)
|
||||
{
|
||||
this.sizeInBytes = sizeInBytes;
|
||||
}
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
public void setSizeInBytes(BigInteger sizeInBytes)
|
||||
{
|
||||
this.sizeInBytes = sizeInBytes;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
public void setVersionLabel(String versionLabel)
|
||||
{
|
||||
this.versionLabel = versionLabel;
|
||||
}
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
public void setVersionLabel(String versionLabel)
|
||||
{
|
||||
this.versionLabel = versionLabel;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -23,6 +23,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
|
||||
package org.alfresco.rest.api.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
@@ -37,31 +38,30 @@ import org.alfresco.service.namespace.QName;
|
||||
*
|
||||
* @author steveglover
|
||||
* @author janv
|
||||
*
|
||||
*/
|
||||
public class Folder extends Node
|
||||
{
|
||||
public Folder()
|
||||
{
|
||||
super();
|
||||
}
|
||||
// instance init block
|
||||
{
|
||||
this.isFolder = Boolean.TRUE;
|
||||
}
|
||||
|
||||
public Folder()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public Folder(NodeRef nodeRef, NodeRef parentNodeRef, Map<QName, Serializable> nodeProps, ServiceRegistry sr)
|
||||
{
|
||||
super(nodeRef, parentNodeRef, nodeProps, sr);
|
||||
}
|
||||
|
||||
public Boolean getIsFolder()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "Folder [nodeRef=" + nodeRef + ", name=" + name + ", title="
|
||||
+ title + ", description=" + description + ", createdAt="
|
||||
+ createdAt + ", modifiedAt=" + modifiedAt + ", createdBy="
|
||||
+ createdBy + ", modifiedBy=" + modifiedBy + "]";
|
||||
}
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "Folder [nodeRef=" + nodeRef + ", name=" + name + ", title="
|
||||
+ title + ", description=" + description + ", createdAt="
|
||||
+ createdAt + ", modifiedAt=" + modifiedAt + ", createdBy="
|
||||
+ createdBy + ", modifiedBy=" + modifiedBy + "]";
|
||||
}
|
||||
}
|
||||
|
@@ -57,13 +57,15 @@ public class Node implements Comparable<Node>
|
||||
protected UserInfo createdByUser;
|
||||
protected UserInfo modifiedByUser;
|
||||
|
||||
protected Boolean isFolder;
|
||||
|
||||
protected NodeRef parentNodeRef;
|
||||
protected PathInfo pathInfo;
|
||||
protected String prefixTypeQName;
|
||||
|
||||
protected List<String> aspectNames;
|
||||
|
||||
protected Map<String, Serializable> props;
|
||||
protected Map<String, Object> properties;
|
||||
|
||||
// TODO fixme !
|
||||
// also need to optionally pass in user map - eg. when listing children (to avoid multiple lookups for same user)
|
||||
@@ -190,12 +192,12 @@ public class Node implements Comparable<Node>
|
||||
this.prefixTypeQName = prefixType;
|
||||
}
|
||||
|
||||
public Map getProperties() {
|
||||
return this.props;
|
||||
public Map<String, Object> getProperties() {
|
||||
return this.properties;
|
||||
}
|
||||
|
||||
public void setProperties(Map props) {
|
||||
this.props = props;
|
||||
public void setProperties(Map<String, Object> props) {
|
||||
this.properties = props;
|
||||
}
|
||||
|
||||
public List<String> getAspectNames() {
|
||||
@@ -211,6 +213,21 @@ public class Node implements Comparable<Node>
|
||||
return parentNodeRef;
|
||||
}
|
||||
|
||||
public void setParentId(NodeRef parentNodeRef)
|
||||
{
|
||||
this.parentNodeRef = parentNodeRef;
|
||||
}
|
||||
|
||||
public Boolean getIsFolder()
|
||||
{
|
||||
return isFolder;
|
||||
}
|
||||
|
||||
public void setIsFolder(Boolean isFolder)
|
||||
{
|
||||
this.isFolder=isFolder;
|
||||
}
|
||||
|
||||
public boolean equals(Object other)
|
||||
{
|
||||
if(this == other)
|
||||
|
@@ -1,64 +1,92 @@
|
||||
|
||||
package org.alfresco.rest.api.model;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
|
||||
/**
|
||||
* Representation of a path info
|
||||
*
|
||||
* @author janv
|
||||
*
|
||||
*/
|
||||
public class PathInfo
|
||||
{
|
||||
private String name;
|
||||
private Boolean isComplete;
|
||||
private List<ElementInfo> elements;
|
||||
private String name;
|
||||
private Boolean isComplete;
|
||||
private List<ElementInfo> elements;
|
||||
|
||||
public PathInfo()
|
||||
{
|
||||
}
|
||||
public PathInfo()
|
||||
{
|
||||
}
|
||||
|
||||
public PathInfo(String name, Boolean isComplete, List<ElementInfo> elements)
|
||||
{
|
||||
this.name = name;
|
||||
this.isComplete = isComplete;
|
||||
this.elements = elements;
|
||||
}
|
||||
public PathInfo(String name, Boolean isComplete, List<ElementInfo> elements)
|
||||
{
|
||||
this.name = name;
|
||||
this.isComplete = isComplete;
|
||||
this.elements = elements;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
public Boolean getIsComplete() {
|
||||
return isComplete;
|
||||
}
|
||||
public Boolean getIsComplete()
|
||||
{
|
||||
return isComplete;
|
||||
}
|
||||
|
||||
public List<ElementInfo> getElements() {
|
||||
return elements;
|
||||
}
|
||||
public List<ElementInfo> getElements()
|
||||
{
|
||||
return elements;
|
||||
}
|
||||
|
||||
public class ElementInfo {
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
final StringBuilder sb = new StringBuilder(120);
|
||||
sb.append("PathInfo [name='").append(name)
|
||||
.append(", isComplete=").append(isComplete)
|
||||
.append(", elements=").append(elements)
|
||||
.append(']');
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
private String id;
|
||||
public static class ElementInfo
|
||||
{
|
||||
|
||||
private String name;
|
||||
private NodeRef id;
|
||||
private String name;
|
||||
|
||||
public ElementInfo()
|
||||
{
|
||||
}
|
||||
public ElementInfo()
|
||||
{
|
||||
}
|
||||
|
||||
public ElementInfo(String id, String name)
|
||||
{
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
}
|
||||
public ElementInfo(NodeRef id, String name)
|
||||
{
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
}
|
||||
public NodeRef getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
final StringBuilder sb = new StringBuilder(250);
|
||||
sb.append("PathElement [id=").append(id)
|
||||
.append(", name='").append(name)
|
||||
.append(']');
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -16,41 +16,42 @@
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package org.alfresco.rest.api.model;
|
||||
|
||||
/**
|
||||
* Representation of a user info
|
||||
*
|
||||
* @author janv
|
||||
*
|
||||
*/
|
||||
public class UserInfo
|
||||
{
|
||||
private String userName;
|
||||
private String displayName;
|
||||
private String userName;
|
||||
private String displayName;
|
||||
|
||||
public UserInfo()
|
||||
{
|
||||
}
|
||||
public UserInfo()
|
||||
{
|
||||
}
|
||||
|
||||
public UserInfo(String userName, String firstName, String lastName)
|
||||
{
|
||||
this.userName = userName;
|
||||
this.displayName = ((firstName != null ? firstName + " " : "") + (lastName != null ? lastName : "")).replaceAll("^\\s+|\\s+$", "");
|
||||
}
|
||||
public UserInfo(String userName, String firstName, String lastName)
|
||||
{
|
||||
this.userName = userName;
|
||||
this.displayName = ((firstName != null ? firstName + " " : "") + (lastName != null ? lastName : "")).trim();
|
||||
}
|
||||
|
||||
public String getDisplayName() {
|
||||
return displayName;
|
||||
}
|
||||
public String getDisplayName()
|
||||
{
|
||||
return displayName;
|
||||
}
|
||||
|
||||
public String getUserName() {
|
||||
return userName;
|
||||
}
|
||||
public String getUserName()
|
||||
{
|
||||
return userName;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "User [userName=" + userName + ", displayName=" + displayName + "]";
|
||||
}
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "User [userName=" + userName + ", displayName=" + displayName + "]";
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user