dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #23576
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 11477: Change from DashboardService to DashboardManager
------------------------------------------------------------
revno: 11477
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2013-07-22 21:14:47 +0200
message:
Change from DashboardService to DashboardManager
modified:
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dashboard/action/ProvideContentAction.java
dhis-2/dhis-web/dhis-web-light/src/main/resources/META-INF/dhis/beans.xml
dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/AddMapViewToDashboardAction.java
dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/document/action/AddDocumentToDashboardAction.java
dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/reportviewer/action/AddReportToDashboardAction.java
dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tablecreator/action/AddReportTableToDashboardAction.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-light/src/main/java/org/hisp/dhis/light/dashboard/action/ProvideContentAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dashboard/action/ProvideContentAction.java 2013-05-21 11:39:31 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dashboard/action/ProvideContentAction.java 2013-07-22 19:14:47 +0000
@@ -8,7 +8,6 @@
import org.hisp.dhis.dashboard.DashboardConfiguration;
import org.hisp.dhis.dashboard.DashboardContent;
import org.hisp.dhis.dashboard.DashboardManager;
-import org.hisp.dhis.dashboard.DashboardService;
import org.hisp.dhis.document.Document;
import org.hisp.dhis.reporttable.ReportTable;
import org.hisp.dhis.user.CurrentUserService;
@@ -23,13 +22,6 @@
// Dependencies
// -------------------------------------------------------------------------
- private DashboardService dashboardService;
-
- public void setDashboardService( DashboardService dashboardService )
- {
- this.dashboardService = dashboardService;
- }
-
private DashboardManager dashboardManager;
public void setDashboardManager( DashboardManager dashboardManager )
@@ -50,7 +42,7 @@
{
this.chartService = chartService;
}
-
+
// -------------------------------------------------------------------------
// Output
// -------------------------------------------------------------------------
@@ -107,7 +99,7 @@
User user = currentUserService.getCurrentUser();
- DashboardContent content = dashboardService.getDashboardContent( user );
+ DashboardContent content = dashboardManager.getDashboardContent( user );
reportTables = content.getReportTables();
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-light/src/main/resources/META-INF/dhis/beans.xml 2013-04-15 09:36:45 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/resources/META-INF/dhis/beans.xml 2013-07-22 19:14:47 +0000
@@ -461,13 +461,13 @@
class="org.hisp.dhis.light.singleevent.action.FindSingleEventOptionSetAction">
<property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService" />
</bean>
+
<!-- Dashboard -->
<bean id="org.hisp.dhis.light.dashboard.action.ProvideContentAction"
class="org.hisp.dhis.light.dashboard.action.ProvideContentAction"
scope="prototype">
<property name="dashboardManager" ref="org.hisp.dhis.dashboard.DashboardManager" />
- <property name="dashboardService" ref="org.hisp.dhis.dashboard.DashboardService" />
<property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
<property name="chartService" ref="org.hisp.dhis.chart.ChartService" />
</bean>
=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/AddMapViewToDashboardAction.java'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/AddMapViewToDashboardAction.java 2013-06-17 11:19:14 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/AddMapViewToDashboardAction.java 2013-07-22 19:14:47 +0000
@@ -30,7 +30,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hisp.dhis.dashboard.DashboardContent;
-import org.hisp.dhis.dashboard.DashboardService;
+import org.hisp.dhis.dashboard.DashboardManager;
import org.hisp.dhis.mapping.Map;
import org.hisp.dhis.mapping.MappingService;
import org.hisp.dhis.user.CurrentUserService;
@@ -55,8 +55,8 @@
private CurrentUserService currentUserService;
@Autowired
- private DashboardService dashboardService;
-
+ private DashboardManager dashboardManager;
+
@Autowired
private MappingService mappingService;
@@ -81,13 +81,13 @@
if ( user != null )
{
- DashboardContent content = dashboardService.getDashboardContent( user );
+ DashboardContent content = dashboardManager.getDashboardContent( user );
Map map = mappingService.getMap( id );
content.addMap( map );
- dashboardService.saveDashboardContent( content );
+ dashboardManager.saveDashboardContent( content );
log.info( "Added mapview '" + map.getName() + "' to dashboard for user '" + user.getName() + "'" );
}
=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/document/action/AddDocumentToDashboardAction.java'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/document/action/AddDocumentToDashboardAction.java 2013-04-30 11:25:21 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/document/action/AddDocumentToDashboardAction.java 2013-07-22 19:14:47 +0000
@@ -30,11 +30,12 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hisp.dhis.dashboard.DashboardContent;
-import org.hisp.dhis.dashboard.DashboardService;
+import org.hisp.dhis.dashboard.DashboardManager;
import org.hisp.dhis.document.Document;
import org.hisp.dhis.document.DocumentService;
import org.hisp.dhis.user.CurrentUserService;
import org.hisp.dhis.user.User;
+import org.springframework.beans.factory.annotation.Autowired;
import com.opensymphony.xwork2.Action;
@@ -57,19 +58,15 @@
this.currentUserService = currentUserService;
}
- private DashboardService dashboardService;
-
- public void setDashboardService( DashboardService dashboardService )
- {
- this.dashboardService = dashboardService;
- }
-
private DocumentService documentService;
public void setDocumentService( DocumentService documentService )
{
this.documentService = documentService;
}
+
+ @Autowired
+ private DashboardManager dashboardManager;
// -------------------------------------------------------------------------
// Input
@@ -92,13 +89,13 @@
if ( user != null )
{
- DashboardContent content = dashboardService.getDashboardContent( user );
+ DashboardContent content = dashboardManager.getDashboardContent( user );
Document document = documentService.getDocument( id );
content.addDocument( document );
- dashboardService.saveDashboardContent( content );
+ dashboardManager.saveDashboardContent( content );
log.info( "Added document '" + document.getName() + "' to dashboard for user '" + user.getName() + "'" );
}
=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/reportviewer/action/AddReportToDashboardAction.java'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/reportviewer/action/AddReportToDashboardAction.java 2013-04-30 11:25:21 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/reportviewer/action/AddReportToDashboardAction.java 2013-07-22 19:14:47 +0000
@@ -30,11 +30,12 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hisp.dhis.dashboard.DashboardContent;
-import org.hisp.dhis.dashboard.DashboardService;
+import org.hisp.dhis.dashboard.DashboardManager;
import org.hisp.dhis.report.Report;
import org.hisp.dhis.report.ReportService;
import org.hisp.dhis.user.CurrentUserService;
import org.hisp.dhis.user.User;
+import org.springframework.beans.factory.annotation.Autowired;
import com.opensymphony.xwork2.Action;
@@ -57,13 +58,6 @@
this.currentUserService = currentUserService;
}
- private DashboardService dashboardService;
-
- public void setDashboardService( DashboardService dashboardService )
- {
- this.dashboardService = dashboardService;
- }
-
private ReportService reportService;
public void setReportService( ReportService reportService )
@@ -71,6 +65,9 @@
this.reportService = reportService;
}
+ @Autowired
+ private DashboardManager dashboardManager;
+
// -------------------------------------------------------------------------
// Input
// -------------------------------------------------------------------------
@@ -92,13 +89,13 @@
if ( user != null )
{
- DashboardContent content = dashboardService.getDashboardContent( user );
+ DashboardContent content = dashboardManager.getDashboardContent( user );
Report report = reportService.getReport( id );
content.addReport( report );
- dashboardService.saveDashboardContent( content );
+ dashboardManager.saveDashboardContent( content );
log.info( "Added report '" + report.getName() + "' to dashboard for user '" + user.getName() + "'" );
}
=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tablecreator/action/AddReportTableToDashboardAction.java'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tablecreator/action/AddReportTableToDashboardAction.java 2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tablecreator/action/AddReportTableToDashboardAction.java 2013-07-22 19:14:47 +0000
@@ -30,11 +30,12 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hisp.dhis.dashboard.DashboardContent;
-import org.hisp.dhis.dashboard.DashboardService;
+import org.hisp.dhis.dashboard.DashboardManager;
import org.hisp.dhis.reporttable.ReportTable;
import org.hisp.dhis.reporttable.ReportTableService;
import org.hisp.dhis.user.CurrentUserService;
import org.hisp.dhis.user.User;
+import org.springframework.beans.factory.annotation.Autowired;
import com.opensymphony.xwork2.Action;
@@ -58,13 +59,6 @@
this.currentUserService = currentUserService;
}
- private DashboardService dashboardService;
-
- public void setDashboardService( DashboardService dashboardService )
- {
- this.dashboardService = dashboardService;
- }
-
private ReportTableService reportTableService;
public void setReportTableService( ReportTableService reportTableService )
@@ -72,6 +66,9 @@
this.reportTableService = reportTableService;
}
+ @Autowired
+ private DashboardManager dashboardManager;
+
// -------------------------------------------------------------------------
// Input
// -------------------------------------------------------------------------
@@ -93,13 +90,13 @@
if ( user != null )
{
- DashboardContent content = dashboardService.getDashboardContent( user );
+ DashboardContent content = dashboardManager.getDashboardContent( user );
ReportTable reportTable = reportTableService.getReportTable( id );
content.addReportTable( reportTable );
- dashboardService.saveDashboardContent( content );
+ dashboardManager.saveDashboardContent( content );
log.info( "Added report table '" + reportTable.getName() + "' to dashboard for user '" + user.getName() + "'" );
}
=== 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 2013-05-29 20:10:38 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/resources/META-INF/dhis/beans.xml 2013-07-22 19:14:47 +0000
@@ -31,7 +31,6 @@
<bean id="org.hisp.dhis.reporting.document.action.AddDocumentToDashboardAction" class="org.hisp.dhis.reporting.document.action.AddDocumentToDashboardAction"
scope="prototype">
<property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
- <property name="dashboardService" ref="org.hisp.dhis.dashboard.DashboardService" />
<property name="documentService" ref="org.hisp.dhis.document.DocumentService" />
</bean>
@@ -61,7 +60,6 @@
<bean id="org.hisp.dhis.reporting.tablecreator.action.AddReportTableToDashboardAction" class="org.hisp.dhis.reporting.tablecreator.action.AddReportTableToDashboardAction"
scope="prototype">
<property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
- <property name="dashboardService" ref="org.hisp.dhis.dashboard.DashboardService" />
<property name="reportTableService" ref="org.hisp.dhis.reporttable.ReportTableService" />
</bean>
@@ -103,7 +101,6 @@
<bean id="org.hisp.dhis.reporting.reportviewer.action.AddReportToDashboardAction" class="org.hisp.dhis.reporting.reportviewer.action.AddReportToDashboardAction"
scope="prototype">
<property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
- <property name="dashboardService" ref="org.hisp.dhis.dashboard.DashboardService" />
<property name="reportService" ref="org.hisp.dhis.report.ReportService" />
</bean>