← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2665: Fixed bug related to loading of reports and report tables from dashboard

 

------------------------------------------------------------
revno: 2665
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2011-01-20 09:46:49 +0100
message:
  Fixed bug related to loading of reports and report tables from dashboard
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/report/Report.java
  dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/engine/DefaultDataMartEngine.java
  dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/provider/ReportContentProvider.java
  dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/report_table.vm
  dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/reportviewer/action/GetAllReportsAction.java
  dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewReportForm.vm


--
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/report/Report.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/report/Report.java	2010-07-28 13:44:59 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/report/Report.java	2011-01-20 08:46:49 +0000
@@ -42,7 +42,7 @@
 {
     public static final String TYPE_BIRT = "birt";
     public static final String TYPE_JASPER = "jasper";
-    public static final String TYPE_DEFAULT = TYPE_BIRT;
+    public static final String TYPE_DEFAULT = TYPE_JASPER;
     public static final String TEMPLATE_DIR = "templates";
     
     private String design;

=== modified file 'dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/engine/DefaultDataMartEngine.java'
--- dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/engine/DefaultDataMartEngine.java	2011-01-19 12:04:43 +0000
+++ dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/engine/DefaultDataMartEngine.java	2011-01-20 08:46:49 +0000
@@ -315,7 +315,7 @@
         {
             count += indicatorDataMart.exportIndicatorValues( indicators, periods, organisationUnits, indicatorOperands, keys );
 
-            log.info( "Exported values for indicators: " + TimeUtils.getHMS() );
+            log.info( "Exported values for indicators (" + indicators.size() + "): " + TimeUtils.getHMS() );
         }
 
         state.setMessage( "exporting_data_for_calculated_data_elements" );
@@ -328,9 +328,13 @@
         {
             count += calculatedDataElementDataMart.exportCalculatedDataElements( calculatedDataElements, periods, organisationUnits, calculatedOperands, keys );
 
-            log.info( "Exported values for calculated data elements: " + TimeUtils.getHMS() );
+            log.info( "Exported values for calculated data elements (" + calculatedDataElements.size() + "): " + TimeUtils.getHMS() );
         }
 
+        // ---------------------------------------------------------------------
+        // Drop crosstab tables
+        // ---------------------------------------------------------------------
+
         for ( String key : keys )
         {
             crossTabService.dropCrossTabTable( key );

=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/provider/ReportContentProvider.java'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/provider/ReportContentProvider.java	2010-08-27 05:22:53 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/provider/ReportContentProvider.java	2011-01-20 08:46:49 +0000
@@ -64,7 +64,8 @@
     
     private static final String SEPARATOR = "/";
     private static final String BASE_QUERY = "frameset?__report=";
-    private static final String JASPER_BASE_URL = "../dhis-web-reporting/renderReport.action?id=";
+    private static final String JASPER_BASE_URL = "../dhis-web-reporting/getReportParams.action?id=";
+    private static final String JASPER_RENDER_URL = "&mode=report&url=renderReport.action?id=";
     
     // -------------------------------------------------------------------------
     // Dependencies
@@ -127,7 +128,7 @@
             {
                 for ( Report report : reports )
                 {
-                    report.setUrl( JASPER_BASE_URL + report.getId() );
+                    report.setUrl( JASPER_BASE_URL + report.getId() + JASPER_RENDER_URL + report.getId() );
                 }
             }
             else if ( framework.equals( TYPE_BIRT ) )

=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/report_table.vm'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/report_table.vm	2009-12-06 14:26:06 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/report_table.vm	2011-01-20 08:46:49 +0000
@@ -6,7 +6,7 @@
     #foreach ( $table in $reportTables )
     <tr>
         <td>
-            <a href="../dhis-web-reporting/getBlankTableData.action?id=${table.id}" target="_blank">$table.name</a>
+            <a href="../dhis-web-reporting/getReportParams.action?id=${table.id}&mode=table" target="_blank">$table.name</a>
         </td>       
         <td style="width:16px">
             <a href="javascript:window.location.href='removeReportTable.action?id=$table.id'" title="$i18n.getString( 'remove' )">

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/reportviewer/action/GetAllReportsAction.java'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/reportviewer/action/GetAllReportsAction.java	2010-12-15 06:32:21 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/reportviewer/action/GetAllReportsAction.java	2011-01-20 08:46:49 +0000
@@ -54,6 +54,7 @@
 {
     private static final String SEPARATOR = "/";
     private static final String BASE_QUERY = "frameset?__report=";
+    private static final String JASPER_BASE_URL = "renderReport.action?id=";
     
     // -------------------------------------------------------------------------
     // Dependencies
@@ -110,13 +111,13 @@
     public String execute() 
         throws Exception
     {
-        String reportFramework = (String) systemSettingManager.getSystemSetting( SystemSettingManager.KEY_REPORT_FRAMEWORK );
+        String reportFramework = (String) systemSettingManager.getSystemSetting( SystemSettingManager.KEY_REPORT_FRAMEWORK, Report.TYPE_DEFAULT );
         
-        if ( reportFramework != null && reportFramework.equals( Report.TYPE_JASPER ) )
+        if ( reportFramework.equals( Report.TYPE_JASPER ) )
         {
             for ( Report report : reportService.getAllReports() )
             {
-                report.setUrl( "renderReport.action?id=" + report.getId() );
+                report.setUrl( JASPER_BASE_URL + report.getId() );
                 
                 reports.add( report );
             }
@@ -125,24 +126,15 @@
         {
             ReportConfiguration config = reportManager.getConfiguration();
             
-            String birtHome = config.getHome();
-            
-            String birtDirectory = config.getDirectory();
-    
             HttpServletRequest request = ServletActionContext.getRequest();
             
-            String birtURL = getBaseUrl( request ) + birtDirectory + SEPARATOR + BASE_QUERY;
+            String birtURL = getBaseUrl( request ) + config.getDirectory() + SEPARATOR + BASE_QUERY;
             
-            if ( birtHome != null && birtDirectory != null )
+            for ( Report report : reportService.getAllReports() )
             {
-                for ( Report report : reportService.getAllReports() )
-                {
-                    String url = birtURL + report.getDesign();
-                    
-                    report.setUrl( url );
-                    
-                    reports.add( report );
-                }
+                report.setUrl( birtURL + report.getDesign() );
+                
+                reports.add( report );
             }
         }
         
@@ -154,10 +146,10 @@
             
             this.paging = createPaging( reports.size() );
             
-            reports = getBlockElement( reports, paging.getStartPos(), paging.getPageSize() );
-           
+            reports = getBlockElement( reports, paging.getStartPos(), paging.getPageSize() );           
         }
-        else {
+        else 
+        {
             this.paging = createPaging( reports.size() );
                 
             reports = getBlockElement( reports, paging.getStartPos(), paging.getPageSize() );
@@ -177,6 +169,7 @@
                 result.add( each );
             }
         }
+        
         return result;
     }
 }

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewReportForm.vm'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewReportForm.vm	2010-12-13 14:58:04 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewReportForm.vm	2011-01-20 08:46:49 +0000
@@ -26,7 +26,7 @@
                 <tr id="tr${report.id}">
                     <td>$encoder.htmlEncode( $report.name )</td>
                     <td style="text-align:right">
-                    	#if ( $report.hasReportTable ) <a href="getReportParams.action?id=$report.id&url=$report.url&mode=report" title="$i18n.getString( 'create' )">
+                    	#if ( $report.hasReportTable ) <a href="getReportParams.action?id=$report.id&mode=report&url=$report.url" title="$i18n.getString( 'create' )">
                     	#else <a href="javascript:viewReport( '$encoder.htmlEncode( $report.url )' )" title="$i18n.getString( 'create' )">#end
                     	<img src="../images/start_process.png" alt="$i18n.getString( 'create' )"></a>                   
 						<a href="displayAddReportForm.action?id=$report.id" title="$i18n.getString( 'edit_report' )"><img src="../images/edit.png" alt="$i18n.getString( 'edit_report' )"></a>