← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 14536: TEI query, meta-data names

 

------------------------------------------------------------
revno: 14536
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Sun 2014-03-30 22:09:40 +0200
message:
  TEI query, meta-data names
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceQueryParams.java
  dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityInstanceService.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/trackedentity/TrackedEntityInstanceQueryParams.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceQueryParams.java	2014-03-30 17:33:23 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceQueryParams.java	2014-03-30 20:09:40 +0000
@@ -53,6 +53,8 @@
     public static final String TRACKED_ENTITY_ATTRIBUTE_ID = "teattribute";
     public static final String TRACKED_ENTITY_ATTRIBUTE_VALUE_ID = "tevalue";
     
+    public static final String META_DATA_NAMES_KEY = "names";
+    
     /**
      * Query value, will apply to all relevant attributes.
      */

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityInstanceService.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityInstanceService.java	2014-03-30 17:33:23 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityInstanceService.java	2014-03-30 20:09:40 +0000
@@ -231,14 +231,16 @@
         
         if ( !params.isSkipMeta() )
         {
-            Map<Object, Object> metaData = new HashMap<Object, Object>();
+            Map<Object, Object> metaData = new HashMap<Object, Object>();            
+            Map<String, String> names = new HashMap<String, String>();
             
             for ( String te : tes )
             {
                 TrackedEntity entity = trackedEntityService.getTrackedEntity( te );
-                metaData.put( te, entity != null ? entity.getDisplayName() : null );
+                names.put( te, entity != null ? entity.getDisplayName() : null );
             }
             
+            metaData.put( TrackedEntityInstanceQueryParams.META_DATA_NAMES_KEY, names );
             grid.setMetaData( metaData );
         }