← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 21921: wip, object bundle validation

 

------------------------------------------------------------
revno: 21921
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2016-02-10 13:31:33 +0700
message:
  wip, object bundle validation
added:
  dhis-2/dhis-services/dhis-service-dxf2/src/test/resources/dxf2/metadata_preheat1.json
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/preheat/PreheatService.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/render/RenderService.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/preheat/DefaultPreheatService.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/render/DefaultRenderService.java
  dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/render/RenderServiceTest.java
  dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/objectbundle/DefaultObjectBundleService.java
  dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/objectbundle/ObjectBundle.java
  dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/objectbundle/ObjectBundleParams.java
  dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/objectbundle/ObjectBundleValidation.java
  dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/metadata2/objectbundle/ObjectBundleServiceTest.java
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonIdentifiableObjects.vm
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/macros.vm
  dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/matchToExistingForm.vm
  dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/previewForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/responseStatistics.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/editDataSet.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/updateOrganisationUnitGroupSetForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateAttibuteGroupForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/updateUserForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/updateUserGroupForm.vm


--
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/preheat/PreheatService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/preheat/PreheatService.java	2016-02-10 03:08:09 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/preheat/PreheatService.java	2016-02-10 06:31:33 +0000
@@ -73,11 +73,20 @@
     /**
      * Checks but does not connect any references, returns check report
      *
+     * @param objects    Object to check
+     * @param preheat    Preheat Cache to use
+     * @param identifier Use this identifier type to check references
+     */
+    Map<String, PreheatValidation> checkReferences( List<IdentifiableObject> objects, Preheat preheat, PreheatIdentifier identifier );
+
+    /**
+     * Checks but does not connect any references, returns check report
+     *
      * @param object     Object to check
      * @param preheat    Preheat Cache to use
      * @param identifier Use this identifier type to check references
      */
-    <T extends IdentifiableObject> PreheatValidation checkReferences( T object, Preheat preheat, PreheatIdentifier identifier );
+    PreheatValidation checkReferences( IdentifiableObject object, Preheat preheat, PreheatIdentifier identifier );
 
     /**
      * Connects id object references on a given object using a given identifier + a preheated Preheat cache.

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/render/RenderService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/render/RenderService.java	2016-02-02 05:58:04 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/render/RenderService.java	2016-02-10 06:31:33 +0000
@@ -72,5 +72,5 @@
      * @param format      Payload format (only JSON is supported)
      * @return Map of all id object types that were found
      */
-    Map<Class<? extends IdentifiableObject>, List<? extends IdentifiableObject>> fromMetadata( InputStream inputStream, RenderFormat format ) throws IOException;
+    Map<Class<? extends IdentifiableObject>, List<IdentifiableObject>> fromMetadata( InputStream inputStream, RenderFormat format ) throws IOException;
 }

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/preheat/DefaultPreheatService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/preheat/DefaultPreheatService.java	2016-02-10 03:08:09 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/preheat/DefaultPreheatService.java	2016-02-10 06:31:33 +0000
@@ -220,8 +220,16 @@
     }
 
     @Override
