← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2881: Minor fix in Data browser.

 

------------------------------------------------------------
revno: 2881
committer: Jason P. Pickering <jason.p.pickering@xxxxxxxxx>
branch nick: dhis2
timestamp: Sun 2011-02-20 06:54:44 +0200
message:
  Minor fix in Data browser.
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/resources/org/hisp/dhis/dataadmin/i18n_module.properties


--
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-18 15:29:15 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/databrowser/DataBrowserTable.java	2011-02-20 04:54:44 +0000
@@ -211,18 +211,17 @@
 
         if ( countRows == 0 )
         {
-            this.addZeroColumn();
+            this.addZeroColumn(addZeros);
         }
-        
         return countRows;
     }
 
-    public void addZeroColumn()
+    public void addZeroColumn(Boolean addZeros)
     {
         this.addColumnName( "counts_of_aggregated_values" );
         for ( List<String> rowItem : this.counts )
         {
-            rowItem.add( "0" );
+            rowItem.add( addZeros ?  "0": "" );
         }
     }
 

=== 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-18 15:29:15 +0000
+++ dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/databrowser/DefaultDataBrowserService.java	2011-02-20 04:54:44 +0000
@@ -116,7 +116,7 @@
 
         DataBrowserTable table = new DataBrowserTable();
 
-        //dataBrowserStore.setStructureForOrgUnitBetweenPeriods( table, orgUnitParent, betweenPeriodIds );
+        dataBrowserStore.setStructureForOrgUnitBetweenPeriods( table, orgUnitParent, betweenPeriodIds );
 
          dataBrowserStore.setCountOrgUnitsBetweenPeriods( table, orgUnitParent, betweenPeriodIds,
             maxLevel );

=== 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-18 15:29:15 +0000
+++ dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/databrowser/jdbc/StatementManagerDataBrowserStore.java	2011-02-20 04:54:44 +0000
@@ -252,7 +252,7 @@
 
 			table.incrementQueryCount();
 
-			numResults = table.addColumnToAllRows(resultSet, true);
+			numResults = table.addColumnToAllRows( resultSet, true );
 		} catch (SQLException e) {
 			throw new RuntimeException("Failed to get aggregated data value\n"
 					+ sqlsb.toString(), e);
@@ -263,6 +263,7 @@
 		return numResults;
 	}
 
+
 	public Integer setCountDataElementsForDataElementGroupBetweenPeriods(
 			DataBrowserTable table, Integer dataElementGroupId,
 			List<Integer> betweenPeriodIds) {
@@ -329,7 +330,7 @@
 		return setCountFromSQL(table, sqlsbDescentdants.toString());
 
 	}
-
+    //This method retrieves raw data for a given orgunit, periods,
 	public Integer setCountDataElementsForOrgUnitBetweenPeriods(
 			DataBrowserTable table, Integer orgUnitId,
 			List<Integer> betweenPeriodIds) {
@@ -348,7 +349,7 @@
 
 			table.incrementQueryCount();
 
-			numResults = table.addColumnToAllRows(resultSet, false);
+			numResults = table.addColumnToAllRows( resultSet, false );
 		} catch (SQLException e) {
 			throw new RuntimeException("Failed to get aggregated data value\n"
 					+ sql, e);
@@ -492,7 +493,7 @@
 				table.addColumnName(it.next().toString());
 			}
 			table.createStructure(resultSet);
-			table.addColumnToAllRows(resultSet, true);
+			table.addColumnToAllRows( resultSet, true );
 		} catch (SQLException e) {
 			throw new RuntimeException("Failed to get aggregated data value\n"
 					+ sqlsb.toString(), e);
@@ -554,7 +555,7 @@
 
 			table.incrementQueryCount();
 
-			numResults = table.addColumnToAllRows(resultSet, true);
+			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/resources/org/hisp/dhis/dataadmin/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/org/hisp/dhis/dataadmin/i18n_module.properties	2011-02-19 04:46:15 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/org/hisp/dhis/dataadmin/i18n_module.properties	2011-02-20 04:54:44 +0000
@@ -194,6 +194,7 @@
 view_data_at_this_level                                             = View raw data at this level
 click_on_this_orgunit                                               = Click on this organisation unit
 counts_of_aggregated_values					    = Total data elements entered
+export_type                                                         = Export type
 export_results_for                                                  = Export results for
 earliest                                                            = earliest
 latest                                                              = latest