← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 6200: (api) added /api/export /api/import controllers for exporting/importing meta-data.. not finished ...

 

------------------------------------------------------------
revno: 6200
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2012-03-07 13:10:37 +0100
message:
  (api) added /api/export /api/import controllers for exporting/importing meta-data.. not finished and output format will be changed
added:
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/ExportController.java
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/ImportController.java
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/webdomain/DXF2.java
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/AttributeValue.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryOptionCombo.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.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/attribute/AttributeValue.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/AttributeValue.java	2011-12-09 18:08:05 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/AttributeValue.java	2012-03-07 12:10:37 +0000
@@ -27,13 +27,11 @@
 
 package org.hisp.dhis.attribute;
 
+import org.codehaus.jackson.annotate.JsonIgnore;
 import org.codehaus.jackson.annotate.JsonProperty;
 import org.hisp.dhis.common.Dxf2Namespace;
 
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.*;
 import java.io.Serializable;
 
 /**
@@ -65,6 +63,8 @@
         this.value = value;
     }
 
+    @XmlTransient
+    @JsonIgnore
     public int getId()
     {
         return id;
@@ -82,6 +82,11 @@
         return attribute.getUid();
     }
 
+    public void setAttributeTypeRef( String uid )
+    {
+        // this is just here so that we don't confuse Jackson (it will try and use setId which takes an integer)
+    }
+
     @XmlAttribute( name = "name" )
     @JsonProperty( value = "name" )
     public String getAttributeName()
@@ -89,6 +94,11 @@
         return attribute.getName();
     }
 
+    public void setAttributeName( String name )
+    {
+        // this is just here so that we don't confuse Jackson
+    }
+
     public Attribute getAttribute()
     {
         return attribute;

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryOptionCombo.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryOptionCombo.java	2012-01-30 09:49:36 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryOptionCombo.java	2012-03-07 12:10:37 +0000
@@ -28,6 +28,7 @@
  */
 
 import org.apache.commons.lang.StringEscapeUtils;
+import org.codehaus.jackson.annotate.JsonIgnore;
 import org.codehaus.jackson.annotate.JsonProperty;
 import org.codehaus.jackson.map.annotate.JsonSerialize;
 import org.hisp.dhis.common.BaseIdentifiableObject;
@@ -265,7 +266,7 @@
     @Override
     public void setName( String name )
     {
-        throw new UnsupportedOperationException( "Cannot set name on DataElementCategoryOptionCombo: " + name );
+        // throw new UnsupportedOperationException( "Cannot set name on DataElementCategoryOptionCombo: " + name );
     }
 
     @Override
@@ -277,7 +278,7 @@
     @Override
     public void setShortName( String shortName )
     {
-        throw new UnsupportedOperationException( "Cannot set shortName on DataElementCategoryOptionCombo: " + shortName );
+        // throw new UnsupportedOperationException( "Cannot set shortName on DataElementCategoryOptionCombo: " + shortName );
     }
 
     @Override
@@ -289,8 +290,8 @@
     @Override
     public void setAlternativeName( String alternativeName )
     {
-        throw new UnsupportedOperationException( "Cannot set alternativename on DataElementCategoryOptionCombo: "
-            + alternativeName );
+        // throw new UnsupportedOperationException( "Cannot set alternativeName on DataElementCategoryOptionCombo: "
+        //    + alternativeName );
     }
 
     @XmlElement

=== 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	2012-02-21 11:39:05 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.java	2012-03-07 12:10:37 +0000
@@ -567,7 +567,7 @@
 
     public void setAlternativeName( String alternativeName )
     {
-        throw new UnsupportedOperationException( "Cannot set alternativeName on OrganisationUnit: " + alternativeName );
+        // throw new UnsupportedOperationException( "Cannot set alternativeName on OrganisationUnit: " + alternativeName );
     }
 
     @XmlElement

