← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 9894: lots of minor fixes to dxf2 format, mostly related to export

 

------------------------------------------------------------
revno: 9894
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2013-02-25 19:33:35 +0700
message:
  lots of minor fixes to dxf2 format, mostly related to export
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseIdentifiableObject.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/concept/Concept.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategory.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryOption.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryOptionCombo.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSet.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/expression/Expression.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/User.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserCredentials.java
  dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/DefaultExportService.java
  dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/ExchangeClasses.java
  dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/MetaData.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/common/IdentityPopulator.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryDeletionHandler.java
  dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElementCategoryOption.hbm.xml
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/AbstractCrudController.java
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/utils/ContextUtils.java
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/webdomain/Resources.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/category/AddDataElementCategoryAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/category/UpdateDataElementCategoryAction.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/common/BaseIdentifiableObject.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseIdentifiableObject.java	2013-02-13 03:57:52 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseIdentifiableObject.java	2013-02-25 12:33:35 +0000
@@ -30,7 +30,6 @@
 import com.fasterxml.jackson.annotation.JsonIgnore;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import com.fasterxml.jackson.annotation.JsonView;
-import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
 import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
 import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
@@ -50,7 +49,7 @@
 /**
  * @author Bob Jolliffe
  */
-@JacksonXmlRootElement(localName = "identifiableObject", namespace = DxfNamespaces.DXF_2_0)
+@JacksonXmlRootElement( localName = "identifiableObject", namespace = DxfNamespaces.DXF_2_0 )
 public class BaseIdentifiableObject
     extends BaseLinkableObject
     implements IdentifiableObject
@@ -159,8 +158,8 @@
         this.id = id;
     }
 
-    @JsonProperty(value = "id")
-    @JacksonXmlProperty(localName = "id", isAttribute = true)
+    @JsonProperty( value = "id" )
+    @JacksonXmlProperty( localName = "id", isAttribute = true )
     public String getUid()
     {
         return uid;
@@ -172,7 +171,7 @@
     }
 
     @JsonProperty
-    @JacksonXmlProperty(isAttribute = true)
+    @JacksonXmlProperty( isAttribute = true )
     public String getCode()
     {
         return code;
@@ -184,7 +183,7 @@
     }
 
     @JsonProperty
-    @JacksonXmlProperty(isAttribute = true)
+    @JacksonXmlProperty( isAttribute = true )
     public String getName()
     {
         return name;
@@ -202,7 +201,7 @@
     }
 
     @JsonProperty
-    @JacksonXmlProperty(isAttribute = true)
+    @JacksonXmlProperty( isAttribute = true )
     public Date getCreated()
     {
         return created;
@@ -214,7 +213,7 @@
     }
 
     @JsonProperty
-    @JacksonXmlProperty(isAttribute = true)
+    @JacksonXmlProperty( isAttribute = true )
     public Date getLastUpdated()
     {
         return lastUpdated;
@@ -227,8 +226,8 @@
 
     @Override
     @JsonProperty
-    @JsonView({ DetailedView.class, ExportView.class })
-    @JacksonXmlProperty(namespace = DxfNamespaces.DXF_2_0)
+    @JsonView( { DetailedView.class, ExportView.class } )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public String getPublicAccess()
     {
         return publicAccess;
@@ -239,11 +238,13 @@
         this.publicAccess = publicAccess;
     }
 
+    /*
     @Override
     @JsonProperty
     @JsonView({ DetailedView.class, ExportView.class })
     @JsonSerialize(as = BaseIdentifiableObject.class)
     @JacksonXmlProperty(namespace = DxfNamespaces.DXF_2_0)
+    */
     public User getUser()
     {
         return user;
@@ -255,9 +256,9 @@
     }
 
     @JsonProperty
-    @JsonView({ DetailedView.class, ExportView.class })
-    @JacksonXmlElementWrapper(localName = "userGroupAccesses", namespace = DxfNamespaces.DXF_2_0)
-    @JacksonXmlProperty(localName = "userGroupAccess", namespace = DxfNamespaces.DXF_2_0)
+    @JsonView( { DetailedView.class, ExportView.class } )
+    @JacksonXmlElementWrapper( localName = "userGroupAccesses", namespace = DxfNamespaces.DXF_2_0 )
+    @JacksonXmlProperty( localName = "userGroupAccess", namespace = DxfNamespaces.DXF_2_0 )
     public Set<UserGroupAccess> getUserGroupAccesses()
     {
         return userGroupAccesses;
@@ -429,5 +430,12 @@
         this.name = other.getName() == null ? this.name : other.getName();
         this.code = other.getCode() == null ? this.code : other.getCode();
         this.lastUpdated = other.getLastUpdated() == null ? this.lastUpdated : other.getLastUpdated();
+        this.created = other.getCreated() == null ? this.created : other.getCreated();
+
+        // TODO disabled for 2.11 release, we don't support sharing in dxf2 import-export
+        //this.user = other.getUser() == null ? this.user : other.getUser();
+        //this.publicAccess = other.getPublicAccess() == null ? this.publicAccess : other.getPublicAccess();
+        //this.userGroupAccesses.clear();
+        //this.userGroupAccesses.addAll( other.getUserGroupAccesses() );
     }
 }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/concept/Concept.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/concept/Concept.java	2013-02-13 03:57:52 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/concept/Concept.java	2013-02-25 12:33:35 +0000
@@ -27,6 +27,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import com.fasterxml.jackson.annotation.JsonInclude;
 import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
 import org.hisp.dhis.common.BaseIdentifiableObject;
 import org.hisp.dhis.common.DxfNamespaces;

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategory.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategory.java	2013-02-22 12:26:37 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategory.java	2013-02-25 12:33:35 +0000
@@ -27,6 +27,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import com.fasterxml.jackson.annotation.JsonInclude;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import com.fasterxml.jackson.annotation.JsonView;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
@@ -109,7 +110,7 @@
         categoryOptions.remove( dataElementCategoryOption );
         dataElementCategoryOption.getCategories().remove( this );
     }
