← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/2.0.5] Rev 2104: Merged r 2334

 

------------------------------------------------------------
revno: 2104
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: 2.0.5
timestamp: Fri 2010-12-10 20:43:08 +0100
message:
  Merged r 2334
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTable.java
  dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/reporttable/impl/DefaultReportTableService.java
  dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/reporttable/statement/CreateReportTableStatement.java


--
lp:~dhis2-devs-core/dhis2/2.0.5
https://code.launchpad.net/~dhis2-devs-core/dhis2/2.0.5

Your team DHIS 2 developers is subscribed to branch lp:~dhis2-devs-core/dhis2/2.0.5.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/2.0.5/+edit-subscription
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTable.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTable.java	2010-10-01 08:18:06 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTable.java	2010-12-10 19:43:08 +0000
@@ -74,6 +74,7 @@
     public static final String ORGANISATIONUNIT_NAME = "organisationunitname";
 
     public static final String REPORTING_MONTH_COLUMN_NAME = "reporting_month_name";
+    public static final String PARAM_ORGANISATIONUNIT_COLUMN_NAME = "param_organisationunit_name";
     
     public static final String SEPARATOR = "_";
     public static final String SPACE = " ";
@@ -290,9 +291,14 @@
     private transient I18nFormat i18nFormat;
     
     /**
-     * The name of the reporting month.
+     * The name of the reporting month based on the report param.
      */
     private String reportingMonthName;
+    
+    /**
+     * The name of the (parent) organisation unit based on the report param. 
+     */
+    private String organisationUnitName;
 
     /**
      * The category option combos derived from the dimension set.
@@ -1372,6 +1378,16 @@
         this.reportingMonthName = reportingMonthName;
     }
     
+    public String getOrganisationUnitName()
+    {
+        return organisationUnitName;
+    }
+
+    public void setOrganisationUnitName( String organisationUnitName )
+    {
+        this.organisationUnitName = organisationUnitName;
+    }
+
     public List<DimensionOption> getDimensionOptions()
     {
         return dimensionOptions;

=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/reporttable/impl/DefaultReportTableService.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/reporttable/impl/DefaultReportTableService.java	2010-11-04 16:36:15 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/reporttable/impl/DefaultReportTableService.java	2010-12-10 19:43:08 +0000
@@ -174,6 +174,7 @@
             {
                 OrganisationUnit organisationUnit = organisationUnitService.getOrganisationUnit( organisationUnitId );
                 reportTable.getRelativeUnits().addAll( new ArrayList<OrganisationUnit>( organisationUnit.getChildren() ) );
+                reportTable.setOrganisationUnitName( organisationUnit.getName() );
                 
                 log.info( "Parent organisation unit: " + organisationUnit.getName() );
             }
@@ -189,6 +190,7 @@
                 List<OrganisationUnit> organisationUnits = new ArrayList<OrganisationUnit>();
                 organisationUnits.add( organisationUnit );
                 reportTable.getRelativeUnits().addAll( organisationUnits );
+                reportTable.setOrganisationUnitName( organisationUnit.getName() );
                 
                 log.info( "Organisation unit: " + organisationUnit.getName() );
             }
@@ -468,10 +470,16 @@
                         }
                         
                         // -----------------------------------------------------
-                        // Reporting month name
+                        // Param reporting month name
                         // -----------------------------------------------------
 
                         grid.addValue( reportTable.getReportingMonthName() );
+
+                        // -----------------------------------------------------
+                        // Param organisation unit name
+                        // -----------------------------------------------------
+
+                        grid.addValue( reportTable.getOrganisationUnitName() );
                         
                         // -----------------------------------------------------
                         // Values

=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/reporttable/statement/CreateReportTableStatement.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/reporttable/statement/CreateReportTableStatement.java	2010-04-12 21:23:33 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/reporttable/statement/CreateReportTableStatement.java	2010-12-10 19:43:08 +0000
@@ -82,12 +82,18 @@
         }
 
         // ---------------------------------------------------------------------
-        // Reporting month name
+        // Param reporting month name
         // ---------------------------------------------------------------------
 
         buffer.append( ReportTable.REPORTING_MONTH_COLUMN_NAME + SPACE + LONG_TEXT_COLUMN_TYPE + SEPARATOR );
 
         // ---------------------------------------------------------------------
+        // Param organisation unit name
+        // ---------------------------------------------------------------------
+
+        buffer.append( ReportTable.PARAM_ORGANISATIONUNIT_COLUMN_NAME + SPACE + LONG_TEXT_COLUMN_TYPE + SEPARATOR );
+        
+        // ---------------------------------------------------------------------
         // Crosstab
         // ---------------------------------------------------------------------