← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2872: Implemented display significant zeroes and nulls in organisationunit raw data drill down in data ...

 

------------------------------------------------------------
revno: 2872
committer: Jason P. Pickering <jason.p.pickering@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2011-02-18 17:29:15 +0200
message:
  Implemented display significant zeroes and nulls in organisationunit raw data drill down in data browser. https://blueprints.launchpad.net/dhis2/+spec/databrowser-exclude-zeros. Fixed a couple of bugs. 
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/databrowser/DataBrowserTable.java
  dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/databrowser/DefaultDataBrowserService.java
  dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/databrowser/jdbc/StatementManagerDataBrowserStore.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/databrowser/SearchAction.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-api/src/main/java/org/hisp/dhis/databrowser/DataBrowserTable.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/databrowser/DataBrowserTable.java	2011-02-16 13:25:39 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/databrowser/DataBrowserTable.java	2011-02-18 15:29:15 +0000
@@ -117,7 +117,7 @@
      * @return 0 if ResultSet was empty else number of rows inserted with
      *         column.
      */
-    public Integer addColumnToAllRows( ResultSet resultSet )
+    public Integer addColumnToAllRows( ResultSet resultSet, Boolean addZeros )
     {
         boolean hasColumnName = false;
         boolean hasPeriodIds = false;
@@ -159,7 +159,7 @@
                 {
                     for ( List<String> rowItem : this.counts )
                     {
-                        rowItem.add( "0" );
+                        rowItem.add( addZeros ?  "0": "" );
                     }
                     if ( hasPeriodIds && hasColumnName )
                     {
@@ -186,7 +186,7 @@
                         makeEmptyCol = false;
                         for ( List<String> rowItem : this.counts )
                         {
-                            rowItem.add( "0" );
+                            rowItem.add( addZeros ?  "0": "" );
                         }
                         if ( hasColumnName )
                         {
@@ -213,6 +213,7 @@
         {
             this.addZeroColumn();
         }
+        
         return countRows;
     }
 

=== modified file 'dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/databrowser/DefaultDataBrowserService.java'
--- dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/databrowser/DefaultDataBrowserService.java	2011-02-16 13:25:39 +0000
+++ dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/databrowser/DefaultDataBrowserService.java	2011-02-18 15:29:15 +0000
@@ -116,15 +116,11 @@
 
         DataBrowserTable table = new DataBrowserTable();
 
-        dataBrowserStore.setStructureForOrgUnitBetweenPeriods( table, orgUnitParent, betweenPeriodIds );
+        //dataBrowserStore.setStructureForOrgUnitBetweenPeriods( table, orgUnitParent, betweenPeriodIds );
 
-        Integer numResults = dataBrowserStore.setCountOrgUnitsBetweenPeriods( table, orgUnitParent, betweenPeriodIds,
+         dataBrowserStore.setCountOrgUnitsBetweenPeriods( table, orgUnitParent, betweenPeriodIds,
             maxLevel );
 
-        if ( numResults == 0 )
-        {
-            table.addZeroColumn();
-        }
 
         return table;
     }
@@ -188,13 +184,9 @@
 
         dataBrowserStore.setDataElementStructureForOrgUnitBetweenPeriods( table, orgUnitGroupId, betweenPeriodIds );
 
-        int numRows = dataBrowserStore.setCountDataElementsForOrgUnitBetweenPeriods( table, orgUnitGroupId,
+        dataBrowserStore.setCountDataElementsForOrgUnitBetweenPeriods( table, orgUnitGroupId,
             betweenPeriodIds );
 
-        if ( numRows == 0 )
-        {
-            table.addZeroColumn();
-        }
 
         return table;
     }

=== modified file 'dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/databrowser/jdbc/StatementManagerDataBrowserStore.java'
--- dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/databrowser/jdbc/StatementManagerDataBrowserStore.java	2011-02-16 13:25:39 +0000
+++ dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/databrowser/jdbc/StatementManagerDataBrowserStore.java	2011-02-18 15:29:15 +0000
@@ -252,7 +252,7 @@
 
 			table.incrementQueryCount();
 
-			numResults = table.addColumnToAllRows(resultSet);
+			numResults = table.addColumnToAllRows(resultSet, true);
 		} catch (SQLException e) {
 			throw new RuntimeException("Failed to get aggregated data value\n"
 					+ sqlsb.toString(), e);
@@ -348,7 +348,7 @@
 
 			table.incrementQueryCount();
 
-			numResults = table.addColumnToAllRows(resultSet);
+			numResults = table.addColumnToAllRows(resultSet, false);
 		} catch (SQLException e) {
 			throw new RuntimeException("Failed to get aggregated data value\n"
 					+ sql, e);
@@ -492,7 +492,7 @@
 				table.addColumnName(it.next().toString());
 			}
 			table.createStructure(resultSet);
-			table.addColumnToAllRows(resultSet);
+			table.addColumnToAllRows(resultSet, true);
 		} catch (SQLException e) {
 			throw new RuntimeException("Failed to get aggregated data value\n"
 					+ sqlsb.toString(), e);
@@ -554,7 +554,7 @@
 
 			table.incrementQueryCount();
 
-			numResults = table.addColumnToAllRows(resultSet);
+			numResults = table.addColumnToAllRows(resultSet, true);
 		} catch (SQLException e) {
 			throw new RuntimeException("Failed to get aggregated data value\n"
 					+ sql, e);

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/databrowser/SearchAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/databrowser/SearchAction.java	2011-02-18 12:21:57 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/databrowser/SearchAction.java	2011-02-18 15:29:15 +0000
@@ -47,7 +47,6 @@
 import org.hisp.dhis.organisationunit.OrganisationUnitService;
 import org.hisp.dhis.organisationunit.comparator.OrganisationUnitNameComparator;
 import org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager;
-import org.hisp.dhis.period.MonthlyPeriodType;
 import org.hisp.dhis.period.PeriodService;
 import org.hisp.dhis.period.PeriodType;
 import org.hisp.dhis.system.util.DateUtils;