← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 4532: Made some strings explicit to help stax parser and jaxb parser stay consistent.

 

------------------------------------------------------------
revno: 4532
committer: Bob Jolliffe bobjolliffe@xxxxxxxxx
branch nick: dhis2
timestamp: Tue 2011-09-06 17:29:46 +0100
message:
  Made some strings explicit to help stax parser and jaxb parser stay consistent.
modified:
  dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf2/model/DataValue.java
  dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf2/model/DataValueSet.java
  dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf2/model/Dxf.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-importexport/src/main/java/org/hisp/dhis/importexport/dxf2/model/DataValue.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf2/model/DataValue.java	2011-09-05 11:56:56 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf2/model/DataValue.java	2011-09-06 16:29:46 +0000
@@ -38,23 +38,36 @@
 @XmlAccessorType( XmlAccessType.FIELD )
 public class DataValue
 {
-
-    @XmlAttribute( name = "dataElement", required = true )
+   // ---------------------------------------------------------------------------
+   // Element and attribute names
+   // ---------------------------------------------------------------------------
+
+    public static final String ATTR_DATAELEMENT = "dataElement";
+
+    public static final String ATTR_VALUE = "value";
+
+    public static final String ATTR_CATEGORY_OPTION_COMBO = "categoryOptionCombo";
+
+    public static final String ATTR_ORGUNIT = "orgunit";
+
+   // ---------------------------------------------------------------------------
+
+    @XmlAttribute( name = ATTR_DATAELEMENT, required = true )
     private String dataElementIdentifier;
 
-    @XmlAttribute( name = "value", required = true)
+    @XmlAttribute( name = ATTR_VALUE, required = true)
     private String value;
 
     /**
      * optional - defaults to default
      */
-    @XmlAttribute( name = "categoryOptionCombo" )
+    @XmlAttribute( name = ATTR_CATEGORY_OPTION_COMBO )
     private String categoryOptionComboIdentifier;
 
     /**
      * optional - defaults to orgUnit id from datavalueset
      */
-    @XmlAttribute( name = "orgUnit" )
+    @XmlAttribute( name = ATTR_ORGUNIT )
     private String orgUnitIdentifier;
 
     /**

=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf2/model/DataValueSet.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf2/model/DataValueSet.java	2011-09-05 11:56:56 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf2/model/DataValueSet.java	2011-09-06 16:29:46 +0000
@@ -39,6 +39,27 @@
 @XmlAccessorType( XmlAccessType.FIELD )
 public class DataValueSet
 {
+
+   // ---------------------------------------------------------------------------
+   // Element and attribute names
+   // ---------------------------------------------------------------------------
+
+    public static final String ATTR_COMMENT = "comment";
+
+    public static final String ATTR_DATASET = "dataSet";
+
+    public static final String ATTR_IDSCHEME = "idScheme";
+
+    public static final String ATTR_ORGUNIT = "orgUnit";
+
+    public static final String ATTR_PERIOD = "period";
+
+    public static final String ATTR_COMPLETE = "period";
+
+    public static final String DATAVALUE = "dataValue";
+
+   // ---------------------------------------------------------------------------
+
     public enum IdentificationStrategy { INTERNAL, UUID, CODE  };
 
     /**
@@ -46,22 +67,22 @@
      */
     public static final IdentificationStrategy DEFAULT_STRATEGY = IdentificationStrategy.UUID;
 
-    @XmlAttribute( name = "dataSet" )
+    @XmlAttribute( name = ATTR_DATASET )
     private String dataSetIdentifier;
 
-    @XmlAttribute( name = "orgUnit" )
+    @XmlAttribute( name = ATTR_ORGUNIT )
     private String organisationUnitIdentifier;
 
-    @XmlAttribute( name = "period", required = true )
+    @XmlAttribute( name = ATTR_PERIOD, required = true )
     private String periodIsoDate;
 
-    @XmlAttribute( name = "complete" )
+    @XmlAttribute( name = ATTR_COMPLETE )
     private String completeDate;
 
-    @XmlAttribute( name = "idScheme" )
+    @XmlAttribute( name = ATTR_IDSCHEME )
     private IdentificationStrategy idScheme;
 
-    @XmlElement( name = "dataValue" )
+    @XmlElement( name = DATAVALUE )
     private List<DataValue> dataValues;
 
     public IdentificationStrategy getIdScheme()

=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf2/model/Dxf.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf2/model/Dxf.java	2011-02-25 04:16:18 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf2/model/Dxf.java	2011-09-06 16:29:46 +0000
@@ -40,12 +40,30 @@
 public class Dxf
 {
 
+   // ---------------------------------------------------------------------------
+   // Element and attribute names
+   // ---------------------------------------------------------------------------
+
+    public static final String NAMESPACE_20 = "http://dhis2.org/schema/dxf/2.0";;
+
+    public static final String DXFROOT = "dxf";
+
+    public static final String ATTRIBUTE_MINOR_VERSION = "minorVersion";
+
+    public static final String ATTRIBUTE_EXPORTED = "exported";
+
+    public static final String DATAVALUESETS = "dataValueSets";
+
+    public static final String DATAVALUESET = "dataValueSet";
+
+    public static final String MINOR_VERSION_10 = "1.0";
+   // ---------------------------------------------------------------------------
     
     @XmlElementWrapper( name="dataSets" )
     @XmlElement( name="dataSet" )
     private List<DataSet> dataSets;
 
-    @XmlElementWrapper( name="dataValueSets" )
+    @XmlElementWrapper( name=DATAVALUESETS )
     @XmlElement( name="dataValueSet" )
     private List<DataValueSet> dataValueSets;