← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2793: Removed BIRT from dashboard too

 

------------------------------------------------------------
revno: 2793
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2011-02-01 12:09:50 +0100
message:
  Removed BIRT from dashboard too
modified:
  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/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-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	2011-01-20 08:46:49 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/provider/ReportContentProvider.java	2011-02-01 11:09:50 +0000
@@ -27,29 +27,15 @@
  * 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 static org.hisp.dhis.report.Report.TYPE_JASPER;
-import static org.hisp.dhis.util.ContextUtils.getBaseUrl;
-
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import javax.servlet.http.HttpServletRequest;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.struts2.ServletActionContext;
 import org.hisp.dhis.dashboard.DashboardContent;
 import org.hisp.dhis.dashboard.DashboardService;
-import org.hisp.dhis.external.configuration.NoConfigurationFoundException;
-import org.hisp.dhis.options.SystemSettingManager;
 import org.hisp.dhis.report.Report;
-import org.hisp.dhis.report.ReportManager;
 import org.hisp.dhis.report.comparator.ReportComparator;
-import org.hisp.dhis.report.manager.ReportConfiguration;
 import org.hisp.dhis.user.CurrentUserService;
 import org.hisp.dhis.user.User;
 
@@ -60,10 +46,6 @@
 public class ReportContentProvider
     implements ContentProvider
 {
-    private static final Log log = LogFactory.getLog( ReportContentProvider.class );
-    
-    private static final String SEPARATOR = "/";
-    private static final String BASE_QUERY = "frameset?__report=";
     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=";
     
@@ -78,13 +60,6 @@
         this.currentUserService = currentUserService;
     }
     
-    private SystemSettingManager systemSettingManager;
-
-    public void setSystemSettingManager( SystemSettingManager systemSettingManager )
-    {
-        this.systemSettingManager = systemSettingManager;
-    }
-
     private DashboardService dashboardService;
 
     public void setDashboardService( DashboardService dashboardService )
@@ -92,13 +67,6 @@
         this.dashboardService = dashboardService;
     }
     
-    private ReportManager reportManager;
-
-    public void setReportManager( ReportManager reportManager )
-    {
-        this.reportManager = reportManager;
-    }
-    
     private String key;
     
     public void setKey( String key )
@@ -120,37 +88,11 @@
         {
             DashboardContent dashboardContent = dashboardService.getDashboardContent( user );
             
-            String framework = (String) systemSettingManager.getSystemSetting( SystemSettingManager.KEY_REPORT_FRAMEWORK, TYPE_DEFAULT );
-            
             List<Report> reports = dashboardContent.getReports();
             
-            if ( framework.equals( TYPE_JASPER ) )
+            for ( Report report : reports )
             {
-                for ( Report report : reports )
-                {
-                    report.setUrl( JASPER_BASE_URL + report.getId() + JASPER_RENDER_URL + report.getId() );
-                }
-            }
-            else if ( framework.equals( TYPE_BIRT ) )
-            {            
-                try
-                {
-                    ReportConfiguration config = reportManager.getConfiguration();
-                    
-                    HttpServletRequest request = ServletActionContext.getRequest();
-                    
-                    String birtURL = getBaseUrl( request ) + config.getDirectory() + SEPARATOR + BASE_QUERY;
-                    
-                    for ( Report report : reports )
-                    {
-                        report.setUrl( birtURL + report.getDesign() );
-                    }
-                    
-                }
-                catch ( NoConfigurationFoundException ex )
-                {
-                    log.error( "Report configuration not set" );
-                }
+                report.setUrl( JASPER_BASE_URL + report.getId() + JASPER_RENDER_URL + report.getId() );
             }
 
             Collections.sort( reports, new ReportComparator() );

=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/META-INF/dhis/beans.xml	2011-01-21 16:22:50 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/META-INF/dhis/beans.xml	2011-02-01 11:09:50 +0000
@@ -9,9 +9,7 @@
   <bean id="reportContentProvider" 
     class="org.hisp.dhis.dashboard.provider.ReportContentProvider">
     <property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService"/>
-	<property name="systemSettingManager" ref="org.hisp.dhis.options.SystemSettingManager"/>
     <property name="dashboardService" ref="org.hisp.dhis.dashboard.DashboardService"/>
-    <property name="reportManager" ref="org.hisp.dhis.report.ReportManager"/>
     <property name="key" value="reports"/>
   </bean>