← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 22175: wip, support dataset/section in dxf2 importer

 

------------------------------------------------------------
revno: 22175
committer: Morten Olav Hansen <morten@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2016-03-08 15:09:23 +0700
message:
  wip, support dataset/section in dxf2 importer
added:
  dhis-2/dhis-services/dhis-service-dxf2/src/test/resources/dxf2/dataset_with_sections.json
  dhis-2/dhis-services/dhis-service-dxf2/src/test/resources/dxf2/dataset_with_sections_gf.json
modified:
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/preheat/DefaultPreheatService.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/test/java/org/hisp/dhis/dxf2/metadata2/objectbundle/ObjectBundleServiceTest.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/preheat/DefaultPreheatService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/preheat/DefaultPreheatService.java	2016-03-08 07:13:54 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/preheat/DefaultPreheatService.java	2016-03-08 08:09:23 +0000
@@ -504,7 +504,7 @@
 
                         IdentifiableObject ref = preheat.get( identifier, refObject );
 
-                        if ( ref == null && refObject != null )
+                        if ( ref == null && refObject != null && !Preheat.isDefaultClass( refObject.getClass() ) )
                         {
                             preheatErrorReports.add( new PreheatErrorReport( identifier, object.getClass(), ErrorCode.E5002,
                                 identifier.getIdentifiersWithName( refObject ), identifier.getIdentifiersWithName( object ), p.getCollectionName() ) );

=== 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-03-08 07:13:54 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/objectbundle/DefaultObjectBundleService.java	2016-03-08 08:09:23 +0000
@@ -35,6 +35,7 @@
 import org.hisp.dhis.common.CodeGenerator;
 import org.hisp.dhis.common.IdentifiableObject;
 import org.hisp.dhis.common.IdentifiableObjectManager;
+import org.hisp.dhis.dbms.DbmsManager;
 import org.hisp.dhis.dxf2.metadata2.objectbundle.hooks.ObjectBundleHook;
 import org.hisp.dhis.feedback.ErrorCode;
 import org.hisp.dhis.feedback.ErrorReport;
@@ -83,6 +84,9 @@
     @Autowired
     private IdentifiableObjectManager manager;
 
+    @Autowired
+    private DbmsManager dbmsManager;
+
     @Autowired( required = false )
     private List<ObjectBundleHook> objectBundleHooks = new ArrayList<>();
 
@@ -304,6 +308,7 @@
 
         objectBundleHooks.forEach( hook -> hook.postImport( bundle ) );
 
+        dbmsManager.clearSession();
         bundle.setObjectBundleStatus( ObjectBundleStatus.COMMITTED );
     }
 