-    
+
     public void removeAllCategoryOptions()
     {
         for ( DataElementCategoryOption categoryOption : categoryOptions )
@@ -195,6 +196,7 @@
     @JsonSerialize( contentAs = BaseIdentifiableObject.class )
     @JsonView( {DetailedView.class, ExportView.class} )
     @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
+    @JsonInclude( JsonInclude.Include.NON_NULL )
     public Concept getConcept()
     {
         return concept;

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryOption.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryOption.java	2013-02-22 12:26:37 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryOption.java	2013-02-25 12:33:35 +0000
@@ -38,6 +38,7 @@
 import org.hisp.dhis.common.BaseNameableObject;
 import org.hisp.dhis.common.DxfNamespaces;
 import org.hisp.dhis.common.IdentifiableObject;
+import org.hisp.dhis.common.annotation.Scanned;
 import org.hisp.dhis.common.view.DetailedView;
 import org.hisp.dhis.common.view.ExportView;
 import org.hisp.dhis.concept.Concept;
@@ -48,7 +49,7 @@
 /**
  * @author Abyot Asalefew
  */
-@JacksonXmlRootElement( localName = "categoryOption", namespace = DxfNamespaces.DXF_2_0)
+@JacksonXmlRootElement(localName = "categoryOption", namespace = DxfNamespaces.DXF_2_0)
 public class DataElementCategoryOption
     extends BaseNameableObject
 {
@@ -63,6 +64,7 @@
 
     private Concept concept;
 
+    @Scanned
     private Set<DataElementCategoryOptionCombo> categoryOptionCombos = new HashSet<DataElementCategoryOptionCombo>();
 
     // -------------------------------------------------------------------------
@@ -154,9 +156,10 @@
     }
 
     @JsonProperty
-    @JsonSerialize( as = BaseIdentifiableObject.class )
-    @JsonView( {DetailedView.class} )
-    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
+    @JsonSerialize(contentAs = BaseIdentifiableObject.class)
+    @JsonView({ DetailedView.class })
+    @JacksonXmlElementWrapper(localName = "categories", namespace = DxfNamespaces.DXF_2_0)
+    @JacksonXmlProperty(localName = "category", namespace = DxfNamespaces.DXF_2_0)
     public Set<DataElementCategory> getCategories()
     {
         return categories;
@@ -168,9 +171,9 @@
     }
 
     @JsonProperty
-    @JsonSerialize( contentAs = BaseIdentifiableObject.class )
-    @JsonView( {DetailedView.class, ExportView.class} )
-    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
+    @JsonSerialize(contentAs = BaseIdentifiableObject.class)
+    @JsonView({ DetailedView.class, ExportView.class })
+    @JacksonXmlProperty(namespace = DxfNamespaces.DXF_2_0)
     public Concept getConcept()
     {
         return concept;
@@ -182,10 +185,10 @@
     }
 
     @JsonProperty
-    @JsonSerialize( contentAs = BaseIdentifiableObject.class )
-    @JsonView( {DetailedView.class} )
-    @JacksonXmlElementWrapper( localName = "categoryOptionCombos", namespace = DxfNamespaces.DXF_2_0)
-    @JacksonXmlProperty( localName = "categoryOptionCombo", namespace = DxfNamespaces.DXF_2_0)
+    @JsonSerialize(contentAs = BaseIdentifiableObject.class)
+    @JsonView({ DetailedView.class })
+    @JacksonXmlElementWrapper(localName = "categoryOptionCombos", namespace = DxfNamespaces.DXF_2_0)
+    @JacksonXmlProperty(localName = "categoryOptionCombo", namespace = DxfNamespaces.DXF_2_0)
     public Set<DataElementCategoryOptionCombo> getCategoryOptionCombos()
     {
         return categoryOptionCombos;

=== 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	2013-02-19 16:12:47 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryOptionCombo.java	2013-02-25 12:33:35 +0000
@@ -281,12 +281,12 @@
     public static Map<Integer, String> getCategoryOptionComboMap( Collection<DataElementCategoryOptionCombo> categoryOptionCombos )
     {
         Map<Integer, String> map = new HashMap<Integer, String>();
-        
+
         for ( DataElementCategoryOptionCombo coc : categoryOptionCombos )
         {
             map.put( coc.getId(), coc.getName() );
         }
-        
+
         return map;
     }
     // -------------------------------------------------------------------------
@@ -308,7 +308,7 @@
             name.append( "(" );
 
             Iterator<DataElementCategoryOption> iterator = categoryOptions.iterator();
-            
+
             if ( iterator.hasNext() )
             {
                 name.append( iterator.next().getDisplayName() );
@@ -350,9 +350,9 @@
     }
 
     @JsonProperty
-    @JsonSerialize( contentAs = BaseIdentifiableObject.class )
-    @JsonView( { DetailedView.class, ExportView.class } )
-    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
+    @JsonSerialize(as = BaseIdentifiableObject.class)
+    @JsonView({ DetailedView.class, ExportView.class })
+    @JacksonXmlProperty(namespace = DxfNamespaces.DXF_2_0)
     public DataElementCategoryCombo getCategoryCombo()
     {
         return categoryCombo;

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSet.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSet.java	2013-02-13 03:57:52 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSet.java	2013-02-25 12:33:35 +0000
@@ -60,7 +60,7 @@
  *
  * @author Kristian Nordal
  */
-@JacksonXmlRootElement( localName = "dataSet", namespace = DxfNamespaces.DXF_2_0)
+@JacksonXmlRootElement( localName = "dataSet", namespace = DxfNamespaces.DXF_2_0 )
 public class DataSet
     extends BaseNameableObject
 {
@@ -135,17 +135,17 @@
      * How many days after period is over will this dataSet auto-lock
      */
     private int expiryDays;
-    
+
     /**
      * Indicating whether aggregation should be skipped.
      */
     private boolean skipAggregation;
-    
+
     /**
      * User group which will receive notifications when data set is marked complete.
      */
     private UserGroup notificationRecipients;
-    
+
     /**
      * Indicating whether the user completing this data set should be sent a notification.
      */
@@ -159,12 +159,12 @@
      * Property indicating whether it should allow to enter data for future periods.
      */
     private boolean allowFuturePeriods;
-    
+
     /**
      * Property indicating that all fields for a data element must be filled.
      */
     private boolean fieldCombinationRequired;
-    
+
     /**
      * Property indicating that all validation rules must pass before the form can be completed.
      */
@@ -355,41 +355,6 @@
     }
 
     // -------------------------------------------------------------------------
-    // hashCode and equals
-    // -------------------------------------------------------------------------
-
-    @Override
-    public boolean equals( Object o )
-    {
-        if ( this == o )
-        {
-            return true;
-        }
-
-        if ( o == null )
-        {
-            return false;
-        }
-
-        if ( !(o instanceof DataSet) )
-        {
-            return false;
-        }
-
-        final DataSet other = (DataSet) o;
-
-        return name.equals( other.getName() );
-    }
-
-    @Override
-    public String toString()
-    {
-        return "DataSet{" +
-            "name=" + name +
-            '}';
-    }
-
-    // -------------------------------------------------------------------------
     // Getters and setters
     // -------------------------------------------------------------------------
 
@@ -402,8 +367,8 @@
     @JsonProperty
     @JsonSerialize( using = JacksonPeriodTypeSerializer.class )
     @JsonDeserialize( using = JacksonPeriodTypeDeserializer.class )
-    @JsonView( {DetailedView.class, ExportView.class} )
-    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
+    @JsonView( { DetailedView.class, ExportView.class } )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public PeriodType getPeriodType()
     {
         return periodType;
@@ -414,11 +379,9 @@
         this.periodType = periodType;
     }
 
-    //@JsonProperty
-    //@JsonView( {DetailedView.class, ExportView.class} )
-    //@JacksonXmlProperty( namespace = Dxf2Namespace.NAMESPACE )
-    // Leaving dataEntryForm out for the moment since we are using IDs there and not UIDs.
-    // At some point it should also be upgraded to idObject (to make it work a bit better with the importer).
+    @JsonProperty
+    @JsonView( { DetailedView.class, ExportView.class } )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public DataEntryForm getDataEntryForm()
     {
         return dataEntryForm;
@@ -431,9 +394,9 @@
 
     @JsonProperty
     @JsonSerialize( contentAs = BaseIdentifiableObject.class )
-    @JsonView( {DetailedView.class, ExportView.class} )
-    @JacksonXmlElementWrapper( localName = "dataElements", namespace = DxfNamespaces.DXF_2_0)
-    @JacksonXmlProperty( localName = "dataElement", namespace = DxfNamespaces.DXF_2_0)
+    @JsonView( { DetailedView.class, ExportView.class } )
+    @JacksonXmlElementWrapper( localName = "dataElements", namespace = DxfNamespaces.DXF_2_0 )
+    @JacksonXmlProperty( localName = "dataElement", namespace = DxfNamespaces.DXF_2_0 )
     public Set<DataElement> getDataElements()
     {
         return dataElements;
@@ -446,9 +409,9 @@
 
     @JsonProperty
     @JsonSerialize( contentAs = BaseIdentifiableObject.class )
-    @JsonView( {DetailedView.class, ExportView.class} )
-    @JacksonXmlElementWrapper( localName = "indicators", namespace = DxfNamespaces.DXF_2_0)
-    @JacksonXmlProperty( localName = "indicator", namespace = DxfNamespaces.DXF_2_0)
+    @JsonView( { DetailedView.class, ExportView.class } )
+    @JacksonXmlElementWrapper( localName = "indicators", namespace = DxfNamespaces.DXF_2_0 )
+    @JacksonXmlProperty( localName = "indicator", namespace = DxfNamespaces.DXF_2_0 )
     public Set<Indicator> getIndicators()
     {
         return indicators;
@@ -460,9 +423,9 @@
     }
 
     @JsonProperty
-    @JsonView( {DetailedView.class, ExportView.class} )
-    @JacksonXmlElementWrapper( localName = "compulsoryDataElementOperands", namespace = DxfNamespaces.DXF_2_0)
-    @JacksonXmlProperty( localName = "compulsoryDataElementOperand", namespace = DxfNamespaces.DXF_2_0)
+    @JsonView( { DetailedView.class, ExportView.class } )
+    @JacksonXmlElementWrapper( localName = "compulsoryDataElementOperands", namespace = DxfNamespaces.DXF_2_0 )
+    @JacksonXmlProperty( localName = "compulsoryDataElementOperand", namespace = DxfNamespaces.DXF_2_0 )
     public Set<DataElementOperand> getCompulsoryDataElementOperands()
     {
         return compulsoryDataElementOperands;
@@ -475,9 +438,9 @@
 
     @JsonProperty( value = "organisationUnits" )
     @JsonSerialize( contentAs = BaseIdentifiableObject.class )
-    @JsonView( {DetailedView.class, ExportView.class} )
-    @JacksonXmlElementWrapper( localName = "organisationUnits", namespace = DxfNamespaces.DXF_2_0)
-    @JacksonXmlProperty( localName = "organisationUnit", namespace = DxfNamespaces.DXF_2_0)
+    @JsonView( { DetailedView.class, ExportView.class } )
+    @JacksonXmlElementWrapper( localName = "organisationUnits", namespace = DxfNamespaces.DXF_2_0 )
+    @JacksonXmlProperty( localName = "organisationUnit", namespace = DxfNamespaces.DXF_2_0 )
     public Set<OrganisationUnit> getSources()
     {
         return sources;
@@ -500,9 +463,9 @@
 
     @JsonProperty
     @JsonSerialize( contentAs = BaseIdentifiableObject.class )
-    @JsonView( {DetailedView.class, ExportView.class} )
-    @JacksonXmlElementWrapper( localName = "sections", namespace = DxfNamespaces.DXF_2_0)
-    @JacksonXmlProperty( localName = "section", namespace = DxfNamespaces.DXF_2_0)
+    @JsonView( { DetailedView.class, ExportView.class } )
+    @JacksonXmlElementWrapper( localName = "sections", namespace = DxfNamespaces.DXF_2_0 )
+    @JacksonXmlProperty( localName = "section", namespace = DxfNamespaces.DXF_2_0 )
     public Set<Section> getSections()
     {
         return sections;
@@ -514,8 +477,8 @@
     }
 
     @JsonProperty
-    @JsonView( {DetailedView.class, ExportView.class} )
-    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
+    @JsonView( { DetailedView.class, ExportView.class } )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public boolean isMobile()
     {
         return mobile;
@@ -527,8 +490,8 @@
     }
 
     @JsonProperty
-    @JsonView( {DetailedView.class, ExportView.class} )
-    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
+    @JsonView( { DetailedView.class, ExportView.class } )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public Integer getVersion()
     {
         return version;
@@ -540,8 +503,8 @@
     }
 
     @JsonProperty
-    @JsonView( {DetailedView.class, ExportView.class} )
-    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
+    @JsonView( { DetailedView.class, ExportView.class } )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public int getExpiryDays()
     {
         return expiryDays;
@@ -553,8 +516,8 @@
     }
 
     @JsonProperty
-    @JsonView( {DetailedView.class, ExportView.class} )
-    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
+    @JsonView( { DetailedView.class, ExportView.class } )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public boolean isSkipAggregation()
     {
         return skipAggregation;
@@ -566,8 +529,8 @@
     }
 
     @JsonProperty
-    @JsonView( {DetailedView.class, ExportView.class} )
-    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
+    @JsonView( { DetailedView.class, ExportView.class } )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public UserGroup getNotificationRecipients()
     {
         return notificationRecipients;
@@ -579,8 +542,8 @@
     }
 
     @JsonProperty
-    @JsonView( {DetailedView.class, ExportView.class} )
-    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
+    @JsonView( { DetailedView.class, ExportView.class } )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public boolean isNotifyCompletingUser()
     {
         return notifyCompletingUser;
@@ -592,8 +555,8 @@
     }
 
     @JsonProperty
-    @JsonView( {DetailedView.class, ExportView.class} )
-    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
+    @JsonView( { DetailedView.class, ExportView.class } )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public boolean isAllowFuturePeriods()
     {
         return allowFuturePeriods;
@@ -605,8 +568,8 @@
     }
 
     @JsonProperty
-    @JsonView( {DetailedView.class, ExportView.class} )
-    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
+    @JsonView( { DetailedView.class, ExportView.class } )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public boolean isFieldCombinationRequired()
     {
         return fieldCombinationRequired;
@@ -618,8 +581,8 @@
     }
 
     @JsonProperty
-    @JsonView( {DetailedView.class, ExportView.class} )
-    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
+    @JsonView( { DetailedView.class, ExportView.class } )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public boolean isValidCompleteOnly()
     {
         return validCompleteOnly;
@@ -631,8 +594,8 @@
     }
 
     @JsonProperty
-    @JsonView( {DetailedView.class, ExportView.class} )
-    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
+    @JsonView( { DetailedView.class, ExportView.class } )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public boolean isSkipOffline()
     {
         return skipOffline;

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/expression/Expression.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/expression/Expression.java	2013-02-13 03:57:52 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/expression/Expression.java	2013-02-25 12:33:35 +0000
@@ -33,7 +33,6 @@
 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.apache.commons.lang.Validate;
 import org.hisp.dhis.common.BaseIdentifiableObject;
 import org.hisp.dhis.common.DxfNamespaces;
@@ -64,7 +63,7 @@
  * @author Margrethe Store
  * @version $Id: Expression.java 5011 2008-04-24 20:41:28Z larshelg $
  */
-@JacksonXmlRootElement( localName = "expression", namespace = DxfNamespaces.DXF_2_0)
+@JacksonXmlRootElement(localName = "expression", namespace = DxfNamespaces.DXF_2_0)
 public class Expression
     implements Serializable
 {
@@ -93,9 +92,9 @@
      * A description of the Expression.
      */
     private String description;
-    
+
     /**
-     * Indicates whether the expression should evaluate to null if there are 
+     * Indicates whether the expression should evaluate to null if there are
      * missing data values in the expression.
      */
     private boolean nullIfBlank;
@@ -228,8 +227,8 @@
     }
 
     @JsonProperty
-    @JsonView( { DetailedView.class, ExportView.class } )
-    @JacksonXmlProperty
+    @JsonView({ DetailedView.class, ExportView.class })
+    @JacksonXmlProperty(namespace = DxfNamespaces.DXF_2_0)
     public String getExpression()
     {
         return expression;
@@ -240,11 +239,11 @@
         this.expression = expression;
     }
 
-    @JsonProperty( value = "dataElements" )
-    @JsonSerialize( contentAs = BaseIdentifiableObject.class )
-    @JsonView( { DetailedView.class, ExportView.class } )
-    @JacksonXmlElementWrapper( localName = "dataElements" )
-    @JacksonXmlProperty( localName = "dataElement" )
+    @JsonProperty(value = "dataElements")
+    @JsonSerialize(contentAs = BaseIdentifiableObject.class)
+    @JsonView({ DetailedView.class, ExportView.class })
+    @JacksonXmlElementWrapper(localName = "dataElements", namespace = DxfNamespaces.DXF_2_0)
+    @JacksonXmlProperty(localName = "dataElement", namespace = DxfNamespaces.DXF_2_0)
     public Set<DataElement> getDataElementsInExpression()
     {
         return dataElementsInExpression;
@@ -255,11 +254,11 @@
         this.dataElementsInExpression = dataElementsInExpression;
     }
 
-    @JsonProperty( value = "categoryOptionCombos" )
-    @JsonSerialize( contentAs = BaseIdentifiableObject.class )
-    @JsonView( { DetailedView.class, ExportView.class } )
-    @JacksonXmlElementWrapper( localName = "categoryOptionCombos" )
-    @JacksonXmlProperty( localName = "categoryOptionCombo" )
+    @JsonProperty(value = "categoryOptionCombos")
+    @JsonSerialize(contentAs = BaseIdentifiableObject.class)
+    @JsonView({ DetailedView.class, ExportView.class })
+    @JacksonXmlElementWrapper(localName = "categoryOptionCombos", namespace = DxfNamespaces.DXF_2_0)
+    @JacksonXmlProperty(localName = "categoryOptionCombo", namespace = DxfNamespaces.DXF_2_0)
     public Set<DataElementCategoryOptionCombo> getOptionCombosInExpression()
     {
         return optionCombosInExpression;
@@ -272,7 +271,7 @@
 
     @JsonProperty
     @JsonView( { DetailedView.class, ExportView.class } )
-    @JacksonXmlProperty
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public String getDescription()
     {
         return description;
@@ -284,8 +283,8 @@
     }
 
     @JsonProperty
-    @JsonView( { DetailedView.class, ExportView.class } )
-    @JacksonXmlProperty
+    @JsonView({ DetailedView.class, ExportView.class })
+    @JacksonXmlProperty(namespace = DxfNamespaces.DXF_2_0)
     public boolean isNullIfBlank()
     {
         return nullIfBlank;
@@ -295,17 +294,17 @@
     {
         this.nullIfBlank = nullIfBlank;
     }
-    
+
     public void mergeWith( Expression other )
     {
         Validate.notNull( other );
-        
+
         expression = other.getExpression() == null ? expression : other.getExpression();
         description = other.getDescription() == null ? description : other.getDescription();
         nullIfBlank = other.isNullIfBlank();
         dataElementsInExpression = other.getDataElementsInExpression() == null ?
             dataElementsInExpression : new HashSet<DataElement>( other.getDataElementsInExpression() );
-        optionCombosInExpression = other.getOptionCombosInExpression() == null ? 
-            optionCombosInExpression : new HashSet<DataElementCategoryOptionCombo>( other.getOptionCombosInExpression() );        
+        optionCombosInExpression = other.getOptionCombosInExpression() == null ?
+            optionCombosInExpression : new HashSet<DataElementCategoryOptionCombo>( other.getOptionCombosInExpression() );
     }
 }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/User.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/User.java	2013-02-13 03:57:52 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/User.java	2013-02-25 12:33:35 +0000
@@ -27,6 +27,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import com.fasterxml.jackson.annotation.JsonIgnore;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import com.fasterxml.jackson.annotation.JsonView;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
@@ -52,7 +53,7 @@
 /**
  * @author Nguyen Hong Duc
  */
-@JacksonXmlRootElement( localName = "user", namespace = DxfNamespaces.DXF_2_0)
+@JacksonXmlRootElement( localName = "user", namespace = DxfNamespaces.DXF_2_0 )
 public class User
     extends BaseIdentifiableObject
 {
@@ -151,23 +152,23 @@
     {
         return firstName + " " + surname;
     }
-    
+
     /**
      * Checks whether the profile has been filled, which is defined as three
      * not-null properties out of all optional properties.
      */
     public boolean isProfileFilled()
     {
-        Object[] props = { jobTitle, introduction, gender, birthday, 
+        Object[] props = { jobTitle, introduction, gender, birthday,
             nationality, employer, education, interests, languages };
-        
+
         int count = 0;
-        
+
         for ( Object prop : props )
         {
-            count = prop != null ? ( count + 1 ) : count;
+            count = prop != null ? (count + 1) : count;
         }
-        
+
         return count > 3;
     }
 
@@ -176,7 +177,7 @@
      * Null is returned if the user has no organisation units. Which
      * organisation unit to return is undefined if the user has multiple
      * organisation units.
-     * 
+     *
      * @return an organisation unit associated with the user.
      */
     public OrganisationUnit getOrganisationUnit()
@@ -215,7 +216,7 @@
 
     @JsonProperty
     @JsonView( { DetailedView.class, ExportView.class } )
-    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public String getFirstName()
     {
         return firstName;
@@ -228,7 +229,7 @@
 
     @JsonProperty
     @JsonView( { DetailedView.class, ExportView.class } )
-    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public String getSurname()
     {
         return surname;
@@ -241,7 +242,7 @@
 
     @JsonProperty
     @JsonView( { DetailedView.class, ExportView.class } )
-    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public String getEmail()
     {
         return email;
@@ -254,7 +255,7 @@
 
     @JsonProperty
     @JsonView( { DetailedView.class, ExportView.class } )
-    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public String getJobTitle()
     {
         return jobTitle;
@@ -267,7 +268,7 @@
 
     @JsonProperty
     @JsonView( { DetailedView.class, ExportView.class } )
-    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public String getPhoneNumber()
     {
         return phoneNumber;
@@ -280,7 +281,7 @@
 
     @JsonProperty
     @JsonView( { DetailedView.class, ExportView.class } )
-    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public String getIntroduction()
     {
         return introduction;
@@ -293,7 +294,7 @@
 
     @JsonProperty
     @JsonView( { DetailedView.class, ExportView.class } )
-    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public String getGender()
     {
         return gender;
@@ -306,7 +307,7 @@
 
     @JsonProperty
     @JsonView( { DetailedView.class, ExportView.class } )
-    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public Date getBirthday()
     {
         return birthday;
@@ -319,7 +320,7 @@
 
     @JsonProperty
     @JsonView( { DetailedView.class, ExportView.class } )
-    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public String getNationality()
     {
         return nationality;
@@ -332,7 +333,7 @@
 
     @JsonProperty
     @JsonView( { DetailedView.class, ExportView.class } )
-    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public String getEmployer()
     {
         return employer;
@@ -345,7 +346,7 @@
 
     @JsonProperty
     @JsonView( { DetailedView.class, ExportView.class } )
-    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public String getEducation()
     {
         return education;
@@ -358,7 +359,7 @@
 
     @JsonProperty
     @JsonView( { DetailedView.class, ExportView.class } )
-    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public String getInterests()
     {
         return interests;
@@ -371,7 +372,7 @@
 
     @JsonProperty
     @JsonView( { DetailedView.class, ExportView.class } )
-    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public String getLanguages()
     {
         return languages;
@@ -394,7 +395,7 @@
 
     @JsonProperty
     @JsonView( { DetailedView.class, ExportView.class } )
-    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public UserCredentials getUserCredentials()
     {
         return userCredentials;
@@ -418,8 +419,8 @@
     @JsonProperty
     @JsonSerialize( contentAs = BaseIdentifiableObject.class )
     @JsonView( { DetailedView.class, ExportView.class } )
-    @JacksonXmlElementWrapper( localName = "organisationUnits", namespace = DxfNamespaces.DXF_2_0)
-    @JacksonXmlProperty( localName = "organisationUnit", namespace = DxfNamespaces.DXF_2_0)
+    @JacksonXmlElementWrapper( localName = "organisationUnits", namespace = DxfNamespaces.DXF_2_0 )
+    @JacksonXmlProperty( localName = "organisationUnit", namespace = DxfNamespaces.DXF_2_0 )
     public Collection<OrganisationUnit> getOrganisationUnits()
     {
         return organisationUnits;
@@ -432,8 +433,8 @@
 
     @JsonProperty( value = "attributes" )
     @JsonView( { DetailedView.class, ExportView.class } )
-    @JacksonXmlElementWrapper( localName = "attributes", namespace = DxfNamespaces.DXF_2_0)
-    @JacksonXmlProperty( localName = "attribute", namespace = DxfNamespaces.DXF_2_0)
+    @JacksonXmlElementWrapper( localName = "attributes", namespace = DxfNamespaces.DXF_2_0 )
+    @JacksonXmlProperty( localName = "attribute", namespace = DxfNamespaces.DXF_2_0 )
     public Set<AttributeValue> getAttributeValues()
     {
         return attributeValues;

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserCredentials.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserCredentials.java	2013-02-13 03:57:52 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserCredentials.java	2013-02-25 12:33:35 +0000
@@ -421,7 +421,7 @@
 
     @JsonProperty
     @JsonView( {DetailedView.class, ExportView.class} )
-    @JacksonXmlProperty
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
     public Date getLastLogin()
     {
         return lastLogin;
@@ -462,6 +462,9 @@
         this.restoreExpiry = restoreExpiry;
     }
 
+    @JsonProperty
+    @JsonView( {DetailedView.class, ExportView.class} )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
     public boolean isSelfRegistered()
     {
         return selfRegistered;
@@ -472,6 +475,9 @@
         this.selfRegistered = selfRegistered;
     }
 
+    @JsonProperty
+    @JsonView( {DetailedView.class, ExportView.class} )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
     public boolean isDisabled()
     {
         return disabled;

=== modified file 'dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/DefaultExportService.java'
--- dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/DefaultExportService.java	2012-07-06 08:37:24 +0000
+++ dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/DefaultExportService.java	2013-02-25 12:33:35 +0000
@@ -82,6 +82,7 @@
     public MetaData getMetaData( Options options, TaskId taskId )
     {
         MetaData metaData = new MetaData();
+        metaData.setCreated( new Date() );
 
         log.info( "User '" + currentUserService.getCurrentUsername() + "' started export at " + new Date() );
 

=== modified file 'dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/ExchangeClasses.java'
--- dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/ExchangeClasses.java	2013-02-13 03:57:52 +0000
+++ dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/ExchangeClasses.java	2013-02-25 12:33:35 +0000
@@ -80,91 +80,104 @@
  */
 final public class ExchangeClasses
 {
+    // all available classes for export, used for controllers etc
+    private static Map<Class<? extends IdentifiableObject>, String> allExportClasses;
+
+    // these are the ones that are available for dxf2 export
     private static Map<Class<? extends IdentifiableObject>, String> exportClasses;
 
+    // these are the ones that are available for dxf2 import
     private static Map<Class<? extends IdentifiableObject>, String> importClasses;
 
     static
     {
-        exportClasses = new LinkedHashMap<Class<? extends IdentifiableObject>, String>();
-
-        exportClasses.put( SqlView.class, "sqlViews" );
-        exportClasses.put( Concept.class, "concepts" );
-        exportClasses.put( Constant.class, "constants" );
-        exportClasses.put( Document.class, "documents" );
-        exportClasses.put( OptionSet.class, "optionSets" );
-        exportClasses.put( Attribute.class, "attributeTypes" );
-
-        exportClasses.put( OrganisationUnit.class, "organisationUnits" );
-        exportClasses.put( OrganisationUnitLevel.class, "organisationUnitLevels" );
-        exportClasses.put( OrganisationUnitGroup.class, "organisationUnitGroups" );
-        exportClasses.put( OrganisationUnitGroupSet.class, "organisationUnitGroupSets" );
-
-        exportClasses.put( DataElementCategoryOption.class, "categoryOptions" );
-        exportClasses.put( DataElementCategory.class, "categories" );
-        exportClasses.put( DataElementCategoryCombo.class, "categoryCombos" );
-        exportClasses.put( DataElementCategoryOptionCombo.class, "categoryOptionCombos" );
-
-        exportClasses.put( DataElement.class, "dataElements" );
-        exportClasses.put( DataElementGroup.class, "dataElementGroups" );
-        exportClasses.put( DataElementGroupSet.class, "dataElementGroupSets" );
-
-        exportClasses.put( IndicatorType.class, "indicatorTypes" );
-        exportClasses.put( Indicator.class, "indicators" );
-        exportClasses.put( IndicatorGroup.class, "indicatorGroups" );
-        exportClasses.put( IndicatorGroupSet.class, "indicatorGroupSets" );
-
-        exportClasses.put( DataDictionary.class, "dataDictionaries" );
-
-        exportClasses.put( DataSet.class, "dataSets" );
-        exportClasses.put( Section.class, "sections" );
-
-        exportClasses.put( ReportTable.class, "reportTables" );
-        exportClasses.put( Report.class, "reports" );
-        exportClasses.put( Chart.class, "charts" );
-
-        exportClasses.put( ValidationRule.class, "validationRules" );
-        exportClasses.put( ValidationRuleGroup.class, "validationRuleGroups" );
-
-        exportClasses.put( org.hisp.dhis.mapping.Map.class, "maps" );
-        exportClasses.put( MapView.class, "mapViews" );
-        exportClasses.put( MapLegend.class, "mapLegends" );
-        exportClasses.put( MapLegendSet.class, "mapLegendSets" );
-        exportClasses.put( MapLayer.class, "mapLayers" );
-
-        exportClasses.put( User.class, "users" );
-        exportClasses.put( UserGroup.class, "userGroups" );
-        exportClasses.put( UserAuthorityGroup.class, "userRoles" );
-
-        exportClasses.put( MessageConversation.class, "messageConversations" );
-        exportClasses.put( Interpretation.class, "interpretations" );
-
-        exportClasses.put( Program.class, "programs" );
-        exportClasses.put( ProgramStage.class, "programStages" );
-
-        importClasses = new LinkedHashMap<Class<? extends IdentifiableObject>, String>( exportClasses );
-
+        allExportClasses = new LinkedHashMap<Class<? extends IdentifiableObject>, String>();
+
+        allExportClasses.put( SqlView.class, "sqlViews" );
+        allExportClasses.put( Concept.class, "concepts" );
+        allExportClasses.put( Constant.class, "constants" );
+        allExportClasses.put( Document.class, "documents" );
+        allExportClasses.put( OptionSet.class, "optionSets" );
+        allExportClasses.put( Attribute.class, "attributeTypes" );
+
+        allExportClasses.put( OrganisationUnit.class, "organisationUnits" );
+        allExportClasses.put( OrganisationUnitLevel.class, "organisationUnitLevels" );
+        allExportClasses.put( OrganisationUnitGroup.class, "organisationUnitGroups" );
+        allExportClasses.put( OrganisationUnitGroupSet.class, "organisationUnitGroupSets" );
+
+        allExportClasses.put( DataElementCategoryOption.class, "categoryOptions" );
+        allExportClasses.put( DataElementCategory.class, "categories" );
+        allExportClasses.put( DataElementCategoryCombo.class, "categoryCombos" );
+        allExportClasses.put( DataElementCategoryOptionCombo.class, "categoryOptionCombos" );
+
+        allExportClasses.put( DataElement.class, "dataElements" );
+        allExportClasses.put( DataElementGroup.class, "dataElementGroups" );
+        allExportClasses.put( DataElementGroupSet.class, "dataElementGroupSets" );
+
+        allExportClasses.put( IndicatorType.class, "indicatorTypes" );
+        allExportClasses.put( Indicator.class, "indicators" );
+        allExportClasses.put( IndicatorGroup.class, "indicatorGroups" );
+        allExportClasses.put( IndicatorGroupSet.class, "indicatorGroupSets" );
+
+        allExportClasses.put( DataDictionary.class, "dataDictionaries" );
+
+        allExportClasses.put( DataSet.class, "dataSets" );
+        allExportClasses.put( Section.class, "sections" );
+
+        allExportClasses.put( ReportTable.class, "reportTables" );
+        allExportClasses.put( Report.class, "reports" );
+        allExportClasses.put( Chart.class, "charts" );
+
+        allExportClasses.put( ValidationRule.class, "validationRules" );
+        allExportClasses.put( ValidationRuleGroup.class, "validationRuleGroups" );
+
+        allExportClasses.put( org.hisp.dhis.mapping.Map.class, "maps" );
+        allExportClasses.put( MapView.class, "mapViews" );
+        allExportClasses.put( MapLegend.class, "mapLegends" );
+        allExportClasses.put( MapLegendSet.class, "mapLegendSets" );
+        allExportClasses.put( MapLayer.class, "mapLayers" );
+
+        allExportClasses.put( User.class, "users" );
+        allExportClasses.put( UserGroup.class, "userGroups" );
+        allExportClasses.put( UserAuthorityGroup.class, "userRoles" );
+
+        allExportClasses.put( MessageConversation.class, "messageConversations" );
+        allExportClasses.put( Interpretation.class, "interpretations" );
+
+        allExportClasses.put( Program.class, "programs" );
+        allExportClasses.put( ProgramStage.class, "programStages" );
+
+        exportClasses = new LinkedHashMap<Class<? extends IdentifiableObject>, String>( allExportClasses );
+        importClasses = new LinkedHashMap<Class<? extends IdentifiableObject>, String>( allExportClasses );
+
+        // for now, do not allow user to be imported
         importClasses.remove( User.class );
         importClasses.remove( UserAuthorityGroup.class );
         importClasses.remove( UserGroup.class );
 
+        // this is considered data, and is not available for meta-data import
+        exportClasses.remove( MessageConversation.class );
+        exportClasses.remove( Interpretation.class );
         importClasses.remove( MessageConversation.class );
         importClasses.remove( Interpretation.class );
 
+        // tracker types are not enabled for meta-data import-export yet
+        exportClasses.remove( Program.class );
+        exportClasses.remove( ProgramStage.class );
         importClasses.remove( Program.class );
         importClasses.remove( ProgramStage.class );
     }
 
+    public static Map<Class<? extends IdentifiableObject>, String> getAllExportMap()
+    {
+        return Collections.unmodifiableMap( allExportClasses );
+    }
+
     public static Map<Class<? extends IdentifiableObject>, String> getExportMap()
     {
         return Collections.unmodifiableMap( exportClasses );
     }
 
-    public static List<Class<? extends IdentifiableObject>> getExportClasses()
-    {
-        return new ArrayList<Class<? extends IdentifiableObject>>( exportClasses.keySet() );
-    }
-
     public static Map<Class<? extends IdentifiableObject>, String> getImportMap()
     {
         return Collections.unmodifiableMap( importClasses );

=== modified file 'dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/MetaData.java'
--- dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/MetaData.java	2013-02-13 03:57:52 +0000
+++ dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/MetaData.java	2013-02-25 12:33:35 +0000
@@ -75,6 +75,7 @@
 import org.hisp.dhis.validation.ValidationRuleGroup;
 
 import java.util.ArrayList;
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -83,6 +84,8 @@
 @JacksonXmlRootElement( localName = "metaData", namespace = DxfNamespaces.DXF_2_0 )
 public class MetaData
 {
+    private Date created;
+
     private List<Attribute> attributeTypes = new ArrayList<Attribute>();
 
     private List<Document> documents = new ArrayList<Document>();
@@ -170,6 +173,18 @@
     }
 
     @JsonProperty
+    @JacksonXmlProperty( isAttribute = true )
+    public Date getCreated()
+    {
+        return created;
+    }
+
+    public void setCreated( Date created )
+    {
+        this.created = created;
+    }
+
+    @JsonProperty
     @JacksonXmlElementWrapper( localName = "attributeTypes", namespace = DxfNamespaces.DXF_2_0 )
     @JacksonXmlProperty( localName = "attributeType", namespace = DxfNamespaces.DXF_2_0 )
     public List<Attribute> getAttributeTypes()

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/common/IdentityPopulator.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/common/IdentityPopulator.java	2013-02-13 03:57:52 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/common/IdentityPopulator.java	2013-02-25 12:33:35 +0000
@@ -50,7 +50,7 @@
 {
     private static final Log log = LogFactory.getLog( IdentityPopulator.class );
 
-    private static String[] tables = { "chart", "constant", "attribute", "indicatortype", "indicatorgroupset", "indicator",
+    private static String[] tables = { "chart", "constant", "concept", "attribute", "indicatortype", "indicatorgroupset", "indicator",
         "indicatorgroup", "datadictionary", "validationrulegroup", "validationrule", "dataset", "orgunitlevel", "document",
         "organisationunit", "orgunitgroup", "orgunitgroupset", "dataelementcategoryoption", "dataelementgroup", "sqlview",
         "dataelement", "dataelementgroupset", "dataelementcategory", "categorycombo", "categoryoptioncombo", "map", "mapview",

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryDeletionHandler.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryDeletionHandler.java	2013-02-22 12:26:37 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryDeletionHandler.java	2013-02-25 12:33:35 +0000
@@ -27,14 +27,12 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.Set;
-
 import org.hisp.dhis.concept.Concept;
 import org.hisp.dhis.concept.ConceptService;
-import org.hisp.dhis.dataelement.DataElementCategory;
-import org.hisp.dhis.dataelement.DataElementCategoryService;
 import org.hisp.dhis.system.deletion.DeletionHandler;
 
+import java.util.Set;
+
 /**
  * @author Dang Duy Hieu
  */
@@ -112,7 +110,7 @@
     public void deleteDataElementCategoryOption( DataElementCategoryOption categoryOption )
     {
         Set<DataElementCategory> categories = categoryOption.getCategories();
-        
+
         for ( DataElementCategory category : categories )
         {
             category.removeDataElementCategoryOption( categoryOption );

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElementCategoryOption.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElementCategoryOption.hbm.xml	2013-02-22 12:26:37 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElementCategoryOption.hbm.xml	2013-02-25 12:33:35 +0000
@@ -14,7 +14,7 @@
       <generator class="native" />
     </id>
     &identifiableProperties;
-    
+
     <property name="name" column="name" not-null="true" unique="true" length="230" />
 
     <many-to-one name="concept" class="org.hisp.dhis.concept.Concept" column="conceptid"

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/AbstractCrudController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/AbstractCrudController.java	2012-12-09 13:46:18 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/AbstractCrudController.java	2013-02-25 12:33:35 +0000
@@ -75,7 +75,7 @@
         WebMetaData metaData = new WebMetaData();
         List<T> entityList = getEntityList( metaData, options );
 
-        ReflectionUtils.invokeSetterMethod( ExchangeClasses.getExportMap().get( getEntityClass() ), metaData, entityList );
+        ReflectionUtils.invokeSetterMethod( ExchangeClasses.getAllExportMap().get( getEntityClass() ), metaData, entityList );
 
         if ( options.hasLinks() )
         {
@@ -98,7 +98,7 @@
         WebMetaData metaData = new WebMetaData();
         List<T> entityList = queryForEntityList( metaData, options, query );
 
-        ReflectionUtils.invokeSetterMethod( ExchangeClasses.getExportMap().get( getEntityClass() ), metaData, entityList );
+        ReflectionUtils.invokeSetterMethod( ExchangeClasses.getAllExportMap().get( getEntityClass() ), metaData, entityList );
 
         if ( options.hasLinks() )
         {

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/utils/ContextUtils.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/utils/ContextUtils.java	2013-02-04 10:13:08 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/utils/ContextUtils.java	2013-02-25 12:33:35 +0000
@@ -210,7 +210,7 @@
             clazz = clazz.getSuperclass();
         }
 
-        String resourcePath = ExchangeClasses.getExportMap().get( clazz );
+        String resourcePath = ExchangeClasses.getAllExportMap().get( clazz );
 
         return getRootPath( getRequest() ) + "/" + resourcePath;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/webdomain/Resources.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/webdomain/Resources.java	2013-02-13 03:57:52 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/webdomain/Resources.java	2013-02-25 12:33:35 +0000
@@ -86,7 +86,7 @@
         mediaTypes.add( MediaType.APPLICATION_XML.toString() );
         mediaTypes.add( new MediaType( "application", "javascript" ).toString() );
 
-        for ( Map.Entry<Class<? extends IdentifiableObject>, String> entry : ExchangeClasses.getExportMap().entrySet() )
+        for ( Map.Entry<Class<? extends IdentifiableObject>, String> entry : ExchangeClasses.getAllExportMap().entrySet() )
         {
             resources.add( new Resource( StringUtils.capitalize( entry.getValue() ), entry.getKey(), requestMethods, mediaTypes ) );
         }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/category/AddDataElementCategoryAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/category/AddDataElementCategoryAction.java	2013-02-22 11:39:14 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/category/AddDataElementCategoryAction.java	2013-02-25 12:33:35 +0000
@@ -27,15 +27,14 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.ArrayList;
-import java.util.List;
-
+import com.opensymphony.xwork2.Action;
 import org.hisp.dhis.concept.ConceptService;
 import org.hisp.dhis.dataelement.DataElementCategory;
 import org.hisp.dhis.dataelement.DataElementCategoryOption;
 import org.hisp.dhis.dataelement.DataElementCategoryService;
 
-import com.opensymphony.xwork2.Action;
+import java.util.ArrayList;
+import java.util.List;
 
 /**
  * @author Selamawit
@@ -98,7 +97,7 @@
         dataElementCategory.setConcept( conceptService.getConcept( conceptId ) );
 
         List<DataElementCategoryOption> options = new ArrayList<DataElementCategoryOption>();
-        
+
         for ( String id : selectedList )
         {
             DataElementCategoryOption categoryOption = dataElementCategoryService.getDataElementCategoryOption( Integer.parseInt( id ) );
@@ -106,7 +105,7 @@
         }
 
         dataElementCategory.setCategoryOptions( options );
-        
+
         dataElementCategoryService.addDataElementCategory( dataElementCategory );
 
         return SUCCESS;

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/category/UpdateDataElementCategoryAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/category/UpdateDataElementCategoryAction.java	2013-02-22 11:39:14 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/category/UpdateDataElementCategoryAction.java	2013-02-25 12:33:35 +0000
@@ -27,15 +27,14 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.ArrayList;
-import java.util.List;
-
+import com.opensymphony.xwork2.Action;
 import org.hisp.dhis.concept.ConceptService;
 import org.hisp.dhis.dataelement.DataElementCategory;
 import org.hisp.dhis.dataelement.DataElementCategoryOption;
 import org.hisp.dhis.dataelement.DataElementCategoryService;
 
-import com.opensymphony.xwork2.Action;
+import java.util.ArrayList;
+import java.util.List;
 
 /**
  * @author Abyot Asalefew
@@ -105,14 +104,14 @@
         dataElementCategory.setConcept( conceptService.getConcept( conceptId ) );
 
         List<DataElementCategoryOption> options = new ArrayList<DataElementCategoryOption>();
-        
+
         for ( String id : selectedList )
         {
             options.add( dataElementCategoryService.getDataElementCategoryOption( Integer.parseInt( id ) ) );
         }
 
         dataElementCategory.setCategoryOptions( options );
-        
+
         dataElementCategoryService.updateDataElementCategory( dataElementCategory );
 
         return SUCCESS;