← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 20150: remove aggregation type references from dhis 1.4 import

 

------------------------------------------------------------
revno: 20150
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2015-09-15 12:29:37 +0700
message:
  remove aggregation type references from dhis 1.4 import
modified:
  dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/util/Dhis14TypeHandler.java
  dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/xml/converter/DataElementConverter.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/dhis14/util/Dhis14TypeHandler.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/util/Dhis14TypeHandler.java	2015-09-14 10:39:44 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/util/Dhis14TypeHandler.java	2015-09-15 05:29:37 +0000
@@ -28,10 +28,6 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import static org.hisp.dhis.dataelement.DataElement.AGGREGATION_OPERATOR_AVERAGE_SUM;
-import static org.hisp.dhis.dataelement.DataElement.AGGREGATION_OPERATOR_COUNT;
-import static org.hisp.dhis.dataelement.DataElement.AGGREGATION_OPERATOR_SUM;
-
 import org.hisp.dhis.datavalue.DataValue;
 
 /**
@@ -43,11 +39,11 @@
     private static final String DHIS14_TRUE = "1";
     private static final String DHIS14_FALSE = "0";
 
+    /*
     private static final String DHIS14_AGGREGATION_OPERATOR_SUM = "Sum";
     private static final String DHIS14_AGGREGATION_OPERATOR_AVERAGE = "Avg";
     private static final String DHIS14_AGGREGATION_OPERATOR_COUNT = "Count";
 
-    /*
     private static final String DHIS14_TYPE_INT = "3";
     private static final String DHIS14_TYPE_STRING = "4";
     private static final String DHIS14_TYPE_BOOL = "5";
@@ -86,6 +82,7 @@
     // Aggregation operator
     // -------------------------------------------------------------------------
 
+    /*
     public static String convertAggregationOperatorToDhis14( String value )
     {
         if ( value == null || value.equals( AGGREGATION_OPERATOR_SUM ) )
@@ -103,7 +100,9 @@
 
         return DHIS14_AGGREGATION_OPERATOR_SUM;
     }
+    */
 
+    /*
     public static String convertAggregationOperatorFromDhis14( String value )
     {
         if ( value == null || value.equals( DHIS14_AGGREGATION_OPERATOR_SUM ) )
@@ -121,6 +120,7 @@
 
         return AGGREGATION_OPERATOR_SUM;
     }
+    */
 
     // -------------------------------------------------------------------------
     // Type

=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/xml/converter/DataElementConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/xml/converter/DataElementConverter.java	2015-09-07 08:51:58 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/xml/converter/DataElementConverter.java	2015-09-15 05:29:37 +0000
@@ -224,8 +224,11 @@
                 writer.writeElement( FIELD_CALCULATED_VALID_TO, "" );
                 writer.writeElement( FIELD_SAVE_CALCULATED, convertBooleanToDhis14( false ) );
                 writer.writeElement( FIELD_AGGREGATION_START_LEVEL, String.valueOf( AGG_START_LEVEL ) );
+
+                /*
                 writer.writeElement( FIELD_AGGREGATION_OPERATOR,
                     convertAggregationOperatorToDhis14( object.getAggregationOperator() ) );
+                */
                 writer.writeElement( FIELD_SELECTED, String.valueOf( 0 ) );
                 writer.writeElement( FIELD_LAST_USER, String.valueOf( 1 ) );
                 writer.writeElement( FIELD_LAST_UPDATED, Dhis14DateUtil.getDateString( object.getLastUpdated() ) );
@@ -273,7 +276,7 @@
         element.setDomainType( DataElementDomain.AGGREGATE );
         element.setZeroIsSignificant( false );
         // element.setType( Dhis14ObjectMappingUtil.getDataElementTypeMap().get(Integer.parseInt( values.get( FIELD_DATA_TYPE ) ) ) );
-        element.setAggregationOperator( convertAggregationOperatorFromDhis14( values.get( FIELD_AGGREGATION_OPERATOR ) ) );
+        // element.setAggregationOperator( convertAggregationOperatorFromDhis14( values.get( FIELD_AGGREGATION_OPERATOR ) ) );
         element.setLastUpdated( Dhis14DateUtil.getDate( values.get( FIELD_LAST_UPDATED ) ) );
 
         if ( values.get( FIELD_CALCULATED ).equals( "0" ) ) // Ignore calculated