dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #15293
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5475: WIP. dxf 1.0 upgrade to cater for identifiable objects and backward compatibility.
------------------------------------------------------------
revno: 5475
committer: Bob Jolliffe bobjolliffe@xxxxxxxxx
branch nick: dhis2
timestamp: Mon 2011-12-19 13:10:25 +0000
message:
WIP. dxf 1.0 upgrade to cater for identifiable objects and backward compatibility.
modified:
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/ChartConverter.java
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/ConceptConverter.java
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/ConstantConverter.java
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/DXFConverter.java
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/DataDictionaryConverter.java
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/DataElementCategoryComboConverter.java
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/DataElementCategoryConverter.java
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/DataElementCategoryOptionComboConverter.java
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/DataElementCategoryOptionConverter.java
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/DataElementConverter.java
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/DataElementGroupConverter.java
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/DataElementGroupSetConverter.java
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/DataSetConverter.java
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/GroupSetConverter.java
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/IndicatorConverter.java
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/IndicatorGroupConverter.java
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/IndicatorGroupSetConverter.java
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/IndicatorTypeConverter.java
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/OrganisationUnitConverter.java
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/exporter/DefaultDXFExportService.java
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/importer/DataElementCategoryOptionImporter.java
dhis-2/dhis-services/dhis-service-importexport/src/test/java/org/hisp/dhis/importexport/dxf/DXFImportServiceTest.java
dhis-2/dhis-services/dhis-service-importexport/src/test/resources/changeroot.xml
dhis-2/dhis-services/dhis-service-importexport/src/test/resources/dxfA.xml
dhis-2/dhis-services/dhis-service-importexport/src/test/resources/dxfC.xml
--
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/dxf/converter/ChartConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/ChartConverter.java 2011-12-18 21:18:21 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/ChartConverter.java 2011-12-19 13:10:25 +0000
@@ -54,6 +54,8 @@
public static final String ELEMENT_NAME = "chart";
private static final String FIELD_ID = "id";
+ private static final String FIELD_UID = "uid";
+ private static final String FIELD_CODE = "code";
private static final String FIELD_TITLE = "title";
private static final String FIELD_TYPE = "type";
private static final String FIELD_SIZE = "size";
@@ -131,6 +133,8 @@
writer.openElement( ELEMENT_NAME );
writer.writeElement( FIELD_ID, String.valueOf( chart.getId() ) );
+ writer.writeElement( FIELD_UID, String.valueOf( chart.getUid() ) ); //v1.2.1
+ writer.writeElement( FIELD_CODE, String.valueOf( chart.getCode() ) ); // v1.2.1
writer.writeElement( FIELD_TITLE, String.valueOf( chart.getName() ) );
writer.writeElement( FIELD_TYPE, String.valueOf( chart.getType() ) );
writer.writeElement( FIELD_SIZE, String.valueOf( chart.getSize() ) );
@@ -189,6 +193,13 @@
reader.moveToStartElement( FIELD_ID );
chart.setId( Integer.parseInt( reader.getElementValue() ) );
+ if (params.minorVersionGreaterOrEqual( "1.3")) {
+ reader.moveToStartElement( FIELD_UID );
+ chart.setUid( reader.getElementValue() );
+ reader.moveToStartElement( FIELD_CODE );
+ chart.setCode( reader.getElementValue() );
+ }
+
reader.moveToStartElement( FIELD_TITLE );
chart.setName( reader.getElementValue() );
=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/ConceptConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/ConceptConverter.java 2011-01-17 11:14:18 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/ConceptConverter.java 2011-12-19 13:10:25 +0000
@@ -59,6 +59,10 @@
private static final String FIELD_ID = "id";
+ private static final String FIELD_UID = "uid";
+
+ private static final String FIELD_CODE = "code";
+
private static final String FIELD_NAME = "name";
// -------------------------------------------------------------------------
@@ -106,6 +110,8 @@
writer.openElement( ELEMENT_NAME );
writer.writeElement( FIELD_ID, String.valueOf( concept.getId() ) );
+ writer.writeElement( FIELD_UID, String.valueOf( concept.getUid() ) );
+ writer.writeElement( FIELD_CODE, String.valueOf( concept.getCode() ) );
writer.writeElement( FIELD_NAME, concept.getName() );
writer.closeElement();
@@ -124,6 +130,15 @@
final Concept concept = new Concept();
concept.setId( Integer.parseInt( values.get( FIELD_ID ) ) );
+
+ if (params.minorVersionGreaterOrEqual( "1.3") ) {
+ reader.moveToStartElement( FIELD_UID );
+ concept.setUid( reader.getElementValue() );
+ reader.moveToStartElement( FIELD_CODE );
+ concept.setCode( reader.getElementValue() );
+ }
+
+
concept.setName( values.get( FIELD_NAME ) );
importObject( concept, params );
=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/ConstantConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/ConstantConverter.java 2011-07-14 03:41:36 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/ConstantConverter.java 2011-12-19 13:10:25 +0000
@@ -55,6 +55,10 @@
private static final String FIELD_ID = "id";
+ private static final String FIELD_UID = "uid";
+
+ private static final String FIELD_CODE = "code";
+
private static final String FIELD_NAME = "name";
private static final String FIELD_VALUE = "value";
@@ -104,6 +108,8 @@
writer.openElement( ELEMENT_NAME );
writer.writeElement( FIELD_ID, String.valueOf( constant.getId() ) );
+ writer.writeElement( FIELD_UID, String.valueOf( constant.getUid() ) );
+ writer.writeElement( FIELD_CODE, String.valueOf( constant.getCode() ) );
writer.writeElement( FIELD_NAME, constant.getName() );
writer.writeElement( FIELD_VALUE, String.valueOf( constant.getValue() ) );
@@ -123,6 +129,13 @@
final Constant constant = new Constant();
constant.setId( Integer.parseInt( results.get( FIELD_ID ) ) );
+ if (params.minorVersionGreaterOrEqual( "1.3") ) {
+ reader.moveToStartElement( FIELD_UID );
+ constant.setUid( reader.getElementValue() );
+ reader.moveToStartElement( FIELD_CODE );
+ constant.setCode( reader.getElementValue() );
+ }
+
constant.setName( results.get( FIELD_NAME ) );
constant.setValue( Double.parseDouble( results.get( FIELD_VALUE ) ) );
=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/DXFConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/DXFConverter.java 2011-12-18 21:21:20 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/DXFConverter.java 2011-12-19 13:10:25 +0000
@@ -145,7 +145,7 @@
public static final String MINOR_VERSION_12 = "1.2";
- public static final String MINOR_VERSION_121 = "1.2.1";
+ public static final String MINOR_VERSION_13 = "1.3";
private final Log log = LogFactory.getLog( DXFConverter.class );
=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/DataDictionaryConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/DataDictionaryConverter.java 2010-05-29 16:06:56 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/DataDictionaryConverter.java 2011-12-19 13:10:25 +0000
@@ -52,6 +52,8 @@
public static final String ELEMENT_NAME = "dataDictionary";
private static final String FIELD_ID = "id";
+ private static final String FIELD_UID = "uid";
+ private static final String FIELD_CODE = "code";
private static final String FIELD_NAME = "name";
private static final String FIELD_DESCRIPTION = "description";
private static final String FIELD_REGION = "region";
@@ -101,6 +103,8 @@
writer.openElement( ELEMENT_NAME );
writer.writeElement( FIELD_ID, String.valueOf( dictionary.getId() ) );
+ writer.writeElement( FIELD_UID, String.valueOf( dictionary.getUid() ) );
+ writer.writeElement( FIELD_CODE, String.valueOf( dictionary.getCode() ) );
writer.writeElement( FIELD_NAME, dictionary.getName() );
writer.writeElement( FIELD_DESCRIPTION, dictionary.getDescription() );
writer.writeElement( FIELD_REGION, dictionary.getRegion() );
@@ -121,6 +125,14 @@
final DataDictionary dictionary = new DataDictionary();
dictionary.setId( Integer.parseInt( values.get( FIELD_ID ) ) );
+
+ if (params.minorVersionGreaterOrEqual( "1.3") ) {
+ reader.moveToStartElement( FIELD_UID );
+ dictionary.setUid( reader.getElementValue() );
+ reader.moveToStartElement( FIELD_CODE );
+ dictionary.setCode( reader.getElementValue() );
+ }
+
dictionary.setName( values.get( FIELD_NAME ) );
dictionary.setDescription( values.get( FIELD_DESCRIPTION ) );
dictionary.setRegion( values.get( FIELD_REGION ) );
=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/DataElementCategoryComboConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/DataElementCategoryComboConverter.java 2010-05-29 16:06:56 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/DataElementCategoryComboConverter.java 2011-12-19 13:10:25 +0000
@@ -52,6 +52,8 @@
public static final String ELEMENT_NAME = "categoryCombo";
private static final String FIELD_ID = "id";
+ private static final String FIELD_UID = "uid";
+ private static final String FIELD_CODE = "code";
private static final String FIELD_NAME = "name";
// -------------------------------------------------------------------------
@@ -100,6 +102,8 @@
writer.openElement( ELEMENT_NAME );
writer.writeElement( FIELD_ID, String.valueOf( categoryCombo.getId() ) );
+ writer.writeElement( FIELD_UID, String.valueOf( categoryCombo.getUid() ) );
+ writer.writeElement( FIELD_CODE, String.valueOf( categoryCombo.getCode() ) );
writer.writeElement( FIELD_NAME, categoryCombo.getName() );
writer.closeElement();
@@ -118,6 +122,13 @@
final DataElementCategoryCombo categoryCombo = new DataElementCategoryCombo();
categoryCombo.setId( Integer.parseInt( values.get( FIELD_ID ) ) );
+
+ if (params.minorVersionGreaterOrEqual( "1.3") )
+ {
+ categoryCombo.setUid( values.get( FIELD_UID) );
+ categoryCombo.setCode( values.get( FIELD_CODE) );
+ }
+
categoryCombo.setName( values.get( FIELD_NAME ) );
importObject( categoryCombo, params );
=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/DataElementCategoryConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/DataElementCategoryConverter.java 2010-12-23 11:56:44 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/DataElementCategoryConverter.java 2011-12-19 13:10:25 +0000
@@ -58,6 +58,8 @@
public static final String ELEMENT_NAME = "category";
private static final String FIELD_ID = "id";
+ private static final String FIELD_UID = "uid";
+ private static final String FIELD_CODE = "code";
private static final String FIELD_NAME = "name";
private static final String FIELD_CONCEPT_ID = "conceptid";
@@ -112,6 +114,8 @@
writer.openElement( ELEMENT_NAME );
writer.writeElement( FIELD_ID, String.valueOf( category.getId() ) );
+ writer.writeElement( FIELD_UID, String.valueOf( category.getId() ) );
+ writer.writeElement( FIELD_CODE, String.valueOf( category.getId() ) );
writer.writeElement( FIELD_NAME, category.getName() );
writer.writeElement( FIELD_CONCEPT_ID, String.valueOf( category.getConcept() == null ? BLANK : category
.getConcept().getId() ) );
@@ -136,6 +140,12 @@
final DataElementCategory category = new DataElementCategory();
category.setId( Integer.parseInt( values.get( FIELD_ID ) ) );
+
+ if (params.minorVersionGreaterOrEqual( "1.3") ) {
+ category.setUid( values.get( FIELD_UID) );
+ category.setCode( values.get( FIELD_CODE) );
+ }
+
category.setName( values.get( FIELD_NAME ) );
if ( params.minorVersionGreaterOrEqual( MINOR_VERSION_12 ) && values.get( FIELD_CONCEPT_ID ) != null )
=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/DataElementCategoryOptionComboConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/DataElementCategoryOptionComboConverter.java 2010-07-02 12:53:57 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/DataElementCategoryOptionComboConverter.java 2011-12-19 13:10:25 +0000
@@ -49,28 +49,35 @@
public class DataElementCategoryOptionComboConverter
extends DataElementCategoryOptionComboImporter implements XMLConverter
{
+
public static final String COLLECTION_NAME = "categoryOptionCombos";
+
public static final String ELEMENT_NAME = "categoryOptionCombo";
-
+
private static final String FIELD_ID = "id";
+
+ private static final String FIELD_UID = "uid";
+
+ private static final String FIELD_CODE = "code";
+
private static final String FIELD_NAME = "name";
private static final String SUB_ELEMENT_NAME = "categoryCombo";
-
+
private static final String SUB_COLLECTION_NAME = "categoryOptions";
+
private static final String SUB_COLLECTION_ELEMENT_NAME = "categoryOption";
// -------------------------------------------------------------------------
// Properties
// -------------------------------------------------------------------------
-
private Map<Object, Integer> categoryComboMapping;
+
private Map<Object, Integer> categoryOptionMapping;
-
+
// -------------------------------------------------------------------------
// Constructor
// -------------------------------------------------------------------------
-
/**
* Constructor for write operations.
*/
@@ -78,7 +85,7 @@
{
this.categoryService = categoryService;
}
-
+
/**
* Constructor for read operations.
*
@@ -94,36 +101,39 @@
this.categoryComboMapping = categoryComboMapping;
this.categoryOptionMapping = categoryOptionMapping;
this.categoryService = categoryService;
- }
+ }
// -------------------------------------------------------------------------
// XMLConverter implementation
// -------------------------------------------------------------------------
-
public void write( XMLWriter writer, ExportParams params )
{
- Collection<DataElementCategoryOptionCombo> categoryOptionCombos =
+ Collection<DataElementCategoryOptionCombo> categoryOptionCombos =
categoryService.getDataElementCategoryOptionCombos( params.getCategoryOptionCombos() );
-
+
if ( categoryOptionCombos != null && categoryOptionCombos.size() > 0 )
{
writer.openElement( COLLECTION_NAME );
-
+
for ( DataElementCategoryOptionCombo categoryOptionCombo : categoryOptionCombos )
{
writer.openElement( ELEMENT_NAME );
-
+
writer.writeElement( FIELD_ID, String.valueOf( categoryOptionCombo.getId() ) );
-
+
+ writer.writeElement( FIELD_UID, String.valueOf( categoryOptionCombo.getUid() ) );
+
+ writer.writeElement( FIELD_CODE, String.valueOf( categoryOptionCombo.getCode() ) );
+
// -------------------------------------------------------------
// Write CategoryCombo
// -------------------------------------------------------------
writer.openElement( SUB_ELEMENT_NAME );
-
+
writer.writeElement( FIELD_ID, String.valueOf( categoryOptionCombo.getCategoryCombo().getId() ) );
writer.writeElement( FIELD_NAME, categoryOptionCombo.getCategoryCombo().getName() );
-
+
writer.closeElement();
// -------------------------------------------------------------
@@ -135,55 +145,63 @@
for ( DataElementCategoryOption categoryOption : categoryOptionCombo.getCategoryOptions() )
{
writer.openElement( SUB_COLLECTION_ELEMENT_NAME );
-
+
writer.writeElement( FIELD_ID, String.valueOf( categoryOption.getId() ) );
writer.writeElement( FIELD_NAME, String.valueOf( categoryOption.getName() ) );
-
+
writer.closeElement();
}
-
+
writer.closeElement();
-
+
writer.closeElement();
}
-
+
writer.closeElement();
}
}
-
+
public void read( XMLReader reader, ImportParams params )
{
while ( reader.moveToStartElement( ELEMENT_NAME, COLLECTION_NAME ) )
{
final DataElementCategoryOptionCombo categoryOptionCombo = new DataElementCategoryOptionCombo();
-
+
reader.moveToStartElement( FIELD_ID );
categoryOptionCombo.setId( Integer.parseInt( reader.getElementValue() ) );
-
+
+ if ( params.minorVersionGreaterOrEqual( "1.3") )
+ {
+ reader.moveToStartElement( FIELD_UID );
+ categoryOptionCombo.setUid( reader.getElementValue() );
+ reader.moveToStartElement( FIELD_CODE );
+ categoryOptionCombo.setCode( reader.getElementValue() );
+ }
+
+
reader.moveToStartElement( FIELD_ID );
int categoryComboId = Integer.parseInt( reader.getElementValue() );
-
+
reader.moveToStartElement( FIELD_NAME );
String categoryComboName = reader.getElementValue();
- log.debug( categoryComboName + ": " + categoryComboId + "-" + categoryOptionCombo.getId());
+ log.debug( categoryComboName + ": " + categoryComboId + "-" + categoryOptionCombo.getId() );
// -----------------------------------------------------------------
// Setting the persisted CategoryCombo on the CategoryOptionCombo
// if not in preview
// -----------------------------------------------------------------
DataElementCategoryCombo categoryCombo = new DataElementCategoryCombo();
-
+
if ( params.isPreview() )
- {
+ {
categoryCombo.setId( categoryComboId );
categoryCombo.setName( categoryComboName );
- }
- else
+ } else
{
categoryCombo = categoryService.getDataElementCategoryCombo( categoryComboMapping.get( categoryComboId ) );
}
-
+
categoryOptionCombo.setCategoryCombo( categoryCombo );
// -----------------------------------------------------------------
@@ -194,26 +212,25 @@
while ( reader.moveToStartElement( SUB_COLLECTION_ELEMENT_NAME, SUB_COLLECTION_NAME ) )
{
DataElementCategoryOption categoryOption = new DataElementCategoryOption();
-
- reader.moveToStartElement( FIELD_ID );
+
+ reader.moveToStartElement( FIELD_ID );
int categoryOptionId = Integer.parseInt( reader.getElementValue() );
-
+
reader.moveToStartElement( FIELD_NAME );
String categoryOptionName = reader.getElementValue();
-
+
if ( params.isPreview() )
{
categoryOption.setId( categoryOptionId );
categoryOption.setName( categoryOptionName );
- }
- else
+ } else
{
- categoryOption = categoryService.getDataElementCategoryOption( categoryOptionMapping.get( categoryOptionId ) );
+ categoryOption = categoryService.getDataElementCategoryOption( categoryOptionMapping.get( categoryOptionId ) );
}
-
+
categoryOptionCombo.getCategoryOptions().add( categoryOption );
}
-
+
importObject( categoryOptionCombo, params );
}
}
=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/DataElementCategoryOptionConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/DataElementCategoryOptionConverter.java 2010-05-29 16:06:56 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/DataElementCategoryOptionConverter.java 2011-12-19 13:10:25 +0000
@@ -52,6 +52,8 @@
public static final String ELEMENT_NAME = "categoryOption";
private static final String FIELD_ID = "id";
+ private static final String FIELD_UID = "uid";
+ private static final String FIELD_CODE = "code";
private static final String FIELD_NAME = "name";
// -------------------------------------------------------------------------
@@ -99,6 +101,8 @@
writer.openElement( ELEMENT_NAME );
writer.writeElement( FIELD_ID, String.valueOf( categoryOption.getId() ) );
+ writer.writeElement( FIELD_UID, String.valueOf( categoryOption.getUid() ) );
+ writer.writeElement( FIELD_CODE, categoryOption.getCode() );
writer.writeElement( FIELD_NAME, categoryOption.getName() );
writer.closeElement();
@@ -115,10 +119,19 @@
final Map<String, String> values = reader.readElements( ELEMENT_NAME );
final DataElementCategoryOption categoryOption = new DataElementCategoryOption();
-
+
categoryOption.setId( Integer.parseInt( values.get( FIELD_ID ) ) );
+
+ if ( params.minorVersionGreaterOrEqual( "1.3") )
+ {
+ categoryOption.setUid( values.get( FIELD_UID) );
+ }
+
+ if (params.minorVersionGreaterOrEqual( "1.2") ) {
+ categoryOption.setCode( values.get( FIELD_CODE ) );
+ }
+
categoryOption.setName( values.get( FIELD_NAME ) );
-
importObject( categoryOption, params );
}
}
=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/DataElementConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/DataElementConverter.java 2011-11-22 15:48:30 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/DataElementConverter.java 2011-12-19 13:10:25 +0000
@@ -55,10 +55,11 @@
public static final String ELEMENT_NAME = "dataElement";
private static final String FIELD_ID = "id";
+ private static final String FIELD_UID = "uid";
+ private static final String FIELD_CODE = "code";
private static final String FIELD_NAME = "name";
private static final String FIELD_ALTERNATIVE_NAME = "alternativeName";
private static final String FIELD_SHORT_NAME = "shortName";
- private static final String FIELD_CODE = "code";
private static final String FIELD_DESCRIPTION = "description";
private static final String FIELD_ACTIVE = "active";
private static final String FIELD_TYPE = "type";
@@ -123,10 +124,11 @@
writer.openElement( ELEMENT_NAME );
writer.writeElement( FIELD_ID, String.valueOf( element.getId() ) );
+ writer.writeElement( FIELD_UID, String.valueOf( element.getUid() ) );
writer.writeElement( FIELD_NAME, element.getName() );
writer.writeElement( FIELD_ALTERNATIVE_NAME, element.getAlternativeName() );
writer.writeElement( FIELD_SHORT_NAME, element.getShortName() );
- writer.writeElement( FIELD_CODE, element.getCode() );
+ writer.writeElement( FIELD_CODE, element.getCode() ); // historic positioning from v1.2 :-(
writer.writeElement( FIELD_DESCRIPTION, element.getDescription() );
writer.writeElement( FIELD_ACTIVE, String.valueOf( element.isActive() ) );
writer.writeElement( FIELD_TYPE, element.getType() );
@@ -154,10 +156,20 @@
element.setCategoryCombo( categoryCombo );
element.setId( Integer.parseInt( values.get( FIELD_ID ) ) );
+
+ if ( params.minorVersionGreaterOrEqual( "1.2" ))
+ {
+ element.setUid( values.get( FIELD_UID ) );
+ }
+
element.setName( values.get( FIELD_NAME ) );
element.setAlternativeName( values.get( FIELD_ALTERNATIVE_NAME ) );
element.setShortName( values.get( FIELD_SHORT_NAME ) );
- element.setCode( values.get( FIELD_CODE ) );
+
+ if ( params.minorVersionGreaterOrEqual( "1.2" )) {
+ element.setCode( values.get( FIELD_CODE ) );
+ }
+
element.setDescription( values.get( FIELD_DESCRIPTION ) );
element.setActive( Boolean.parseBoolean( values.get( FIELD_ACTIVE ) ) );
element.setType( values.get( FIELD_TYPE ) );
=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/DataElementGroupConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/DataElementGroupConverter.java 2011-11-22 15:48:30 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/DataElementGroupConverter.java 2011-12-19 13:10:25 +0000
@@ -52,6 +52,8 @@
public static final String ELEMENT_NAME = "dataElementGroup";
private static final String FIELD_ID = "id";
+ private static final String FIELD_UID = "uid";
+ private static final String FIELD_CODE = "code";
private static final String FIELD_NAME = "name";
// -------------------------------------------------------------------------
@@ -99,6 +101,8 @@
writer.openElement( ELEMENT_NAME );
writer.writeElement( FIELD_ID, String.valueOf( group.getId() ) );
+ writer.writeElement( FIELD_UID, String.valueOf( group.getUid() ) );
+ writer.writeElement( FIELD_CODE, String.valueOf( group.getCode() ) );
writer.writeElement( FIELD_NAME, group.getName() );
writer.closeElement();
@@ -117,6 +121,13 @@
final DataElementGroup group = new DataElementGroup();
group.setId( Integer.parseInt( values.get( FIELD_ID ) ) );
+
+ if ( params.minorVersionGreaterOrEqual( "1.3") )
+ {
+ group.setUid( values.get( FIELD_UID ) );
+ group.setCode( values.get( FIELD_CODE) );
+ }
+
group.setName( values.get( FIELD_NAME ) );
importObject( group, params );
=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/DataElementGroupSetConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/DataElementGroupSetConverter.java 2011-11-22 15:48:30 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/DataElementGroupSetConverter.java 2011-12-19 13:10:25 +0000
@@ -52,6 +52,8 @@
public static final String ELEMENT_NAME = "dataElementGroupSet";
private static final String FIELD_ID = "id";
+ private static final String FIELD_UID = "uid";
+ private static final String FIELD_CODE = "code";
private static final String FIELD_NAME = "name";
// -------------------------------------------------------------------------
@@ -90,6 +92,8 @@
writer.openElement( ELEMENT_NAME );
writer.writeElement( FIELD_ID, String.valueOf( groupSet.getId() ) );
+ writer.writeElement( FIELD_UID, String.valueOf( groupSet.getUid() ) );
+ writer.writeElement( FIELD_CODE, String.valueOf( groupSet.getCode() ) );
writer.writeElement( FIELD_NAME, groupSet.getName() );
writer.closeElement();
@@ -109,6 +113,13 @@
final DataElementGroupSet groupSet = new DataElementGroupSet();
groupSet.setId( Integer.parseInt( values.get( FIELD_ID ) ) );
+
+ if ( params.minorVersionGreaterOrEqual( "1.3") )
+ {
+ groupSet.setUid( values.get( FIELD_UID) );
+ groupSet.setCode( values.get( FIELD_CODE) );
+ }
+
groupSet.setName( values.get( FIELD_NAME ) );
importObject( groupSet, params );
=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/DataSetConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/DataSetConverter.java 2011-11-22 15:48:30 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/DataSetConverter.java 2011-12-19 13:10:25 +0000
@@ -55,6 +55,7 @@
public static final String ELEMENT_NAME = "dataSet";
private static final String FIELD_ID = "id";
+ private static final String FIELD_UID = "uid";
private static final String FIELD_NAME = "name";
private static final String FIELD_SHORT_NAME = "shortName";
private static final String FIELD_CODE = "code";
@@ -123,6 +124,7 @@
writer.openElement( ELEMENT_NAME );
writer.writeElement( FIELD_ID, String.valueOf( dataSet.getId() ) );
+ writer.writeElement( FIELD_UID, String.valueOf( dataSet.getUid() ) );
writer.writeCData( FIELD_NAME, dataSet.getName() );
writer.writeCData( FIELD_SHORT_NAME, dataSet.getShortName() );
writer.writeElement( FIELD_CODE, dataSet.getCode() );
@@ -147,9 +149,20 @@
final Map<String, String> values = reader.readElements( ELEMENT_NAME );
dataSet.setId( Integer.parseInt( values.get( FIELD_ID ) ) );
+
+ if ( params.minorVersionGreaterOrEqual( "1.3") )
+ {
+ dataSet.setUid( values.get( FIELD_UID) );
+ }
+
dataSet.setName( values.get( FIELD_NAME ) );
dataSet.setShortName( values.get( FIELD_SHORT_NAME ) );
- dataSet.setCode( values.get( FIELD_CODE ) );
+
+ if ( params.minorVersionGreaterOrEqual( "1.2") )
+ {
+ dataSet.setCode( values.get( FIELD_CODE ) );
+ }
+
dataSet.getPeriodType().setId( periodTypeMapping.get( values.get( FIELD_PERIOD_TYPE ) ) );
importObject( dataSet, params );
=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/GroupSetConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/GroupSetConverter.java 2010-05-29 16:06:56 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/GroupSetConverter.java 2011-12-19 13:10:25 +0000
@@ -52,6 +52,8 @@
public static final String ELEMENT_NAME = "groupSet";
private static final String FIELD_ID = "id";
+ private static final String FIELD_UID = "uid";
+ private static final String FIELD_CODE = "code";
private static final String FIELD_NAME = "name";
private static final String FIELD_DESCRIPTION = "description";
private static final String FIELD_COMPULSORY = "compulsory";
@@ -102,6 +104,8 @@
writer.openElement( ELEMENT_NAME );
writer.writeElement( FIELD_ID, String.valueOf( groupSet.getId() ) );
+ writer.writeElement( FIELD_UID, String.valueOf( groupSet.getUid() ) );
+ writer.writeElement( FIELD_CODE, String.valueOf( groupSet.getCode() ) );
writer.writeElement( FIELD_NAME, groupSet.getName() );
writer.writeElement( FIELD_DESCRIPTION, groupSet.getDescription() );
writer.writeElement( FIELD_COMPULSORY, String.valueOf( groupSet.isCompulsory() ) );
@@ -122,6 +126,13 @@
final OrganisationUnitGroupSet groupSet = new OrganisationUnitGroupSet();
groupSet.setId( Integer.parseInt( values.get( FIELD_ID ) ) );
+
+ if ( params.minorVersionGreaterOrEqual( "1.3") )
+ {
+ groupSet.setUid( values.get( FIELD_UID ) );
+ groupSet.setCode( values.get( FIELD_CODE ) );
+ }
+
groupSet.setName( values.get( FIELD_NAME ) );
groupSet.setDescription( values.get( FIELD_DESCRIPTION ) );
groupSet.setCompulsory( Boolean.parseBoolean( values.get( FIELD_COMPULSORY ) ) );
=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/IndicatorConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/IndicatorConverter.java 2011-11-23 18:07:35 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/IndicatorConverter.java 2011-12-19 13:10:25 +0000
@@ -56,6 +56,7 @@
public static final String ELEMENT_NAME = "indicator";
private static final String FIELD_ID = "id";
+ private static final String FIELD_UID = "uid";
private static final String FIELD_NAME = "name";
private static final String FIELD_ALTERNATIVE_NAME = "alternativeName";
private static final String FIELD_SHORT_NAME = "shortName";
@@ -140,6 +141,7 @@
writer.openElement( ELEMENT_NAME );
writer.writeElement( FIELD_ID, String.valueOf( indicator.getId() ) );
+ writer.writeElement( FIELD_UID, String.valueOf( indicator.getUid() ) );
writer.writeElement( FIELD_NAME, indicator.getName() );
writer.writeElement( FIELD_ALTERNATIVE_NAME, indicator.getAlternativeName() );
writer.writeElement( FIELD_SHORT_NAME, indicator.getShortName() );
@@ -171,10 +173,21 @@
final IndicatorType type = new IndicatorType();
indicator.setIndicatorType( type );
indicator.setId( Integer.parseInt( values.get( FIELD_ID ) ) );
+
+ if ( params.minorVersionGreaterOrEqual( "1.3" ) )
+ {
+ indicator.setUid( values.get( FIELD_UID) );
+ }
+
indicator.setName( values.get( FIELD_NAME ) );
indicator.setAlternativeName( values.get( FIELD_ALTERNATIVE_NAME ) );
indicator.setShortName( values.get( FIELD_SHORT_NAME ) );
- indicator.setCode( values.get( FIELD_CODE ) );
+
+ if ( params.minorVersionGreaterOrEqual( "1.2" ) )
+ {
+ indicator.setCode( values.get( FIELD_CODE ) );
+ }
+
indicator.setDescription( values.get( FIELD_DESCRIPTION ) );
indicator.setAnnualized( Boolean.parseBoolean( values.get( FIELD_ANNUALIZED ) ) );
indicator.getIndicatorType().setId( indicatorTypeMapping.get( Integer.parseInt( values.get( FIELD_INDICATOR_TYPE ) ) ) );
=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/IndicatorGroupConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/IndicatorGroupConverter.java 2011-11-22 15:48:30 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/IndicatorGroupConverter.java 2011-12-19 13:10:25 +0000
@@ -52,6 +52,8 @@
public static final String ELEMENT_NAME = "indicatorGroup";
private static final String FIELD_ID = "id";
+ private static final String FIELD_UID = "uid";
+ private static final String FIELD_CODE = "code";
private static final String FIELD_NAME = "name";
// -------------------------------------------------------------------------
@@ -99,6 +101,8 @@
writer.openElement( ELEMENT_NAME );
writer.writeElement( FIELD_ID, String.valueOf( group.getId() ) );
+ writer.writeElement( FIELD_UID, String.valueOf( group.getUid() ) );
+ writer.writeElement( FIELD_CODE, String.valueOf( group.getCode() ) );
writer.writeElement( FIELD_NAME, group.getName() );
writer.closeElement();
@@ -117,6 +121,12 @@
final IndicatorGroup group = new IndicatorGroup();
group.setId( Integer.parseInt( values.get( FIELD_ID ) ) );
+
+ if (params.minorVersionGreaterOrEqual( "1.3") ) {
+ group.setUid( values.get( FIELD_UID) );
+ group.setCode( values.get( FIELD_CODE) );
+ }
+
group.setName( values.get( FIELD_NAME ) );
importObject( group, params );
=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/IndicatorGroupSetConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/IndicatorGroupSetConverter.java 2011-11-22 15:48:30 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/IndicatorGroupSetConverter.java 2011-12-19 13:10:25 +0000
@@ -52,6 +52,8 @@
public static final String ELEMENT_NAME = "indicatorGroupSet";
private static final String FIELD_ID = "id";
+ private static final String FIELD_UID = "uid";
+ private static final String FIELD_CODE = "code";
private static final String FIELD_NAME = "name";
// -------------------------------------------------------------------------
@@ -99,6 +101,8 @@
writer.openElement( ELEMENT_NAME );
writer.writeElement( FIELD_ID, String.valueOf( groupSet.getId() ) );
+ writer.writeElement( FIELD_UID, String.valueOf( groupSet.getUid() ) );
+ writer.writeElement( FIELD_CODE, String.valueOf( groupSet.getCode() ) );
writer.writeElement( FIELD_NAME, groupSet.getName() );
writer.closeElement();
@@ -117,6 +121,12 @@
final IndicatorGroupSet groupSet = new IndicatorGroupSet();
groupSet.setId( Integer.parseInt( values.get( FIELD_ID ) ) );
+
+ if (params.minorVersionGreaterOrEqual( "1.3") ) {
+ groupSet.setUid( values.get( FIELD_UID) );
+ groupSet.setCode( values.get( FIELD_CODE) );
+ }
+
groupSet.setName( values.get( FIELD_NAME ) );
importObject( groupSet, params );
=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/IndicatorTypeConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/IndicatorTypeConverter.java 2010-05-29 16:06:56 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/IndicatorTypeConverter.java 2011-12-19 13:10:25 +0000
@@ -52,6 +52,8 @@
public static final String ELEMENT_NAME = "indicatorType";
private static final String FIELD_ID = "id";
+ private static final String FIELD_UID = "uid";
+ private static final String FIELD_CODE = "code";
private static final String FIELD_NAME = "name";
private static final String FIELD_FACTOR = "factor";
@@ -100,6 +102,8 @@
writer.openElement( ELEMENT_NAME );
writer.writeElement( FIELD_ID, String.valueOf( type.getId() ) );
+ writer.writeElement( FIELD_UID, String.valueOf( type.getUid() ) );
+ writer.writeElement( FIELD_CODE, String.valueOf( type.getCode() ) );
writer.writeElement( FIELD_NAME, type.getName() );
writer.writeElement( FIELD_FACTOR, String.valueOf( type.getFactor() ) );
@@ -119,6 +123,12 @@
final IndicatorType type = new IndicatorType();
type.setId( Integer.parseInt( values.get( FIELD_ID ) ) );
+
+ if (params.minorVersionGreaterOrEqual( "1.3") ) {
+ type.setUid( values.get( FIELD_UID ) );
+ type.setCode( values.get( FIELD_CODE ) );
+ }
+
type.setName( values.get( FIELD_NAME ) );
type.setFactor( Integer.parseInt( values.get( FIELD_FACTOR ) ) );
=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/OrganisationUnitConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/OrganisationUnitConverter.java 2011-11-22 15:48:30 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/OrganisationUnitConverter.java 2011-12-19 13:10:25 +0000
@@ -58,6 +58,7 @@
public static final String ELEMENT_NAME = "organisationUnit";
private static final String FIELD_ID = "id";
+ private static final String FIELD_UID = "uid";
private static final String FIELD_NAME = "name";
private static final String FIELD_SHORT_NAME = "shortName";
private static final String FIELD_CODE = "code";
@@ -119,6 +120,7 @@
writer.openElement( ELEMENT_NAME );
writer.writeElement( FIELD_ID, String.valueOf( unit.getId() ) );
+ writer.writeElement( FIELD_UID, String.valueOf( unit.getUid() ) );
writer.writeElement( FIELD_NAME, unit.getName() );
writer.writeElement( FIELD_SHORT_NAME, unit.getShortName() );
writer.writeElement( FIELD_CODE, unit.getCode() );
@@ -164,6 +166,13 @@
reader.moveToStartElement( FIELD_ID );
unit.setId( Integer.parseInt( reader.getElementValue() ) );
+
+ if ( params.minorVersionGreaterOrEqual( "1.3") )
+ {
+ reader.moveToStartElement( FIELD_UID );
+ unit.setUid( reader.getElementValue() );
+ }
+
reader.moveToStartElement( FIELD_NAME );
unit.setName(reader.getElementValue() );
@@ -171,8 +180,11 @@
reader.moveToStartElement( FIELD_SHORT_NAME );
unit.setShortName( reader.getElementValue() );
- reader.moveToStartElement( FIELD_CODE );
- unit.setCode( reader.getElementValue() );
+ if ( params.minorVersionGreaterOrEqual( "1.2") )
+ {
+ reader.moveToStartElement( FIELD_CODE );
+ unit.setCode( reader.getElementValue() );
+ }
reader.moveToStartElement( FIELD_OPENING_DATE );
unit.setOpeningDate( DateUtils.getMediumDate( reader.getElementValue() ) );
=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/exporter/DefaultDXFExportService.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/exporter/DefaultDXFExportService.java 2011-12-18 21:21:20 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/exporter/DefaultDXFExportService.java 2011-12-19 13:10:25 +0000
@@ -31,7 +31,7 @@
import static org.hisp.dhis.importexport.dxf.converter.DXFConverter.ATTRIBUTE_EXPORTED;
import static org.hisp.dhis.importexport.dxf.converter.DXFConverter.ATTRIBUTE_MINOR_VERSION;
import static org.hisp.dhis.importexport.dxf.converter.DXFConverter.DXFROOT;
-import static org.hisp.dhis.importexport.dxf.converter.DXFConverter.MINOR_VERSION_121;
+import static org.hisp.dhis.importexport.dxf.converter.DXFConverter.MINOR_VERSION_13;
import static org.hisp.dhis.importexport.dxf.converter.DXFConverter.NAMESPACE_10;
import java.io.BufferedInputStream;
@@ -274,7 +274,7 @@
// Writes to one end of the pipe
// -----------------------------------------------------------------
- String[] rootProperties = { ATTRIBUTE_NAMESPACE, NAMESPACE_10, ATTRIBUTE_MINOR_VERSION, MINOR_VERSION_121,
+ String[] rootProperties = { ATTRIBUTE_NAMESPACE, NAMESPACE_10, ATTRIBUTE_MINOR_VERSION, MINOR_VERSION_13,
ATTRIBUTE_EXPORTED, DateUtils.getMediumDateString() };
ExportPipeThread thread = new ExportPipeThread( sessionFactory );
=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/importer/DataElementCategoryOptionImporter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/importer/DataElementCategoryOptionImporter.java 2010-05-31 13:53:07 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/importer/DataElementCategoryOptionImporter.java 2011-12-19 13:10:25 +0000
@@ -71,7 +71,11 @@
@Override
protected void importMatching( DataElementCategoryOption object, DataElementCategoryOption match )
{
- throw new UnsupportedOperationException( "DataElementCategoryOption can only be unique or duplicate" );
+ match.setCode(object.getCode());
+ match.setUid( object.getUid());
+ match.setName( object.getName());
+
+ categoryService.updateDataElementCategoryOption( match );
}
@Override
@@ -83,6 +87,18 @@
@Override
protected boolean isIdentical( DataElementCategoryOption object, DataElementCategoryOption existing )
{
- return object.getName().equals( existing.getName() );
+ boolean codeMatch = true;
+ boolean uidMatch = true;
+
+ // if there is a code that must also match
+ if (object.getCode() != null) {
+ codeMatch = object.getCode().equals( existing.getCode());
+ }
+ // if there is a uid that must also match
+ if (object.getUid() != null) {
+ uidMatch = object.getUid().equals( existing.getUid());
+ }
+
+ return (object.getName().equals( existing.getName()) && codeMatch && uidMatch);
}
}
=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/test/java/org/hisp/dhis/importexport/dxf/DXFImportServiceTest.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/test/java/org/hisp/dhis/importexport/dxf/DXFImportServiceTest.java 2011-02-02 21:37:29 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/test/java/org/hisp/dhis/importexport/dxf/DXFImportServiceTest.java 2011-12-19 13:10:25 +0000
@@ -270,7 +270,7 @@
importService.importData( importParams, inputStreamH );
- assertObjects( dataASize );
+ assertEquals( categoryService.getAllDataElementCategoryOptions().size(), 5 );
}
@Ignore
@@ -370,7 +370,7 @@
importService.importData( importParams, inputStreamC );
- assertUpdateableImportObjects( ImportObjectStatus.UPDATE, dataASize );
+ assertUpdateableImportObjects( ImportObjectStatus.UPDATE, dataASize );
assertImportObjects( ImportObjectStatus.NEW, dataCSize - dataASize );
=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/test/resources/changeroot.xml'
--- dhis-2/dhis-services/dhis-service-importexport/src/test/resources/changeroot.xml 2010-12-05 17:38:27 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/test/resources/changeroot.xml 2011-12-19 13:10:25 +0000
@@ -24,600 +24,4 @@
<name>categoryOptionD</name>
</categoryOption>
</categoryOptions>
- <categories>
- <category>
- <id>65</id>
- <name>categoryA</name>
- <conceptid>1</conceptid>
- </category>
- <category>
- <id>66</id>
- <name>categoryB</name>
- <conceptid>1</conceptid>
- </category>
- </categories>
- <categoryCombos>
- <categoryCombo>
- <id>65</id>
- <name>categoryComboA</name>
- </categoryCombo>
- <categoryCombo>
- <id>66</id>
- <name>categoryComboB</name>
- </categoryCombo>
- </categoryCombos>
- <categoryOptionCombos>
- <categoryOptionCombo>
- <id>65</id>
- <categoryCombo>
- <id>65</id>
- <name>categoryComboA</name>
- </categoryCombo>
- <categoryOptions>
- <categoryOption>
- <id>65</id>
- <name>categoryOptionA</name>
- </categoryOption>
- <categoryOption>
- <id>67</id>
- <name>categoryOptionC</name>
- </categoryOption>
- </categoryOptions>
- </categoryOptionCombo>
- <categoryOptionCombo>
- <id>66</id>
- <categoryCombo>
- <id>65</id>
- <name>categoryComboA</name>
- </categoryCombo>
- <categoryOptions>
- <categoryOption>
- <id>66</id>
- <name>categoryOptionB</name>
- </categoryOption>
- <categoryOption>
- <id>68</id>
- <name>categoryOptionD</name>
- </categoryOption>
- </categoryOptions>
- </categoryOptionCombo>
- <categoryOptionCombo>
- <id>67</id>
- <categoryCombo>
- <id>66</id>
- <name>categoryComboB</name>
- </categoryCombo>
- <categoryOptions>
- <categoryOption>
- <id>65</id>
- <name>categoryOptionA</name>
- </categoryOption>
- </categoryOptions>
- </categoryOptionCombo>
- <categoryOptionCombo>
- <id>68</id>
- <categoryCombo>
- <id>66</id>
- <name>categoryComboB</name>
- </categoryCombo>
- <categoryOptions>
- <categoryOption>
- <id>66</id>
- <name>categoryOptionB</name>
- </categoryOption>
- </categoryOptions>
- </categoryOptionCombo>
- </categoryOptionCombos>
- <categoryCategoryOptionAssociations>
- <categoryCategoryOptionAssociation>
- <category>65</category>
- <categoryOption>65</categoryOption>
- </categoryCategoryOptionAssociation>
- <categoryCategoryOptionAssociation>
- <category>65</category>
- <categoryOption>66</categoryOption>
- </categoryCategoryOptionAssociation>
- <categoryCategoryOptionAssociation>
- <category>66</category>
- <categoryOption>68</categoryOption>
- </categoryCategoryOptionAssociation>
- <categoryCategoryOptionAssociation>
- <category>66</category>
- <categoryOption>67</categoryOption>
- </categoryCategoryOptionAssociation>
- </categoryCategoryOptionAssociations>
- <categoryComboCategoryAssociations>
- <categoryComboCategoryAssociation>
- <categoryCombo>65</categoryCombo>
- <category>66</category>
- </categoryComboCategoryAssociation>
- <categoryComboCategoryAssociation>
- <categoryCombo>65</categoryCombo>
- <category>65</category>
- </categoryComboCategoryAssociation>
- <categoryComboCategoryAssociation>
- <categoryCombo>66</categoryCombo>
- <category>65</category>
- </categoryComboCategoryAssociation>
- </categoryComboCategoryAssociations>
- <dataElements>
- <dataElement>
- <id>65</id>
- <uuid>C3C2E28D-9686-4634-93FD-BE3133935ECA</uuid>
- <name>DataElementA</name>
- <alternativeName>AlternativeNameA</alternativeName>
- <shortName>ShortNameA</shortName>
- <code>CodeA</code>
- <description>DescriptionA</description>
- <active>true</active>
- <type>int</type>
- <aggregationOperator>sum</aggregationOperator>
- <categoryCombo>65</categoryCombo>
- </dataElement>
- <dataElement>
- <id>66</id>
- <uuid>C3C2E28D-9686-4634-93FD-BE3133935ECB</uuid>
- <name>DataElementB</name>
- <alternativeName>AlternativeNameB</alternativeName>
- <shortName>ShortNameB</shortName>
- <code>CodeB</code>
- <description>DescriptionB</description>
- <active>true</active>
- <type>int</type>
- <aggregationOperator>sum</aggregationOperator>
- <categoryCombo>65</categoryCombo>
- </dataElement>
- <dataElement>
- <id>67</id>
- <uuid>C3C2E28D-9686-4634-93FD-BE3133935ECC</uuid>
- <name>DataElementC</name>
- <alternativeName>AlternativeNameC</alternativeName>
- <shortName>ShortNameC</shortName>
- <code>CodeC</code>
- <description>DescriptionC</description>
- <active>true</active>
- <type>int</type>
- <aggregationOperator>sum</aggregationOperator>
- <categoryCombo>65</categoryCombo>
- </dataElement>
- </dataElements>
- <dataElementGroups>
- <dataElementGroup>
- <id>65</id>
- <uuid>C3C2E28D-9686-4634-93FD-BE3133935ECA</uuid>
- <name>DataElementGroupA</name>
- </dataElementGroup>
- <dataElementGroup>
- <id>66</id>
- <uuid>C3C2E28D-9686-4634-93FD-BE3133935ECB</uuid>
- <name>DataElementGroupB</name>
- </dataElementGroup>
- <dataElementGroup>
- <id>67</id>
- <uuid>C3C2E28D-9686-4634-93FD-BE3133935ECC</uuid>
- <name>DataElementGroupC</name>
- </dataElementGroup>
- </dataElementGroups>
- <dataElementGroupMembers>
- <dataElementGroupMember>
- <dataElementGroup>65</dataElementGroup>
- <dataElement>67</dataElement>
- </dataElementGroupMember>
- <dataElementGroupMember>
- <dataElementGroup>65</dataElementGroup>
- <dataElement>66</dataElement>
- </dataElementGroupMember>
- <dataElementGroupMember>
- <dataElementGroup>65</dataElementGroup>
- <dataElement>65</dataElement>
- </dataElementGroupMember>
- <dataElementGroupMember>
- <dataElementGroup>66</dataElementGroup>
- <dataElement>67</dataElement>
- </dataElementGroupMember>
- <dataElementGroupMember>
- <dataElementGroup>66</dataElementGroup>
- <dataElement>66</dataElement>
- </dataElementGroupMember>
- <dataElementGroupMember>
- <dataElementGroup>66</dataElementGroup>
- <dataElement>65</dataElement>
- </dataElementGroupMember>
- <dataElementGroupMember>
- <dataElementGroup>67</dataElementGroup>
- <dataElement>67</dataElement>
- </dataElementGroupMember>
- <dataElementGroupMember>
- <dataElementGroup>67</dataElementGroup>
- <dataElement>66</dataElement>
- </dataElementGroupMember>
- <dataElementGroupMember>
- <dataElementGroup>67</dataElementGroup>
- <dataElement>65</dataElement>
- </dataElementGroupMember>
- </dataElementGroupMembers>
- <indicatorTypes>
- <indicatorType>
- <id>65</id>
- <name>IndicatorTypeA</name>
- <factor>100</factor>
- </indicatorType>
- <indicatorType>
- <id>66</id>
- <name>IndicatorTypeB</name>
- <factor>100</factor>
- </indicatorType>
- <indicatorType>
- <id>67</id>
- <name>IndicatorTypeC</name>
- <factor>100</factor>
- </indicatorType>
- </indicatorTypes>
- <indicators>
- <indicator>
- <id>65</id>
- <uuid>C3C2E28D-9686-4634-93FD-BE3133935ECA</uuid>
- <name>IndicatorA</name>
- <alternativeName>AlternativeNameA</alternativeName>
- <shortName>ShortNameA</shortName>
- <code>CodeA</code>
- <description>DescriptionA</description>
- <annualized>false</annualized>
- <indicatorType>65</indicatorType>
- <numerator>Numerator</numerator>
- <numeratorDescription>NumeratorDescription</numeratorDescription>
- <numeratorAggregationOperator>sum</numeratorAggregationOperator>
- <denominator>Denominator</denominator>
- <denominatorDescription>DenominatorDescription</denominatorDescription>
- <denominatorAggregationOperator>sum</denominatorAggregationOperator>
- </indicator>
- <indicator>
- <id>66</id>
- <uuid>C3C2E28D-9686-4634-93FD-BE3133935ECB</uuid>
- <name>IndicatorB</name>
- <alternativeName>AlternativeNameB</alternativeName>
- <shortName>ShortNameB</shortName>
- <code>CodeB</code>
- <description>DescriptionB</description>
- <annualized>false</annualized>
- <indicatorType>65</indicatorType>
- <numerator>Numerator</numerator>
- <numeratorDescription>NumeratorDescription</numeratorDescription>
- <numeratorAggregationOperator>sum</numeratorAggregationOperator>
- <denominator>Denominator</denominator>
- <denominatorDescription>DenominatorDescription</denominatorDescription>
- <denominatorAggregationOperator>sum</denominatorAggregationOperator>
- </indicator>
- <indicator>
- <id>67</id>
- <uuid>C3C2E28D-9686-4634-93FD-BE3133935ECC</uuid>
- <name>IndicatorC</name>
- <alternativeName>AlternativeNameC</alternativeName>
- <shortName>ShortNameC</shortName>
- <code>CodeC</code>
- <description>DescriptionC</description>
- <annualized>false</annualized>
- <indicatorType>65</indicatorType>
- <numerator>Numerator</numerator>
- <numeratorDescription>NumeratorDescription</numeratorDescription>
- <numeratorAggregationOperator>sum</numeratorAggregationOperator>
- <denominator>Denominator</denominator>
- <denominatorDescription>DenominatorDescription</denominatorDescription>
- <denominatorAggregationOperator>sum</denominatorAggregationOperator>
- </indicator>
- </indicators>
- <indicatorGroups>
- <indicatorGroup>
- <id>65</id>
- <uuid>C3C2E28D-9686-4634-93FD-BE3133935ECA</uuid>
- <name>IndicatorGroupA</name>
- </indicatorGroup>
- <indicatorGroup>
- <id>66</id>
- <uuid>C3C2E28D-9686-4634-93FD-BE3133935ECB</uuid>
- <name>IndicatorGroupB</name>
- </indicatorGroup>
- <indicatorGroup>
- <id>67</id>
- <uuid>C3C2E28D-9686-4634-93FD-BE3133935ECC</uuid>
- <name>IndicatorGroupC</name>
- </indicatorGroup>
- </indicatorGroups>
- <indicatorGroupMembers>
- <indicatorGroupMember>
- <indicatorGroup>65</indicatorGroup>
- <indicator>66</indicator>
- </indicatorGroupMember>
- <indicatorGroupMember>
- <indicatorGroup>65</indicatorGroup>
- <indicator>65</indicator>
- </indicatorGroupMember>
- <indicatorGroupMember>
- <indicatorGroup>65</indicatorGroup>
- <indicator>67</indicator>
- </indicatorGroupMember>
- <indicatorGroupMember>
- <indicatorGroup>66</indicatorGroup>
- <indicator>66</indicator>
- </indicatorGroupMember>
- <indicatorGroupMember>
- <indicatorGroup>66</indicatorGroup>
- <indicator>65</indicator>
- </indicatorGroupMember>
- <indicatorGroupMember>
- <indicatorGroup>66</indicatorGroup>
- <indicator>67</indicator>
- </indicatorGroupMember>
- <indicatorGroupMember>
- <indicatorGroup>67</indicatorGroup>
- <indicator>66</indicator>
- </indicatorGroupMember>
- <indicatorGroupMember>
- <indicatorGroup>67</indicatorGroup>
- <indicator>65</indicator>
- </indicatorGroupMember>
- <indicatorGroupMember>
- <indicatorGroup>67</indicatorGroup>
- <indicator>67</indicator>
- </indicatorGroupMember>
- </indicatorGroupMembers>
- <dataSets>
- <dataSet>
- <id>65</id>
- <name>DataSetA</name>
- <periodType>Weekly</periodType>
- </dataSet>
- <dataSet>
- <id>66</id>
- <name>DataSetB</name>
- <periodType>Weekly</periodType>
- </dataSet>
- <dataSet>
- <id>67</id>
- <name>DataSetC</name>
- <periodType>Weekly</periodType>
- </dataSet>
- </dataSets>
- <dataSetMembers>
- <dataSetMember>
- <dataSet>65</dataSet>
- <dataElement>67</dataElement>
- </dataSetMember>
- <dataSetMember>
- <dataSet>65</dataSet>
- <dataElement>66</dataElement>
- </dataSetMember>
- <dataSetMember>
- <dataSet>65</dataSet>
- <dataElement>65</dataElement>
- </dataSetMember>
- <dataSetMember>
- <dataSet>66</dataSet>
- <dataElement>67</dataElement>
- </dataSetMember>
- <dataSetMember>
- <dataSet>66</dataSet>
- <dataElement>66</dataElement>
- </dataSetMember>
- <dataSetMember>
- <dataSet>66</dataSet>
- <dataElement>65</dataElement>
- </dataSetMember>
- <dataSetMember>
- <dataSet>67</dataSet>
- <dataElement>67</dataElement>
- </dataSetMember>
- <dataSetMember>
- <dataSet>67</dataSet>
- <dataElement>66</dataElement>
- </dataSetMember>
- <dataSetMember>
- <dataSet>67</dataSet>
- <dataElement>65</dataElement>
- </dataSetMember>
- </dataSetMembers>
- <organisationUnits>
- <organisationUnit>
- <id>65</id>
- <uuid>C3C2E28D-9686-4634-93FD-BE3133935ECA</uuid>
- <name>OrganisationUnitA</name>
- <shortName>ShortNameA</shortName>
- <code>CodeA</code>
- <openingDate>1970-01-01</openingDate>
- <closedDate>1970-01-01</closedDate>
- <active>true</active>
- <comment>CommentA</comment>
- <geoCode>GeoCode</geoCode>
- <feature type="Polygon">
- <coordinates>11.11,22.22 33.33,44.44 55.55,66.66</coordinates>
- </feature>
- <lastUpdated>2010-01-01</lastUpdated>
- </organisationUnit>
- <organisationUnit>
- <id>66</id>
- <uuid>C3C2E28D-9686-4634-93FD-BE3133935ECB</uuid>
- <name>OrganisationUnitB</name>
- <shortName>ShortNameB</shortName>
- <code>CodeB</code>
- <openingDate>1970-01-01</openingDate>
- <closedDate>1970-01-01</closedDate>
- <active>true</active>
- <comment>CommentB</comment>
- <geoCode>GeoCode</geoCode>
- <feature type="Polygon">
- <coordinates>11.11,22.22 33.33,44.44 55.55,66.66</coordinates>
- </feature>
- <lastUpdated>2010-01-01</lastUpdated>
- </organisationUnit>
- <organisationUnit>
- <id>67</id>
- <uuid>C3C2E28D-9686-4634-93FD-BE3133935ECC</uuid>
- <name>OrganisationUnitC</name>
- <shortName>ShortNameC</shortName>
- <code>CodeC</code>
- <openingDate>1970-01-01</openingDate>
- <closedDate>1970-01-01</closedDate>
- <active>true</active>
- <comment>CommentC</comment>
- <geoCode>GeoCode</geoCode>
- <feature type="Polygon">
- <coordinates>11.11,22.22 33.33,44.44 55.55,66.66</coordinates>
- </feature>
- <lastUpdated>2010-01-01</lastUpdated>
- </organisationUnit>
- </organisationUnits>
- <organisationUnitRelationships>
- <organisationUnitRelationship>
- <parent>65</parent>
- <child>66</child>
- </organisationUnitRelationship>
- <organisationUnitRelationship>
- <parent>66</parent>
- <child>67</child>
- </organisationUnitRelationship>
- </organisationUnitRelationships>
- <organisationUnitGroups>
- <organisationUnitGroup>
- <id>65</id>
- <uuid>C3C2E28D-9686-4634-93FD-BE3133935ECA</uuid>
- <name>OrganisationUnitGroupA</name>
- </organisationUnitGroup>
- <organisationUnitGroup>
- <id>66</id>
- <uuid>C3C2E28D-9686-4634-93FD-BE3133935ECB</uuid>
- <name>OrganisationUnitGroupB</name>
- </organisationUnitGroup>
- <organisationUnitGroup>
- <id>67</id>
- <uuid>C3C2E28D-9686-4634-93FD-BE3133935ECC</uuid>
- <name>OrganisationUnitGroupC</name>
- </organisationUnitGroup>
- </organisationUnitGroups>
- <organisationUnitGroupMembers>
- <organisationUnitGroupMember>
- <organisationUnitGroup>65</organisationUnitGroup>
- <organisationUnit>66</organisationUnit>
- </organisationUnitGroupMember>
- <organisationUnitGroupMember>
- <organisationUnitGroup>65</organisationUnitGroup>
- <organisationUnit>67</organisationUnit>
- </organisationUnitGroupMember>
- <organisationUnitGroupMember>
- <organisationUnitGroup>65</organisationUnitGroup>
- <organisationUnit>65</organisationUnit>
- </organisationUnitGroupMember>
- <organisationUnitGroupMember>
- <organisationUnitGroup>66</organisationUnitGroup>
- <organisationUnit>66</organisationUnit>
- </organisationUnitGroupMember>
- <organisationUnitGroupMember>
- <organisationUnitGroup>66</organisationUnitGroup>
- <organisationUnit>67</organisationUnit>
- </organisationUnitGroupMember>
- <organisationUnitGroupMember>
- <organisationUnitGroup>66</organisationUnitGroup>
- <organisationUnit>65</organisationUnit>
- </organisationUnitGroupMember>
- <organisationUnitGroupMember>
- <organisationUnitGroup>67</organisationUnitGroup>
- <organisationUnit>66</organisationUnit>
- </organisationUnitGroupMember>
- <organisationUnitGroupMember>
- <organisationUnitGroup>67</organisationUnitGroup>
- <organisationUnit>67</organisationUnit>
- </organisationUnitGroupMember>
- <organisationUnitGroupMember>
- <organisationUnitGroup>67</organisationUnitGroup>
- <organisationUnit>65</organisationUnit>
- </organisationUnitGroupMember>
- </organisationUnitGroupMembers>
- <groupSets>
- <groupSet>
- <id>65</id>
- <name>OrganisationUnitGroupSetA</name>
- <description>DescriptionA</description>
- <compulsory>true</compulsory>
- <exclusive>true</exclusive>
- </groupSet>
- <groupSet>
- <id>66</id>
- <name>OrganisationUnitGroupSetB</name>
- <description>DescriptionB</description>
- <compulsory>true</compulsory>
- <exclusive>true</exclusive>
- </groupSet>
- <groupSet>
- <id>67</id>
- <name>OrganisationUnitGroupSetC</name>
- <description>DescriptionC</description>
- <compulsory>true</compulsory>
- <exclusive>true</exclusive>
- </groupSet>
- </groupSets>
- <groupSetMembers>
- <groupSetMember>
- <groupSet>65</groupSet>
- <organisationUnitGroup>65</organisationUnitGroup>
- </groupSetMember>
- <groupSetMember>
- <groupSet>66</groupSet>
- <organisationUnitGroup>66</organisationUnitGroup>
- </groupSetMember>
- <groupSetMember>
- <groupSet>67</groupSet>
- <organisationUnitGroup>67</organisationUnitGroup>
- </groupSetMember>
- </groupSetMembers>
- <validationRules>
- <validationRule>
- <name>ValidationRuleA</name>
- <description>DescriptionA</description>
- <type>absolute</type>
- <operator>equal_to</operator>
- <leftSideExpression>[65.65]+[66.65]</leftSideExpression>
- <leftSideDescription>DescriptionA</leftSideDescription>
- <rightSideExpression>[65.65]+[66.65]</rightSideExpression>
- <rightSideDescription>DescriptionA</rightSideDescription>
- </validationRule>
- <validationRule>
- <name>ValidationRuleB</name>
- <description>DescriptionB</description>
- <type>absolute</type>
- <operator>equal_to</operator>
- <leftSideExpression>[65.65]+[66.65]</leftSideExpression>
- <leftSideDescription>DescriptionA</leftSideDescription>
- <rightSideExpression>[65.65]+[66.65]</rightSideExpression>
- <rightSideDescription>DescriptionA</rightSideDescription>
- </validationRule>
- <validationRule>
- <name>ValidationRuleC</name>
- <description>DescriptionC</description>
- <type>absolute</type>
- <operator>equal_to</operator>
- <leftSideExpression>[65.65]+[66.65]</leftSideExpression>
- <leftSideDescription>DescriptionA</leftSideDescription>
- <rightSideExpression>[65.65]+[66.65]</rightSideExpression>
- <rightSideDescription>DescriptionA</rightSideDescription>
- </validationRule>
- </validationRules>
- <periods>
- <period>
- <id>65</id>
- <periodType>Weekly</periodType>
- <startDate>1999-12-27</startDate>
- <endDate>2000-01-02</endDate>
- </period>
- <period>
- <id>66</id>
- <periodType>Weekly</periodType>
- <startDate>2000-01-03</startDate>
- <endDate>2000-01-09</endDate>
- </period>
- <period>
- <id>67</id>
- <periodType>Weekly</periodType>
- <startDate>2000-01-10</startDate>
- <endDate>2000-01-16</endDate>
- </period>
- </periods>
</change>
=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/test/resources/dxfA.xml'
--- dhis-2/dhis-services/dhis-service-importexport/src/test/resources/dxfA.xml 2011-11-22 15:48:30 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/test/resources/dxfA.xml 2011-12-19 13:10:25 +0000
@@ -1,5 +1,5 @@
<?xml version='1.0'?>
-<dxf>
+<dxf minorVersion="1.2">
<categoryOptions>
<categoryOption>
<id>65</id>
@@ -414,6 +414,8 @@
<active>true</active>
<comment>CommentA</comment>
<geoCode>GeoCode</geoCode>
+ <feature />
+ <lastUpdated>2011-12-19</lastUpdated>
</organisationUnit>
<organisationUnit>
<id>66</id>
@@ -426,6 +428,8 @@
<active>true</active>
<comment>CommentB</comment>
<geoCode>GeoCode</geoCode>
+ <feature />
+ <lastUpdated>2011-12-19</lastUpdated>
</organisationUnit>
<organisationUnit>
<id>67</id>
@@ -438,6 +442,8 @@
<active>true</active>
<comment>CommentC</comment>
<geoCode>GeoCode</geoCode>
+ <feature />
+ <lastUpdated>2011-12-19</lastUpdated>
</organisationUnit>
</organisationUnits>
<organisationUnitRelationships>
=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/test/resources/dxfC.xml'
--- dhis-2/dhis-services/dhis-service-importexport/src/test/resources/dxfC.xml 2011-11-22 15:48:30 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/test/resources/dxfC.xml 2011-12-19 13:10:25 +0000
@@ -1,5 +1,5 @@
<?xml version='1.0'?>
-<dxf>
+<dxf minorVersion="1.2">
<categoryOptions>
<categoryOption>
<id>65</id>
@@ -702,6 +702,8 @@
<active>true</active>
<comment>CommentA</comment>
<geoCode>GeoCode</geoCode>
+ <feature />
+ <lastUpdated>2011-12-19</lastUpdated>
</organisationUnit>
<organisationUnit>
<id>66</id>
@@ -714,6 +716,8 @@
<active>true</active>
<comment>CommentB</comment>
<geoCode>GeoCode</geoCode>
+ <feature />
+ <lastUpdated>2011-12-19</lastUpdated>
</organisationUnit>
<organisationUnit>
<id>67</id>
@@ -726,6 +730,8 @@
<active>true</active>
<comment>CommentC</comment>
<geoCode>GeoCode</geoCode>
+ <feature />
+ <lastUpdated>2011-12-19</lastUpdated>
</organisationUnit>
<organisationUnit>
<id>68</id>
@@ -738,6 +744,8 @@
<active>true</active>
<comment>CommentD</comment>
<geoCode>GeoCode</geoCode>
+ <feature />
+ <lastUpdated>2011-12-19</lastUpdated>
</organisationUnit>
<organisationUnit>
<id>69</id>
@@ -750,6 +758,8 @@
<active>true</active>
<comment>CommentE</comment>
<geoCode>GeoCode</geoCode>
+ <feature />
+ <lastUpdated>2011-12-19</lastUpdated>
</organisationUnit>
</organisationUnits>
<organisationUnitRelationships>