← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 19987: use value types in data element importer

 

------------------------------------------------------------
revno: 19987
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2015-09-04 14:12:38 +0700
message:
  use value types in data element importer
modified:
  dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/importer/DataElementImporter.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/importer/DataElementImporter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/importer/DataElementImporter.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/importer/DataElementImporter.java	2015-09-04 07:12:38 +0000
@@ -54,13 +54,13 @@
         this.batchHandler = batchHandler;
         this.dataElementService = dataElementService;
     }
-    
+
     @Override
     public void importObject( DataElement object, ImportParams params )
     {
         NameMappingUtil.addDataElementMapping( object.getId(), object.getName() );
         NameMappingUtil.addDataElementAggregationOperatorMapping( object.getId(), object.getAggregationOperator() );
-        
+
         read( object, GroupMemberType.NONE, params );
     }
 
@@ -77,7 +77,7 @@
         match.setShortName( object.getShortName() );
         match.setCode( object.getCode() );
         match.setDescription( object.getDescription() );
-        match.setType( object.getType() );
+        match.setValueType( object.getValueType() );
         match.setDomainType( object.getDomainType() );
         match.setAggregationOperator( object.getAggregationOperator() );
         match.setLastUpdated( object.getLastUpdated() );
@@ -98,7 +98,7 @@
         {
             match = dataElementService.getDataElementByCode( object.getCode() );
         }
-        
+
         return match;
     }
 
@@ -113,19 +113,19 @@
         {
             return false;
         }
-        if ( !isSimiliar( object.getCode(), existing.getCode() ) || ( isNotNull( object.getCode(), existing.getCode() ) && !object.getCode().equals( existing.getCode() ) ) )
-        {
-            return false;
-        }
-        if ( !isSimiliar( object.getDescription(), existing.getDescription() ) || ( isNotNull( object.getDescription(), existing.getDescription() ) && !object.getDescription().equals( existing.getDescription() ) ) )
-        {
-            return false;
-        }
-        if ( !object.getType().equals( existing.getType() ) )
-        {
-            return false;
-        }
-        if ( !isSimiliar( object.getDomainType(), existing.getDomainType() ) || ( isNotNull( object.getDomainType(), existing.getDomainType() ) && !object.getDomainType().equals( existing.getDomainType() ) ) )
+        if ( !isSimiliar( object.getCode(), existing.getCode() ) || (isNotNull( object.getCode(), existing.getCode() ) && !object.getCode().equals( existing.getCode() )) )
+        {
+            return false;
+        }
+        if ( !isSimiliar( object.getDescription(), existing.getDescription() ) || (isNotNull( object.getDescription(), existing.getDescription() ) && !object.getDescription().equals( existing.getDescription() )) )
+        {
+            return false;
+        }
+        if ( !(object.getValueType() == existing.getValueType()) )
+        {
+            return false;
+        }
+        if ( !isSimiliar( object.getDomainType(), existing.getDomainType() ) || (isNotNull( object.getDomainType(), existing.getDomainType() ) && !object.getDomainType().equals( existing.getDomainType() )) )
         {
             return false;
         }