← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 21518: minor fix

 

------------------------------------------------------------
revno: 21518
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2015-12-23 09:43:54 +0100
message:
  minor fix
modified:
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/fieldfilter/DefaultFieldFilterService.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/node/Preset.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/DimensionController.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-services/dhis-service-core/src/main/java/org/hisp/dhis/fieldfilter/DefaultFieldFilterService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/fieldfilter/DefaultFieldFilterService.java	2015-12-22 10:31:26 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/fieldfilter/DefaultFieldFilterService.java	2015-12-23 08:43:54 +0000
@@ -221,7 +221,7 @@
             }
             else if ( fieldValue.isEmpty() )
             {
-                List<String> fields = Preset.defaultPreset().getFields();
+                List<String> fields = Preset.defaultAssociationPreset().getFields();
 
                 if ( property.isCollection() )
                 {

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/node/Preset.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/node/Preset.java	2015-12-22 10:31:26 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/node/Preset.java	2015-12-23 08:43:54 +0000
@@ -38,6 +38,7 @@
 public enum Preset
 {
     ID( "id", Lists.newArrayList( "id" ) ),
+    ID_NAME( "idName", Lists.newArrayList( "id", "displayName" ) ),
     ALL( "all", Lists.newArrayList( "*" ) ),
     IDENTIFIABLE( "identifiable", Lists.newArrayList( "id", "name", "code", "created", "lastUpdated", "href" ) ),
     NAMEABLE( "nameable", Lists.newArrayList( "id", "name", "shortName", "description", "code", "created", "lastUpdated", "href" ) );
@@ -64,6 +65,11 @@
 
     public static Preset defaultPreset()
     {
+        return Preset.ID_NAME;
+    }
+
+    public static Preset defaultAssociationPreset()
+    {
         return Preset.ID;
     }
 }

=== 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	2015-12-22 10:31:26 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AbstractCrudController.java	2015-12-23 08:43:54 +0000
@@ -59,6 +59,7 @@
 import org.hisp.dhis.importexport.ImportStrategy;
 import org.hisp.dhis.node.Node;
 import org.hisp.dhis.node.NodeUtils;
+import org.hisp.dhis.node.Preset;
 import org.hisp.dhis.node.config.InclusionStrategy;
 import org.hisp.dhis.node.types.CollectionNode;
 import org.hisp.dhis.node.types.ComplexNode;
@@ -174,7 +175,7 @@
 
         if ( fields.isEmpty() )
         {
-            fields.add( ":id" );
+            fields.addAll( Preset.defaultPreset().getFields() );
         }
 
         List<T> entities = getEntityList( metaData, options, filters, orders );

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/DimensionController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/DimensionController.java	2015-12-22 10:31:26 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/DimensionController.java	2015-12-23 08:43:54 +0000
@@ -39,6 +39,7 @@
 import org.hisp.dhis.node.AbstractNode;
 import org.hisp.dhis.node.Node;
 import org.hisp.dhis.node.NodeUtils;
+import org.hisp.dhis.node.Preset;
 import org.hisp.dhis.node.types.CollectionNode;
 import org.hisp.dhis.node.types.RootNode;
 import org.hisp.dhis.query.Order;
@@ -114,7 +115,7 @@
 
         if ( fields.isEmpty() )
         {
-            fields.add( ":id" );
+            fields.addAll( Preset.defaultPreset().getFields() );
         }
 
         List<DimensionalItemObject> items = dimensionService.getCanReadDimensionItems( uid );