← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 20801: minor cleanup in Sharing objects

 

------------------------------------------------------------
revno: 20801
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2015-10-20 17:43:45 +0700
message:
  minor cleanup in Sharing objects
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserGroupAccess.java
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/SharingController.java
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/webdomain/sharing/SharingObject.java
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/webdomain/sharing/SharingUserGroupAccess.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserGroupAccess.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserGroupAccess.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserGroupAccess.java	2015-10-20 10:43:45 +0000
@@ -78,6 +78,20 @@
         return userGroup != null ? userGroup.getUid() : null;
     }
 
+    @JsonProperty( "id" )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
+    public String getUid()
+    {
+        return userGroup != null ? userGroup.getUid() : null;
+    }
+
+    @JsonProperty
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
+    public String displayName()
+    {
+        return userGroup != null ? userGroup.getDisplayName() : null;
+    }
+
     public UserGroup getUserGroup()
     {
         return userGroup;

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/SharingController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/SharingController.java	2015-10-20 04:15:40 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/SharingController.java	2015-10-20 10:43:45 +0000
@@ -126,6 +126,7 @@
 
         sharing.getObject().setId( object.getUid() );
         sharing.getObject().setName( object.getDisplayName() );
+        sharing.getObject().setDisplayName( object.getDisplayName() );
         sharing.getObject().setExternalAccess( object.getExternalAccess() );
 
         if ( object.getPublicAccess() == null )
@@ -159,6 +160,7 @@
             SharingUserGroupAccess sharingUserGroupAccess = new SharingUserGroupAccess();
             sharingUserGroupAccess.setId( userGroupAccess.getUserGroup().getUid() );
             sharingUserGroupAccess.setName( userGroupAccess.getUserGroup().getDisplayName() );
+            sharingUserGroupAccess.setDisplayName( userGroupAccess.getUserGroup().getDisplayName() );
             sharingUserGroupAccess.setAccess( userGroupAccess.getAccess() );
 
             sharing.getObject().getUserGroupAccesses().add( sharingUserGroupAccess );
@@ -287,6 +289,7 @@
 
             sharingUserGroupAccess.setId( userGroup.getUid() );
             sharingUserGroupAccess.setName( userGroup.getDisplayName() );
+            sharingUserGroupAccess.setDisplayName( userGroup.getDisplayName() );
 
             sharingUserGroups.getUserGroups().add( sharingUserGroupAccess );
         }

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/webdomain/sharing/SharingObject.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/webdomain/sharing/SharingObject.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/webdomain/sharing/SharingObject.java	2015-10-20 10:43:45 +0000
@@ -45,6 +45,9 @@
     private String name;
 
     @JsonProperty
+    private String displayName;
+
+    @JsonProperty
     private String publicAccess;
 
     @JsonProperty
@@ -80,6 +83,16 @@
         this.name = name;
     }
 
+    public String getDisplayName()
+    {
+        return displayName;
+    }
+
+    public void setDisplayName( String displayName )
+    {
+        this.displayName = displayName;
+    }
+
     public String getPublicAccess()
     {
         return publicAccess;

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/webdomain/sharing/SharingUserGroupAccess.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/webdomain/sharing/SharingUserGroupAccess.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/webdomain/sharing/SharingUserGroupAccess.java	2015-10-20 10:43:45 +0000
@@ -43,6 +43,9 @@
     private String name;
 
     @JsonProperty
+    private String displayName;
+
+    @JsonProperty
     private String access;
 
     public SharingUserGroupAccess()
@@ -69,6 +72,16 @@
         this.name = name;
     }
 
+    public String getDisplayName()
+    {
+        return displayName;
+    }
+
+    public void setDisplayName( String displayName )
+    {
+        this.displayName = displayName;
+    }
+
     public String getAccess()
     {
         return access;
@@ -78,7 +91,7 @@
     {
         this.access = access;
     }
-    
+
     public String toString()
     {
         return MoreObjects.toStringHelper( this ).