← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 1196: Fixed bug: System asked for report config even if using Jasper as report frameworl. The report co...

 

------------------------------------------------------------
revno: 1196
committer: Lars Helge Oeverland larshelge@xxxxxxxxx
branch nick: trunk
timestamp: Wed 2009-12-09 16:55:44 +0100
message:
  Fixed bug: System asked for report config even if using Jasper as report frameworl. The report config is only relevant when using Birt.
modified:
  dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/reportviewer/action/GetReportConfigurationAction.java
  dhis-2/dhis-web/dhis-web-reporting/src/main/resources/META-INF/dhis/beans.xml


--
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-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/reportviewer/action/GetReportConfigurationAction.java'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/reportviewer/action/GetReportConfigurationAction.java	2009-08-20 08:17:49 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/reportviewer/action/GetReportConfigurationAction.java	2009-12-09 15:55:44 +0000
@@ -27,8 +27,12 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import static org.hisp.dhis.report.Report.TYPE_BIRT;
+import static org.hisp.dhis.report.Report.TYPE_DEFAULT;
+
 import org.hisp.dhis.external.configuration.NoConfigurationFoundException;
 import org.hisp.dhis.i18n.I18n;
+import org.hisp.dhis.options.SystemSettingManager;
 import org.hisp.dhis.report.ReportManager;
 import org.hisp.dhis.report.manager.ReportConfiguration;
 
@@ -70,6 +74,13 @@
         return reportConfiguration;
     }
     
+    private SystemSettingManager systemSettingManager;
+    
+    public void setSystemSettingManager( SystemSettingManager systemSettingManager )
+    {
+        this.systemSettingManager = systemSettingManager;
+    }
+
     private String message;
 
     public String getMessage()
@@ -83,15 +94,20 @@
 
     public String execute()
     {
-        try
-        {
-            reportConfiguration = reportManager.getConfiguration();
-        }
-        catch ( NoConfigurationFoundException ex )
-        {
-            message = i18n.getString( "set_configuration" );
-            
-            return NONE;
+        String framework = (String) systemSettingManager.getSystemSetting( SystemSettingManager.KEY_REPORT_FRAMEWORK, TYPE_DEFAULT );
+        
+        if ( framework.equals( TYPE_BIRT ) )
+        {
+            try
+            {
+                reportConfiguration = reportManager.getConfiguration();
+            }
+            catch ( NoConfigurationFoundException ex )
+            {
+                message = i18n.getString( "set_configuration" );
+                
+                return NONE;
+            }
         }
         
         return SUCCESS;

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/resources/META-INF/dhis/beans.xml	2009-11-16 10:32:46 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/resources/META-INF/dhis/beans.xml	2009-12-09 15:55:44 +0000
@@ -364,6 +364,8 @@
     scope="prototype">
     <property name="reportManager"
       ref="org.hisp.dhis.report.ReportManager"/>
+	<property name="systemSettingManager"
+	  ref="org.hisp.dhis.options.SystemSettingManager"/>
   </bean>
   
   <bean id="org.hisp.dhis.reporting.reportviewer.action.AddReportToDashboardAction"