REPO-1661: properties and aspects no longer appear in /comments listing.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@133552 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Matt Ward
2016-12-09 16:54:07 +00:00
parent 3b4599a91a
commit cfed51f84b
8 changed files with 106 additions and 65 deletions

View File

@@ -45,14 +45,16 @@ import org.alfresco.service.namespace.QName;
public class Comment
{
public static final QName PROP_COMMENT_CONTENT = QName.createQName("RestApi", "commentContent");
public static final QName PROP_COMMENT_CREATED_BY = QName.createQName("RestApi", "createdBy");
public static final QName PROP_COMMENT_MODIFIED_BY = QName.createQName("RestApi", "modifiedBy");
private String id;
private String title;
private String content;
private Date createdAt;
private String createdBy;
private Person createdBy;
private Date modifiedAt;
private String modifiedBy;
private Person modifiedBy;
private Boolean edited;
// permissions
@@ -117,15 +119,13 @@ public class Comment
{
return createdAt;
}
@EmbeddedEntityResource(propertyName = "createdBy", entityResource = PeopleEntityResource.class)
public String getCreatedBy()
public Person getCreatedBy()
{
return createdBy;
}
@EmbeddedEntityResource(propertyName = "modifiedBy", entityResource = PeopleEntityResource.class)
public String getModifiedBy()
public Person getModifiedBy()
{
return modifiedBy;
}
@@ -155,13 +155,16 @@ public class Comment
long diff = modifiedAt.getTime() - createdAt.getTime();
this.edited = Boolean.valueOf(diff >= 100); // logic is consistent with existing (Javascript) comments implementation
}
this.createdBy = (String)nodeProps.get(ContentModel.PROP_CREATOR);
this.modifiedBy = (String)nodeProps.get(ContentModel.PROP_MODIFIER);
this.content = (String)nodeProps.get(PROP_COMMENT_CONTENT);
nodeProps.remove(PROP_COMMENT_CONTENT);
}
this.createdBy = (Person) nodeProps.get(PROP_COMMENT_CREATED_BY);
nodeProps.remove(PROP_COMMENT_CREATED_BY);
this.modifiedBy = (Person) nodeProps.get(PROP_COMMENT_MODIFIED_BY);
nodeProps.remove(PROP_COMMENT_MODIFIED_BY);
}
@Override
public String toString()

View File

@@ -42,8 +42,9 @@ import java.util.Map;
* @author steveglover
*
*/
public class Person
public class Person implements Serializable
{
private static final long serialVersionUID = 1L;
protected String userName;
protected Boolean enabled;
protected NodeRef avatarId;