← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 20128: fix for data element csv import, use valueType instead of type/numberType etc.

 

------------------------------------------------------------
revno: 20128
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2015-09-14 17:23:17 +0700
message:
  fix for data element csv import, use valueType instead of type/numberType etc.
modified:
  dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/csv/DefaultCsvImportService.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-dxf2/src/main/java/org/hisp/dhis/dxf2/csv/DefaultCsvImportService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/csv/DefaultCsvImportService.java	2015-09-14 10:15:27 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/csv/DefaultCsvImportService.java	2015-09-14 10:23:17 +0000
@@ -193,21 +193,14 @@
 
                 String domainType = getSafe( values, 6, DataElementDomain.AGGREGATE.getValue(), 16 );
                 object.setDomainType( DataElementDomain.fromValue( domainType ) );
-
-                /* TODO fixme
-                object.setValueType( ValueType.getFromDataElementTypes(
-                    getSafe( values, 7, DataElement.VALUE_TYPE_INT, 16 ),
-                    getSafe( values, 8, DataElement.VALUE_TYPE_NUMBER, 16 ),
-                    getSafe( values, 9, null, 16 )
-                ) );
-                */
-
-                object.setAggregationOperator( getSafe( values, 10, DataElement.AGGREGATION_OPERATOR_SUM, 16 ) );
-                String categoryComboUid = getSafe( values, 11, null, 11 );
-                object.setUrl( getSafe( values, 12, null, 255 ) );
-                object.setZeroIsSignificant( Boolean.valueOf( getSafe( values, 13, "false", null ) ) );
-                String optionSetUid = getSafe( values, 14, null, 11 );
-                String commentOptionSetUid = getSafe( values, 15, null, 11 );
+                object.setValueType( ValueType.valueOf( getSafe( values, 7, ValueType.TEXT.toString(), 50 ) ) );
+
+                object.setAggregationOperator( getSafe( values, 8, DataElement.AGGREGATION_OPERATOR_SUM, 16 ) );
+                String categoryComboUid = getSafe( values, 9, null, 11 );
+                object.setUrl( getSafe( values, 10, null, 255 ) );
+                object.setZeroIsSignificant( Boolean.valueOf( getSafe( values, 11, "false", null ) ) );
+                String optionSetUid = getSafe( values, 12, null, 11 );
+                String commentOptionSetUid = getSafe( values, 13, null, 11 );
 
                 if ( categoryComboUid != null )
                 {