← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 15206: Removed unused action class and service method

 

------------------------------------------------------------
revno: 15206
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2014-05-09 17:56:43 +0200
message:
  Removed unused action class and service method
removed:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/RemoveEmptyEventsAction.java
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstanceService.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstanceStore.java
  dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/DefaultProgramStageInstanceService.java
  dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStageInstanceStore.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.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/program/ProgramStageInstanceService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstanceService.java	2014-05-07 10:09:11 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstanceService.java	2014-05-09 15:56:43 +0000
@@ -157,14 +157,6 @@
     List<Grid> getProgramStageInstancesReport( ProgramInstance programInstance, I18nFormat format, I18n i18n );
 
     /**
-     * Remove events without any data values
-     * 
-     * @param programStage Empty events belong to this program stage are removed
-     * @param organisationUnit Specify an orgunit where empty events belong to
-     */
-    void removeEmptyEvents( ProgramStage programStage, OrganisationUnit organisationUnit );
-
-    /**
      * Create relationship between an OutboundSms with many events.
      * 
      * @param programStageInstances Event list

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstanceStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstanceStore.java	2014-05-07 10:09:11 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstanceStore.java	2014-05-09 15:56:43 +0000
@@ -35,7 +35,6 @@
 import org.hisp.dhis.common.GenericIdentifiableObjectStore;
 import org.hisp.dhis.common.Grid;
 import org.hisp.dhis.i18n.I18n;
-import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.sms.outbound.OutboundSms;
 import org.hisp.dhis.trackedentity.TrackedEntityInstance;
 
@@ -102,14 +101,6 @@
     List<ProgramStageInstance> get( TrackedEntityInstance entityInstance, Boolean completed );
 
     /**
-     * Remove events without any data values
-     * 
-     * @param programStage Empty events belong to this program stage are removed
-     * @param organisationUnit Specify an orgunit where empty events belong to
-     */
-    void removeEmptyEvents( ProgramStage programStage, OrganisationUnit organisationUnit );
-
-    /**
      * Create relationship between an OutboundSms with many events.
      * 
      * @param programStageInstances Event list

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/DefaultProgramStageInstanceService.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/DefaultProgramStageInstanceService.java	2014-05-07 10:09:11 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/DefaultProgramStageInstanceService.java	2014-05-09 15:56:43 +0000
@@ -61,7 +61,6 @@
 
 /**
  * @author Abyot Asalefew
- * @version $Id$
  */
 @Transactional
 public class DefaultProgramStageInstanceService
@@ -266,12 +265,6 @@
     }
 
     @Override