=== added file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/ExportController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/ExportController.java	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/ExportController.java	2012-03-07 12:10:37 +0000
@@ -0,0 +1,113 @@
+package org.hisp.dhis.api.controller;
+
+/*
+ * Copyright (c) 2004-2012, University of Oslo
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright notice, this
+ *   list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ *   this list of conditions and the following disclaimer in the documentation
+ *   and/or other materials provided with the distribution.
+ * * Neither the name of the HISP project nor the names of its contributors may
+ *   be used to endorse or promote products derived from this software without
+ *   specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import org.hisp.dhis.api.webdomain.DXF2;
+import org.hisp.dhis.dataelement.*;
+import org.hisp.dhis.dataset.DataSet;
+import org.hisp.dhis.dataset.DataSetService;
+import org.hisp.dhis.indicator.Indicator;
+import org.hisp.dhis.indicator.IndicatorGroup;
+import org.hisp.dhis.indicator.IndicatorGroupSet;
+import org.hisp.dhis.indicator.IndicatorService;
+import org.hisp.dhis.organisationunit.*;
+import org.hisp.dhis.validation.ValidationRule;
+import org.hisp.dhis.validation.ValidationRuleGroup;
+import org.hisp.dhis.validation.ValidationRuleService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+import java.util.ArrayList;
+
+/**
+ * @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
+ */
+@Controller
+@RequestMapping( value = ExportController.RESOURCE_PATH )
+public class ExportController
+{
+    public static final String RESOURCE_PATH = "/export";
+
+    @Autowired
+    private DataElementService dataElementService;
+
+    @Autowired
+    private DataElementCategoryService dataElementCategoryService;
+
+    @Autowired
+    private IndicatorService indicatorService;
+
+    @Autowired
+    private OrganisationUnitService organisationUnitService;
+
+    @Autowired
+    private OrganisationUnitGroupService organisationUnitGroupService;
+
+    @Autowired
+    private DataSetService dataSetService;
+
+    @Autowired
+    private ValidationRuleService validationRuleService;
+
+    @RequestMapping( method = RequestMethod.GET )
+    @PreAuthorize( "hasRole('ALL') or hasRole('F_METADATA_EXPORT')" )
+    public String export( Model model )
+    {
+        DXF2 dxf2 = new DXF2();
+
+        dxf2.setDataElements( new ArrayList<DataElement>( dataElementService.getAllDataElements() ) );
+        dxf2.setDataElementGroups( new ArrayList<DataElementGroup>( dataElementService.getAllDataElementGroups() ) );
+        dxf2.setDataElementGroupSets( new ArrayList<DataElementGroupSet>( dataElementService.getAllDataElementGroupSets() ) );
+        dxf2.setCategories( new ArrayList<DataElementCategory>( dataElementCategoryService.getAllDataElementCategories() ) );
+        dxf2.setCategoryCombos( new ArrayList<DataElementCategoryCombo>( dataElementCategoryService.getAllDataElementCategoryCombos() ) );
+        dxf2.setCategoryOptions( new ArrayList<DataElementCategoryOption>( dataElementCategoryService.getAllDataElementCategoryOptions() ) );
+        dxf2.setCategoryOptionCombos( new ArrayList<DataElementCategoryOptionCombo>( dataElementCategoryService.getAllDataElementCategoryOptionCombos() ) );
+
+        dxf2.setIndicators( new ArrayList<Indicator>( indicatorService.getAllIndicators() ) );
+        dxf2.setIndicatorGroups( new ArrayList<IndicatorGroup>( indicatorService.getAllIndicatorGroups() ) );
+        dxf2.setIndicatorGroupSets( new ArrayList<IndicatorGroupSet>( indicatorService.getAllIndicatorGroupSets() ) );
+
+        dxf2.setOrganisationUnits( new ArrayList<OrganisationUnit>( organisationUnitService.getAllOrganisationUnits() ) );
+        dxf2.setOrganisationUnitLevels( new ArrayList<OrganisationUnitLevel>( organisationUnitService.getOrganisationUnitLevels() ) );
+        dxf2.setOrganisationUnitGroups( new ArrayList<OrganisationUnitGroup>( organisationUnitGroupService.getAllOrganisationUnitGroups() ) );
+        dxf2.setOrganisationUnitGroupSets( new ArrayList<OrganisationUnitGroupSet>( organisationUnitGroupService.getAllOrganisationUnitGroupSets() ) );
+
+        dxf2.setDataSets( new ArrayList<DataSet>( dataSetService.getAllDataSets() ) );
+
+        dxf2.setValidationRules( new ArrayList<ValidationRule>( validationRuleService.getAllValidationRules() ) );
+        dxf2.setValidationRuleGroups( new ArrayList<ValidationRuleGroup>( validationRuleService.getAllValidationRuleGroups() ) );
+
+        model.addAttribute( "model", dxf2 );
+
+        return "export";
+    }
+}

