← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 300: Improved period naming

 

------------------------------------------------------------
revno: 300
committer: Lars Helge Oeverland larshelge@xxxxxxxxx
branch nick: trunk
timestamp: Tue 2009-05-19 11:18:21 +0200
message:
  Improved period naming
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTableService.java
  dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/csv/converter/ReportTableDataConverter.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/workbook/WorkbookService.java
  dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/workbook/impl/JExcelWorkbookService.java
  dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tablecreator/action/GenerateTableDataWorkbookAction.java
  dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tablecreator/action/GetTableDataAction.java
  dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tablecreator/action/GetTableDataExportAction.java

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTableService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTableService.java	2009-05-18 20:27:17 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTableService.java	2009-05-19 09:18:21 +0000
@@ -31,6 +31,7 @@
 import java.util.Date;
 import java.util.List;
 
+import org.hisp.dhis.i18n.I18nFormat;
 import org.hisp.dhis.period.Period;
 
 /**
@@ -121,5 +122,5 @@
      *        based on.
      * @return a ReportTableData object.
      */
-    ReportTableData getReportTableData( int id );
+    ReportTableData getReportTableData( int id, I18nFormat format );
 }

=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/csv/converter/ReportTableDataConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/csv/converter/ReportTableDataConverter.java	2009-05-05 10:15:05 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/csv/converter/ReportTableDataConverter.java	2009-05-19 09:18:21 +0000
@@ -75,7 +75,7 @@
         {
             for ( Integer id : params.getReportTables() ) //TODO more than one?
             {
-                ReportTableData data = reportTableService.getReportTableData( id );
+                ReportTableData data = reportTableService.getReportTableData( id, params.getFormat() );
                 
                 Iterator<String> columns = data.getPrettyPrintColumns().iterator();
                 

=== 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	2009-05-18 21:42:15 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/reporttable/impl/DefaultReportTableService.java	2009-05-19 09:18:21 +0000
@@ -33,6 +33,7 @@
 import java.util.Date;
 import java.util.List;
 
+import org.hisp.dhis.i18n.I18nFormat;
 import org.hisp.dhis.period.MonthlyPeriodType;
 import org.hisp.dhis.period.Period;
 import org.hisp.dhis.period.PeriodService;
@@ -280,10 +281,11 @@
         return reportTableStore.getReportTableByName( name );
     }
     
-    public ReportTableData getReportTableData( int id )
+    public ReportTableData getReportTableData( int id, I18nFormat format )
     {
         ReportTable reportTable = getReportTable( id );
         
+        reportTable.setI18nFormat( format );
         reportTable.init();
         
         return reportTableManager.getDisplayReportTableData( reportTable );

=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/workbook/WorkbookService.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/workbook/WorkbookService.java	2009-04-28 18:39:58 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/workbook/WorkbookService.java	2009-05-19 09:18:21 +0000
@@ -45,7 +45,7 @@
 {
     String ID = WorkbookService.class.getName();
     
-    String writeReportTableData( OutputStream outputStream, int id );
+    String writeReportTableData( OutputStream outputStream, int id, I18nFormat format );
     
     void writeAllDataElements( OutputStream outputStream );
     

=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/workbook/impl/JExcelWorkbookService.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/workbook/impl/JExcelWorkbookService.java	2009-04-28 18:39:58 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/workbook/impl/JExcelWorkbookService.java	2009-05-19 09:18:21 +0000
@@ -114,9 +114,9 @@
     // WorkbookService implementation
     // -------------------------------------------------------------------------
 
-    public String writeReportTableData( OutputStream outputStream, int id )
+    public String writeReportTableData( OutputStream outputStream, int id, I18nFormat format )
     {
-        ReportTableData data = reportTableService.getReportTableData( id );
+        ReportTableData data = reportTableService.getReportTableData( id, format );
         
         try
         {

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tablecreator/action/GenerateTableDataWorkbookAction.java'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tablecreator/action/GenerateTableDataWorkbookAction.java	2009-04-28 18:39:58 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tablecreator/action/GenerateTableDataWorkbookAction.java	2009-05-19 09:18:21 +0000
@@ -31,6 +31,7 @@
 import java.io.ByteArrayOutputStream;
 import java.io.InputStream;
 
+import org.hisp.dhis.i18n.I18nFormat;
 import org.hisp.dhis.workbook.WorkbookService;
 
 import com.opensymphony.xwork.Action;
@@ -52,6 +53,13 @@
     {
         this.workbookService = workbookService;
     }
+    
+    private I18nFormat format;
+
+    public void setFormat( I18nFormat format )
+    {
+        this.format = format;
+    }
 
     // -------------------------------------------------------------------------
     // Input
@@ -90,7 +98,7 @@
     {
         ByteArrayOutputStream out = new ByteArrayOutputStream();
         
-        fileName = workbookService.writeReportTableData( out, id );
+        fileName = workbookService.writeReportTableData( out, id, format );
 
         inputStream = new ByteArrayInputStream( out.toByteArray() );
                 

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tablecreator/action/GetTableDataAction.java'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tablecreator/action/GetTableDataAction.java	2009-05-19 08:43:37 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tablecreator/action/GetTableDataAction.java	2009-05-19 09:18:21 +0000
@@ -27,6 +27,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import org.hisp.dhis.i18n.I18nFormat;
 import org.hisp.dhis.reporttable.ReportTableData;
 import org.hisp.dhis.reporttable.ReportTableService;
 
@@ -50,6 +51,13 @@
         this.reportTableService = reportTableService;
     }
 
+    private I18nFormat format;
+
+    public void setFormat( I18nFormat format )
+    {
+        this.format = format;
+    }
+    
     // -------------------------------------------------------------------------
     // Input
     // -------------------------------------------------------------------------
@@ -78,8 +86,8 @@
 
     public String execute()
     {
-        data = reportTableService.getReportTableData( id );
+        data = reportTableService.getReportTableData( id, format );
         
         return SUCCESS;
-    }    
+    } 
 }

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tablecreator/action/GetTableDataExportAction.java'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tablecreator/action/GetTableDataExportAction.java	2009-04-16 10:14:30 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tablecreator/action/GetTableDataExportAction.java	2009-05-19 09:18:21 +0000
@@ -29,6 +29,7 @@
 
 import java.io.InputStream;
 
+import org.hisp.dhis.i18n.I18nFormat;
 import org.hisp.dhis.importexport.ExportParams;
 import org.hisp.dhis.importexport.ExportService;
 import org.hisp.dhis.importexport.ImportExportServiceManager;
@@ -52,6 +53,13 @@
     {
         this.serviceManager = serviceManager;
     }
+    
+    private I18nFormat format;
+
+    public void setFormat( I18nFormat format )
+    {
+        this.format = format;
+    }
 
     // -------------------------------------------------------------------------
     // Input
@@ -100,6 +108,7 @@
         ExportParams params = new ExportParams();
         
         params.getReportTables().add( id );
+        params.setFormat( format );
         
         inputStream = exportService.exportData( params );
         



--
Trunk
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.