← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 15620: minor fixes to orgUnit controller

 

------------------------------------------------------------
revno: 15620
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2014-06-11 13:13:54 +0200
message:
  minor fixes to orgUnit controller
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.java
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AbstractCrudController.java
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/organisationunit/OrganisationUnitController.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/organisationunit/OrganisationUnit.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.java	2014-04-25 11:22:12 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.java	2014-06-11 11:13:54 +0000
@@ -738,7 +738,7 @@
 
     @JsonProperty
     @JsonView( UuidView.class )
-    @JacksonXmlProperty( isAttribute = true, namespace = DxfNamespaces.DXF_2_0 )
+    @JacksonXmlProperty( isAttribute = true )
     public String getUuid()
     {
         return uuid;

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AbstractCrudController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AbstractCrudController.java	2014-06-11 11:03:34 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AbstractCrudController.java	2014-06-11 11:13:54 +0000
@@ -228,8 +228,7 @@
 
         CollectionNode collectionNode = filterService.fieldFilter( getEntityClass(), entities, fields );
 
-        if ( options.booleanTrue( "useWrapper" ) || entities.size() > 1
-            || options.getOptions().containsKey( "includeChildren" ) || options.getOptions().containsKey( "includeDescendants" ) )
+        if ( options.booleanTrue( "useWrapper" ) || entities.size() > 1 )
         {
             RootNode rootNode = new RootNode( "metadata" );
             rootNode.setDefaultNamespace( DxfNamespaces.DXF_2_0 );
@@ -242,6 +241,7 @@
         {
             RootNode rootNode = new RootNode( collectionNode.getChildren().get( 0 ) );
             rootNode.setDefaultNamespace( DxfNamespaces.DXF_2_0 );
+            rootNode.setNamespace( DxfNamespaces.DXF_2_0 );
 
             return rootNode;
         }

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/organisationunit/OrganisationUnitController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/organisationunit/OrganisationUnitController.java	2014-06-11 11:03:34 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/organisationunit/OrganisationUnitController.java	2014-06-11 11:13:54 +0000
@@ -176,11 +176,13 @@
 
         if ( options.getOptions().containsKey( "includeChildren" ) )
         {
+            options.getOptions().put( "useWrapper", "true" );
             organisationUnits.add( organisationUnit );
             organisationUnits.addAll( organisationUnit.getChildren() );
         }
         else if ( options.getOptions().containsKey( "includeDescendants" ) )
         {
+            options.getOptions().put( "useWrapper", "true" );
             organisationUnits.addAll( organisationUnitService.getOrganisationUnitsWithChildren( uid ) );
         }
         else