mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
Merged 5.1.N (5.1.2) to 5.2.N (5.2.1)
125605 rmunteanu: Merged 5.1.1 (5.1.1) to 5.1.N (5.1.2) 125498 slanglois: MNT-16155 Update source headers - remove svn:eol-style property on Java and JSP source files git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@125783 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -1,140 +1,140 @@
|
||||
package org.alfresco.rest.api.model;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.rest.framework.resource.UniqueId;
|
||||
|
||||
/**
|
||||
* Represents an activity feed entry.
|
||||
*
|
||||
* @author steveglover
|
||||
*
|
||||
*/
|
||||
public class Activity implements Comparable<Activity>
|
||||
{
|
||||
private Long id;
|
||||
private String networkId;
|
||||
private String siteId;
|
||||
private String feedPersonId;
|
||||
private String postPersonId;
|
||||
private Date postedAt;
|
||||
private String activityType;
|
||||
private Map<String, Object> activitySummary;
|
||||
|
||||
public Activity()
|
||||
{
|
||||
}
|
||||
|
||||
public Activity(Long id, String networkId, String siteId, String feedPersonId,
|
||||
String postPersonId, Date postedAt, String activityType, Map<String, Object> activitySummary)
|
||||
{
|
||||
super();
|
||||
this.id = id;
|
||||
this.networkId = networkId;
|
||||
this.siteId = siteId;
|
||||
this.feedPersonId = feedPersonId;
|
||||
this.postPersonId = postPersonId;
|
||||
this.postedAt = postedAt;
|
||||
this.activityType = activityType;
|
||||
this.activitySummary = activitySummary;
|
||||
}
|
||||
|
||||
@UniqueId
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getNetworkId()
|
||||
{
|
||||
return networkId;
|
||||
}
|
||||
|
||||
public String getSiteId()
|
||||
{
|
||||
return siteId;
|
||||
}
|
||||
|
||||
public String getFeedPersonId()
|
||||
{
|
||||
return feedPersonId;
|
||||
}
|
||||
|
||||
public String getPostPersonId()
|
||||
{
|
||||
return postPersonId;
|
||||
}
|
||||
|
||||
public String getActivityType()
|
||||
{
|
||||
return activityType;
|
||||
}
|
||||
|
||||
public Date getPostedAt()
|
||||
{
|
||||
return postedAt;
|
||||
}
|
||||
|
||||
public Map<String, Object> getActivitySummary()
|
||||
{
|
||||
return activitySummary;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((id == null) ? 0 : id.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj)
|
||||
{
|
||||
if (this == obj)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (obj == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (getClass() != obj.getClass())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Activity other = (Activity) obj;
|
||||
return(id.equals(other.id));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(Activity activity)
|
||||
{
|
||||
long otherId = activity.getId();
|
||||
long diff = id - otherId;
|
||||
if(diff == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
return diff < 0 ? -1 : 1;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "Activity [id=" + id + ", siteId=" + siteId
|
||||
+ ", feedPersonId=" + feedPersonId + ", postPersonId=" + postPersonId
|
||||
+ ", postedAt=" + postedAt
|
||||
+ ", activityType=" + activityType + ", activitySummary="
|
||||
+ activitySummary + "]";
|
||||
}
|
||||
|
||||
}
|
||||
package org.alfresco.rest.api.model;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.rest.framework.resource.UniqueId;
|
||||
|
||||
/**
|
||||
* Represents an activity feed entry.
|
||||
*
|
||||
* @author steveglover
|
||||
*
|
||||
*/
|
||||
public class Activity implements Comparable<Activity>
|
||||
{
|
||||
private Long id;
|
||||
private String networkId;
|
||||
private String siteId;
|
||||
private String feedPersonId;
|
||||
private String postPersonId;
|
||||
private Date postedAt;
|
||||
private String activityType;
|
||||
private Map<String, Object> activitySummary;
|
||||
|
||||
public Activity()
|
||||
{
|
||||
}
|
||||
|
||||
public Activity(Long id, String networkId, String siteId, String feedPersonId,
|
||||
String postPersonId, Date postedAt, String activityType, Map<String, Object> activitySummary)
|
||||
{
|
||||
super();
|
||||
this.id = id;
|
||||
this.networkId = networkId;
|
||||
this.siteId = siteId;
|
||||
this.feedPersonId = feedPersonId;
|
||||
this.postPersonId = postPersonId;
|
||||
this.postedAt = postedAt;
|
||||
this.activityType = activityType;
|
||||
this.activitySummary = activitySummary;
|
||||
}
|
||||
|
||||
@UniqueId
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getNetworkId()
|
||||
{
|
||||
return networkId;
|
||||
}
|
||||
|
||||
public String getSiteId()
|
||||
{
|
||||
return siteId;
|
||||
}
|
||||
|
||||
public String getFeedPersonId()
|
||||
{
|
||||
return feedPersonId;
|
||||
}
|
||||
|
||||
public String getPostPersonId()
|
||||
{
|
||||
return postPersonId;
|
||||
}
|
||||
|
||||
public String getActivityType()
|
||||
{
|
||||
return activityType;
|
||||
}
|
||||
|
||||
public Date getPostedAt()
|
||||
{
|
||||
return postedAt;
|
||||
}
|
||||
|
||||
public Map<String, Object> getActivitySummary()
|
||||
{
|
||||
return activitySummary;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((id == null) ? 0 : id.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj)
|
||||
{
|
||||
if (this == obj)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (obj == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (getClass() != obj.getClass())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Activity other = (Activity) obj;
|
||||
return(id.equals(other.id));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(Activity activity)
|
||||
{
|
||||
long otherId = activity.getId();
|
||||
long diff = id - otherId;
|
||||
if(diff == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
return diff < 0 ? -1 : 1;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "Activity [id=" + id + ", siteId=" + siteId
|
||||
+ ", feedPersonId=" + feedPersonId + ", postPersonId=" + postPersonId
|
||||
+ ", postedAt=" + postedAt
|
||||
+ ", activityType=" + activityType + ", activitySummary="
|
||||
+ activitySummary + "]";
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,83 +1,83 @@
|
||||
package org.alfresco.rest.api.model;
|
||||
|
||||
/**
|
||||
* Represents a company
|
||||
*
|
||||
* @author steveglover
|
||||
*
|
||||
*/
|
||||
public class Company
|
||||
{
|
||||
private String organization;
|
||||
private String address1;
|
||||
private String address2;
|
||||
private String address3;
|
||||
private String postcode;
|
||||
private String telephone;
|
||||
private String fax;
|
||||
private String email;
|
||||
|
||||
public Company(String organization, String address1, String address2, String address3,
|
||||
String postcode, String telephone, String fax, String email)
|
||||
{
|
||||
super();
|
||||
this.organization = organization;
|
||||
this.address1 = address1;
|
||||
this.address2 = address2;
|
||||
this.address3 = address3;
|
||||
this.postcode = postcode;
|
||||
this.telephone = telephone;
|
||||
this.fax = fax;
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public String getOrganization()
|
||||
{
|
||||
return organization;
|
||||
}
|
||||
|
||||
public String getAddress1()
|
||||
{
|
||||
return address1;
|
||||
}
|
||||
|
||||
public String getAddress2()
|
||||
{
|
||||
return address2;
|
||||
}
|
||||
|
||||
public String getAddress3()
|
||||
{
|
||||
return address3;
|
||||
}
|
||||
|
||||
public String getPostcode()
|
||||
{
|
||||
return postcode;
|
||||
}
|
||||
|
||||
public String getTelephone()
|
||||
{
|
||||
return telephone;
|
||||
}
|
||||
|
||||
public String getFax()
|
||||
{
|
||||
return fax;
|
||||
}
|
||||
|
||||
public String getEmail()
|
||||
{
|
||||
return email;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "Company [address1=" + address1 + ", address2=" + address2
|
||||
+ ", address3=" + address3 + ", postcode=" + postcode
|
||||
+ ", telephone=" + telephone + ", fax=" + fax + ", email="
|
||||
+ email + "]";
|
||||
}
|
||||
|
||||
}
|
||||
package org.alfresco.rest.api.model;
|
||||
|
||||
/**
|
||||
* Represents a company
|
||||
*
|
||||
* @author steveglover
|
||||
*
|
||||
*/
|
||||
public class Company
|
||||
{
|
||||
private String organization;
|
||||
private String address1;
|
||||
private String address2;
|
||||
private String address3;
|
||||
private String postcode;
|
||||
private String telephone;
|
||||
private String fax;
|
||||
private String email;
|
||||
|
||||
public Company(String organization, String address1, String address2, String address3,
|
||||
String postcode, String telephone, String fax, String email)
|
||||
{
|
||||
super();
|
||||
this.organization = organization;
|
||||
this.address1 = address1;
|
||||
this.address2 = address2;
|
||||
this.address3 = address3;
|
||||
this.postcode = postcode;
|
||||
this.telephone = telephone;
|
||||
this.fax = fax;
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public String getOrganization()
|
||||
{
|
||||
return organization;
|
||||
}
|
||||
|
||||
public String getAddress1()
|
||||
{
|
||||
return address1;
|
||||
}
|
||||
|
||||
public String getAddress2()
|
||||
{
|
||||
return address2;
|
||||
}
|
||||
|
||||
public String getAddress3()
|
||||
{
|
||||
return address3;
|
||||
}
|
||||
|
||||
public String getPostcode()
|
||||
{
|
||||
return postcode;
|
||||
}
|
||||
|
||||
public String getTelephone()
|
||||
{
|
||||
return telephone;
|
||||
}
|
||||
|
||||
public String getFax()
|
||||
{
|
||||
return fax;
|
||||
}
|
||||
|
||||
public String getEmail()
|
||||
{
|
||||
return email;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "Company [address1=" + address1 + ", address2=" + address2
|
||||
+ ", address3=" + address3 + ", postcode=" + postcode
|
||||
+ ", telephone=" + telephone + ", fax=" + fax + ", email="
|
||||
+ email + "]";
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,70 +1,70 @@
|
||||
package org.alfresco.rest.api.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigInteger;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.apache.chemistry.opencmis.commons.PropertyIds;
|
||||
import org.apache.chemistry.opencmis.commons.data.Properties;
|
||||
import org.apache.chemistry.opencmis.commons.data.PropertyData;
|
||||
|
||||
/**
|
||||
* Representation of a document node.
|
||||
*
|
||||
* @author steveglover
|
||||
*
|
||||
*/
|
||||
public class Document extends Node
|
||||
{
|
||||
private String mimeType;
|
||||
private BigInteger sizeInBytes;
|
||||
private String versionLabel;
|
||||
|
||||
public Document()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public Document(NodeRef nodeRef, Properties properties)
|
||||
{
|
||||
super(nodeRef, properties);
|
||||
|
||||
Map<String, PropertyData<?>> props = properties.getProperties();
|
||||
this.mimeType = (String)getValue(props, PropertyIds.CONTENT_STREAM_MIME_TYPE);
|
||||
this.sizeInBytes = (BigInteger)getValue(props, PropertyIds.CONTENT_STREAM_LENGTH);
|
||||
this.versionLabel = (String)getValue(props, PropertyIds.VERSION_LABEL);
|
||||
}
|
||||
|
||||
public Document(NodeRef nodeRef, Map<QName, Serializable> nodeProps)
|
||||
{
|
||||
super(nodeRef, nodeProps);
|
||||
}
|
||||
|
||||
public String getMimeType()
|
||||
{
|
||||
return mimeType;
|
||||
}
|
||||
|
||||
public BigInteger getSizeInBytes()
|
||||
{
|
||||
return sizeInBytes;
|
||||
}
|
||||
|
||||
public String getVersionLabel()
|
||||
{
|
||||
return versionLabel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "Document [mimeType=" + mimeType + ", sizeInBytes="
|
||||
+ sizeInBytes + ", versionLabel=" + versionLabel + ", nodeRef="
|
||||
+ nodeRef + ", name=" + name + ", title=" + title
|
||||
+ ", description=" + description + ", createdAt=" + createdAt
|
||||
+ ", modifiedAt=" + modifiedAt + ", createdBy=" + createdBy
|
||||
+ ", modifiedBy=" + modifiedBy + "]";
|
||||
}
|
||||
}
|
||||
package org.alfresco.rest.api.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigInteger;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.apache.chemistry.opencmis.commons.PropertyIds;
|
||||
import org.apache.chemistry.opencmis.commons.data.Properties;
|
||||
import org.apache.chemistry.opencmis.commons.data.PropertyData;
|
||||
|
||||
/**
|
||||
* Representation of a document node.
|
||||
*
|
||||
* @author steveglover
|
||||
*
|
||||
*/
|
||||
public class Document extends Node
|
||||
{
|
||||
private String mimeType;
|
||||
private BigInteger sizeInBytes;
|
||||
private String versionLabel;
|
||||
|
||||
public Document()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public Document(NodeRef nodeRef, Properties properties)
|
||||
{
|
||||
super(nodeRef, properties);
|
||||
|
||||
Map<String, PropertyData<?>> props = properties.getProperties();
|
||||
this.mimeType = (String)getValue(props, PropertyIds.CONTENT_STREAM_MIME_TYPE);
|
||||
this.sizeInBytes = (BigInteger)getValue(props, PropertyIds.CONTENT_STREAM_LENGTH);
|
||||
this.versionLabel = (String)getValue(props, PropertyIds.VERSION_LABEL);
|
||||
}
|
||||
|
||||
public Document(NodeRef nodeRef, Map<QName, Serializable> nodeProps)
|
||||
{
|
||||
super(nodeRef, nodeProps);
|
||||
}
|
||||
|
||||
public String getMimeType()
|
||||
{
|
||||
return mimeType;
|
||||
}
|
||||
|
||||
public BigInteger getSizeInBytes()
|
||||
{
|
||||
return sizeInBytes;
|
||||
}
|
||||
|
||||
public String getVersionLabel()
|
||||
{
|
||||
return versionLabel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "Document [mimeType=" + mimeType + ", sizeInBytes="
|
||||
+ sizeInBytes + ", versionLabel=" + versionLabel + ", nodeRef="
|
||||
+ nodeRef + ", name=" + name + ", title=" + title
|
||||
+ ", description=" + description + ", createdAt=" + createdAt
|
||||
+ ", modifiedAt=" + modifiedAt + ", createdBy=" + createdBy
|
||||
+ ", modifiedBy=" + modifiedBy + "]";
|
||||
}
|
||||
}
|
||||
|
@@ -1,5 +1,5 @@
|
||||
package org.alfresco.rest.api.model;
|
||||
|
||||
public interface DocumentRatingSummary
|
||||
{
|
||||
}
|
||||
package org.alfresco.rest.api.model;
|
||||
|
||||
public interface DocumentRatingSummary
|
||||
{
|
||||
}
|
||||
|
@@ -1,40 +1,40 @@
|
||||
package org.alfresco.rest.api.model;
|
||||
|
||||
/**
|
||||
* A document target favourite.
|
||||
*
|
||||
* @author steveglover
|
||||
*
|
||||
*/
|
||||
public class DocumentTarget extends Target
|
||||
{
|
||||
private Document file;
|
||||
|
||||
public DocumentTarget()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public DocumentTarget(Document file)
|
||||
{
|
||||
super();
|
||||
this.file = file;
|
||||
}
|
||||
|
||||
public void setDocument(Document file)
|
||||
{
|
||||
this.file = file;
|
||||
}
|
||||
|
||||
public Document getFile()
|
||||
{
|
||||
return file;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "DocumentTarget [file=" + file + "]";
|
||||
}
|
||||
|
||||
}
|
||||
package org.alfresco.rest.api.model;
|
||||
|
||||
/**
|
||||
* A document target favourite.
|
||||
*
|
||||
* @author steveglover
|
||||
*
|
||||
*/
|
||||
public class DocumentTarget extends Target
|
||||
{
|
||||
private Document file;
|
||||
|
||||
public DocumentTarget()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public DocumentTarget(Document file)
|
||||
{
|
||||
super();
|
||||
this.file = file;
|
||||
}
|
||||
|
||||
public void setDocument(Document file)
|
||||
{
|
||||
this.file = file;
|
||||
}
|
||||
|
||||
public Document getFile()
|
||||
{
|
||||
return file;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "DocumentTarget [file=" + file + "]";
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,56 +1,56 @@
|
||||
package org.alfresco.rest.api.model;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import org.alfresco.rest.framework.resource.UniqueId;
|
||||
|
||||
/**
|
||||
* Representation of a favourite (document, folder, site, ...).
|
||||
*
|
||||
* @author steveglover
|
||||
*
|
||||
*/
|
||||
public class Favourite
|
||||
{
|
||||
private String targetGuid;
|
||||
private Date createdAt;
|
||||
private Target target;
|
||||
|
||||
public Date getCreatedAt()
|
||||
{
|
||||
return createdAt;
|
||||
}
|
||||
|
||||
public void setCreatedAt(Date createdAt)
|
||||
{
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
@UniqueId(name="targetGuid")
|
||||
public String getTargetGuid()
|
||||
{
|
||||
return targetGuid;
|
||||
}
|
||||
|
||||
public void setTargetGuid(String targetGuid)
|
||||
{
|
||||
this.targetGuid = targetGuid;
|
||||
}
|
||||
|
||||
public Target getTarget()
|
||||
{
|
||||
return target;
|
||||
}
|
||||
|
||||
public void setTarget(Target target)
|
||||
{
|
||||
this.target = target;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "Favourite [targetGuid=" + targetGuid
|
||||
+ ", createdAt=" + createdAt + ", target=" + target + "]";
|
||||
}
|
||||
package org.alfresco.rest.api.model;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import org.alfresco.rest.framework.resource.UniqueId;
|
||||
|
||||
/**
|
||||
* Representation of a favourite (document, folder, site, ...).
|
||||
*
|
||||
* @author steveglover
|
||||
*
|
||||
*/
|
||||
public class Favourite
|
||||
{
|
||||
private String targetGuid;
|
||||
private Date createdAt;
|
||||
private Target target;
|
||||
|
||||
public Date getCreatedAt()
|
||||
{
|
||||
return createdAt;
|
||||
}
|
||||
|
||||
public void setCreatedAt(Date createdAt)
|
||||
{
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
@UniqueId(name="targetGuid")
|
||||
public String getTargetGuid()
|
||||
{
|
||||
return targetGuid;
|
||||
}
|
||||
|
||||
public void setTargetGuid(String targetGuid)
|
||||
{
|
||||
this.targetGuid = targetGuid;
|
||||
}
|
||||
|
||||
public Target getTarget()
|
||||
{
|
||||
return target;
|
||||
}
|
||||
|
||||
public void setTarget(Target target)
|
||||
{
|
||||
this.target = target;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "Favourite [targetGuid=" + targetGuid
|
||||
+ ", createdAt=" + createdAt + ", target=" + target + "]";
|
||||
}
|
||||
}
|
@@ -1,31 +1,31 @@
|
||||
package org.alfresco.rest.api.model;
|
||||
|
||||
import org.alfresco.service.cmr.site.SiteInfo;
|
||||
|
||||
/**
|
||||
* Represents a user's favourite site.
|
||||
*
|
||||
* Represented by a separate class in order to allow other attributes to be added.
|
||||
*
|
||||
* @author steveglover
|
||||
*
|
||||
*/
|
||||
public class FavouriteSite extends SiteImpl
|
||||
{
|
||||
public FavouriteSite()
|
||||
{
|
||||
}
|
||||
|
||||
public FavouriteSite(SiteInfo siteInfo, String role)
|
||||
{
|
||||
super(siteInfo, role);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "FavouriteSite [id=" + id + ", guid=" + guid + ", title="
|
||||
+ title + ", description=" + description + ", visibility="
|
||||
+ visibility + ", role=" + role + "]";
|
||||
}
|
||||
}
|
||||
package org.alfresco.rest.api.model;
|
||||
|
||||
import org.alfresco.service.cmr.site.SiteInfo;
|
||||
|
||||
/**
|
||||
* Represents a user's favourite site.
|
||||
*
|
||||
* Represented by a separate class in order to allow other attributes to be added.
|
||||
*
|
||||
* @author steveglover
|
||||
*
|
||||
*/
|
||||
public class FavouriteSite extends SiteImpl
|
||||
{
|
||||
public FavouriteSite()
|
||||
{
|
||||
}
|
||||
|
||||
public FavouriteSite(SiteInfo siteInfo, String role)
|
||||
{
|
||||
super(siteInfo, role);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "FavouriteSite [id=" + id + ", guid=" + guid + ", title="
|
||||
+ title + ", description=" + description + ", visibility="
|
||||
+ visibility + ", role=" + role + "]";
|
||||
}
|
||||
}
|
||||
|
@@ -1,32 +1,32 @@
|
||||
package org.alfresco.rest.api.model;
|
||||
|
||||
public class FiveStarRatingSummary implements DocumentRatingSummary
|
||||
{
|
||||
private Integer numberOfRatings;
|
||||
private Float average;
|
||||
|
||||
public FiveStarRatingSummary(Integer numberOfRatings, Float ratingTotal, Float average)
|
||||
{
|
||||
super();
|
||||
this.numberOfRatings = numberOfRatings;
|
||||
this.average = (average == -1 ? null : average);
|
||||
}
|
||||
|
||||
public Integer getNumberOfRatings()
|
||||
{
|
||||
return numberOfRatings;
|
||||
}
|
||||
|
||||
public Float getAverage()
|
||||
{
|
||||
return average;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "FiveStarRatingSummary [numberOfRatings=" + numberOfRatings
|
||||
+ ", average=" + average + "]";
|
||||
}
|
||||
|
||||
}
|
||||
package org.alfresco.rest.api.model;
|
||||
|
||||
public class FiveStarRatingSummary implements DocumentRatingSummary
|
||||
{
|
||||
private Integer numberOfRatings;
|
||||
private Float average;
|
||||
|
||||
public FiveStarRatingSummary(Integer numberOfRatings, Float ratingTotal, Float average)
|
||||
{
|
||||
super();
|
||||
this.numberOfRatings = numberOfRatings;
|
||||
this.average = (average == -1 ? null : average);
|
||||
}
|
||||
|
||||
public Integer getNumberOfRatings()
|
||||
{
|
||||
return numberOfRatings;
|
||||
}
|
||||
|
||||
public Float getAverage()
|
||||
{
|
||||
return average;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "FiveStarRatingSummary [numberOfRatings=" + numberOfRatings
|
||||
+ ", average=" + average + "]";
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,41 +1,41 @@
|
||||
package org.alfresco.rest.api.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.apache.chemistry.opencmis.commons.data.Properties;
|
||||
|
||||
/**
|
||||
* Representation of a folder node.
|
||||
*
|
||||
* @author steveglover
|
||||
*
|
||||
*/
|
||||
public class Folder extends Node
|
||||
{
|
||||
public Folder()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public Folder(NodeRef nodeRef, Properties properties)
|
||||
{
|
||||
super(nodeRef, properties);
|
||||
}
|
||||
|
||||
public Folder(NodeRef nodeRef, Map<QName, Serializable> nodeProps)
|
||||
{
|
||||
super(nodeRef, nodeProps);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "Folder [nodeRef=" + nodeRef + ", name=" + name + ", title="
|
||||
+ title + ", description=" + description + ", createdAt="
|
||||
+ createdAt + ", modifiedAt=" + modifiedAt + ", createdBy="
|
||||
+ createdBy + ", modifiedBy=" + modifiedBy + "]";
|
||||
}
|
||||
}
|
||||
package org.alfresco.rest.api.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.apache.chemistry.opencmis.commons.data.Properties;
|
||||
|
||||
/**
|
||||
* Representation of a folder node.
|
||||
*
|
||||
* @author steveglover
|
||||
*
|
||||
*/
|
||||
public class Folder extends Node
|
||||
{
|
||||
public Folder()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public Folder(NodeRef nodeRef, Properties properties)
|
||||
{
|
||||
super(nodeRef, properties);
|
||||
}
|
||||
|
||||
public Folder(NodeRef nodeRef, Map<QName, Serializable> nodeProps)
|
||||
{
|
||||
super(nodeRef, nodeProps);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "Folder [nodeRef=" + nodeRef + ", name=" + name + ", title="
|
||||
+ title + ", description=" + description + ", createdAt="
|
||||
+ createdAt + ", modifiedAt=" + modifiedAt + ", createdBy="
|
||||
+ createdBy + ", modifiedBy=" + modifiedBy + "]";
|
||||
}
|
||||
}
|
||||
|
@@ -1,39 +1,39 @@
|
||||
package org.alfresco.rest.api.model;
|
||||
|
||||
/**
|
||||
* A folder target favourite.
|
||||
*
|
||||
* @author steveglover
|
||||
*
|
||||
*/
|
||||
public class FolderTarget extends Target
|
||||
{
|
||||
private Folder folder;
|
||||
|
||||
public FolderTarget()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public FolderTarget(Folder folder)
|
||||
{
|
||||
super();
|
||||
this.folder = folder;
|
||||
}
|
||||
|
||||
public void setFolder(Folder folder)
|
||||
{
|
||||
this.folder = folder;
|
||||
}
|
||||
|
||||
public Folder getFolder()
|
||||
{
|
||||
return folder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "FolderTarget [folder=" + folder + "]";
|
||||
}
|
||||
}
|
||||
package org.alfresco.rest.api.model;
|
||||
|
||||
/**
|
||||
* A folder target favourite.
|
||||
*
|
||||
* @author steveglover
|
||||
*
|
||||
*/
|
||||
public class FolderTarget extends Target
|
||||
{
|
||||
private Folder folder;
|
||||
|
||||
public FolderTarget()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public FolderTarget(Folder folder)
|
||||
{
|
||||
super();
|
||||
this.folder = folder;
|
||||
}
|
||||
|
||||
public void setFolder(Folder folder)
|
||||
{
|
||||
this.folder = folder;
|
||||
}
|
||||
|
||||
public Folder getFolder()
|
||||
{
|
||||
return folder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "FolderTarget [folder=" + folder + "]";
|
||||
}
|
||||
}
|
||||
|
@@ -1,24 +1,24 @@
|
||||
package org.alfresco.rest.api.model;
|
||||
|
||||
public class LikesRatingSummary implements DocumentRatingSummary
|
||||
{
|
||||
private Integer numberOfRatings;
|
||||
|
||||
public LikesRatingSummary(Integer numberOfRatings)
|
||||
{
|
||||
super();
|
||||
this.numberOfRatings = numberOfRatings;
|
||||
}
|
||||
|
||||
public Integer getNumberOfRatings()
|
||||
{
|
||||
return numberOfRatings;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "LikesRatingSummary [numberOfRatings=" + numberOfRatings + "]";
|
||||
}
|
||||
|
||||
}
|
||||
package org.alfresco.rest.api.model;
|
||||
|
||||
public class LikesRatingSummary implements DocumentRatingSummary
|
||||
{
|
||||
private Integer numberOfRatings;
|
||||
|
||||
public LikesRatingSummary(Integer numberOfRatings)
|
||||
{
|
||||
super();
|
||||
this.numberOfRatings = numberOfRatings;
|
||||
}
|
||||
|
||||
public Integer getNumberOfRatings()
|
||||
{
|
||||
return numberOfRatings;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "LikesRatingSummary [numberOfRatings=" + numberOfRatings + "]";
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,146 +1,146 @@
|
||||
package org.alfresco.rest.api.model;
|
||||
|
||||
import org.alfresco.rest.api.sites.SiteEntityResource;
|
||||
import org.alfresco.rest.framework.resource.EmbeddedEntityResource;
|
||||
import org.alfresco.rest.framework.resource.UniqueId;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.site.SiteInfo;
|
||||
|
||||
/**
|
||||
* Represents membership of a site.
|
||||
*
|
||||
* @author steveglover
|
||||
*
|
||||
*/
|
||||
public class MemberOfSite implements Comparable<MemberOfSite>
|
||||
{
|
||||
private String role;
|
||||
private String siteShortName;
|
||||
private NodeRef guid;
|
||||
|
||||
public MemberOfSite()
|
||||
{
|
||||
}
|
||||
|
||||
public MemberOfSite(String siteShortName, NodeRef siteGuid, String role)
|
||||
{
|
||||
super();
|
||||
if(siteShortName == null)
|
||||
{
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
if(role == null)
|
||||
{
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
if(siteGuid == null)
|
||||
{
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
this.role = role;
|
||||
this.siteShortName = siteShortName;
|
||||
this.guid = siteGuid;
|
||||
}
|
||||
|
||||
public static MemberOfSite getMemberOfSite(SiteInfo siteInfo, String siteRole)
|
||||
{
|
||||
MemberOfSite memberOfSite = new MemberOfSite(siteInfo.getShortName(), siteInfo.getNodeRef(), siteRole);
|
||||
return memberOfSite;
|
||||
}
|
||||
|
||||
@UniqueId
|
||||
@EmbeddedEntityResource(propertyName = "site", entityResource = SiteEntityResource.class)
|
||||
public String getSiteShortName()
|
||||
{
|
||||
return siteShortName;
|
||||
}
|
||||
|
||||
public NodeRef getGuid()
|
||||
{
|
||||
return guid;
|
||||
}
|
||||
|
||||
public void setGuid(NodeRef guid)
|
||||
{
|
||||
this.guid = guid;
|
||||
}
|
||||
|
||||
public String getRole()
|
||||
{
|
||||
return role;
|
||||
}
|
||||
|
||||
public void setRole(String role)
|
||||
{
|
||||
if(role == null)
|
||||
{
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
this.role = role;
|
||||
}
|
||||
|
||||
public void setSiteShortName(String siteShortName)
|
||||
{
|
||||
if(siteShortName == null)
|
||||
{
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
this.siteShortName = siteShortName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((role == null) ? 0 : role.hashCode());
|
||||
result = prime * result
|
||||
+ ((siteShortName == null) ? 0 : siteShortName.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj)
|
||||
{
|
||||
if (this == obj)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (obj == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (getClass() != obj.getClass())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
MemberOfSite other = (MemberOfSite) obj;
|
||||
if (role != other.role)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return siteShortName.equals(other.siteShortName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(MemberOfSite o)
|
||||
{
|
||||
int i = siteShortName.compareTo(o.getSiteShortName());
|
||||
if(i == 0)
|
||||
{
|
||||
i = role.compareTo(o.getRole());
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "MemberOfSite [role=" + role + ", siteShortName="
|
||||
+ siteShortName + ", siteGuid=" + guid + "]";
|
||||
}
|
||||
}
|
||||
package org.alfresco.rest.api.model;
|
||||
|
||||
import org.alfresco.rest.api.sites.SiteEntityResource;
|
||||
import org.alfresco.rest.framework.resource.EmbeddedEntityResource;
|
||||
import org.alfresco.rest.framework.resource.UniqueId;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.site.SiteInfo;
|
||||
|
||||
/**
|
||||
* Represents membership of a site.
|
||||
*
|
||||
* @author steveglover
|
||||
*
|
||||
*/
|
||||
public class MemberOfSite implements Comparable<MemberOfSite>
|
||||
{
|
||||
private String role;
|
||||
private String siteShortName;
|
||||
private NodeRef guid;
|
||||
|
||||
public MemberOfSite()
|
||||
{
|
||||
}
|
||||
|
||||
public MemberOfSite(String siteShortName, NodeRef siteGuid, String role)
|
||||
{
|
||||
super();
|
||||
if(siteShortName == null)
|
||||
{
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
if(role == null)
|
||||
{
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
if(siteGuid == null)
|
||||
{
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
this.role = role;
|
||||
this.siteShortName = siteShortName;
|
||||
this.guid = siteGuid;
|
||||
}
|
||||
|
||||
public static MemberOfSite getMemberOfSite(SiteInfo siteInfo, String siteRole)
|
||||
{
|
||||
MemberOfSite memberOfSite = new MemberOfSite(siteInfo.getShortName(), siteInfo.getNodeRef(), siteRole);
|
||||
return memberOfSite;
|
||||
}
|
||||
|
||||
@UniqueId
|
||||
@EmbeddedEntityResource(propertyName = "site", entityResource = SiteEntityResource.class)
|
||||
public String getSiteShortName()
|
||||
{
|
||||
return siteShortName;
|
||||
}
|
||||
|
||||
public NodeRef getGuid()
|
||||
{
|
||||
return guid;
|
||||
}
|
||||
|
||||
public void setGuid(NodeRef guid)
|
||||
{
|
||||
this.guid = guid;
|
||||
}
|
||||
|
||||
public String getRole()
|
||||
{
|
||||
return role;
|
||||
}
|
||||
|
||||
public void setRole(String role)
|
||||
{
|
||||
if(role == null)
|
||||
{
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
this.role = role;
|
||||
}
|
||||
|
||||
public void setSiteShortName(String siteShortName)
|
||||
{
|
||||
if(siteShortName == null)
|
||||
{
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
this.siteShortName = siteShortName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((role == null) ? 0 : role.hashCode());
|
||||
result = prime * result
|
||||
+ ((siteShortName == null) ? 0 : siteShortName.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj)
|
||||
{
|
||||
if (this == obj)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (obj == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (getClass() != obj.getClass())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
MemberOfSite other = (MemberOfSite) obj;
|
||||
if (role != other.role)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return siteShortName.equals(other.siteShortName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(MemberOfSite o)
|
||||
{
|
||||
int i = siteShortName.compareTo(o.getSiteShortName());
|
||||
if(i == 0)
|
||||
{
|
||||
i = role.compareTo(o.getRole());
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "MemberOfSite [role=" + role + ", siteShortName="
|
||||
+ siteShortName + ", siteGuid=" + guid + "]";
|
||||
}
|
||||
}
|
||||
|
@@ -1,38 +1,38 @@
|
||||
package org.alfresco.rest.api.model;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Represents a cloud network (account).
|
||||
*
|
||||
* @author steveglover
|
||||
*
|
||||
*/
|
||||
public interface Network
|
||||
{
|
||||
public String getId();
|
||||
|
||||
/**
|
||||
* Gets the date the account was created
|
||||
*
|
||||
* @return The account creation date
|
||||
*/
|
||||
public Date getCreatedAt();
|
||||
public List<Quota> getQuotas();
|
||||
|
||||
/**
|
||||
* Gets whether an account is enabled or not.
|
||||
*
|
||||
* @return true = account is enabled, false = account is disabled
|
||||
*/
|
||||
public Boolean getIsEnabled();
|
||||
|
||||
/**
|
||||
* Gets the subscription level.
|
||||
* @return String
|
||||
*/
|
||||
public String getSubscriptionLevel();
|
||||
|
||||
public Boolean getPaidNetwork();
|
||||
package org.alfresco.rest.api.model;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Represents a cloud network (account).
|
||||
*
|
||||
* @author steveglover
|
||||
*
|
||||
*/
|
||||
public interface Network
|
||||
{
|
||||
public String getId();
|
||||
|
||||
/**
|
||||
* Gets the date the account was created
|
||||
*
|
||||
* @return The account creation date
|
||||
*/
|
||||
public Date getCreatedAt();
|
||||
public List<Quota> getQuotas();
|
||||
|
||||
/**
|
||||
* Gets whether an account is enabled or not.
|
||||
*
|
||||
* @return true = account is enabled, false = account is disabled
|
||||
*/
|
||||
public Boolean getIsEnabled();
|
||||
|
||||
/**
|
||||
* Gets the subscription level.
|
||||
* @return String
|
||||
*/
|
||||
public String getSubscriptionLevel();
|
||||
|
||||
public Boolean getPaidNetwork();
|
||||
}
|
@@ -1,139 +1,139 @@
|
||||
package org.alfresco.rest.api.model;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import org.alfresco.rest.framework.resource.UniqueId;
|
||||
|
||||
/**
|
||||
* Represents a cloud network (account).
|
||||
*
|
||||
* @author steveglover
|
||||
*
|
||||
*/
|
||||
public class NetworkImpl implements Comparable<NetworkImpl>, Network
|
||||
{
|
||||
private String id;
|
||||
private Date createdAt;
|
||||
private List<Quota> quotas = new LinkedList<Quota>();
|
||||
private Boolean isEnabled;
|
||||
private String subscriptionLevel;
|
||||
private Boolean paidNetwork;
|
||||
|
||||
public NetworkImpl(org.alfresco.repo.tenant.Network network)
|
||||
{
|
||||
this.id = network.getTenantDomain();
|
||||
this.createdAt = network.getCreatedAt();
|
||||
this.isEnabled = network.isEnabled();
|
||||
this.paidNetwork = network.getPaidNetwork();
|
||||
this.subscriptionLevel = network.getSubscriptionLevel();
|
||||
}
|
||||
|
||||
public NetworkImpl(String id, Date createdAt, Boolean isEnabled, String subscriptionLevel, Boolean paidNetwork)
|
||||
{
|
||||
this.id = id;
|
||||
this.createdAt = createdAt;
|
||||
this.isEnabled = isEnabled;
|
||||
this.subscriptionLevel = subscriptionLevel;
|
||||
this.paidNetwork = paidNetwork;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the account name
|
||||
*
|
||||
* @return The name of the account
|
||||
*/
|
||||
@UniqueId
|
||||
public String getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the date the account was created
|
||||
*
|
||||
* @return The account creation date
|
||||
*/
|
||||
public Date getCreatedAt()
|
||||
{
|
||||
return createdAt;
|
||||
}
|
||||
|
||||
public List<Quota> getQuotas()
|
||||
{
|
||||
return quotas;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets whether an account is enabled or not.
|
||||
*
|
||||
* @return true = account is enabled, false = account is disabled
|
||||
*/
|
||||
public Boolean getIsEnabled()
|
||||
{
|
||||
return isEnabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the subscription level.
|
||||
*
|
||||
* @return ths subscription level
|
||||
*/
|
||||
public String getSubscriptionLevel()
|
||||
{
|
||||
return subscriptionLevel;
|
||||
}
|
||||
|
||||
public Boolean getPaidNetwork()
|
||||
{
|
||||
return paidNetwork;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(NetworkImpl network)
|
||||
{
|
||||
return id.compareTo(network.getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((id == null) ? 0 : id.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj)
|
||||
{
|
||||
if (this == obj)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (obj == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (getClass() != obj.getClass())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Network other = (Network) obj;
|
||||
return(id.equals(other.getId()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "Network [id=" + id
|
||||
+ ", createdAt=" + createdAt + ", quotas=" + quotas
|
||||
+ ", isEnabled=" + isEnabled + ", subscriptionLevel="
|
||||
+ subscriptionLevel + "]";
|
||||
}
|
||||
|
||||
}
|
||||
package org.alfresco.rest.api.model;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import org.alfresco.rest.framework.resource.UniqueId;
|
||||
|
||||
/**
|
||||
* Represents a cloud network (account).
|
||||
*
|
||||
* @author steveglover
|
||||
*
|
||||
*/
|
||||
public class NetworkImpl implements Comparable<NetworkImpl>, Network
|
||||
{
|
||||
private String id;
|
||||
private Date createdAt;
|
||||
private List<Quota> quotas = new LinkedList<Quota>();
|
||||
private Boolean isEnabled;
|
||||
private String subscriptionLevel;
|
||||
private Boolean paidNetwork;
|
||||
|
||||
public NetworkImpl(org.alfresco.repo.tenant.Network network)
|
||||
{
|
||||
this.id = network.getTenantDomain();
|
||||
this.createdAt = network.getCreatedAt();
|
||||
this.isEnabled = network.isEnabled();
|
||||
this.paidNetwork = network.getPaidNetwork();
|
||||
this.subscriptionLevel = network.getSubscriptionLevel();
|
||||
}
|
||||
|
||||
public NetworkImpl(String id, Date createdAt, Boolean isEnabled, String subscriptionLevel, Boolean paidNetwork)
|
||||
{
|
||||
this.id = id;
|
||||
this.createdAt = createdAt;
|
||||
this.isEnabled = isEnabled;
|
||||
this.subscriptionLevel = subscriptionLevel;
|
||||
this.paidNetwork = paidNetwork;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the account name
|
||||
*
|
||||
* @return The name of the account
|
||||
*/
|
||||
@UniqueId
|
||||
public String getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the date the account was created
|
||||
*
|
||||
* @return The account creation date
|
||||
*/
|
||||
public Date getCreatedAt()
|
||||
{
|
||||
return createdAt;
|
||||
}
|
||||
|
||||
public List<Quota> getQuotas()
|
||||
{
|
||||
return quotas;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets whether an account is enabled or not.
|
||||
*
|
||||
* @return true = account is enabled, false = account is disabled
|
||||
*/
|
||||
public Boolean getIsEnabled()
|
||||
{
|
||||
return isEnabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the subscription level.
|
||||
*
|
||||
* @return ths subscription level
|
||||
*/
|
||||
public String getSubscriptionLevel()
|
||||
{
|
||||
return subscriptionLevel;
|
||||
}
|
||||
|
||||
public Boolean getPaidNetwork()
|
||||
{
|
||||
return paidNetwork;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(NetworkImpl network)
|
||||
{
|
||||
return id.compareTo(network.getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((id == null) ? 0 : id.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj)
|
||||
{
|
||||
if (this == obj)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (obj == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (getClass() != obj.getClass())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Network other = (Network) obj;
|
||||
return(id.equals(other.getId()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "Network [id=" + id
|
||||
+ ", createdAt=" + createdAt + ", quotas=" + quotas
|
||||
+ ", isEnabled=" + isEnabled + ", subscriptionLevel="
|
||||
+ subscriptionLevel + "]";
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,120 +1,120 @@
|
||||
package org.alfresco.rest.api.model;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import org.alfresco.rest.framework.resource.UniqueId;
|
||||
|
||||
/**
|
||||
* Represents a node rating.
|
||||
*
|
||||
* @author steveglover
|
||||
*
|
||||
*/
|
||||
public class NodeRating implements Comparable<NodeRating>
|
||||
{
|
||||
private String ratingSchemeId;
|
||||
private Object myRating;
|
||||
private Date ratedAt;
|
||||
private DocumentRatingSummary documentRatingSummary;
|
||||
|
||||
public NodeRating()
|
||||
{
|
||||
}
|
||||
|
||||
public NodeRating(String ratingSchemeId, Object myRating, Date ratedAt, DocumentRatingSummary documentRatingSummary)
|
||||
{
|
||||
if(ratingSchemeId == null)
|
||||
{
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
|
||||
this.ratingSchemeId = ratingSchemeId;
|
||||
this.documentRatingSummary = documentRatingSummary;
|
||||
this.myRating = myRating;
|
||||
this.ratedAt = ratedAt;
|
||||
}
|
||||
|
||||
@UniqueId
|
||||
public String getScheme()
|
||||
{
|
||||
return ratingSchemeId;
|
||||
}
|
||||
|
||||
public void setScheme(String ratingSchemeId)
|
||||
{
|
||||
if(ratingSchemeId == null)
|
||||
{
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
this.ratingSchemeId = ratingSchemeId;
|
||||
}
|
||||
|
||||
public Date getRatedAt()
|
||||
{
|
||||
return ratedAt;
|
||||
}
|
||||
|
||||
public Object getMyRating()
|
||||
{
|
||||
return myRating;
|
||||
}
|
||||
|
||||
public void setMyRating(Object myRating)
|
||||
{
|
||||
this.myRating = myRating;
|
||||
}
|
||||
|
||||
public DocumentRatingSummary getAggregate()
|
||||
{
|
||||
return documentRatingSummary;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((ratingSchemeId == null) ? 0 : ratingSchemeId.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj)
|
||||
{
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
NodeRating other = (NodeRating) obj;
|
||||
if (ratingSchemeId == null) {
|
||||
if (other.getScheme() != null)
|
||||
return false;
|
||||
} else if (!ratingSchemeId.equals(other.getScheme()))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(NodeRating other)
|
||||
{
|
||||
if(other != null)
|
||||
{
|
||||
int ret = (ratingSchemeId.compareTo(other.getScheme()));
|
||||
return ret;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "NodeRating [scheme=" + ratingSchemeId + ", myRating=" + myRating
|
||||
+ ", ratedAt=" + ratedAt
|
||||
+ ", documentRatingSummary=" + documentRatingSummary + "]";
|
||||
}
|
||||
}
|
||||
package org.alfresco.rest.api.model;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import org.alfresco.rest.framework.resource.UniqueId;
|
||||
|
||||
/**
|
||||
* Represents a node rating.
|
||||
*
|
||||
* @author steveglover
|
||||
*
|
||||
*/
|
||||
public class NodeRating implements Comparable<NodeRating>
|
||||
{
|
||||
private String ratingSchemeId;
|
||||
private Object myRating;
|
||||
private Date ratedAt;
|
||||
private DocumentRatingSummary documentRatingSummary;
|
||||
|
||||
public NodeRating()
|
||||
{
|
||||
}
|
||||
|
||||
public NodeRating(String ratingSchemeId, Object myRating, Date ratedAt, DocumentRatingSummary documentRatingSummary)
|
||||
{
|
||||
if(ratingSchemeId == null)
|
||||
{
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
|
||||
this.ratingSchemeId = ratingSchemeId;
|
||||
this.documentRatingSummary = documentRatingSummary;
|
||||
this.myRating = myRating;
|
||||
this.ratedAt = ratedAt;
|
||||
}
|
||||
|
||||
@UniqueId
|
||||
public String getScheme()
|
||||
{
|
||||
return ratingSchemeId;
|
||||
}
|
||||
|
||||
public void setScheme(String ratingSchemeId)
|
||||
{
|
||||
if(ratingSchemeId == null)
|
||||
{
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
this.ratingSchemeId = ratingSchemeId;
|
||||
}
|
||||
|
||||
public Date getRatedAt()
|
||||
{
|
||||
return ratedAt;
|
||||
}
|
||||
|
||||
public Object getMyRating()
|
||||
{
|
||||
return myRating;
|
||||
}
|
||||
|
||||
public void setMyRating(Object myRating)
|
||||
{
|
||||
this.myRating = myRating;
|
||||
}
|
||||
|
||||
public DocumentRatingSummary getAggregate()
|
||||
{
|
||||
return documentRatingSummary;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((ratingSchemeId == null) ? 0 : ratingSchemeId.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj)
|
||||
{
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
NodeRating other = (NodeRating) obj;
|
||||
if (ratingSchemeId == null) {
|
||||
if (other.getScheme() != null)
|
||||
return false;
|
||||
} else if (!ratingSchemeId.equals(other.getScheme()))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(NodeRating other)
|
||||
{
|
||||
if(other != null)
|
||||
{
|
||||
int ret = (ratingSchemeId.compareTo(other.getScheme()));
|
||||
return ret;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "NodeRating [scheme=" + ratingSchemeId + ", myRating=" + myRating
|
||||
+ ", ratedAt=" + ratedAt
|
||||
+ ", documentRatingSummary=" + documentRatingSummary + "]";
|
||||
}
|
||||
}
|
||||
|
@@ -1,222 +1,222 @@
|
||||
package org.alfresco.rest.api.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.rest.framework.resource.UniqueId;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
|
||||
/**
|
||||
* Represents a user of the system.
|
||||
*
|
||||
* @author steveglover
|
||||
*
|
||||
*/
|
||||
public class Person
|
||||
{
|
||||
public static final QName PROP_PERSON_DESCRIPTION = QName.createQName("RestApi", "description");
|
||||
|
||||
protected String userName;
|
||||
protected Boolean enabled;
|
||||
protected NodeRef avatarId;
|
||||
protected String firstName;
|
||||
protected String lastName;
|
||||
protected String jobTitle;
|
||||
protected String location;
|
||||
protected String telephone;
|
||||
protected String mobile;
|
||||
protected String email;
|
||||
protected String skypeId;
|
||||
protected String instantMessageId;
|
||||
protected String userStatus;
|
||||
protected Date statusUpdatedAt;
|
||||
protected String googleId;
|
||||
protected Long quota;
|
||||
protected Long quotaUsed;
|
||||
protected Boolean emailNotificationsEnabled;
|
||||
protected String description;
|
||||
protected Company company;
|
||||
|
||||
public Person()
|
||||
{
|
||||
}
|
||||
|
||||
public Person(NodeRef nodeRef, Map<QName, Serializable> nodeProps, boolean enabled)
|
||||
{
|
||||
mapProperties(nodeProps);
|
||||
this.enabled = enabled;
|
||||
}
|
||||
|
||||
protected void mapProperties(Map<QName, Serializable> nodeProps)
|
||||
{
|
||||
nodeProps.remove(ContentModel.PROP_CONTENT);
|
||||
|
||||
this.userName = (String) nodeProps.get(ContentModel.PROP_USERNAME);
|
||||
this.firstName = (String) nodeProps.get(ContentModel.PROP_FIRSTNAME);
|
||||
this.lastName = (String) nodeProps.get(ContentModel.PROP_LASTNAME);
|
||||
this.jobTitle = (String) nodeProps.get(ContentModel.PROP_JOBTITLE);
|
||||
|
||||
this.location = (String) nodeProps.get(ContentModel.PROP_LOCATION);
|
||||
this.telephone = (String) nodeProps.get(ContentModel.PROP_TELEPHONE);
|
||||
this.mobile = (String) nodeProps.get(ContentModel.PROP_MOBILE);
|
||||
this.email = (String) nodeProps.get(ContentModel.PROP_EMAIL);
|
||||
|
||||
String organization = (String) nodeProps.get(ContentModel.PROP_ORGANIZATION);
|
||||
String companyAddress1 = (String) nodeProps.get(ContentModel.PROP_COMPANYADDRESS1);
|
||||
String companyAddress2 = (String) nodeProps.get(ContentModel.PROP_COMPANYADDRESS2);
|
||||
String companyAddress3 = (String) nodeProps.get(ContentModel.PROP_COMPANYADDRESS3);
|
||||
String companyPostcode = (String) nodeProps.get(ContentModel.PROP_COMPANYPOSTCODE);
|
||||
String companyTelephone = (String) nodeProps.get(ContentModel.PROP_COMPANYTELEPHONE);
|
||||
String companyFax = (String) nodeProps.get(ContentModel.PROP_COMPANYFAX);
|
||||
String companyEmail = (String) nodeProps.get(ContentModel.PROP_COMPANYEMAIL);
|
||||
this.company = new Company(organization, companyAddress1, companyAddress2, companyAddress3, companyPostcode, companyTelephone, companyFax, companyEmail);
|
||||
|
||||
this.skypeId = (String) nodeProps.get(ContentModel.PROP_SKYPE);
|
||||
this.instantMessageId = (String) nodeProps.get(ContentModel.PROP_INSTANTMSG);
|
||||
this.userStatus = (String) nodeProps.get(ContentModel.PROP_USER_STATUS);
|
||||
this.statusUpdatedAt = (Date) nodeProps.get(ContentModel.PROP_USER_STATUS_TIME);
|
||||
this.googleId = (String) nodeProps.get(ContentModel.PROP_GOOGLEUSERNAME);
|
||||
this.quota = (Long) nodeProps.get(ContentModel.PROP_SIZE_QUOTA);
|
||||
this.quotaUsed = (Long) nodeProps.get(ContentModel.PROP_SIZE_CURRENT);
|
||||
Boolean bool = (Boolean)nodeProps.get(ContentModel.PROP_EMAIL_FEED_DISABLED);
|
||||
this.emailNotificationsEnabled = (bool == null ? Boolean.TRUE : !bool.booleanValue());
|
||||
this.description = (String)nodeProps.get(PROP_PERSON_DESCRIPTION);
|
||||
}
|
||||
|
||||
public Company getCompany()
|
||||
{
|
||||
return company;
|
||||
}
|
||||
|
||||
public String getInstantMessageId()
|
||||
{
|
||||
return instantMessageId;
|
||||
}
|
||||
|
||||
public String getGoogleId()
|
||||
{
|
||||
return googleId;
|
||||
}
|
||||
|
||||
public Long getQuota()
|
||||
{
|
||||
return quota;
|
||||
}
|
||||
|
||||
public Long getQuotaUsed()
|
||||
{
|
||||
return quotaUsed;
|
||||
}
|
||||
|
||||
public String getDescription()
|
||||
{
|
||||
return description;
|
||||
}
|
||||
|
||||
@UniqueId
|
||||
public String getUserName()
|
||||
{
|
||||
return userName;
|
||||
}
|
||||
|
||||
public Boolean isEnabled()
|
||||
{
|
||||
return enabled;
|
||||
}
|
||||
|
||||
public void setAvatarId(NodeRef avatarId)
|
||||
{
|
||||
this.avatarId = avatarId;
|
||||
}
|
||||
|
||||
public NodeRef getAvatarId()
|
||||
{
|
||||
return avatarId;
|
||||
}
|
||||
|
||||
public String getFirstName()
|
||||
{
|
||||
return firstName;
|
||||
}
|
||||
|
||||
public void setFirstName(String firstName)
|
||||
{
|
||||
this.firstName = firstName;
|
||||
}
|
||||
|
||||
public void setLastName(String lastName)
|
||||
{
|
||||
this.lastName = lastName;
|
||||
}
|
||||
|
||||
public String getLastName()
|
||||
{
|
||||
return lastName;
|
||||
}
|
||||
|
||||
public String getJobTitle()
|
||||
{
|
||||
return jobTitle;
|
||||
}
|
||||
|
||||
public String getLocation()
|
||||
{
|
||||
return location;
|
||||
}
|
||||
|
||||
public String getTelephone()
|
||||
{
|
||||
return telephone;
|
||||
}
|
||||
|
||||
public String getMobile()
|
||||
{
|
||||
return mobile;
|
||||
}
|
||||
|
||||
public String getEmail()
|
||||
{
|
||||
return email;
|
||||
}
|
||||
|
||||
public String getSkypeId()
|
||||
{
|
||||
return skypeId;
|
||||
}
|
||||
|
||||
public String getUserStatus()
|
||||
{
|
||||
return userStatus;
|
||||
}
|
||||
|
||||
public Date getStatusUpdatedAt()
|
||||
{
|
||||
return statusUpdatedAt;
|
||||
}
|
||||
|
||||
public Boolean isEmailNotificationsEnabled()
|
||||
{
|
||||
return emailNotificationsEnabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "Person [userName=" + userName + ", enabled=" + enabled
|
||||
+ ", avatarId=" + avatarId + ", firstName=" + firstName
|
||||
+ ", lastName=" + lastName + ", jobTitle=" + jobTitle
|
||||
+ ", location=" + location
|
||||
+ ", telephone=" + telephone + ", mobile=" + mobile
|
||||
+ ", email=" + email + ", skypeId=" + skypeId
|
||||
+ ", instantMessageId=" + instantMessageId + ", userStatus="
|
||||
+ userStatus + ", statusUpdatedAt=" + statusUpdatedAt
|
||||
+ ", googleId=" + googleId + ", quota=" + quota
|
||||
+ ", quotaUsed=" + quotaUsed + ", emailNotificationsEnabled="
|
||||
+ emailNotificationsEnabled + ", description=" + description
|
||||
+ ", company=" + company + "]";
|
||||
}
|
||||
|
||||
}
|
||||
package org.alfresco.rest.api.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.rest.framework.resource.UniqueId;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
|
||||
/**
|
||||
* Represents a user of the system.
|
||||
*
|
||||
* @author steveglover
|
||||
*
|
||||
*/
|
||||
public class Person
|
||||
{
|
||||
public static final QName PROP_PERSON_DESCRIPTION = QName.createQName("RestApi", "description");
|
||||
|
||||
protected String userName;
|
||||
protected Boolean enabled;
|
||||
protected NodeRef avatarId;
|
||||
protected String firstName;
|
||||
protected String lastName;
|
||||
protected String jobTitle;
|
||||
protected String location;
|
||||
protected String telephone;
|
||||
protected String mobile;
|
||||
protected String email;
|
||||
protected String skypeId;
|
||||
protected String instantMessageId;
|
||||
protected String userStatus;
|
||||
protected Date statusUpdatedAt;
|
||||
protected String googleId;
|
||||
protected Long quota;
|
||||
protected Long quotaUsed;
|
||||
protected Boolean emailNotificationsEnabled;
|
||||
protected String description;
|
||||
protected Company company;
|
||||
|
||||
public Person()
|
||||
{
|
||||
}
|
||||
|
||||
public Person(NodeRef nodeRef, Map<QName, Serializable> nodeProps, boolean enabled)
|
||||
{
|
||||
mapProperties(nodeProps);
|
||||
this.enabled = enabled;
|
||||
}
|
||||
|
||||
protected void mapProperties(Map<QName, Serializable> nodeProps)
|
||||
{
|
||||
nodeProps.remove(ContentModel.PROP_CONTENT);
|
||||
|
||||
this.userName = (String) nodeProps.get(ContentModel.PROP_USERNAME);
|
||||
this.firstName = (String) nodeProps.get(ContentModel.PROP_FIRSTNAME);
|
||||
this.lastName = (String) nodeProps.get(ContentModel.PROP_LASTNAME);
|
||||
this.jobTitle = (String) nodeProps.get(ContentModel.PROP_JOBTITLE);
|
||||
|
||||
this.location = (String) nodeProps.get(ContentModel.PROP_LOCATION);
|
||||
this.telephone = (String) nodeProps.get(ContentModel.PROP_TELEPHONE);
|
||||
this.mobile = (String) nodeProps.get(ContentModel.PROP_MOBILE);
|
||||
this.email = (String) nodeProps.get(ContentModel.PROP_EMAIL);
|
||||
|
||||
String organization = (String) nodeProps.get(ContentModel.PROP_ORGANIZATION);
|
||||
String companyAddress1 = (String) nodeProps.get(ContentModel.PROP_COMPANYADDRESS1);
|
||||
String companyAddress2 = (String) nodeProps.get(ContentModel.PROP_COMPANYADDRESS2);
|
||||
String companyAddress3 = (String) nodeProps.get(ContentModel.PROP_COMPANYADDRESS3);
|
||||
String companyPostcode = (String) nodeProps.get(ContentModel.PROP_COMPANYPOSTCODE);
|
||||
String companyTelephone = (String) nodeProps.get(ContentModel.PROP_COMPANYTELEPHONE);
|
||||
String companyFax = (String) nodeProps.get(ContentModel.PROP_COMPANYFAX);
|
||||
String companyEmail = (String) nodeProps.get(ContentModel.PROP_COMPANYEMAIL);
|
||||
this.company = new Company(organization, companyAddress1, companyAddress2, companyAddress3, companyPostcode, companyTelephone, companyFax, companyEmail);
|
||||
|
||||
this.skypeId = (String) nodeProps.get(ContentModel.PROP_SKYPE);
|
||||
this.instantMessageId = (String) nodeProps.get(ContentModel.PROP_INSTANTMSG);
|
||||
this.userStatus = (String) nodeProps.get(ContentModel.PROP_USER_STATUS);
|
||||
this.statusUpdatedAt = (Date) nodeProps.get(ContentModel.PROP_USER_STATUS_TIME);
|
||||
this.googleId = (String) nodeProps.get(ContentModel.PROP_GOOGLEUSERNAME);
|
||||
this.quota = (Long) nodeProps.get(ContentModel.PROP_SIZE_QUOTA);
|
||||
this.quotaUsed = (Long) nodeProps.get(ContentModel.PROP_SIZE_CURRENT);
|
||||
Boolean bool = (Boolean)nodeProps.get(ContentModel.PROP_EMAIL_FEED_DISABLED);
|
||||
this.emailNotificationsEnabled = (bool == null ? Boolean.TRUE : !bool.booleanValue());
|
||||
this.description = (String)nodeProps.get(PROP_PERSON_DESCRIPTION);
|
||||
}
|
||||
|
||||
public Company getCompany()
|
||||
{
|
||||
return company;
|
||||
}
|
||||
|
||||
public String getInstantMessageId()
|
||||
{
|
||||
return instantMessageId;
|
||||
}
|
||||
|
||||
public String getGoogleId()
|
||||
{
|
||||
return googleId;
|
||||
}
|
||||
|
||||
public Long getQuota()
|
||||
{
|
||||
return quota;
|
||||
}
|
||||
|
||||
public Long getQuotaUsed()
|
||||
{
|
||||
return quotaUsed;
|
||||
}
|
||||
|
||||
public String getDescription()
|
||||
{
|
||||
return description;
|
||||
}
|
||||
|
||||
@UniqueId
|
||||
public String getUserName()
|
||||
{
|
||||
return userName;
|
||||
}
|
||||
|
||||
public Boolean isEnabled()
|
||||
{
|
||||
return enabled;
|
||||
}
|
||||
|
||||
public void setAvatarId(NodeRef avatarId)
|
||||
{
|
||||
this.avatarId = avatarId;
|
||||
}
|
||||
|
||||
public NodeRef getAvatarId()
|
||||
{
|
||||
return avatarId;
|
||||
}
|
||||
|
||||
public String getFirstName()
|
||||
{
|
||||
return firstName;
|
||||
}
|
||||
|
||||
public void setFirstName(String firstName)
|
||||
{
|
||||
this.firstName = firstName;
|
||||
}
|
||||
|
||||
public void setLastName(String lastName)
|
||||
{
|
||||
this.lastName = lastName;
|
||||
}
|
||||
|
||||
public String getLastName()
|
||||
{
|
||||
return lastName;
|
||||
}
|
||||
|
||||
public String getJobTitle()
|
||||
{
|
||||
return jobTitle;
|
||||
}
|
||||
|
||||
public String getLocation()
|
||||
{
|
||||
return location;
|
||||
}
|
||||
|
||||
public String getTelephone()
|
||||
{
|
||||
return telephone;
|
||||
}
|
||||
|
||||
public String getMobile()
|
||||
{
|
||||
return mobile;
|
||||
}
|
||||
|
||||
public String getEmail()
|
||||
{
|
||||
return email;
|
||||
}
|
||||
|
||||
public String getSkypeId()
|
||||
{
|
||||
return skypeId;
|
||||
}
|
||||
|
||||
public String getUserStatus()
|
||||
{
|
||||
return userStatus;
|
||||
}
|
||||
|
||||
public Date getStatusUpdatedAt()
|
||||
{
|
||||
return statusUpdatedAt;
|
||||
}
|
||||
|
||||
public Boolean isEmailNotificationsEnabled()
|
||||
{
|
||||
return emailNotificationsEnabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "Person [userName=" + userName + ", enabled=" + enabled
|
||||
+ ", avatarId=" + avatarId + ", firstName=" + firstName
|
||||
+ ", lastName=" + lastName + ", jobTitle=" + jobTitle
|
||||
+ ", location=" + location
|
||||
+ ", telephone=" + telephone + ", mobile=" + mobile
|
||||
+ ", email=" + email + ", skypeId=" + skypeId
|
||||
+ ", instantMessageId=" + instantMessageId + ", userStatus="
|
||||
+ userStatus + ", statusUpdatedAt=" + statusUpdatedAt
|
||||
+ ", googleId=" + googleId + ", quota=" + quota
|
||||
+ ", quotaUsed=" + quotaUsed + ", emailNotificationsEnabled="
|
||||
+ emailNotificationsEnabled + ", description=" + description
|
||||
+ ", company=" + company + "]";
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,107 +1,107 @@
|
||||
package org.alfresco.rest.api.model;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.alfresco.rest.framework.resource.UniqueId;
|
||||
|
||||
/**
|
||||
* Represents network membership.
|
||||
*
|
||||
* @author steveglover
|
||||
*
|
||||
*/
|
||||
public class PersonNetwork implements Network, Comparable<PersonNetwork>
|
||||
{
|
||||
private Boolean homeNetwork;
|
||||
private Network network;
|
||||
|
||||
public PersonNetwork()
|
||||
{
|
||||
}
|
||||
|
||||
public PersonNetwork(Boolean homeNetwork, Network network)
|
||||
{
|
||||
super();
|
||||
this.homeNetwork = homeNetwork;
|
||||
this.network = network;
|
||||
}
|
||||
|
||||
@UniqueId
|
||||
public String getId()
|
||||
{
|
||||
return network.getId();
|
||||
}
|
||||
|
||||
public Date getCreatedAt()
|
||||
{
|
||||
return network.getCreatedAt();
|
||||
}
|
||||
|
||||
public List<Quota> getQuotas()
|
||||
{
|
||||
return network.getQuotas();
|
||||
}
|
||||
|
||||
public Boolean getIsEnabled()
|
||||
{
|
||||
return network.getIsEnabled();
|
||||
}
|
||||
|
||||
public String getSubscriptionLevel()
|
||||
{
|
||||
return network.getSubscriptionLevel();
|
||||
}
|
||||
|
||||
public Boolean getPaidNetwork()
|
||||
{
|
||||
return network.getPaidNetwork();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(PersonNetwork member)
|
||||
{
|
||||
int ret = getId().compareTo(member.getId());
|
||||
return ret;
|
||||
}
|
||||
|
||||
public Boolean getHomeNetwork()
|
||||
{
|
||||
return homeNetwork;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((network == null) ? 0 : network.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
PersonNetwork other = (PersonNetwork) obj;
|
||||
if (network == null)
|
||||
{
|
||||
if (other.network != null)
|
||||
return false;
|
||||
}
|
||||
else if (!network.equals(other.network))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "PersonNetwork [homeNetwork=" + homeNetwork + ", network="
|
||||
+ network + "]";
|
||||
}
|
||||
}
|
||||
package org.alfresco.rest.api.model;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.alfresco.rest.framework.resource.UniqueId;
|
||||
|
||||
/**
|
||||
* Represents network membership.
|
||||
*
|
||||
* @author steveglover
|
||||
*
|
||||
*/
|
||||
public class PersonNetwork implements Network, Comparable<PersonNetwork>
|
||||
{
|
||||
private Boolean homeNetwork;
|
||||
private Network network;
|
||||
|
||||
public PersonNetwork()
|
||||
{
|
||||
}
|
||||
|
||||
public PersonNetwork(Boolean homeNetwork, Network network)
|
||||
{
|
||||
super();
|
||||
this.homeNetwork = homeNetwork;
|
||||
this.network = network;
|
||||
}
|
||||
|
||||
@UniqueId
|
||||
public String getId()
|
||||
{
|
||||
return network.getId();
|
||||
}
|
||||
|
||||
public Date getCreatedAt()
|
||||
{
|
||||
return network.getCreatedAt();
|
||||
}
|
||||
|
||||
public List<Quota> getQuotas()
|
||||
{
|
||||
return network.getQuotas();
|
||||
}
|
||||
|
||||
public Boolean getIsEnabled()
|
||||
{
|
||||
return network.getIsEnabled();
|
||||
}
|
||||
|
||||
public String getSubscriptionLevel()
|
||||
{
|
||||
return network.getSubscriptionLevel();
|
||||
}
|
||||
|
||||
public Boolean getPaidNetwork()
|
||||
{
|
||||
return network.getPaidNetwork();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(PersonNetwork member)
|
||||
{
|
||||
int ret = getId().compareTo(member.getId());
|
||||
return ret;
|
||||
}
|
||||
|
||||
public Boolean getHomeNetwork()
|
||||
{
|
||||
return homeNetwork;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((network == null) ? 0 : network.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
PersonNetwork other = (PersonNetwork) obj;
|
||||
if (network == null)
|
||||
{
|
||||
if (other.network != null)
|
||||
return false;
|
||||
}
|
||||
else if (!network.equals(other.network))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "PersonNetwork [homeNetwork=" + homeNetwork + ", network="
|
||||
+ network + "]";
|
||||
}
|
||||
}
|
||||
|
@@ -1,99 +1,99 @@
|
||||
package org.alfresco.rest.api.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.alfresco.rest.framework.resource.UniqueId;
|
||||
|
||||
/**
|
||||
* Represents a user preference.
|
||||
*
|
||||
* @author steveglover
|
||||
*
|
||||
*/
|
||||
public class Preference implements Comparable<Preference>
|
||||
{
|
||||
private String name;
|
||||
private Serializable value;
|
||||
|
||||
public Preference()
|
||||
{
|
||||
}
|
||||
|
||||
public Preference(String name, Serializable value)
|
||||
{
|
||||
if(name == null)
|
||||
{
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
this.name = name;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@UniqueId
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name)
|
||||
{
|
||||
if(name == null)
|
||||
{
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Serializable getValue()
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(Serializable value)
|
||||
{
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((name == null) ? 0 : name.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj)
|
||||
{
|
||||
if (this == obj)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (obj == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (getClass() != obj.getClass())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Preference other = (Preference) obj;
|
||||
return name.equals(other.name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(Preference preference)
|
||||
{
|
||||
return name.compareTo(preference.getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "Preference [name=" + name + ", value=" + value + "]";
|
||||
}
|
||||
}
|
||||
package org.alfresco.rest.api.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.alfresco.rest.framework.resource.UniqueId;
|
||||
|
||||
/**
|
||||
* Represents a user preference.
|
||||
*
|
||||
* @author steveglover
|
||||
*
|
||||
*/
|
||||
public class Preference implements Comparable<Preference>
|
||||
{
|
||||
private String name;
|
||||
private Serializable value;
|
||||
|
||||
public Preference()
|
||||
{
|
||||
}
|
||||
|
||||
public Preference(String name, Serializable value)
|
||||
{
|
||||
if(name == null)
|
||||
{
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
this.name = name;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@UniqueId
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name)
|
||||
{
|
||||
if(name == null)
|
||||
{
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Serializable getValue()
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(Serializable value)
|
||||
{
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((name == null) ? 0 : name.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj)
|
||||
{
|
||||
if (this == obj)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (obj == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (getClass() != obj.getClass())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Preference other = (Preference) obj;
|
||||
return name.equals(other.name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(Preference preference)
|
||||
{
|
||||
return name.compareTo(preference.getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "Preference [name=" + name + ", value=" + value + "]";
|
||||
}
|
||||
}
|
||||
|
@@ -1,66 +1,66 @@
|
||||
package org.alfresco.rest.api.model;
|
||||
|
||||
import org.alfresco.rest.framework.resource.UniqueId;
|
||||
|
||||
/**
|
||||
* Represents a network quota.
|
||||
*
|
||||
* @author steveglover
|
||||
*
|
||||
*/
|
||||
public class Quota
|
||||
{
|
||||
private String name;
|
||||
private Long limit;
|
||||
private Long usage;
|
||||
|
||||
public Quota()
|
||||
{
|
||||
}
|
||||
|
||||
public Quota(String name, Long limit, Long usage)
|
||||
{
|
||||
this.name = name;
|
||||
this.limit = limit;
|
||||
this.usage = usage;
|
||||
}
|
||||
|
||||
@UniqueId
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Long getLimit()
|
||||
{
|
||||
return limit;
|
||||
}
|
||||
|
||||
public void setLimit(Long limit)
|
||||
{
|
||||
this.limit = limit;
|
||||
}
|
||||
|
||||
public Long getUsage()
|
||||
{
|
||||
return usage;
|
||||
}
|
||||
|
||||
public void setUsage(Long usage)
|
||||
{
|
||||
this.usage = usage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "Quota [name=" + name + ", limit=" + limit + ", usage=" + usage
|
||||
+ "]";
|
||||
}
|
||||
|
||||
}
|
||||
package org.alfresco.rest.api.model;
|
||||
|
||||
import org.alfresco.rest.framework.resource.UniqueId;
|
||||
|
||||
/**
|
||||
* Represents a network quota.
|
||||
*
|
||||
* @author steveglover
|
||||
*
|
||||
*/
|
||||
public class Quota
|
||||
{
|
||||
private String name;
|
||||
private Long limit;
|
||||
private Long usage;
|
||||
|
||||
public Quota()
|
||||
{
|
||||
}
|
||||
|
||||
public Quota(String name, Long limit, Long usage)
|
||||
{
|
||||
this.name = name;
|
||||
this.limit = limit;
|
||||
this.usage = usage;
|
||||
}
|
||||
|
||||
@UniqueId
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Long getLimit()
|
||||
{
|
||||
return limit;
|
||||
}
|
||||
|
||||
public void setLimit(Long limit)
|
||||
{
|
||||
this.limit = limit;
|
||||
}
|
||||
|
||||
public Long getUsage()
|
||||
{
|
||||
return usage;
|
||||
}
|
||||
|
||||
public void setUsage(Long usage)
|
||||
{
|
||||
this.usage = usage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "Quota [name=" + name + ", limit=" + limit + ", usage=" + usage
|
||||
+ "]";
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,23 +1,23 @@
|
||||
package org.alfresco.rest.api.model;
|
||||
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.site.SiteVisibility;
|
||||
|
||||
/**
|
||||
* Represents a site.
|
||||
*
|
||||
* @author steveglover
|
||||
*
|
||||
*/
|
||||
public interface Site
|
||||
{
|
||||
public static final String ROLE = "role";
|
||||
|
||||
String getId();
|
||||
void setId(String id);
|
||||
NodeRef getGuid();
|
||||
String getTitle();
|
||||
String getDescription();
|
||||
SiteVisibility getVisibility();
|
||||
String getRole();
|
||||
package org.alfresco.rest.api.model;
|
||||
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.site.SiteVisibility;
|
||||
|
||||
/**
|
||||
* Represents a site.
|
||||
*
|
||||
* @author steveglover
|
||||
*
|
||||
*/
|
||||
public interface Site
|
||||
{
|
||||
public static final String ROLE = "role";
|
||||
|
||||
String getId();
|
||||
void setId(String id);
|
||||
NodeRef getGuid();
|
||||
String getTitle();
|
||||
String getDescription();
|
||||
SiteVisibility getVisibility();
|
||||
String getRole();
|
||||
}
|
@@ -1,92 +1,92 @@
|
||||
package org.alfresco.rest.api.model;
|
||||
|
||||
import org.alfresco.rest.framework.resource.UniqueId;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
|
||||
/**
|
||||
* Represents a site container.
|
||||
*
|
||||
* @author steveglover
|
||||
*
|
||||
*/
|
||||
public class SiteContainer implements Comparable<SiteContainer>
|
||||
{
|
||||
private String folderId;
|
||||
private NodeRef nodeRef;
|
||||
|
||||
public SiteContainer()
|
||||
{
|
||||
}
|
||||
|
||||
public SiteContainer(String folderId, NodeRef nodeRef)
|
||||
{
|
||||
super();
|
||||
if(folderId == null)
|
||||
{
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
if(nodeRef == null)
|
||||
{
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
this.folderId = folderId;
|
||||
this.nodeRef = nodeRef;
|
||||
}
|
||||
|
||||
public String getFolderId()
|
||||
{
|
||||
return folderId;
|
||||
}
|
||||
|
||||
@UniqueId
|
||||
public NodeRef getNodeRef()
|
||||
{
|
||||
return nodeRef;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result
|
||||
+ ((folderId == null) ? 0 : folderId.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj)
|
||||
{
|
||||
if (this == obj)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (obj == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (getClass() != obj.getClass())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
SiteContainer other = (SiteContainer) obj;
|
||||
return nodeRef.equals(other.getNodeRef());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(SiteContainer other)
|
||||
{
|
||||
return folderId.compareTo(other.getFolderId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "SiteContainer [folderId=" + folderId + ", nodeRef="
|
||||
+ nodeRef + "]";
|
||||
}
|
||||
|
||||
}
|
||||
package org.alfresco.rest.api.model;
|
||||
|
||||
import org.alfresco.rest.framework.resource.UniqueId;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
|
||||
/**
|
||||
* Represents a site container.
|
||||
*
|
||||
* @author steveglover
|
||||
*
|
||||
*/
|
||||
public class SiteContainer implements Comparable<SiteContainer>
|
||||
{
|
||||
private String folderId;
|
||||
private NodeRef nodeRef;
|
||||
|
||||
public SiteContainer()
|
||||
{
|
||||
}
|
||||
|
||||
public SiteContainer(String folderId, NodeRef nodeRef)
|
||||
{
|
||||
super();
|
||||
if(folderId == null)
|
||||
{
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
if(nodeRef == null)
|
||||
{
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
this.folderId = folderId;
|
||||
this.nodeRef = nodeRef;
|
||||
}
|
||||
|
||||
public String getFolderId()
|
||||
{
|
||||
return folderId;
|
||||
}
|
||||
|
||||
@UniqueId
|
||||
public NodeRef getNodeRef()
|
||||
{
|
||||
return nodeRef;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result
|
||||
+ ((folderId == null) ? 0 : folderId.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj)
|
||||
{
|
||||
if (this == obj)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (obj == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (getClass() != obj.getClass())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
SiteContainer other = (SiteContainer) obj;
|
||||
return nodeRef.equals(other.getNodeRef());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(SiteContainer other)
|
||||
{
|
||||
return folderId.compareTo(other.getFolderId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "SiteContainer [folderId=" + folderId + ", nodeRef="
|
||||
+ nodeRef + "]";
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,128 +1,128 @@
|
||||
package org.alfresco.rest.api.model;
|
||||
|
||||
import org.alfresco.rest.framework.resource.UniqueId;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.site.SiteInfo;
|
||||
import org.alfresco.service.cmr.site.SiteVisibility;
|
||||
|
||||
/**
|
||||
* Represents a site.
|
||||
*
|
||||
* @author steveglover
|
||||
*
|
||||
*/
|
||||
public class SiteImpl implements Site, Comparable<SiteImpl>
|
||||
{
|
||||
protected String id;
|
||||
protected NodeRef guid;
|
||||
protected String title;
|
||||
protected String description;
|
||||
protected SiteVisibility visibility;
|
||||
protected String role;
|
||||
|
||||
public SiteImpl()
|
||||
{
|
||||
}
|
||||
|
||||
public SiteImpl(SiteInfo siteInfo, String role)
|
||||
{
|
||||
if(siteInfo == null)
|
||||
{
|
||||
throw new IllegalArgumentException("Must provide siteInfo");
|
||||
}
|
||||
this.id = siteInfo.getShortName();
|
||||
this.guid = siteInfo.getNodeRef();
|
||||
this.title = siteInfo.getTitle();
|
||||
this.description = siteInfo.getDescription();
|
||||
this.visibility = siteInfo.getVisibility();
|
||||
this.role = role;
|
||||
}
|
||||
|
||||
@UniqueId
|
||||
public String getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public NodeRef getGuid()
|
||||
{
|
||||
return guid;
|
||||
}
|
||||
|
||||
public void setGuid(NodeRef guid)
|
||||
{
|
||||
this.guid = guid;
|
||||
}
|
||||
|
||||
public String getTitle()
|
||||
{
|
||||
return title;
|
||||
}
|
||||
|
||||
public String getDescription()
|
||||
{
|
||||
return description;
|
||||
}
|
||||
|
||||
public SiteVisibility getVisibility()
|
||||
{
|
||||
return visibility;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj)
|
||||
{
|
||||
if (this == obj)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (obj == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (getClass() != obj.getClass())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
SiteImpl other = (SiteImpl) obj;
|
||||
return id.equals(other.id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(SiteImpl site)
|
||||
{
|
||||
return id.compareTo(site.getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result
|
||||
+ ((id == null) ? 0 : id.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "Site [id=" + id + ", guid=" + guid + ", title=" + title
|
||||
+ ", description=" + description + ", visibility=" + visibility
|
||||
+ "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRole()
|
||||
{
|
||||
return role;
|
||||
}
|
||||
package org.alfresco.rest.api.model;
|
||||
|
||||
import org.alfresco.rest.framework.resource.UniqueId;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.site.SiteInfo;
|
||||
import org.alfresco.service.cmr.site.SiteVisibility;
|
||||
|
||||
/**
|
||||
* Represents a site.
|
||||
*
|
||||
* @author steveglover
|
||||
*
|
||||
*/
|
||||
public class SiteImpl implements Site, Comparable<SiteImpl>
|
||||
{
|
||||
protected String id;
|
||||
protected NodeRef guid;
|
||||
protected String title;
|
||||
protected String description;
|
||||
protected SiteVisibility visibility;
|
||||
protected String role;
|
||||
|
||||
public SiteImpl()
|
||||
{
|
||||
}
|
||||
|
||||
public SiteImpl(SiteInfo siteInfo, String role)
|
||||
{
|
||||
if(siteInfo == null)
|
||||
{
|
||||
throw new IllegalArgumentException("Must provide siteInfo");
|
||||
}
|
||||
this.id = siteInfo.getShortName();
|
||||
this.guid = siteInfo.getNodeRef();
|
||||
this.title = siteInfo.getTitle();
|
||||
this.description = siteInfo.getDescription();
|
||||
this.visibility = siteInfo.getVisibility();
|
||||
this.role = role;
|
||||
}
|
||||
|
||||
@UniqueId
|
||||
public String getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public NodeRef getGuid()
|
||||
{
|
||||
return guid;
|
||||
}
|
||||
|
||||
public void setGuid(NodeRef guid)
|
||||
{
|
||||
this.guid = guid;
|
||||
}
|
||||
|
||||
public String getTitle()
|
||||
{
|
||||
return title;
|
||||
}
|
||||
|
||||
public String getDescription()
|
||||
{
|
||||
return description;
|
||||
}
|
||||
|
||||
public SiteVisibility getVisibility()
|
||||
{
|
||||
return visibility;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj)
|
||||
{
|
||||
if (this == obj)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (obj == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (getClass() != obj.getClass())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
SiteImpl other = (SiteImpl) obj;
|
||||
return id.equals(other.id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(SiteImpl site)
|
||||
{
|
||||
return id.compareTo(site.getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result
|
||||
+ ((id == null) ? 0 : id.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "Site [id=" + id + ", guid=" + guid + ", title=" + title
|
||||
+ ", description=" + description + ", visibility=" + visibility
|
||||
+ "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRole()
|
||||
{
|
||||
return role;
|
||||
}
|
||||
}
|
@@ -1,112 +1,112 @@
|
||||
package org.alfresco.rest.api.model;
|
||||
|
||||
import org.alfresco.rest.api.people.PeopleEntityResource;
|
||||
import org.alfresco.rest.framework.resource.EmbeddedEntityResource;
|
||||
import org.alfresco.rest.framework.resource.UniqueId;
|
||||
import org.alfresco.service.cmr.site.SiteRole;
|
||||
|
||||
/**
|
||||
* Represents site membership.
|
||||
*
|
||||
* @author steveglover
|
||||
*
|
||||
*/
|
||||
public class SiteMember
|
||||
{
|
||||
private String personId;
|
||||
private String role;
|
||||
|
||||
public SiteMember()
|
||||
{
|
||||
}
|
||||
|
||||
public SiteMember(String personId, String role)
|
||||
{
|
||||
super();
|
||||
if(personId == null)
|
||||
{
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
if(role == null)
|
||||
{
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
this.personId = personId;
|
||||
this.role = role;
|
||||
}
|
||||
|
||||
@UniqueId
|
||||
@EmbeddedEntityResource(propertyName = "person", entityResource = PeopleEntityResource.class)
|
||||
public String getPersonId()
|
||||
{
|
||||
return personId;
|
||||
}
|
||||
|
||||
public String getRole()
|
||||
{
|
||||
return role;
|
||||
}
|
||||
|
||||
public void setRole(String role)
|
||||
{
|
||||
if(role == null)
|
||||
{
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
this.role = role;
|
||||
}
|
||||
|
||||
public void setPersonId(String personId)
|
||||
{
|
||||
if(personId == null)
|
||||
{
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
this.personId = personId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result
|
||||
+ ((personId == null) ? 0 : personId.hashCode());
|
||||
result = prime * result + ((role == null) ? 0 : role.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj)
|
||||
{
|
||||
if (this == obj)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (obj == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (getClass() != obj.getClass())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
SiteMember other = (SiteMember) obj;
|
||||
if (!personId.equals(other.personId))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return(role == other.role);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "SiteMember [personId=" + personId + ", role=" + role + "]";
|
||||
}
|
||||
|
||||
package org.alfresco.rest.api.model;
|
||||
|
||||
import org.alfresco.rest.api.people.PeopleEntityResource;
|
||||
import org.alfresco.rest.framework.resource.EmbeddedEntityResource;
|
||||
import org.alfresco.rest.framework.resource.UniqueId;
|
||||
import org.alfresco.service.cmr.site.SiteRole;
|
||||
|
||||
/**
|
||||
* Represents site membership.
|
||||
*
|
||||
* @author steveglover
|
||||
*
|
||||
*/
|
||||
public class SiteMember
|
||||
{
|
||||
private String personId;
|
||||
private String role;
|
||||
|
||||
public SiteMember()
|
||||
{
|
||||
}
|
||||
|
||||
public SiteMember(String personId, String role)
|
||||
{
|
||||
super();
|
||||
if(personId == null)
|
||||
{
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
if(role == null)
|
||||
{
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
this.personId = personId;
|
||||
this.role = role;
|
||||
}
|
||||
|
||||
@UniqueId
|
||||
@EmbeddedEntityResource(propertyName = "person", entityResource = PeopleEntityResource.class)
|
||||
public String getPersonId()
|
||||
{
|
||||
return personId;
|
||||
}
|
||||
|
||||
public String getRole()
|
||||
{
|
||||
return role;
|
||||
}
|
||||
|
||||
public void setRole(String role)
|
||||
{
|
||||
if(role == null)
|
||||
{
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
this.role = role;
|
||||
}
|
||||
|
||||
public void setPersonId(String personId)
|
||||
{
|
||||
if(personId == null)
|
||||
{
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
this.personId = personId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result
|
||||
+ ((personId == null) ? 0 : personId.hashCode());
|
||||
result = prime * result + ((role == null) ? 0 : role.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj)
|
||||
{
|
||||
if (this == obj)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (obj == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (getClass() != obj.getClass())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
SiteMember other = (SiteMember) obj;
|
||||
if (!personId.equals(other.personId))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return(role == other.role);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "SiteMember [personId=" + personId + ", role=" + role + "]";
|
||||
}
|
||||
|
||||
}
|
@@ -1,159 +1,159 @@
|
||||
package org.alfresco.rest.api.model;
|
||||
|
||||
import java.text.Collator;
|
||||
import java.util.Date;
|
||||
|
||||
import org.alfresco.rest.api.sites.SiteEntityResource;
|
||||
import org.alfresco.rest.framework.core.exceptions.InvalidArgumentException;
|
||||
import org.alfresco.rest.framework.resource.EmbeddedEntityResource;
|
||||
import org.alfresco.rest.framework.resource.UniqueId;
|
||||
import org.alfresco.util.Pair;
|
||||
import org.codehaus.jackson.annotate.JsonIgnore;
|
||||
|
||||
/**
|
||||
* Representation of a site membership request for a specific user.
|
||||
*
|
||||
* Ordering is by id (site id).
|
||||
*
|
||||
* @author steveglover
|
||||
*
|
||||
*/
|
||||
public class SiteMembershipRequest implements Comparable<SiteMembershipRequest>
|
||||
{
|
||||
private static Collator collator = Collator.getInstance();
|
||||
|
||||
private String id; // site id
|
||||
private String message;
|
||||
private Date createdAt;
|
||||
private Date modifiedAt;
|
||||
private String title; // for sorting only
|
||||
|
||||
public static Pair<String, String> splitId(String id)
|
||||
{
|
||||
int idx = id.indexOf(":");
|
||||
if(idx != -1)
|
||||
{
|
||||
String workflowId = id.substring(0, idx);
|
||||
String key = id.substring(idx + 1);
|
||||
Pair<String, String> ret = new Pair<String, String>(workflowId, key);
|
||||
return ret;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new InvalidArgumentException("Site invite id is invalid: " + id);
|
||||
}
|
||||
}
|
||||
|
||||
public SiteMembershipRequest()
|
||||
{
|
||||
}
|
||||
|
||||
@EmbeddedEntityResource(propertyName = "site", entityResource = SiteEntityResource.class)
|
||||
@UniqueId
|
||||
public String getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public void setTitle(String title)
|
||||
{
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public String getTitle()
|
||||
{
|
||||
return title;
|
||||
}
|
||||
|
||||
public Date getCreatedAt()
|
||||
{
|
||||
return createdAt;
|
||||
}
|
||||
|
||||
public void setCreatedAt(Date createdAt)
|
||||
{
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public Date getModifiedAt()
|
||||
{
|
||||
return modifiedAt;
|
||||
}
|
||||
|
||||
public void setModifiedAt(Date modifiedAt)
|
||||
{
|
||||
this.modifiedAt = modifiedAt;
|
||||
}
|
||||
|
||||
public String getMessage()
|
||||
{
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMessage(String message)
|
||||
{
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "SiteMembershipRequest [id=" + id + ", message=" + message + ", createdAt=" + createdAt
|
||||
+ ", modifiedAt=" + modifiedAt + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((id == null) ? 0 : id.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj)
|
||||
{
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
SiteMembershipRequest other = (SiteMembershipRequest) obj;
|
||||
if (id == null)
|
||||
{
|
||||
if (other.id != null)
|
||||
return false;
|
||||
} else if (!id.equals(other.id))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(SiteMembershipRequest o)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
if(title == null && o.getTitle() != null)
|
||||
{
|
||||
ret = -1;
|
||||
}
|
||||
else if(title != null && o.getTitle() == null)
|
||||
{
|
||||
ret = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = collator.compare(title, o.getTitle());
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
package org.alfresco.rest.api.model;
|
||||
|
||||
import java.text.Collator;
|
||||
import java.util.Date;
|
||||
|
||||
import org.alfresco.rest.api.sites.SiteEntityResource;
|
||||
import org.alfresco.rest.framework.core.exceptions.InvalidArgumentException;
|
||||
import org.alfresco.rest.framework.resource.EmbeddedEntityResource;
|
||||
import org.alfresco.rest.framework.resource.UniqueId;
|
||||
import org.alfresco.util.Pair;
|
||||
import org.codehaus.jackson.annotate.JsonIgnore;
|
||||
|
||||
/**
|
||||
* Representation of a site membership request for a specific user.
|
||||
*
|
||||
* Ordering is by id (site id).
|
||||
*
|
||||
* @author steveglover
|
||||
*
|
||||
*/
|
||||
public class SiteMembershipRequest implements Comparable<SiteMembershipRequest>
|
||||
{
|
||||
private static Collator collator = Collator.getInstance();
|
||||
|
||||
private String id; // site id
|
||||
private String message;
|
||||
private Date createdAt;
|
||||
private Date modifiedAt;
|
||||
private String title; // for sorting only
|
||||
|
||||
public static Pair<String, String> splitId(String id)
|
||||
{
|
||||
int idx = id.indexOf(":");
|
||||
if(idx != -1)
|
||||
{
|
||||
String workflowId = id.substring(0, idx);
|
||||
String key = id.substring(idx + 1);
|
||||
Pair<String, String> ret = new Pair<String, String>(workflowId, key);
|
||||
return ret;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new InvalidArgumentException("Site invite id is invalid: " + id);
|
||||
}
|
||||
}
|
||||
|
||||
public SiteMembershipRequest()
|
||||
{
|
||||
}
|
||||
|
||||
@EmbeddedEntityResource(propertyName = "site", entityResource = SiteEntityResource.class)
|
||||
@UniqueId
|
||||
public String getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public void setTitle(String title)
|
||||
{
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public String getTitle()
|
||||
{
|
||||
return title;
|
||||
}
|
||||
|
||||
public Date getCreatedAt()
|
||||
{
|
||||
return createdAt;
|
||||
}
|
||||
|
||||
public void setCreatedAt(Date createdAt)
|
||||
{
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public Date getModifiedAt()
|
||||
{
|
||||
return modifiedAt;
|
||||
}
|
||||
|
||||
public void setModifiedAt(Date modifiedAt)
|
||||
{
|
||||
this.modifiedAt = modifiedAt;
|
||||
}
|
||||
|
||||
public String getMessage()
|
||||
{
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMessage(String message)
|
||||
{
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "SiteMembershipRequest [id=" + id + ", message=" + message + ", createdAt=" + createdAt
|
||||
+ ", modifiedAt=" + modifiedAt + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((id == null) ? 0 : id.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj)
|
||||
{
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
SiteMembershipRequest other = (SiteMembershipRequest) obj;
|
||||
if (id == null)
|
||||
{
|
||||
if (other.id != null)
|
||||
return false;
|
||||
} else if (!id.equals(other.id))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(SiteMembershipRequest o)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
if(title == null && o.getTitle() != null)
|
||||
{
|
||||
ret = -1;
|
||||
}
|
||||
else if(title != null && o.getTitle() == null)
|
||||
{
|
||||
ret = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = collator.compare(title, o.getTitle());
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
@@ -1,40 +1,40 @@
|
||||
package org.alfresco.rest.api.model;
|
||||
|
||||
|
||||
/**
|
||||
* A site target favourite.
|
||||
*
|
||||
* @author steveglover
|
||||
*
|
||||
*/
|
||||
public class SiteTarget extends Target
|
||||
{
|
||||
private Site site;
|
||||
|
||||
public SiteTarget()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public SiteTarget(Site site)
|
||||
{
|
||||
super();
|
||||
this.site = site;
|
||||
}
|
||||
|
||||
public void setSite(Site site)
|
||||
{
|
||||
this.site = site;
|
||||
}
|
||||
|
||||
public Site getSite()
|
||||
{
|
||||
return site;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "SiteTarget [site=" + site + "]";
|
||||
}
|
||||
}
|
||||
package org.alfresco.rest.api.model;
|
||||
|
||||
|
||||
/**
|
||||
* A site target favourite.
|
||||
*
|
||||
* @author steveglover
|
||||
*
|
||||
*/
|
||||
public class SiteTarget extends Target
|
||||
{
|
||||
private Site site;
|
||||
|
||||
public SiteTarget()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public SiteTarget(Site site)
|
||||
{
|
||||
super();
|
||||
this.site = site;
|
||||
}
|
||||
|
||||
public void setSite(Site site)
|
||||
{
|
||||
this.site = site;
|
||||
}
|
||||
|
||||
public Site getSite()
|
||||
{
|
||||
return site;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "SiteTarget [site=" + site + "]";
|
||||
}
|
||||
}
|
||||
|
@@ -1,101 +1,101 @@
|
||||
package org.alfresco.rest.api.model;
|
||||
|
||||
import org.alfresco.rest.framework.resource.UniqueId;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
|
||||
/**
|
||||
* Represents a node tag.
|
||||
*
|
||||
* @author steveglover
|
||||
*
|
||||
*/
|
||||
public class Tag implements Comparable<Tag>
|
||||
{
|
||||
private NodeRef nodeRef;
|
||||
private String tag;
|
||||
|
||||
public Tag()
|
||||
{
|
||||
}
|
||||
|
||||
public Tag(NodeRef nodeRef, String tag)
|
||||
{
|
||||
this.nodeRef = nodeRef;
|
||||
this.tag = tag;
|
||||
}
|
||||
|
||||
@UniqueId
|
||||
public NodeRef getNodeRef()
|
||||
{
|
||||
return nodeRef;
|
||||
}
|
||||
|
||||
public void setNodeRef(NodeRef nodeRef)
|
||||
{
|
||||
this.nodeRef = nodeRef;
|
||||
}
|
||||
|
||||
public String getTag()
|
||||
{
|
||||
return tag;
|
||||
}
|
||||
|
||||
public void setTag(String tag)
|
||||
{
|
||||
this.tag = tag;
|
||||
}
|
||||
|
||||
/*
|
||||
* Note that comparison of tags is based on their string value. This should still
|
||||
* be consistent with equals since tags that are equal implies NodeRefs that are equal.
|
||||
*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Comparable#compareTo(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public int compareTo(Tag o)
|
||||
{
|
||||
int ret = getTag().compareTo(o.getTag());
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((nodeRef == null) ? 0 : nodeRef.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* Tags are equal if they have the same NodeRef
|
||||
*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj)
|
||||
{
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
Tag other = (Tag) obj;
|
||||
if (nodeRef == null) {
|
||||
if (other.nodeRef != null)
|
||||
return false;
|
||||
} else if (!nodeRef.equals(other.nodeRef))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "Tag [nodeRef=" + nodeRef + ", tag=" + tag + "]";
|
||||
}
|
||||
|
||||
}
|
||||
package org.alfresco.rest.api.model;
|
||||
|
||||
import org.alfresco.rest.framework.resource.UniqueId;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
|
||||
/**
|
||||
* Represents a node tag.
|
||||
*
|
||||
* @author steveglover
|
||||
*
|
||||
*/
|
||||
public class Tag implements Comparable<Tag>
|
||||
{
|
||||
private NodeRef nodeRef;
|
||||
private String tag;
|
||||
|
||||
public Tag()
|
||||
{
|
||||
}
|
||||
|
||||
public Tag(NodeRef nodeRef, String tag)
|
||||
{
|
||||
this.nodeRef = nodeRef;
|
||||
this.tag = tag;
|
||||
}
|
||||
|
||||
@UniqueId
|
||||
public NodeRef getNodeRef()
|
||||
{
|
||||
return nodeRef;
|
||||
}
|
||||
|
||||
public void setNodeRef(NodeRef nodeRef)
|
||||
{
|
||||
this.nodeRef = nodeRef;
|
||||
}
|
||||
|
||||
public String getTag()
|
||||
{
|
||||
return tag;
|
||||
}
|
||||
|
||||
public void setTag(String tag)
|
||||
{
|
||||
this.tag = tag;
|
||||
}
|
||||
|
||||
/*
|
||||
* Note that comparison of tags is based on their string value. This should still
|
||||
* be consistent with equals since tags that are equal implies NodeRefs that are equal.
|
||||
*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Comparable#compareTo(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public int compareTo(Tag o)
|
||||
{
|
||||
int ret = getTag().compareTo(o.getTag());
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((nodeRef == null) ? 0 : nodeRef.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* Tags are equal if they have the same NodeRef
|
||||
*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj)
|
||||
{
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
Tag other = (Tag) obj;
|
||||
if (nodeRef == null) {
|
||||
if (other.nodeRef != null)
|
||||
return false;
|
||||
} else if (!nodeRef.equals(other.nodeRef))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "Tag [nodeRef=" + nodeRef + ", tag=" + tag + "]";
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,11 +1,11 @@
|
||||
package org.alfresco.rest.api.model;
|
||||
|
||||
/**
|
||||
* A favourite target entity.
|
||||
*
|
||||
* @author steveglover
|
||||
*
|
||||
*/
|
||||
public abstract class Target
|
||||
{
|
||||
}
|
||||
package org.alfresco.rest.api.model;
|
||||
|
||||
/**
|
||||
* A favourite target entity.
|
||||
*
|
||||
* @author steveglover
|
||||
*
|
||||
*/
|
||||
public abstract class Target
|
||||
{
|
||||
}
|
||||
|
@@ -1,42 +1,42 @@
|
||||
package org.alfresco.rest.api.model;
|
||||
|
||||
import org.alfresco.rest.framework.resource.UniqueId;
|
||||
|
||||
/**
|
||||
* Represents a user rating for a node.
|
||||
*
|
||||
* @author steveglover
|
||||
*
|
||||
*/
|
||||
public class UserRating
|
||||
{
|
||||
private Float userRating;
|
||||
private String personId;
|
||||
|
||||
public UserRating(String personId, Float userRating)
|
||||
{
|
||||
super();
|
||||
this.userRating = userRating;
|
||||
this.personId = personId;
|
||||
}
|
||||
|
||||
public Float getUserRating()
|
||||
{
|
||||
return userRating;
|
||||
}
|
||||
|
||||
@UniqueId
|
||||
public String getPersonId()
|
||||
{
|
||||
return personId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "UserRating [userRating=" + userRating + ", personId="
|
||||
+ personId + "]";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
package org.alfresco.rest.api.model;
|
||||
|
||||
import org.alfresco.rest.framework.resource.UniqueId;
|
||||
|
||||
/**
|
||||
* Represents a user rating for a node.
|
||||
*
|
||||
* @author steveglover
|
||||
*
|
||||
*/
|
||||
public class UserRating
|
||||
{
|
||||
private Float userRating;
|
||||
private String personId;
|
||||
|
||||
public UserRating(String personId, Float userRating)
|
||||
{
|
||||
super();
|
||||
this.userRating = userRating;
|
||||
this.personId = personId;
|
||||
}
|
||||
|
||||
public Float getUserRating()
|
||||
{
|
||||
return userRating;
|
||||
}
|
||||
|
||||
@UniqueId
|
||||
public String getPersonId()
|
||||
{
|
||||
return personId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "UserRating [userRating=" + userRating + ", personId="
|
||||
+ personId + "]";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user