← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 21623: AnalyticalObjectService for event report and event chart

 

------------------------------------------------------------
revno: 21623
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2016-01-06 15:37:53 +0100
message:
  AnalyticalObjectService for event report and event chart
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/eventchart/EventChartService.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/eventreport/EventReportService.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/eventchart/DefaultEventChartService.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/eventreport/DefaultEventReportService.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/eventreport/EventReportDeletionHandler.java
  dhis-2/dhis-services/dhis-service-core/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-api/src/main/java/org/hisp/dhis/eventchart/EventChartService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/eventchart/EventChartService.java	2016-01-04 02:27:49 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/eventchart/EventChartService.java	2016-01-06 14:37:53 +0000
@@ -30,10 +30,13 @@
 
 import java.util.List;
 
+import org.hisp.dhis.common.AnalyticalObjectService;
+
 /**
 * @author Lars Helge Overland
 */
 public interface EventChartService
+    extends AnalyticalObjectService<EventChart>
 {
     int saveEventChart( EventChart eventChart );
     

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/eventreport/EventReportService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/eventreport/EventReportService.java	2016-01-04 02:27:49 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/eventreport/EventReportService.java	2016-01-06 14:37:53 +0000
@@ -30,10 +30,13 @@
 
 import java.util.List;
 
+import org.hisp.dhis.common.AnalyticalObjectService;
+
 /**
 * @author Lars Helge Overland
 */
 public interface EventReportService
+    extends AnalyticalObjectService<EventReport>
 {
     int saveEventReport( EventReport report );
     

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/eventchart/DefaultEventChartService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/eventchart/DefaultEventChartService.java	2016-01-04 02:27:49 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/eventchart/DefaultEventChartService.java	2016-01-06 14:37:53 +0000
@@ -30,7 +30,9 @@
 
 import java.util.List;
 
-import org.hisp.dhis.common.hibernate.HibernateIdentifiableObjectStore;
+import org.hisp.dhis.common.AnalyticalObjectStore;
+import org.hisp.dhis.common.GenericAnalyticalObjectService;
+import org.hisp.dhis.common.hibernate.HibernateAnalyticalObjectStore;
 import org.springframework.transaction.annotation.Transactional;
 
 /**
@@ -38,11 +40,12 @@
 */
 @Transactional
 public class DefaultEventChartService
+    extends GenericAnalyticalObjectService<EventChart>
     implements EventChartService
 {
-    private HibernateIdentifiableObjectStore<EventChart> eventChartStore;
+    private HibernateAnalyticalObjectStore<EventChart> eventChartStore;
 
-    public void setEventChartStore( HibernateIdentifiableObjectStore<EventChart> eventChartStore )
+    public void setEventChartStore( HibernateAnalyticalObjectStore<EventChart> eventChartStore )
     {
         this.eventChartStore = eventChartStore;
     }
@@ -52,6 +55,12 @@
     // -------------------------------------------------------------------------
 
     @Override
+    protected AnalyticalObjectStore<EventChart> getAnalyticalObjectStore()
+    {
+        return eventChartStore;
+    }
+    
+    @Override
     public int saveEventChart( EventChart eventChart )
     {
         return eventChartStore.save( eventChart );

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/eventreport/DefaultEventReportService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/eventreport/DefaultEventReportService.java	2016-01-04 02:27:49 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/eventreport/DefaultEventReportService.java	2016-01-06 14:37:53 +0000
@@ -30,7 +30,9 @@
 
 import java.util.List;
 
-import org.hisp.dhis.common.hibernate.HibernateIdentifiableObjectStore;
+import org.hisp.dhis.common.AnalyticalObjectStore;
+import org.hisp.dhis.common.GenericAnalyticalObjectService;
+import org.hisp.dhis.common.hibernate.HibernateAnalyticalObjectStore;
 import org.springframework.transaction.annotation.Transactional;
 
 /**
@@ -38,11 +40,12 @@
 */
 @Transactional
 public class DefaultEventReportService
+    extends GenericAnalyticalObjectService<EventReport>
     implements EventReportService
 {
-    private HibernateIdentifiableObjectStore<EventReport> eventReportStore;
+    private HibernateAnalyticalObjectStore<EventReport> eventReportStore;
 
-    public void setEventReportStore( HibernateIdentifiableObjectStore<EventReport> eventReportStore )
+    public void setEventReportStore( HibernateAnalyticalObjectStore<EventReport> eventReportStore )
     {
         this.eventReportStore = eventReportStore;
     }
@@ -52,6 +55,12 @@
     // -------------------------------------------------------------------------
 
     @Override
+    protected AnalyticalObjectStore<EventReport> getAnalyticalObjectStore()
+    {
+        return eventReportStore;
+    }
+    
+    @Override
     public int saveEventReport( EventReport report )
     {
         return eventReportStore.save( report );

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/eventreport/EventReportDeletionHandler.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/eventreport/EventReportDeletionHandler.java	2016-01-04 02:27:49 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/eventreport/EventReportDeletionHandler.java	2016-01-06 14:37:53 +0000
@@ -63,7 +63,7 @@
     {
         Collection<EventReport> charts = eventReportService.getAllEventReports();
         
-        for( EventReport chart : charts )
+        for ( EventReport chart : charts )
         {
             if( chart.getProgramStage().equals( programStage ))
             {
@@ -77,7 +77,7 @@
     {
         Collection<EventReport> charts = eventReportService.getAllEventReports();
         
-        for( EventReport chart : charts )
+        for ( EventReport chart : charts )
         {
             if( chart.getProgram().equals( program ))
             {

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/beans.xml	2016-01-05 14:03:19 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/beans.xml	2016-01-06 14:37:53 +0000
@@ -580,13 +580,13 @@
   </bean>
 
   <bean id="org.hisp.dhis.eventreport.EventReportStore"
-    class="org.hisp.dhis.common.hibernate.HibernateIdentifiableObjectStore">
+    class="org.hisp.dhis.common.hibernate.HibernateAnalyticalObjectStore">
     <property name="clazz" value="org.hisp.dhis.eventreport.EventReport" />
     <property name="sessionFactory" ref="sessionFactory" />
   </bean>
 
   <bean id="org.hisp.dhis.eventchart.EventChartStore"
-    class="org.hisp.dhis.common.hibernate.HibernateIdentifiableObjectStore">
+    class="org.hisp.dhis.common.hibernate.HibernateAnalyticalObjectStore">
     <property name="clazz" value="org.hisp.dhis.eventchart.EventChart" />
     <property name="sessionFactory" ref="sessionFactory" />
   </bean>