-    public void removeEmptyEvents( ProgramStage programStage, OrganisationUnit organisationUnit )
-    {
-        programStageInstanceStore.removeEmptyEvents( programStage, organisationUnit );
-    }
-
-    @Override
     public void updateProgramStageInstances( Collection<Integer> programStageInstanceIds, OutboundSms outboundSms )
     {
         programStageInstanceStore.update( programStageInstanceIds, outboundSms );

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStageInstanceStore.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStageInstanceStore.java	2014-05-09 15:49:36 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStageInstanceStore.java	2014-05-09 15:56:43 +0000
@@ -43,7 +43,6 @@
 import org.hisp.dhis.common.GridHeader;
 import org.hisp.dhis.common.hibernate.HibernateIdentifiableObjectStore;
 import org.hisp.dhis.i18n.I18n;
-import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.period.PeriodType;
 import org.hisp.dhis.program.Program;
 import org.hisp.dhis.program.ProgramInstance;
@@ -132,15 +131,6 @@
     // TODO this class must be re-written from here
     
     @Override
-    public void removeEmptyEvents( ProgramStage programStage, OrganisationUnit organisationUnit )
-    {
-        String sql = "delete from programstageinstance where programstageid=" + programStage.getId()
-            + " and organisationunitid=" + organisationUnit.getId() + " and programstageinstanceid not in "
-            + "(select pdv.programstageinstanceid from trackedentitydatavalue pdv )";
-        jdbcTemplate.execute( sql );
-    }
-
-    @Override
     public void update( Collection<Integer> programStageInstanceIds, OutboundSms outboundSms )
     {
         for ( Integer programStageInstanceId : programStageInstanceIds )

=== removed file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/RemoveEmptyEventsAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/RemoveEmptyEventsAction.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/RemoveEmptyEventsAction.java	1970-01-01 00:00:00 +0000
@@ -1,103 +0,0 @@
-package org.hisp.dhis.caseentry.action.caseentry;
-
-/*
- * Copyright (c) 2004-2014, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * Neither the name of the HISP project nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import org.hisp.dhis.organisationunit.OrganisationUnit;
-import org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager;
-import org.hisp.dhis.program.ProgramStage;
-import org.hisp.dhis.program.ProgramStageInstanceService;
-import org.hisp.dhis.program.ProgramStageService;
-
-import com.opensymphony.xwork2.Action;
-
-/**
- * @author Chau Thu Tran
- * @version RemoveEmptyEventsAction.java Jul 3, 2012 $
- */
-public class RemoveEmptyEventsAction
-    implements Action
-{
-    // -------------------------------------------------------------------------
-    // Dependencies
-    // -------------------------------------------------------------------------
-
-    private ProgramStageService programStageService;
-
-    public void setProgramStageService( ProgramStageService programStageService )
-    {
-        this.programStageService = programStageService;
-    }
-
-    private ProgramStageInstanceService programStageInstanceService;
-
-    public void setProgramStageInstanceService( ProgramStageInstanceService programStageInstanceService )
-    {
-        this.programStageInstanceService = programStageInstanceService;
-    }
-
-    private OrganisationUnitSelectionManager selectionManager;
-
-    public void setSelectionManager( OrganisationUnitSelectionManager selectionManager )
-    {
-        this.selectionManager = selectionManager;
-    }
-
-    // -------------------------------------------------------------------------
-    // Input/Output
-    // -------------------------------------------------------------------------
-
-    private Integer programStageId;
-
-    public void setProgramStageId( Integer programStageId )
-    {
-        this.programStageId = programStageId;
-    }
-
-    // -------------------------------------------------------------------------
-    // Implementation Action
-    // -------------------------------------------------------------------------
-
-    public String execute()
-        throws Exception
-    {
-        if ( programStageId == null )
-        {
-            return INPUT;
-        }
-
-        ProgramStage programStage = programStageService.getProgramStage( programStageId );
-
-        OrganisationUnit organisationUnit = selectionManager.getSelectedOrganisationUnit();
-
-        programStageInstanceService.removeEmptyEvents( programStage, organisationUnit );
-
-        return SUCCESS;
-    }
-
-}

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml	2014-05-08 13:39:17 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml	2014-05-09 15:56:43 +0000
@@ -351,17 +351,6 @@
 		<property name="programStageService" ref="org.hisp.dhis.program.ProgramStageService" />
 	</bean>
 
-	<bean
-		id="org.hisp.dhis.caseentry.action.caseentry.RemoveEmptyEventsAction"
-		class="org.hisp.dhis.caseentry.action.caseentry.RemoveEmptyEventsAction"
-		scope="prototype">
-		<property name="programStageService" ref="org.hisp.dhis.program.ProgramStageService" />
-		<property name="programStageInstanceService"
-			ref="org.hisp.dhis.program.ProgramStageInstanceService" />
-		<property name="selectionManager"
-			ref="org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager" />
-	</bean>
-
 	<!-- Tracked Entity Instance -->
 
 	<bean id="org.hisp.dhis.caseentry.action.trackedentity.SelectAction"

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml	2014-05-08 13:39:17 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml	2014-05-09 15:56:43 +0000
@@ -212,13 +212,6 @@
 			</result>
 		</action>
 
-		<action name="removeEmptyEvents"
-			class="org.hisp.dhis.caseentry.action.caseentry.RemoveEmptyEventsAction">
-			<result name="success" type="velocity-json">
-				/dhis-web-commons/ajax/jsonResponseSuccess.vm
-			</result>
-		</action>
-
 		<action name="getUsernameList"
 			class="org.hisp.dhis.caseentry.action.caseentry.GetUsernameListAction">
 			<result name="success" type="velocity-json">/dhis-web-caseentry/jsonUsernames.vm