=== added file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/ImportController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/ImportController.java	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/ImportController.java	2012-03-07 12:10:37 +0000
@@ -0,0 +1,71 @@
+package org.hisp.dhis.api.controller;
+
+/*
+ * Copyright (c) 2004-2012, University of Oslo
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright notice, this
+ *   list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ *   this list of conditions and the following disclaimer in the documentation
+ *   and/or other materials provided with the distribution.
+ * * Neither the name of the HISP project nor the names of its contributors may
+ *   be used to endorse or promote products derived from this software without
+ *   specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import org.hisp.dhis.api.view.JacksonUtils;
+import org.hisp.dhis.api.view.Jaxb2Utils;
+import org.hisp.dhis.api.webdomain.DXF2;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+import javax.servlet.http.HttpServletResponse;
+import javax.xml.bind.JAXBException;
+import java.io.IOException;
+import java.io.InputStream;
+
+/**
+ * @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
+ */
+@Controller
+@RequestMapping( value = ImportController.RESOURCE_PATH )
+public class ImportController
+{
+    public static final String RESOURCE_PATH = "/import";
+
+    @RequestMapping( method = RequestMethod.POST, headers = {"Content-Type=application/xml, text/xml"} )
+    @PreAuthorize( "hasRole('ALL') or hasRole('F_METADATA_IMPORT')" )
+    public String importXML( HttpServletResponse response, InputStream input ) throws JAXBException
+    {
+        DXF2 dxf2 = Jaxb2Utils.unmarshal( DXF2.class, input );
+        System.err.println( dxf2.getDataSets().size() );
+
+        return "import";
+    }
+
+    @RequestMapping( method = RequestMethod.POST, headers = {"Content-Type=application/json"} )
+    @PreAuthorize( "hasRole('ALL') or hasRole('F_METADATA_IMPORT')" )
+    public String importJSON( HttpServletResponse response, InputStream input ) throws IOException
+    {
+        DXF2 dxf2 = JacksonUtils.readValueAs( DXF2.class, input );
+        System.err.println( dxf2.getDataSets().size() );
+
+        return "import";
+    }
+}