@@ -314,7 +319,7 @@
 
     private void handleCreates( List<IdentifiableObject> objects, ObjectBundle bundle )
     {
-        log.info( "Creating " + objects.size() + " object of type " + objects.get( 0 ).getClass().getSimpleName() );
+        log.info( "Creating " + objects.size() + " object(s) of type " + objects.get( 0 ).getClass().getSimpleName() );
 
         for ( IdentifiableObject object : objects )
         {
@@ -339,7 +344,7 @@
 
     private void handleUpdates( List<IdentifiableObject> objects, ObjectBundle bundle )
     {
-        log.info( "Updating " + objects.size() + " object of type " + objects.get( 0 ).getClass().getSimpleName() );
+        log.info( "Updating " + objects.size() + " object(s) of type " + objects.get( 0 ).getClass().getSimpleName() );
 
         for ( IdentifiableObject object : objects )
         {
@@ -367,7 +372,7 @@
 
     private void handleDeletes( List<IdentifiableObject> objects, ObjectBundle bundle )
     {
-        log.info( "Deleting " + objects.size() + " object of type " + objects.get( 0 ).getClass().getSimpleName() );
+        log.info( "Deleting " + objects.size() + " object(s) of type " + objects.get( 0 ).getClass().getSimpleName() );
 
         List<IdentifiableObject> persistedObjects = bundle.getPreheat().getAll( bundle.getPreheatIdentifier(), objects );
 

=== 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-03-08 07:13:54 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/metadata2/objectbundle/ObjectBundleServiceTest.java	2016-03-08 08:09:23 +0000
@@ -39,6 +39,7 @@
 import org.hisp.dhis.dataelement.DataElementCategoryCombo;
 import org.hisp.dhis.dataelement.DataElementGroup;
 import org.hisp.dhis.dataset.DataSet;
+import org.hisp.dhis.dataset.Section;
 import org.hisp.dhis.dxf2.metadata2.MetadataExportService;
 import org.hisp.dhis.feedback.ErrorCode;
 import org.hisp.dhis.feedback.ErrorReport;
@@ -57,6 +58,7 @@
 import org.hisp.dhis.user.User;
 import org.hisp.dhis.user.UserAuthorityGroup;
 import org.hisp.dhis.user.UserGroup;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.core.io.ClassPathResource;
@@ -258,8 +260,6 @@
         ObjectBundle bundle = objectBundleService.create( params );
         ObjectBundleValidation validate = objectBundleService.validate( bundle );
 
-        System.err.println( validate.getErrorReportsByCode( DataElement.class, ErrorCode.E5002 ) );
-
         assertFalse( validate.getObjectErrorReportsMap().isEmpty() );
         assertEquals( 5, validate.getErrorReportsByCode( DataElement.class, ErrorCode.E5002 ).size() );
         assertEquals( 3, validate.getErrorReportsByCode( DataElement.class, ErrorCode.E4000 ).size() );
@@ -750,6 +750,59 @@
         assertEquals( 0, dataElementD.getUserGroupAccesses().size() );
     }
 
+    @Test
+    public void testCreateDataSetWithSections() throws IOException
+    {
+        Map<Class<? extends IdentifiableObject>, List<IdentifiableObject>> metadata = renderService.fromMetadata(
+            new ClassPathResource( "dxf2/dataset_with_sections.json" ).getInputStream(), RenderFormat.JSON );
+
+        ObjectBundleParams params = new ObjectBundleParams();
+        params.setObjectBundleMode( ObjectBundleMode.COMMIT );
+        params.setImportMode( ImportStrategy.CREATE );
+        params.setObjects( metadata );
+
+        ObjectBundle bundle = objectBundleService.create( params );
+        ObjectBundleValidation validate = objectBundleService.validate( bundle );
+        assertTrue( validate.getObjectErrorReportsMap().isEmpty() );
+
+        objectBundleService.commit( bundle );
+
+        List<DataSet> dataSets = manager.getAll( DataSet.class );
+        List<Section> sections = manager.getAll( Section.class );
+
+        assertEquals( 1, dataSets.size() );
+        assertEquals( 2, sections.size() );
+
+        DataSet dataSet = dataSets.get( 0 );
+        assertEquals( 2, dataSet.getSections().size() );
+
+        Section section1 = sections.get( 0 );
+        Section section2 = sections.get( 1 );
+
+        assertEquals( 1, section1.getDataElements().size() );
+        assertEquals( 1, section2.getDataElements().size() );
+
+        assertNotNull( section1.getDataSet() );
+        assertNotNull( section2.getDataSet() );
+    }
+
+    @Test
+    @Ignore
+    public void testCreateDataSetWithSectionsAndGreyedFields() throws IOException
+    {
+        Map<Class<? extends IdentifiableObject>, List<IdentifiableObject>> metadata = renderService.fromMetadata(
+            new ClassPathResource( "dxf2/dataset_with_sections_gf.json" ).getInputStream(), RenderFormat.JSON );
+
+        ObjectBundleParams params = new ObjectBundleParams();
+        params.setObjectBundleMode( ObjectBundleMode.COMMIT );
+        params.setImportMode( ImportStrategy.CREATE );
+        params.setObjects( metadata );
+
+        ObjectBundle bundle = objectBundleService.create( params );
+        objectBundleService.validate( bundle );
+        objectBundleService.commit( bundle );
+    }
+
     private void defaultSetup()
     {
         DataElement de1 = createDataElement( 'A' );

=== added file 'dhis-2/dhis-services/dhis-service-dxf2/src/test/resources/dxf2/dataset_with_sections.json'
--- dhis-2/dhis-services/dhis-service-dxf2/src/test/resources/dxf2/dataset_with_sections.json	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/test/resources/dxf2/dataset_with_sections.json	2016-03-08 08:09:23 +0000
@@ -0,0 +1,408 @@
+{
+  "dataElements": [
+    {
+      "valueType": "NUMBER",
+      "user": {
+        "id": "T12jeH7KPzk"
+      },
+      "aggregationLevels": [ ],
+      "publicAccess": "rw------",
+      "categoryCombo": {
+        "id": "VfQ8S1gSE9T"
+      },
+      "aggregationType": "SUM",
+      "lastUpdated": "2016-03-08T07:30:07.699+0000",
+      "created": "2016-03-08T07:30:07.698+0000",
+      "name": "Simple Value",
+      "shortName": "Simple Value",
+      "attributeValues": [ ],
+      "zeroIsSignificant": false,
+      "userGroupAccesses": [ ],
+      "domainType": "AGGREGATE",
+      "id": "nHwIqKAudKN"
+    },
+    {
+      "name": "Value with CC",
+      "created": "2016-03-08T07:30:58.416+0000",
+      "lastUpdated": "2016-03-08T07:30:58.417+0000",
+      "zeroIsSignificant": false,
+      "userGroupAccesses": [ ],
+      "id": "VolAzjFe5zP",
+      "domainType": "AGGREGATE",
+      "attributeValues": [ ],
+      "shortName": "Value with CC",
+      "aggregationLevels": [ ],
+      "user": {
+        "id": "T12jeH7KPzk"
+      },
+      "publicAccess": "rw------",
+      "valueType": "NUMBER",
+      "aggregationType": "SUM",
+      "categoryCombo": {
+        "id": "faV8QvLgIwB"
+      }
+    }
+  ],
+  "categoryCombos": [
+    {
+      "publicAccess": "--------",
+      "dataDimensionType": "DISAGGREGATION",
+      "name": "default",
+      "categories": [
+        {
+          "id": "k3ASmFuqr11"
+        }
+      ],
+      "created": "2016-03-08T07:26:31.545+0000",
+      "lastUpdated": "2016-03-08T07:26:31.548+0000",
+      "skipTotal": false,
+      "id": "VfQ8S1gSE9T",
+      "userGroupAccesses": [ ]
+    },
+    {
+      "user": {
+        "id": "T12jeH7KPzk"
+      },
+      "publicAccess": "rw------",
+      "lastUpdated": "2016-03-08T07:29:15.719+0000",
+      "created": "2016-03-08T07:29:07.104+0000",
+      "categories": [
+        {
+          "id": "XJGLlMAMCcn"
+        }
+      ],
+      "name": "Gender",
+      "userGroupAccesses": [ ],
+      "skipTotal": false,
+      "id": "faV8QvLgIwB"
+    }
+  ],
+  "organisationUnits": [
+    {
+      "lastUpdated": "2016-03-08T07:27:17.772+0000",
+      "name": "Country",
+      "created": "2016-03-08T07:27:17.757+0000",
+      "uuid": "d981e7c4-3c72-4e0d-8995-078f16830473",
+      "shortName": "Country",
+      "description": "",
+      "id": "x3gVvpbVgqy",
+      "attributeValues": [ ],
+      "path": "/x3gVvpbVgqy",
+      "featureType": "NONE",
+      "user": {
+        "id": "T12jeH7KPzk"
+      },
+      "openingDate": "2016-03-08"
+    }
+  ],
+  "categoryOptions": [
+    {
+      "organisationUnits": [ ],
+      "publicAccess": "--------",
+      "shortName": "default",
+      "attributeValues": [ ],
+      "userGroupAccesses": [ ],
+      "id": "NS6DGfTR650",
+      "lastUpdated": "2016-03-08T07:26:31.551+0000",
+      "created": "2016-03-08T07:26:31.533+0000",
+      "name": "default"
+    },
+    {
+      "id": "JYiFOMKa25J",
+      "userGroupAccesses": [ ],
+      "attributeValues": [ ],
+      "shortName": "Female",
+      "name": "Female",
+      "created": "2016-03-08T07:28:50.372+0000",
+      "lastUpdated": "2016-03-08T07:28:50.374+0000",
+      "organisationUnits": [ ],
+      "user": {
+        "id": "T12jeH7KPzk"
+      },
+      "publicAccess": "rw------"
+    },
+    {
+      "shortName": "Male",
+      "userGroupAccesses": [ ],
+      "id": "tdaMRD34m8o",
+      "attributeValues": [ ],
+      "lastUpdated": "2016-03-08T07:28:44.217+0000",
+      "name": "Male",
+      "created": "2016-03-08T07:28:44.214+0000",
+      "organisationUnits": [ ],
+      "user": {
+        "id": "T12jeH7KPzk"
+      },
+      "publicAccess": "rw------"
+    }
+  ],
+  "userRoles": [
+    {
+      "name": "Superuser",
+      "created": "2016-03-08T07:26:51.925+0000",
+      "lastUpdated": "2016-03-08T07:26:51.925+0000",
+      "userGroupAccesses": [ ],
+      "id": "wSdzlWUHmEu",
+      "dataSets": [ ],
+      "authorities": [
+        "F_TRACKED_ENTITY_INSTANCE_SEARCH_IN_ALL_ORGUNITS",
+        "ALL",
+        "F_USERGROUP_MANAGING_RELATIONSHIPS_ADD",
+        "F_REPORTTABLE_PUBLIC_ADD",
+        "F_TRACKED_ENTITY_INSTANCE_DELETE",
+        "F_USER_GROUPS_READ_ONLY_ADD_MEMBERS",
+        "F_MAP_PUBLIC_ADD",
+        "F_USER_ADD_WITHIN_MANAGED_GROUP",
+        "F_TRACKED_ENTITY_INSTANCE_SEARCH",
+        "F_PROGRAM_ENROLLMENT",
+        "F_REPORTTABLE_EXTERNAL",
+        "F_SQLVIEW_EXTERNAL",
+        "F_GIS_ADMIN",
+        "F_REPLICATE_USER",
+        "F_INSERT_CUSTOM_JS_CSS",
+        "F_DASHBOARD_PUBLIC_ADD",
+        "F_METADATA_IMPORT",
+        "F_CHART_PUBLIC_ADD",
+        "F_VIEW_UNAPPROVED_DATA",
+        "F_CHART_EXTERNAL",
+        "F_USERGROUP_MANAGING_RELATIONSHIPS_VIEW",
+        "F_METADATA_EXPORT",
+        "F_PROGRAM_UNENROLLMENT",
+        "F_APPROVE_DATA",
+        "F_ACCEPT_DATA_LOWER_LEVELS",
+        "F_TRACKED_ENTITY_INSTANCE_ADD",
+        "F_USERGROUP_PUBLIC_ADD",
+        "F_OAUTH2_CLIENT_MANAGE",
+        "F_TRACKED_ENTITY_DATAVALUE_ADD",
+        "F_PROGRAM_DASHBOARD_CONFIG_ADMIN",
+        "F_MAP_EXTERNAL",
+        "F_APPROVE_DATA_LOWER_LEVELS",
+        "F_TRACKED_ENTITY_DATAVALUE_DELETE"
+      ],
+      "publicAccess": "--------",
+      "programs": [ ]
+    }
+  ],
+  "categories": [
+    {
+      "dataDimension": true,
+      "id": "k3ASmFuqr11",
+      "userGroupAccesses": [ ],
+      "lastUpdated": "2016-03-08T07:26:31.729+0000",
+      "created": "2016-03-08T07:26:31.543+0000",
+      "name": "default",
+      "categoryOptions": [
+        {
+          "id": "NS6DGfTR650"
+        }
+      ],
+      "dataDimensionType": "DISAGGREGATION",
+      "publicAccess": "--------"
+    },
+    {
+      "user": {
+        "id": "T12jeH7KPzk"
+      },
+      "publicAccess": "rw------",
+      "categoryOptions": [
+        {
+          "id": "JYiFOMKa25J"
+        },
+        {
+          "id": "tdaMRD34m8o"
+        }
+      ],
+      "created": "2016-03-08T07:28:58.738+0000",
+      "name": "Gender",
+      "lastUpdated": "2016-03-08T07:28:58.740+0000",
+      "dataDimension": true,
+      "userGroupAccesses": [ ],
+      "id": "XJGLlMAMCcn"
+    }
+  ],
+  "trackedEntities": [
+    {
+      "description": "Person",
+      "id": "MDvmqCKmXQM",
+      "attributeValues": [ ],
+      "name": "Person"
+    }
+  ],
+  "sections": [
+    {
+      "sortOrder": 0,
+      "id": "JwcV2ZifEQf",
+      "indicators": [ ],
+      "lastUpdated": "2016-03-08T07:32:29.362+0000",
+      "created": "2016-03-08T07:32:29.361+0000",
+      "name": "Section Default",
+      "dataSet": {
+        "id": "em8Bg4LCr5k"
+      },
+      "dataElements": [
+        {
+          "id": "nHwIqKAudKN"
+        }
+      ],
+      "greyedFields": [ ]
+    },
+    {
+      "lastUpdated": "2016-03-08T07:32:42.140+0000",
+      "created": "2016-03-08T07:32:42.140+0000",
+      "name": "Section Gender",
+      "id": "C50M0WxaI7y",
+      "indicators": [ ],
+      "sortOrder": 0,
+      "dataElements": [
+        {
+          "id": "VolAzjFe5zP"
+        }
+      ],
+      "greyedFields": [ ],
+      "dataSet": {
+        "id": "em8Bg4LCr5k"
+      }
+    }
+  ],
+  "categoryOptionCombos": [
+    {
+      "name": "default",
+      "created": "2016-03-08T07:26:31.546+0000",
+      "lastUpdated": "2016-03-08T07:26:31.546+0000",
+      "id": "Z3oAZ1xdHIg",
+      "ignoreApproval": false,
+      "categoryCombo": {
+        "id": "VfQ8S1gSE9T"
+      },
+      "categoryOptions": [
+        {
+          "id": "NS6DGfTR650"
+        }
+      ]
+    },
+    {
+      "categoryOptions": [
+        {
+          "id": "JYiFOMKa25J"
+        }
+      ],
+      "categoryCombo": {
+        "id": "faV8QvLgIwB"
+      },
+      "id": "J5uZylXMmbB",
+      "ignoreApproval": false,
+      "lastUpdated": "2016-03-08T07:29:15.715+0000",
+      "name": "Female",
+      "created": "2016-03-08T07:29:15.714+0000"
+    },
+    {
+      "lastUpdated": "2016-03-08T07:29:15.717+0000",
+      "created": "2016-03-08T07:29:15.717+0000",
+      "name": "Male",
+      "categoryCombo": {
+        "id": "faV8QvLgIwB"
+      },
+      "categoryOptions": [
+        {
+          "id": "tdaMRD34m8o"
+        }
+      ],
+      "ignoreApproval": false,
+      "id": "p99yaU6mweU"
+    }
+  ],
+  "organisationUnitLevels": [
+    {
+      "id": "JEMRBUHgpqN",
+      "name": "Level 1",
+      "created": "2016-03-08T07:27:22.448+0000",
+      "level": 1,
+      "lastUpdated": "2016-03-08T07:27:22.449+0000"
+    }
+  ],
+  "dataSets": [
+    {
+      "compulsoryDataElementOperands": [ ],
+      "timelyDays": 15,
+      "fieldCombinationRequired": false,
+      "version": 4,
+      "renderAsTabs": false,
+      "name": "Data Set",
+      "categoryCombo": {
+        "id": "VfQ8S1gSE9T"
+      },
+      "expiryDays": 0,
+      "skipOffline": false,
+      "dataElementDecoration": false,
+      "validCompleteOnly": false,
+      "publicAccess": "rw------",
+      "noValueRequiresComment": false,
+      "shortName": "Data Set",
+      "attributeValues": [ ],
+      "id": "em8Bg4LCr5k",
+      "indicators": [ ],
+      "userGroupAccesses": [ ],
+      "periodType": "Monthly",
+      "mobile": false,
+      "lastUpdated": "2016-03-08T07:32:42.146+0000",
+      "notifyCompletingUser": false,
+      "openFuturePeriods": 0,
+      "created": "2016-03-08T07:31:30.424+0000",
+      "organisationUnits": [
+        {
+          "id": "x3gVvpbVgqy"
+        }
+      ],
+      "renderHorizontally": false,
+      "dataElements": [
+        {
+          "id": "nHwIqKAudKN"
+        },
+        {
+          "id": "VolAzjFe5zP"
+        }
+      ],
+      "user": {
+        "id": "T12jeH7KPzk"
+      }
+    }
+  ],
+  "users": [
+    {
+      "organisationUnits": [
+        {
+          "id": "x3gVvpbVgqy"
+        }
+      ],
+      "dataViewOrganisationUnits": [ ],
+      "userCredentials": {
+        "catDimensionConstraints": [ ],
+        "userInfo": {
+          "id": "T12jeH7KPzk"
+        },
+        "disabled": false,
+        "username": "admin",
+        "created": "2016-03-08T07:26:52.033+0000",
+        "selfRegistered": false,
+        "cogsDimensionConstraints": [ ],
+        "passwordLastUpdated": "2016-03-08T07:26:51.942+0000",
+        "userRoles": [
+          {
+            "id": "wSdzlWUHmEu"
+          }
+        ],
+        "invitation": false,
+        "externalAuth": false,
+        "lastLogin": "2016-03-08T07:26:51.942+0000"
+      },
+      "surname": "admin",
+      "attributeValues": [ ],
+      "id": "T12jeH7KPzk",
+      "created": "2016-03-08T07:26:51.909+0000",
+      "firstName": "admin",
+      "lastUpdated": "2016-03-08T07:26:51.909+0000",
+      "teiSearchOrganisationUnits": [ ]
+    }
+  ],
+  "date": "2016-03-08T07:34:13.552+0000"
+}

=== added file 'dhis-2/dhis-services/dhis-service-dxf2/src/test/resources/dxf2/dataset_with_sections_gf.json'
--- dhis-2/dhis-services/dhis-service-dxf2/src/test/resources/dxf2/dataset_with_sections_gf.json	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/test/resources/dxf2/dataset_with_sections_gf.json	2016-03-08 08:09:23 +0000
@@ -0,0 +1,417 @@
+{
+  "dataSets": [
+    {
+      "version": 5,
+      "name": "Data Set",
+      "user": {
+        "id": "T12jeH7KPzk"
+      },
+      "expiryDays": 0,
+      "mobile": false,
+      "compulsoryDataElementOperands": [ ],
+      "created": "2016-03-08T07:31:30.424+0000",
+      "publicAccess": "rw------",
+      "periodType": "Monthly",
+      "validCompleteOnly": false,
+      "attributeValues": [ ],
+      "openFuturePeriods": 0,
+      "userGroupAccesses": [ ],
+      "organisationUnits": [
+        {
+          "id": "x3gVvpbVgqy"
+        }
+      ],
+      "timelyDays": 15,
+      "dataElements": [
+        {
+          "id": "nHwIqKAudKN"
+        },
+        {
+          "id": "VolAzjFe5zP"
+        }
+      ],
+      "indicators": [ ],
+      "noValueRequiresComment": false,
+      "notifyCompletingUser": false,
+      "skipOffline": false,
+      "renderAsTabs": false,
+      "id": "em8Bg4LCr5k",
+      "shortName": "Data Set",
+      "fieldCombinationRequired": false,
+      "categoryCombo": {
+        "id": "VfQ8S1gSE9T"
+      },
+      "renderHorizontally": false,
+      "lastUpdated": "2016-03-08T07:34:23.833+0000",
+      "dataElementDecoration": false
+    }
+  ],
+  "organisationUnits": [
+    {
+      "openingDate": "2016-03-08",
+      "name": "Country",
+      "user": {
+        "id": "T12jeH7KPzk"
+      },
+      "description": "",
+      "path": "/x3gVvpbVgqy",
+      "uuid": "d981e7c4-3c72-4e0d-8995-078f16830473",
+      "created": "2016-03-08T07:27:17.757+0000",
+      "id": "x3gVvpbVgqy",
+      "shortName": "Country",
+      "attributeValues": [ ],
+      "featureType": "NONE",
+      "lastUpdated": "2016-03-08T07:27:17.772+0000"
+    }
+  ],
+  "categoryOptions": [
+    {
+      "name": "default",
+      "id": "NS6DGfTR650",
+      "publicAccess": "--------",
+      "created": "2016-03-08T07:26:31.533+0000",
+      "lastUpdated": "2016-03-08T07:26:31.551+0000",
+      "userGroupAccesses": [ ],
+      "organisationUnits": [ ],
+      "attributeValues": [ ],
+      "shortName": "default"
+    },
+    {
+      "created": "2016-03-08T07:28:50.372+0000",
+      "publicAccess": "rw------",
+      "id": "JYiFOMKa25J",
+      "shortName": "Female",
+      "organisationUnits": [ ],
+      "attributeValues": [ ],
+      "userGroupAccesses": [ ],
+      "lastUpdated": "2016-03-08T07:28:50.374+0000",
+      "name": "Female",
+      "user": {
+        "id": "T12jeH7KPzk"
+      }
+    },
+    {
+      "attributeValues": [ ],
+      "organisationUnits": [ ],
+      "userGroupAccesses": [ ],
+      "shortName": "Male",
+      "lastUpdated": "2016-03-08T07:28:44.217+0000",
+      "created": "2016-03-08T07:28:44.214+0000",
+      "id": "tdaMRD34m8o",
+      "publicAccess": "rw------",
+      "name": "Male",
+      "user": {
+        "id": "T12jeH7KPzk"
+      }
+    }
+  ],
+  "dataElements": [
+    {
+      "domainType": "AGGREGATE",
+      "user": {
+        "id": "T12jeH7KPzk"
+      },
+      "valueType": "NUMBER",
+      "name": "Simple Value",
+      "lastUpdated": "2016-03-08T07:30:07.699+0000",
+      "attributeValues": [ ],
+      "shortName": "Simple Value",
+      "userGroupAccesses": [ ],
+      "categoryCombo": {
+        "id": "VfQ8S1gSE9T"
+      },
+      "aggregationLevels": [ ],
+      "aggregationType": "SUM",
+      "publicAccess": "rw------",
+      "zeroIsSignificant": false,
+      "id": "nHwIqKAudKN",
+      "created": "2016-03-08T07:30:07.698+0000"
+    },
+    {
+      "user": {
+        "id": "T12jeH7KPzk"
+      },
+      "valueType": "NUMBER",
+      "name": "Value with CC",
+      "domainType": "AGGREGATE",
+      "publicAccess": "rw------",
+      "zeroIsSignificant": false,
+      "id": "VolAzjFe5zP",
+      "created": "2016-03-08T07:30:58.416+0000",
+      "lastUpdated": "2016-03-08T07:30:58.417+0000",
+      "attributeValues": [ ],
+      "userGroupAccesses": [ ],
+      "shortName": "Value with CC",
+      "aggregationType": "SUM",
+      "aggregationLevels": [ ],
+      "categoryCombo": {
+        "id": "faV8QvLgIwB"
+      }
+    }
+  ],
+  "userRoles": [
+    {
+      "authorities": [
+        "F_TRACKED_ENTITY_INSTANCE_SEARCH_IN_ALL_ORGUNITS",
+        "ALL",
+        "F_USERGROUP_MANAGING_RELATIONSHIPS_ADD",
+        "F_REPORTTABLE_PUBLIC_ADD",
+        "F_TRACKED_ENTITY_INSTANCE_DELETE",
+        "F_USER_GROUPS_READ_ONLY_ADD_MEMBERS",
+        "F_MAP_PUBLIC_ADD",
+        "F_USER_ADD_WITHIN_MANAGED_GROUP",
+        "F_TRACKED_ENTITY_INSTANCE_SEARCH",
+        "F_PROGRAM_ENROLLMENT",
+        "F_REPORTTABLE_EXTERNAL",
+        "F_SQLVIEW_EXTERNAL",
+        "F_GIS_ADMIN",
+        "F_REPLICATE_USER",
+        "F_INSERT_CUSTOM_JS_CSS",
+        "F_DASHBOARD_PUBLIC_ADD",
+        "F_METADATA_IMPORT",
+        "F_CHART_PUBLIC_ADD",
+        "F_VIEW_UNAPPROVED_DATA",
+        "F_CHART_EXTERNAL",
+        "F_USERGROUP_MANAGING_RELATIONSHIPS_VIEW",
+        "F_METADATA_EXPORT",
+        "F_PROGRAM_UNENROLLMENT",
+        "F_APPROVE_DATA",
+        "F_ACCEPT_DATA_LOWER_LEVELS",
+        "F_TRACKED_ENTITY_INSTANCE_ADD",
+        "F_USERGROUP_PUBLIC_ADD",
+        "F_OAUTH2_CLIENT_MANAGE",
+        "F_TRACKED_ENTITY_DATAVALUE_ADD",
+        "F_PROGRAM_DASHBOARD_CONFIG_ADMIN",
+        "F_MAP_EXTERNAL",
+        "F_APPROVE_DATA_LOWER_LEVELS",
+        "F_TRACKED_ENTITY_DATAVALUE_DELETE"
+      ],
+      "name": "Superuser",
+      "dataSets": [ ],
+      "userGroupAccesses": [ ],
+      "lastUpdated": "2016-03-08T07:26:51.925+0000",
+      "programs": [ ],
+      "created": "2016-03-08T07:26:51.925+0000",
+      "publicAccess": "--------",
+      "id": "wSdzlWUHmEu"
+    }
+  ],
+  "trackedEntities": [
+    {
+      "description": "Person",
+      "id": "MDvmqCKmXQM",
+      "name": "Person",
+      "attributeValues": [ ]
+    }
+  ],
+  "categoryCombos": [
+    {
+      "created": "2016-03-08T07:26:31.545+0000",
+      "skipTotal": false,
+      "publicAccess": "--------",
+      "id": "VfQ8S1gSE9T",
+      "userGroupAccesses": [ ],
+      "lastUpdated": "2016-03-08T07:26:31.548+0000",
+      "categories": [
+        {
+          "id": "k3ASmFuqr11"
+        }
+      ],
+      "name": "default",
+      "dataDimensionType": "DISAGGREGATION"
+    },
+    {
+      "created": "2016-03-08T07:29:07.104+0000",
+      "id": "faV8QvLgIwB",
+      "skipTotal": false,
+      "publicAccess": "rw------",
+      "userGroupAccesses": [ ],
+      "lastUpdated": "2016-03-08T07:29:15.719+0000",
+      "name": "Gender",
+      "categories": [
+        {
+          "id": "XJGLlMAMCcn"
+        }
+      ],
+      "user": {
+        "id": "T12jeH7KPzk"
+      }
+    }
+  ],
+  "organisationUnitLevels": [
+    {
+      "id": "JEMRBUHgpqN",
+      "created": "2016-03-08T07:27:22.448+0000",
+      "name": "Level 1",
+      "level": 1,
+      "lastUpdated": "2016-03-08T07:27:22.449+0000"
+    }
+  ],
+  "users": [
+    {
+      "lastUpdated": "2016-03-08T07:26:51.909+0000",
+      "attributeValues": [ ],
+      "organisationUnits": [
+        {
+          "id": "x3gVvpbVgqy"
+        }
+      ],
+      "firstName": "admin",
+      "userCredentials": {
+        "cogsDimensionConstraints": [ ],
+        "lastLogin": "2016-03-08T07:26:51.942+0000",
+        "invitation": false,
+        "username": "admin",
+        "passwordLastUpdated": "2016-03-08T07:26:51.942+0000",
+        "selfRegistered": false,
+        "externalAuth": false,
+        "created": "2016-03-08T07:26:52.033+0000",
+        "disabled": false,
+        "userInfo": {
+          "id": "T12jeH7KPzk"
+        },
+        "catDimensionConstraints": [ ],
+        "userRoles": [
+          {
+            "id": "wSdzlWUHmEu"
+          }
+        ]
+      },
+      "id": "T12jeH7KPzk",
+      "created": "2016-03-08T07:26:51.909+0000",
+      "teiSearchOrganisationUnits": [ ],
+      "dataViewOrganisationUnits": [ ],
+      "surname": "admin"
+    }
+  ],
+  "categories": [
+    {
+      "lastUpdated": "2016-03-08T07:26:31.729+0000",
+      "categoryOptions": [
+        {
+          "id": "NS6DGfTR650"
+        }
+      ],
+      "userGroupAccesses": [ ],
+      "id": "k3ASmFuqr11",
+      "publicAccess": "--------",
+      "created": "2016-03-08T07:26:31.543+0000",
+      "dataDimensionType": "DISAGGREGATION",
+      "dataDimension": true,
+      "name": "default"
+    },
+    {
+      "id": "XJGLlMAMCcn",
+      "publicAccess": "rw------",
+      "created": "2016-03-08T07:28:58.738+0000",
+      "lastUpdated": "2016-03-08T07:28:58.740+0000",
+      "categoryOptions": [
+        {
+          "id": "JYiFOMKa25J"
+        },
+        {
+          "id": "tdaMRD34m8o"
+        }
+      ],
+      "userGroupAccesses": [ ],
+      "dataDimension": true,
+      "user": {
+        "id": "T12jeH7KPzk"
+      },
+      "name": "Gender"
+    }
+  ],
+  "sections": [
+    {
+      "lastUpdated": "2016-03-08T07:32:29.362+0000",
+      "indicators": [ ],
+      "dataElements": [
+        {
+          "id": "nHwIqKAudKN"
+        }
+      ],
+      "dataSet": {
+        "id": "em8Bg4LCr5k"
+      },
+      "id": "JwcV2ZifEQf",
+      "greyedFields": [ ],
+      "created": "2016-03-08T07:32:29.361+0000",
+      "sortOrder": 0,
+      "name": "Section Default"
+    },
+    {
+      "dataElements": [
+        {
+          "id": "VolAzjFe5zP"
+        }
+      ],
+      "indicators": [ ],
+      "lastUpdated": "2016-03-08T07:34:23.831+0000",
+      "greyedFields": [
+        {
+          "dataElement": {
+            "id": "VolAzjFe5zP"
+          },
+          "categoryOptionCombo": {
+            "id": "p99yaU6mweU"
+          }
+        }
+      ],
+      "created": "2016-03-08T07:32:42.140+0000",
+      "dataSet": {
+        "id": "em8Bg4LCr5k"
+      },
+      "id": "C50M0WxaI7y",
+      "name": "Section Gender",
+      "sortOrder": 0
+    }
+  ],
+  "date": "2016-03-08T07:35:11.295+0000",
+  "categoryOptionCombos": [
+    {
+      "name": "default",
+      "created": "2016-03-08T07:26:31.546+0000",
+      "id": "Z3oAZ1xdHIg",
+      "ignoreApproval": false,
+      "categoryCombo": {
+        "id": "VfQ8S1gSE9T"
+      },
+      "lastUpdated": "2016-03-08T07:26:31.546+0000",
+      "categoryOptions": [
+        {
+          "id": "NS6DGfTR650"
+        }
+      ]
+    },
+    {
+      "name": "Female",
+      "created": "2016-03-08T07:29:15.714+0000",
+      "id": "J5uZylXMmbB",
+      "ignoreApproval": false,
+      "categoryCombo": {
+        "id": "faV8QvLgIwB"
+      },
+      "categoryOptions": [
+        {
+          "id": "JYiFOMKa25J"
+        }
+      ],
+      "lastUpdated": "2016-03-08T07:29:15.715+0000"
+    },
+    {
+      "name": "Male",
+      "created": "2016-03-08T07:29:15.717+0000",
+      "id": "p99yaU6mweU",
+      "ignoreApproval": false,
+      "categoryCombo": {
+        "id": "faV8QvLgIwB"
+      },
+      "categoryOptions": [
+        {
+          "id": "tdaMRD34m8o"
+        }
+      ],
+      "lastUpdated": "2016-03-08T07:29:15.717+0000"
+    }
+  ]
+}