-    @SuppressWarnings( "unchecked" )
-    public <T extends IdentifiableObject> PreheatValidation checkReferences( T object, Preheat preheat, PreheatIdentifier identifier )
+    public Map<String, PreheatValidation> checkReferences( List<IdentifiableObject> objects, Preheat preheat, PreheatIdentifier identifier )
+    {
+        Map<String, PreheatValidation> preheatValidationMap = new HashMap<>();
+        objects.forEach( o -> preheatValidationMap.put( identifier.getIdentifier( o ), checkReferences( o, preheat, identifier ) ) );
+
+        return preheatValidationMap;
+    }
+
+    @Override
+    public PreheatValidation checkReferences( IdentifiableObject object, Preheat preheat, PreheatIdentifier identifier )
     {
         PreheatValidation preheatValidation = new PreheatValidation();
 
@@ -236,8 +244,8 @@
             .forEach( p -> {
                 if ( !p.isCollection() )
                 {
-                    T refObject = ReflectionUtils.invokeMethod( object, p.getGetterMethod() );
-                    T ref = preheat.get( identifier, refObject );
+                    IdentifiableObject refObject = ReflectionUtils.invokeMethod( object, p.getGetterMethod() );
+                    IdentifiableObject ref = preheat.get( identifier, refObject );
 
                     if ( ref == null && refObject != null )
                     {
@@ -246,12 +254,12 @@
                 }
                 else
                 {
-                    Collection<T> objects = ReflectionUtils.newCollectionInstance( p.getKlass() );
+                    Collection<IdentifiableObject> objects = ReflectionUtils.newCollectionInstance( p.getKlass() );
                     Collection<IdentifiableObject> refObjects = ReflectionUtils.invokeMethod( object, p.getGetterMethod() );
 
                     for ( IdentifiableObject refObject : refObjects )
                     {
-                        T ref = preheat.get( identifier, (T) refObject );
+                        IdentifiableObject ref = preheat.get( identifier, refObject );
 
                         if ( ref == null && refObject != null )
                         {

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/render/DefaultRenderService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/render/DefaultRenderService.java	2016-02-02 05:58:04 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/render/DefaultRenderService.java	2016-02-10 06:31:33 +0000
@@ -177,9 +177,9 @@
 
     @Override
     @SuppressWarnings( "unchecked" )
-    public Map<Class<? extends IdentifiableObject>, List<? extends IdentifiableObject>> fromMetadata( InputStream inputStream, RenderFormat format ) throws IOException
+    public Map<Class<? extends IdentifiableObject>, List<IdentifiableObject>> fromMetadata( InputStream inputStream, RenderFormat format ) throws IOException
     {
-        Map<Class<? extends IdentifiableObject>, List<? extends IdentifiableObject>> map = new HashMap<>();
+        Map<Class<? extends IdentifiableObject>, List<IdentifiableObject>> map = new HashMap<>();
 
         ObjectMapper mapper;
 

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/render/RenderServiceTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/render/RenderServiceTest.java	2016-02-02 05:58:04 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/render/RenderServiceTest.java	2016-02-10 06:31:33 +0000
@@ -55,7 +55,7 @@
     @Test
     public void testParseJsonMetadata() throws IOException
     {
-        Map<Class<? extends IdentifiableObject>, List<? extends IdentifiableObject>> map = renderService.fromMetadata(
+        Map<Class<? extends IdentifiableObject>, List<IdentifiableObject>> map = renderService.fromMetadata(
             new ClassPathResource( "render/metadata.json" ).getInputStream(), RenderFormat.JSON );
 
         assertTrue( map.containsKey( DataElement.class ) );
@@ -72,7 +72,7 @@
     @Ignore // ignoring since Jackson can't handle parsing of XML as trees
     public void testParseXmlMetadata() throws IOException
     {
-        Map<Class<? extends IdentifiableObject>, List<? extends IdentifiableObject>> map = renderService.fromMetadata(
+        Map<Class<? extends IdentifiableObject>, List<IdentifiableObject>> map = renderService.fromMetadata(
             new ClassPathResource( "render/metadata.xml" ).getInputStream(), RenderFormat.XML );
 
         assertTrue( map.containsKey( DataElement.class ) );

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/objectbundle/DefaultObjectBundleService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/objectbundle/DefaultObjectBundleService.java	2016-02-10 03:08:09 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/objectbundle/DefaultObjectBundleService.java	2016-02-10 06:31:33 +0000
@@ -28,9 +28,11 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import org.hisp.dhis.common.IdentifiableObject;
 import org.hisp.dhis.preheat.PreheatMode;
 import org.hisp.dhis.preheat.PreheatParams;
 import org.hisp.dhis.preheat.PreheatService;
+import org.hisp.dhis.schema.Schema;
 import org.hisp.dhis.schema.SchemaService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
@@ -51,7 +53,7 @@
     public ObjectBundle create( ObjectBundleParams params )
     {
         ObjectBundle bundle = new ObjectBundle();
-        bundle.addObjects( params.getObjects() );
+        bundle.putObjects( params.getObjectMap() );
 
         PreheatParams preheatParams = params.getPreheatParams();
 
@@ -69,6 +71,14 @@
     public ObjectBundleValidation validate( ObjectBundle bundle )
     {
         ObjectBundleValidation objectBundleValidation = new ObjectBundleValidation();
+
+        for ( Class<? extends IdentifiableObject> klass : bundle.getObjects().keySet() )
+        {
+            Schema schema = schemaService.getDynamicSchema( klass );
+            objectBundleValidation.addInvalidReferences( klass, preheatService.checkReferences(
+                bundle.getObjects().get( klass ), bundle.getPreheat(), bundle.getPreheatIdentifier() ) );
+        }
+
         return objectBundleValidation;
     }
 

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/objectbundle/ObjectBundle.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/objectbundle/ObjectBundle.java	2016-02-08 07:21:53 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/objectbundle/ObjectBundle.java	2016-02-10 06:31:33 +0000
@@ -106,6 +106,19 @@
         objects.forEach( this::addObject );
     }
 
+    public void putObjects( Map<Class<? extends IdentifiableObject>, List<IdentifiableObject>> objects )
+    {
+        for ( Class<? extends IdentifiableObject> klass : objects.keySet() )
+        {
+            if ( !this.objects.containsKey( klass ) )
+            {
+                this.objects.put( klass, new ArrayList<>() );
+            }
+
+            this.objects.get( klass ).addAll( objects.get( klass ) );
+        }
+    }
+
     public Map<Class<? extends IdentifiableObject>, List<IdentifiableObject>> getObjects()
     {
         return objects;

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/objectbundle/ObjectBundleParams.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/objectbundle/ObjectBundleParams.java	2016-02-08 08:21:50 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/objectbundle/ObjectBundleParams.java	2016-02-10 06:31:33 +0000
@@ -34,7 +34,9 @@
 import org.hisp.dhis.preheat.PreheatParams;
 
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 /**
  * @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
@@ -47,7 +49,7 @@
 
     private PreheatMode preheatMode = PreheatMode.REFERENCE;
 
-    private List<? extends IdentifiableObject> objects = new ArrayList<>();
+    private Map<Class<? extends IdentifiableObject>, List<IdentifiableObject>> objectMap = new HashMap<>();
 
     public ObjectBundleParams()
     {
@@ -85,14 +87,56 @@
         this.preheatMode = preheatMode;
     }
 
-    public List<? extends IdentifiableObject> getObjects()
-    {
+    public Map<Class<? extends IdentifiableObject>, List<IdentifiableObject>> getObjectMap()
+    {
+        return objectMap;
+    }
+
+    public List<IdentifiableObject> getObjects()
+    {
+        List<IdentifiableObject> objects = new ArrayList<>();
+
+        for ( Class<? extends IdentifiableObject> klass : objectMap.keySet() )
+        {
+            objects.addAll( objectMap.get( klass ) );
+        }
+
         return objects;
     }
 
-    public void setObjects( List<? extends IdentifiableObject> objects )
-    {
-        this.objects = objects;
+    public void setObjectMap( Map<Class<? extends IdentifiableObject>, List<IdentifiableObject>> objectMap )
+    {
+        this.objectMap = objectMap;
+    }
+
+    public void addObject( Class<? extends IdentifiableObject> klass, IdentifiableObject object )
+    {
+        if ( object == null )
+        {
+            return;
+        }
+
+        if ( !objectMap.containsKey( klass ) )
+        {
+            objectMap.put( klass, new ArrayList<>() );
+        }
+
+        objectMap.get( klass ).add( object );
+    }
+
+    public void addObject( IdentifiableObject object )
+    {
+        if ( object == null )
+        {
+            return;
+        }
+
+        if ( !objectMap.containsKey( object.getClass() ) )
+        {
+            objectMap.put( object.getClass(), new ArrayList<>() );
+        }
+
+        objectMap.get( object.getClass() ).add( object );
     }
 
     public PreheatParams getPreheatParams()

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/objectbundle/ObjectBundleValidation.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/objectbundle/ObjectBundleValidation.java	2016-02-10 03:08:09 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/objectbundle/ObjectBundleValidation.java	2016-02-10 06:31:33 +0000
@@ -28,38 +28,30 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
-import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
-import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
-import org.hisp.dhis.common.DxfNamespaces;
-import org.hisp.dhis.preheat.InvalidReference;
+import org.hisp.dhis.common.IdentifiableObject;
+import org.hisp.dhis.preheat.PreheatValidation;
 
-import java.util.ArrayList;
-import java.util.List;
+import java.util.HashMap;
+import java.util.Map;
 
 /**
  * @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
  */
-@JacksonXmlRootElement( localName = "objectBundleValidation", namespace = DxfNamespaces.DXF_2_0 )
 public class ObjectBundleValidation
 {
-    private List<InvalidReference> missingReferences = new ArrayList<>();
+    private Map<Class<? extends IdentifiableObject>, Map<String, PreheatValidation>> preheatValidations = new HashMap<>();
 
     public ObjectBundleValidation()
     {
     }
 
-    @JsonProperty
-    @JacksonXmlElementWrapper( localName = "missingReferences", namespace = DxfNamespaces.DXF_2_0 )
-    @JacksonXmlProperty( localName = "missingReference", namespace = DxfNamespaces.DXF_2_0 )
-    public List<InvalidReference> getMissingReferences()
+    public void addInvalidReferences( Class<? extends IdentifiableObject> klass, Map<String, PreheatValidation> preheatValidations )
     {
-        return missingReferences;
+        this.preheatValidations.put( klass, preheatValidations );
     }
 
-    public void setMissingReferences( List<InvalidReference> missingReferences )
+    public Map<Class<? extends IdentifiableObject>, Map<String, PreheatValidation>> getPreheatValidations()
     {
-        this.missingReferences = missingReferences;
+        return preheatValidations;
     }
 }

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/metadata2/objectbundle/ObjectBundleServiceTest.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/metadata2/objectbundle/ObjectBundleServiceTest.java	2016-02-08 08:21:50 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/metadata2/objectbundle/ObjectBundleServiceTest.java	2016-02-10 06:31:33 +0000
@@ -28,16 +28,24 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import com.google.common.collect.Lists;
 import org.hisp.dhis.DhisSpringTest;
+import org.hisp.dhis.common.IdentifiableObject;
 import org.hisp.dhis.common.IdentifiableObjectManager;
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementGroup;
 import org.hisp.dhis.preheat.PreheatIdentifier;
+import org.hisp.dhis.preheat.PreheatMode;
+import org.hisp.dhis.render.RenderFormat;
 import org.hisp.dhis.render.RenderService;
 import org.hisp.dhis.user.User;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.io.ClassPathResource;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.Map;
 
 import static org.junit.Assert.*;
 
@@ -78,7 +86,8 @@
         defaultSetup();
 
         ObjectBundleParams params = new ObjectBundleParams();
-        params.setObjects( Lists.newArrayList( dataElementGroup ) );
+        params.setPreheatMode( PreheatMode.REFERENCE );
+        params.addObject( dataElementGroup );
 
         ObjectBundle bundle = objectBundleService.create( params );
 
@@ -107,6 +116,23 @@
         assertTrue( bundle.getPreheat().containsKey( PreheatIdentifier.UID, DataElementGroup.class, dataElementGroup.getUid() ) );
     }
 
+    @Test
+    @Ignore
+    public void testPreheatValidations() throws IOException
+    {
+        Map<Class<? extends IdentifiableObject>, List<IdentifiableObject>> metadata = renderService.fromMetadata(
+            new ClassPathResource( "dxf2/metadata_preheat1.json" ).getInputStream(), RenderFormat.JSON );
+
+        ObjectBundleParams params = new ObjectBundleParams();
+        params.setObjectBundleMode( ObjectBundleMode.VALIDATE );
+        params.setObjectMap( metadata );
+
+        ObjectBundle bundle = objectBundleService.create( params );
+        ObjectBundleValidation validate = objectBundleService.validate( bundle );
+
+        // assertFalse( validate.getPreheatValidations().isEmpty() );
+    }
+
     private void defaultSetup()
     {
         DataElement de1 = createDataElement( 'A' );

=== added file 'dhis-2/dhis-services/dhis-service-dxf2/src/test/resources/dxf2/metadata_preheat1.json'
--- dhis-2/dhis-services/dhis-service-dxf2/src/test/resources/dxf2/metadata_preheat1.json	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/test/resources/dxf2/metadata_preheat1.json	2016-02-10 06:31:33 +0000
@@ -0,0 +1,52 @@
+{
+  "dataElementGroups": [
+    {
+      "name": "DataElementGroupA",
+      "user": {
+        "id": "userabcdefA"
+      },
+      "dataElements": [
+        {
+          "id": "deabcdefghA"
+        },
+        {
+          "id": "deabcdefghB"
+        },
+        {
+          "id": "deabcdefghC"
+        }
+      ]
+    },
+    {
+      "name": "DataElementGroupB",
+      "user": {
+        "id": "userabcdefA"
+      },
+      "dataElements": [
+        {
+          "id": "deabcdefghA"
+        },
+        {
+          "id": "deabcdefghB"
+        },
+        {
+          "id": "deabcdefghC"
+        }
+      ]
+    }
+  ],
+  "dataElements": [
+    {
+      "id": "deabcdefghA",
+      "name": "DataElementA"
+    },
+    {
+      "id": "deabcdefghB",
+      "name": "DataElementB"
+    },
+    {
+      "id": "deabcdefghC",
+      "name": "DataElementC"
+    }
+  ]
+}
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonIdentifiableObjects.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonIdentifiableObjects.vm	2014-04-03 17:22:46 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonIdentifiableObjects.vm	2016-02-10 06:31:33 +0000
@@ -1,6 +1,6 @@
-#set( $size = $objects.size() )
+#set( $size = $objectMap.size() )
 { "objects": [
-#foreach( $object in $objects )
+#foreach( $object in $objectMap )
   {
     "id": "$!{object.id}",
     "uid": "$!{object.uid}",

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/macros.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/macros.vm	2015-11-16 05:51:35 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/macros.vm	2016-02-10 06:31:33 +0000
@@ -504,7 +504,7 @@
       </td>
       <td>
         <select id="${args.prefix}Selected" name="${args.prefix}Selected" multiple="multiple" style="height: 200px; width: 100%;">
-        #foreach ( $object in $args.objects )
+        #foreach ( $object in $args.objectMap )
         <option value="$object.uid">$encoder.htmlEncode( $object.displayName )</option>
         #end
         </select>

=== modified file 'dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/matchToExistingForm.vm'
--- dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/matchToExistingForm.vm	2014-10-15 04:17:05 +0000
+++ dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/matchToExistingForm.vm	2016-02-10 06:31:33 +0000
@@ -192,7 +192,7 @@
 	<tr>
 		<td colspan="2">
 			<select multiple id="existingObjects" name="existingObjects" style="width:100%; height:220px">
-				#foreach( $object in $objects )
+				#foreach( $object in $objectMap )
 					<option value="$object.id">$object.name</option>
 				#end
 			</select>

=== modified file 'dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/previewForm.vm'
--- dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/previewForm.vm	2014-10-15 04:17:05 +0000
+++ dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/previewForm.vm	2016-02-10 06:31:33 +0000
@@ -73,7 +73,7 @@
 		<td colspan="4" style="height:10px"></td>
 	</tr>	
 	<tr>
-		<th colspan="4">$i18n.getString( "objects" )</th>
+		<th colspan="4">$i18n.getString( "objectMap" )</th>
 	</tr>
 	<tr>
 		<td colspan="4">

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/responseStatistics.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/responseStatistics.vm	2015-04-24 11:25:27 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/responseStatistics.vm	2016-02-10 06:31:33 +0000
@@ -6,79 +6,79 @@
     </tr>
     <tr>
         <td>$i18n.getString( "data_elements" )</td>
-        <td>$objects.getValue( "DATAELEMENT" )</td>
+        <td>$objectMap.getValue( "DATAELEMENT" )</td>
     </tr>
     <tr>
         <td>$i18n.getString( "data_element_groups" )</td>
-        <td>$objects.getValue( "DATAELEMENTGROUP" )</td>
+        <td>$objectMap.getValue( "DATAELEMENTGROUP" )</td>
     </tr>
     <tr>
         <td>$i18n.getString( "indicator_types" )</td>
-        <td>$objects.getValue( "INDICATORTYPE" )</td>
+        <td>$objectMap.getValue( "INDICATORTYPE" )</td>
     </tr>
     <tr>
         <td>$i18n.getString( "indicators" )</td>
-        <td>$objects.getValue( "INDICATOR" )</td>
+        <td>$objectMap.getValue( "INDICATOR" )</td>
     </tr>
     <tr>
         <td>$i18n.getString( "indicator_groups" )</td>
-        <td>$objects.getValue( "INDICATORGROUP" )</td>
+        <td>$objectMap.getValue( "INDICATORGROUP" )</td>
     </tr>
     <tr>
         <td>$i18n.getString( "data_sets" )</td>
-        <td>$objects.getValue( "DATASET" )</td>
+        <td>$objectMap.getValue( "DATASET" )</td>
     </tr>
     <tr>
         <td>$i18n.getString( "organisation_units" )</td>
-        <td>$objects.getValue( "ORGANISATIONUNIT" )</td>
+        <td>$objectMap.getValue( "ORGANISATIONUNIT" )</td>
     </tr>
     <tr>
         <td>$i18n.getString( "organisation_unit_groups" )</td>
-        <td>$objects.getValue( "ORGANISATIONUNITGROUP" )</td>
+        <td>$objectMap.getValue( "ORGANISATIONUNITGROUP" )</td>
     </tr>
     <tr>
         <td>$i18n.getString( "validation_rules" )</td>
-        <td>$objects.getValue( "VALIDATIONRULE" )</td>
+        <td>$objectMap.getValue( "VALIDATIONRULE" )</td>
     </tr>
     <tr>
         <td>$i18n.getString( "periods" )</td>
-        <td>$objects.getValue( "PERIOD" )</td>
+        <td>$objectMap.getValue( "PERIOD" )</td>
     </tr>
     <tr>
         <td>$i18n.getString( "users" )</td>
-        <td>$objects.getValue( "USER" )</td>
+        <td>$objectMap.getValue( "USER" )</td>
     </tr>
     <tr>
         <td>$i18n.getString( "user_groups" )</td>
-        <td>$objects.getValue( "USERGROUP" )</td>
+        <td>$objectMap.getValue( "USERGROUP" )</td>
     </tr>
     <tr>
         <td>$i18n.getString( "pivot_tables" )</td>
-        <td>$objects.getValue( "REPORTTABLE" )</td>
+        <td>$objectMap.getValue( "REPORTTABLE" )</td>
     </tr>
     <tr>
         <td>$i18n.getString( "charts" )</td>
-        <td>$objects.getValue( "CHART" )</td>
+        <td>$objectMap.getValue( "CHART" )</td>
     </tr>
     <tr>
         <td>$i18n.getString( "maps" )</td>
-        <td>$objects.getValue( "MAP" )</td>
+        <td>$objectMap.getValue( "MAP" )</td>
     </tr>
     <tr>
         <td>$i18n.getString( "dashboards" )</td>
-        <td>$objects.getValue( "DASHBOARD" )</td>
+        <td>$objectMap.getValue( "DASHBOARD" )</td>
     </tr>
     <tr>
         <td>$i18n.getString( "data_values" )</td>
-        <td>$objects.getValue( "DATAVALUE" )</td>
+        <td>$objectMap.getValue( "DATAVALUE" )</td>
     </tr>
     <tr>
         <td>$i18n.getString( "programs" )</td>
-        <td>$objects.getValue( "PROGRAM" )</td>
+        <td>$objectMap.getValue( "PROGRAM" )</td>
     </tr>
     <tr>
         <td>$i18n.getString( "events" )</td>
-        <td>$objects.getValue( "PROGRAMSTAGEINSTANCE" )</td>
+        <td>$objectMap.getValue( "PROGRAMSTAGEINSTANCE" )</td>
     </tr>
     <tr>
     	<td colspan="2" style="height:15px"></td>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/editDataSet.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/editDataSet.vm	2015-11-30 03:36:54 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/editDataSet.vm	2016-02-10 06:31:33 +0000
@@ -242,14 +242,14 @@
     "prefix": "de",
     "i18n_available": "available_data_elements",
     "i18n_selected": "selected_data_elements",
-    "objects": $dataElements
+    "objectMap": $dataElements
 })
 
 #jqSelected({
     "prefix": "in",
     "i18n_available": "available_indicators",
     "i18n_selected": "selected_indicators",
-    "objects": $indicators
+    "objectMap": $indicators
 })
 
 <table>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/updateOrganisationUnitGroupSetForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/updateOrganisationUnitGroupSetForm.vm	2015-02-09 18:12:51 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/updateOrganisationUnitGroupSetForm.vm	2016-02-10 06:31:33 +0000
@@ -84,7 +84,7 @@
   "prefix": "oug",
   "i18n_available": "available_groups",
   "i18n_selected": "selected_groups",
-  "objects": $selectedGroups
+  "objectMap": $selectedGroups
 })
 
 <p>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateAttibuteGroupForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateAttibuteGroupForm.vm	2015-04-08 23:26:45 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateAttibuteGroupForm.vm	2016-02-10 06:31:33 +0000
@@ -28,7 +28,7 @@
   "prefix": "tea",
   "i18n_available": "availableAttribute",
   "i18n_selected": "selectedAttribute",
-  "objects": $attributeGroup.attributes
+  "objectMap": $attributeGroup.attributes
 })
 
 <table>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/updateUserForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/updateUserForm.vm	2015-11-08 16:46:08 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/updateUserForm.vm	2016-02-10 06:31:33 +0000
@@ -177,7 +177,7 @@
     "required": true,
     "i18n_available": "available_roles",
     "i18n_selected": "selected_roles",
-    "objects": $userAuthorityGroups
+    "objectMap": $userAuthorityGroups
   })
 
   <table style="margin-bottom: 20px;">
@@ -205,14 +205,14 @@
       "prefix": "ug",
       "i18n_available": "available_user_groups",
       "i18n_selected": "selected_user_groups",
-      "objects": $userGroups
+      "objectMap": $userGroups
     })
 
     #jqSelected({
       "prefix": "dc",
       "i18n_available": "available_dimension_restrictions_for_data_analytics",
       "i18n_selected": "selected_dimension_restrictions_for_data_analytics",
-      "objects": $dimensionConstraints
+      "objectMap": $dimensionConstraints
     })
 
     <div id="showFewerOptions" style="margin-bottom: 20px;"><a href="javascript:showUserOptions()">$i18n.getString( "show_fewer_options" )</a></div>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/updateUserGroupForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/updateUserGroupForm.vm	2015-05-28 06:26:32 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/updateUserGroupForm.vm	2016-02-10 06:31:33 +0000
@@ -55,14 +55,14 @@
     "prefix": "users",
     "i18n_available": "available_users",
     "i18n_selected": "group_members",
-    "objects": $groupMembers
+    "objectMap": $groupMembers
 })
 
 #jqSelected({
   "prefix": "userGroups",
   "i18n_available": "available_managed_user_groups",
   "i18n_selected": "managed_user_groups",
-  "objects": $managedGroups
+  "objectMap": $managedGroups
 })