mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
ACS-5506 Proper Group serialization
This commit is contained in:
@@ -58,7 +58,9 @@ public class Group extends org.alfresco.rest.api.model.Group implements Serializ
|
||||
|
||||
AssertUtil.assertEquals("id", getId(), other.getId());
|
||||
AssertUtil.assertEquals("displayName", getDisplayName(), other.getDisplayName());
|
||||
AssertUtil.assertEquals("description", getDescription(), other.getDescription());
|
||||
AssertUtil.assertEquals("isRoot", getIsRoot(), other.getIsRoot());
|
||||
AssertUtil.assertEquals("hasSubgroups", getHasSubgroups(), other.getHasSubgroups());
|
||||
AssertUtil.assertEquals("parentIds", getParentIds(), other.getParentIds());
|
||||
AssertUtil.assertEquals("zones", getZones(), other.getZones());
|
||||
}
|
||||
@@ -73,11 +75,21 @@ public class Group extends org.alfresco.rest.api.model.Group implements Serializ
|
||||
|
||||
groupJson.put("displayName", getDisplayName());
|
||||
|
||||
if (getDescription() != null)
|
||||
{
|
||||
groupJson.put("description", getDescription());
|
||||
}
|
||||
|
||||
if (getIsRoot() != null)
|
||||
{
|
||||
groupJson.put("isRoot", getIsRoot());
|
||||
}
|
||||
|
||||
if (getHasSubgroups() != null)
|
||||
{
|
||||
groupJson.put("hasSubgroups", getHasSubgroups());
|
||||
}
|
||||
|
||||
if (getParentIds() != null)
|
||||
{
|
||||
groupJson.put("parentIds", new ArrayList(getParentIds()));
|
||||
@@ -97,6 +109,7 @@ public class Group extends org.alfresco.rest.api.model.Group implements Serializ
|
||||
String displayName = (String) jsonObject.get("displayName");
|
||||
String description = (String) jsonObject.get("description");
|
||||
Boolean isRoot = (Boolean) jsonObject.get("isRoot");
|
||||
Boolean hasSubgroups = (Boolean) jsonObject.get("hasSubgroups");
|
||||
List<String> parentIds = (List<String>) jsonObject.get("parentIds");
|
||||
List<String> zones = (List<String>) jsonObject.get("zones");
|
||||
|
||||
@@ -105,6 +118,7 @@ public class Group extends org.alfresco.rest.api.model.Group implements Serializ
|
||||
group.setDisplayName(displayName);
|
||||
group.setDescription(description);
|
||||
group.setIsRoot(isRoot);
|
||||
group.setHasSubgroups(hasSubgroups);
|
||||
group.setParentIds(parentIds != null ? new HashSet<>(parentIds) : null);
|
||||
group.setZones(zones != null ? new HashSet<>(zones) : null);
|
||||
|
||||
|
Reference in New Issue
Block a user