← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 20184: Cleanup

 

------------------------------------------------------------
revno: 20184
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2015-09-16 16:51:59 +0200
message:
  Cleanup
modified:
  dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/file/typehandler/AggregationOperatorTypeHandler.java
  dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/util/Dhis14ExpressionConverter.java
  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/dxf/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/file/typehandler/AggregationOperatorTypeHandler.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/file/typehandler/AggregationOperatorTypeHandler.java	2015-09-15 09:54:24 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/file/typehandler/AggregationOperatorTypeHandler.java	2015-09-16 14:51:59 +0000
@@ -28,14 +28,15 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import java.sql.SQLException;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.hisp.dhis.analytics.AggregationType;
+
 import com.ibatis.sqlmap.client.extensions.ParameterSetter;
 import com.ibatis.sqlmap.client.extensions.ResultGetter;
 import com.ibatis.sqlmap.client.extensions.TypeHandlerCallback;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.hisp.dhis.dataelement.DataElement;
-
-import java.sql.SQLException;
 
 /**
  * @author Lars Helge Overland
@@ -48,7 +49,7 @@
     private static final String JDBC_AVERAGE = "Avg";
     private static final String JDBC_COUNT = "Count";
 
-    private static final Integer NON_EXISTING = -1;
+    //private static final Integer NON_EXISTING = -1;
 
     private static final Log log = LogFactory.getLog( AggregationOperatorTypeHandler.class );
 
@@ -59,40 +60,36 @@
     @Override
     public Object getResult( ResultGetter getter )
         throws SQLException
-    {
-        return null;
-
-        /*
+    {        
         String result = getter.getString();
 
         if ( result != null )
         {
             if ( result.equalsIgnoreCase( JDBC_SUM ) )
             {
-                return DataElement.AGGREGATION_OPERATOR_SUM;
+                return AggregationType.SUM;
             }
             else if ( result.equalsIgnoreCase( JDBC_AVERAGE ) )
             {
-                return DataElement.AGGREGATION_OPERATOR_AVERAGE_SUM;
+                return AggregationType.AVERAGE;
             }
             else if ( result.equalsIgnoreCase( JDBC_COUNT ) )
             {
-                return DataElement.AGGREGATION_OPERATOR_COUNT;
+                return AggregationType.COUNT;
             }
             else
             {
                 log.warn( "Unknow aggregation operator, returning sum " + result );
                 
-                return DataElement.AGGREGATION_OPERATOR_SUM;
+                return AggregationType.SUM;
             }
         }
         else
         {
             log.warn( "Aggregation operator is null, returning sum " + result );
             
-            return DataElement.AGGREGATION_OPERATOR_SUM;
+            return AggregationType.SUM;
         }
-        */
     }
 
     @Override

=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/util/Dhis14ExpressionConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/util/Dhis14ExpressionConverter.java	2015-09-15 09:54:24 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/util/Dhis14ExpressionConverter.java	2015-09-16 14:51:59 +0000
@@ -36,7 +36,6 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.hisp.dhis.dataelement.DataElement;
 
 /**
  * @author Lars Helge Overland

=== 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-15 09:54:24 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/xml/converter/DataElementConverter.java	2015-09-16 14:51:59 +0000
@@ -28,6 +28,12 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import static org.hisp.dhis.dataelement.DataElementCategoryCombo.DEFAULT_CATEGORY_COMBO_NAME;
+import static org.hisp.dhis.importexport.dhis14.util.Dhis14TypeHandler.convertBooleanToDhis14;
+
+import java.util.Collection;
+import java.util.Map;
+
 import org.amplecode.staxwax.reader.XMLReader;
 import org.amplecode.staxwax.writer.XMLWriter;
 import org.hisp.dhis.dataelement.DataElement;
@@ -43,13 +49,6 @@
 import org.hisp.dhis.importexport.dhis14.util.Dhis14DateUtil;
 import org.hisp.dhis.importexport.dhis14.util.Dhis14ParsingUtils;
 import org.hisp.dhis.importexport.importer.DataElementImporter;
-import org.hisp.dhis.importexport.mapping.NameMappingUtil;
-
-import java.util.Collection;
-import java.util.Map;
-
-import static org.hisp.dhis.dataelement.DataElementCategoryCombo.DEFAULT_CATEGORY_COMBO_NAME;
-import static org.hisp.dhis.importexport.dhis14.util.Dhis14TypeHandler.*;
 
 /**
  * @author Lars Helge Overland
@@ -97,7 +96,7 @@
 
     private static final String FIELD_AGGREGATION_START_LEVEL = "AggregateStartLevel";
 
-    private static final String FIELD_AGGREGATION_OPERATOR = "AggregateOperator";
+    //private static final String FIELD_AGGREGATION_OPERATOR = "AggregateOperator";
 
     private static final String FIELD_SELECTED = "Selected";
 

=== 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	2015-09-15 09:54:24 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/DataElementConverter.java	2015-09-16 14:51:59 +0000
@@ -65,7 +65,7 @@
     private static final String FIELD_DESCRIPTION = "description";
     private static final String FIELD_VALUE_TYPE = "valueType";
     private static final String FIELD_DOMAIN_TYPE = "domainType";
-    private static final String FIELD_AGGREGATION_OPERATOR = "aggregationOperator";
+    //private static final String FIELD_AGGREGATION_OPERATOR = "aggregationOperator";
     private static final String FIELD_CATEGORY_COMBO = "categoryCombo";
     private static final String FIELD_LAST_UPDATED = "lastUpdated";