=== added file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/webdomain/DXF2.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/webdomain/DXF2.java	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/webdomain/DXF2.java	2012-03-07 12:10:37 +0000
@@ -0,0 +1,309 @@
+package org.hisp.dhis.api.webdomain;
+
+/*
+ * Copyright (c) 2004-2012, University of Oslo
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright notice, this
+ *   list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ *   this list of conditions and the following disclaimer in the documentation
+ *   and/or other materials provided with the distribution.
+ * * Neither the name of the HISP project nor the names of its contributors may
+ *   be used to endorse or promote products derived from this software without
+ *   specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import org.codehaus.jackson.annotate.JsonProperty;
+import org.hisp.dhis.common.Dxf2Namespace;
+import org.hisp.dhis.dataelement.*;
+import org.hisp.dhis.dataset.DataSet;
+import org.hisp.dhis.indicator.Indicator;
+import org.hisp.dhis.indicator.IndicatorGroup;
+import org.hisp.dhis.indicator.IndicatorGroupSet;
+import org.hisp.dhis.organisationunit.OrganisationUnit;
+import org.hisp.dhis.organisationunit.OrganisationUnitGroup;
+import org.hisp.dhis.organisationunit.OrganisationUnitGroupSet;
+import org.hisp.dhis.organisationunit.OrganisationUnitLevel;
+import org.hisp.dhis.validation.ValidationRule;
+import org.hisp.dhis.validation.ValidationRuleGroup;
+
+import javax.xml.bind.annotation.*;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
+ */
+@XmlRootElement( name = "DXF2", namespace = Dxf2Namespace.NAMESPACE )
+@XmlAccessorType( value = XmlAccessType.NONE )
+public class DXF2
+{
+    private List<DataElement> dataElements = new ArrayList<DataElement>();
+
+    private List<DataElementGroup> dataElementGroups = new ArrayList<DataElementGroup>();
+
+    private List<DataElementGroupSet> dataElementGroupSets = new ArrayList<DataElementGroupSet>();
+
+    private List<DataElementCategory> categories = new ArrayList<DataElementCategory>();
+
+    private List<DataElementCategoryOption> categoryOptions = new ArrayList<DataElementCategoryOption>();
+
+    private List<DataElementCategoryCombo> categoryCombos = new ArrayList<DataElementCategoryCombo>();
+
+    private List<DataElementCategoryOptionCombo> categoryOptionCombos = new ArrayList<DataElementCategoryOptionCombo>();
+
+    private List<Indicator> indicators = new ArrayList<Indicator>();
+
+    private List<IndicatorGroup> indicatorGroups = new ArrayList<IndicatorGroup>();
+
+    private List<IndicatorGroupSet> indicatorGroupSets = new ArrayList<IndicatorGroupSet>();
+
+    private List<OrganisationUnit> organisationUnits = new ArrayList<OrganisationUnit>();
+
+    private List<OrganisationUnitGroup> organisationUnitGroups = new ArrayList<OrganisationUnitGroup>();
+
+    private List<OrganisationUnitGroupSet> organisationUnitGroupSets = new ArrayList<OrganisationUnitGroupSet>();
+
+    private List<OrganisationUnitLevel> organisationUnitLevels = new ArrayList<OrganisationUnitLevel>();
+
+    private List<DataSet> dataSets = new ArrayList<DataSet>();
+
+    private List<ValidationRule> validationRules = new ArrayList<ValidationRule>();
+
+    private List<ValidationRuleGroup> validationRuleGroups = new ArrayList<ValidationRuleGroup>();
+
+    @XmlElementWrapper( name = "dataElements" )
+    @XmlElement( name = "dataElement" )
+    @JsonProperty( value = "dataElements" )
+    public List<DataElement> getDataElements()
+    {
+        return dataElements;
+    }
+
+    public void setDataElements( List<DataElement> dataElements )
+    {
+        this.dataElements = dataElements;
+    }
+
+    @XmlElementWrapper( name = "dataElementGroups" )
+    @XmlElement( name = "dataElementGroup" )
+    @JsonProperty( value = "dataElementGroups" )
+    public List<DataElementGroup> getDataElementGroups()
+    {
+        return dataElementGroups;
+    }
+
+    public void setDataElementGroups( List<DataElementGroup> dataElementGroups )
+    {
+        this.dataElementGroups = dataElementGroups;
+    }
+
+    @XmlElementWrapper( name = "dataElementGroupSets" )
+    @XmlElement( name = "dataElementGroupSet" )
+    @JsonProperty( value = "dataElementGroupSets" )
+    public List<DataElementGroupSet> getDataElementGroupSets()
+    {
+        return dataElementGroupSets;
+    }
+
+    public void setDataElementGroupSets( List<DataElementGroupSet> dataElementGroupSets )
+    {
+        this.dataElementGroupSets = dataElementGroupSets;
+    }
+
+    @XmlElementWrapper( name = "categories" )
+    @XmlElement( name = "category" )
+    @JsonProperty( value = "categories" )
+    public List<DataElementCategory> getCategories()
+    {
+        return categories;
+    }
+
+    public void setCategories( List<DataElementCategory> categories )
+    {
+        this.categories = categories;
+    }
+
+    @XmlElementWrapper( name = "categoryOptions" )
+    @XmlElement( name = "categoryOption" )
+    @JsonProperty( value = "categoryOptions" )
+    public List<DataElementCategoryOption> getCategoryOptions()
+    {
+        return categoryOptions;
+    }
+
+    public void setCategoryOptions( List<DataElementCategoryOption> categoryOptions )
+    {
+        this.categoryOptions = categoryOptions;
+    }
+
+    @XmlElementWrapper( name = "categoryCombos" )
+    @XmlElement( name = "categoryCombo" )
+    @JsonProperty( value = "categoryCombos" )
+    public List<DataElementCategoryCombo> getCategoryCombos()
+    {
+        return categoryCombos;
+    }
+
+    public void setCategoryCombos( List<DataElementCategoryCombo> categoryCombos )
+    {
+        this.categoryCombos = categoryCombos;
+    }
+
+    @XmlElementWrapper( name = "categoryOptionCombos" )
+    @XmlElement( name = "categoryOptionCombo" )
+    @JsonProperty( value = "categoryOptionCombos" )
+    public List<DataElementCategoryOptionCombo> getCategoryOptionCombos()
+    {
+        return categoryOptionCombos;
+    }
+
+    public void setCategoryOptionCombos( List<DataElementCategoryOptionCombo> categoryOptionCombos )
+    {
+        this.categoryOptionCombos = categoryOptionCombos;
+    }
+
+    @XmlElementWrapper( name = "indicators" )
+    @XmlElement( name = "indicator" )
+    @JsonProperty( value = "indicators" )
+    public List<Indicator> getIndicators()
+    {
+        return indicators;
+    }
+
+    public void setIndicators( List<Indicator> indicators )
+    {
+        this.indicators = indicators;
+    }
+
+    @XmlElementWrapper( name = "indicatorGroups" )
+    @XmlElement( name = "indicatorGroup" )
+    @JsonProperty( value = "indicatorGroups" )
+    public List<IndicatorGroup> getIndicatorGroups()
+    {
+        return indicatorGroups;
+    }
+
+    public void setIndicatorGroups( List<IndicatorGroup> indicatorGroups )
+    {
+        this.indicatorGroups = indicatorGroups;
+    }
+
+    @XmlElementWrapper( name = "indicatorGroupSets" )
+    @XmlElement( name = "indicatorGroupSet" )
+    @JsonProperty( value = "indicatorGroupSets" )
+    public List<IndicatorGroupSet> getIndicatorGroupSets()
+    {
+        return indicatorGroupSets;
+    }
+
+    public void setIndicatorGroupSets( List<IndicatorGroupSet> indicatorGroupSets )
+    {
+        this.indicatorGroupSets = indicatorGroupSets;
+    }
+
+    @XmlElementWrapper( name = "organisationUnits" )
+    @XmlElement( name = "organisationUnit" )
+    @JsonProperty( value = "organisationUnits" )
+    public List<OrganisationUnit> getOrganisationUnits()
+    {
+        return organisationUnits;
+    }
+
+    public void setOrganisationUnits( List<OrganisationUnit> organisationUnits )
+    {
+        this.organisationUnits = organisationUnits;
+    }
+
+    @XmlElementWrapper( name = "organisationUnitGroups" )
+    @XmlElement( name = "organisationUnitGroup" )
+    @JsonProperty( value = "organisationUnitGroups" )
+    public List<OrganisationUnitGroup> getOrganisationUnitGroups()
+    {
+        return organisationUnitGroups;
+    }
+
+    public void setOrganisationUnitGroups( List<OrganisationUnitGroup> organisationUnitGroups )
+    {
+        this.organisationUnitGroups = organisationUnitGroups;
+    }
+
+    @XmlElementWrapper( name = "organisationUnitGroupSets" )
+    @XmlElement( name = "organisationUnitGroupSet" )
+    @JsonProperty( value = "organisationUnitGroupSets" )
+    public List<OrganisationUnitGroupSet> getOrganisationUnitGroupSets()
+    {
+        return organisationUnitGroupSets;
+    }
+
+    public void setOrganisationUnitGroupSets( List<OrganisationUnitGroupSet> organisationUnitGroupSets )
+    {
+        this.organisationUnitGroupSets = organisationUnitGroupSets;
+    }
+
+    @XmlElementWrapper( name = "organisationUnitLevels" )
+    @XmlElement( name = "organisationUnitLevel" )
+    @JsonProperty( value = "organisationUnitLevels" )
+    public List<OrganisationUnitLevel> getOrganisationUnitLevels()
+    {
+        return organisationUnitLevels;
+    }
+
+    public void setOrganisationUnitLevels( List<OrganisationUnitLevel> organisationUnitLevels )
+    {
+        this.organisationUnitLevels = organisationUnitLevels;
+    }
+
+    @XmlElementWrapper( name = "dataSets" )
+    @XmlElement( name = "dataSet" )
+    @JsonProperty( value = "dataSets" )
+    public List<DataSet> getDataSets()
+    {
+        return dataSets;
+    }
+
+    public void setDataSets( List<DataSet> dataSets )
+    {
+        this.dataSets = dataSets;
+    }
+
+    @XmlElementWrapper( name = "validationRules" )
+    @XmlElement( name = "validationRule" )
+    @JsonProperty( value = "validationRules" )
+    public List<ValidationRule> getValidationRules()
+    {
+        return validationRules;
+    }
+
+    public void setValidationRules( List<ValidationRule> validationRules )
+    {
+        this.validationRules = validationRules;
+    }
+
+    @XmlElementWrapper( name = "validationRuleGroups" )
+    @XmlElement( name = "validationRuleGroup" )
+    @JsonProperty( value = "validationRuleGroups" )
+    public List<ValidationRuleGroup> getValidationRuleGroups()
+    {
+        return validationRuleGroups;
+    }
+
+    public void setValidationRuleGroups( List<ValidationRuleGroup> validationRuleGroups )
+    {
+        this.validationRuleGroups = validationRuleGroups;
+    }
+}