← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2757: Removed custom values action from patient module

 

------------------------------------------------------------
revno: 2757
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2011-01-26 00:29:58 +0100
message:
  Removed custom values action from patient module
removed:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/dataentryform/GetCustomValuesAction.java
modified:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/relationship/ValidateRelationshipTypeAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/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
=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/dataentryform/GetCustomValuesAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/dataentryform/GetCustomValuesAction.java	2010-06-23 12:06:35 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/dataentryform/GetCustomValuesAction.java	1970-01-01 00:00:00 +0000
@@ -1,248 +0,0 @@
-package org.hisp.dhis.patient.action.dataentryform;
-
-/*
- * Copyright (c) 2004-2009, 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 java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.hisp.dhis.customvalue.CustomValue;
-import org.hisp.dhis.customvalue.CustomValueService;
-import org.hisp.dhis.dataelement.DataElement;
-import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
-import org.hisp.dhis.dataelement.DataElementCategoryService;
-import org.hisp.dhis.dataelement.DataElementService;
-
-import com.opensymphony.xwork2.Action;
-
-/**
- * @author Latifov Murodillo Abdusamadovich
- * 
- * @version $Id$
- */
-public class GetCustomValuesAction
-    implements Action
-{
-    // -------------------------------------------------------------------------
-    // Dependencies
-    // -------------------------------------------------------------------------
-
-    private DataElementService dataElementService;
-
-    public void setDataElementService( DataElementService dataElementService )
-    {
-        this.dataElementService = dataElementService;
-    }
-
-    private DataElementCategoryService dataElementCategoryService;
-
-    public void setDataElementCategoryService( DataElementCategoryService dataElementCategoryService )
-    {
-        this.dataElementCategoryService = dataElementCategoryService;
-    }
-
-    private CustomValueService customValueService;
-
-    public void setCustomValueService( CustomValueService customValueService )
-    {
-        this.customValueService = customValueService;
-    }
-
-    // -------------------------------------------------------------------------
-    // Getters & Setters
-    // -------------------------------------------------------------------------
-
-    private int customValueId;
-
-    public int getCustomValueId()
-    {
-        return customValueId;
-    }
-
-    public void setCustomValueId( int customValueId )
-    {
-        this.customValueId = customValueId;
-    }
-
-    private int dataElementId;
-
-    public void setDataElementId( int dataElementId )
-    {
-        this.dataElementId = dataElementId;
-    }
-
-    private int associationId;
-
-    public int getAssociationId()
-    {
-        return associationId;
-    }
-
-    public void setAssociationId( int associationId )
-    {
-        this.associationId = associationId;
-    }
-
-    private int categoryOptionComboId;
-
-    public int getCategoryOptionComboId()
-    {
-        return categoryOptionComboId;
-    }
-
-    public void setCategoryOptionComboId( int categoryOptionComboId )
-    {
-        this.categoryOptionComboId = categoryOptionComboId;
-    }
-
-    private List<String> customValueIds;
-
-    public List<String> getCustomValueIds()
-    {
-        return customValueIds;
-    }
-
-    private List<String> customValueNames;
-
-    public List<String> getCustomValueNames()
-    {
-        return customValueNames;
-    }
-
-    private String operation;
-
-    public String getOperation()
-    {
-        return operation;
-    }
-
-    public void setOperation( String operation )
-    {
-        this.operation = operation;
-    }
-
-    private String value;
-
-    public String getValue()
-    {
-        return value;
-    }
-
-    public void setValue( String value )
-    {
-        this.value = value;
-    }
-
-    // -------------------------------------------------------------------------
-    // Execute
-    // -------------------------------------------------------------------------
-
-    public String execute()
-        throws Exception
-    {
-        customValueIds = new ArrayList<String>();
-        customValueNames = new ArrayList<String>();
-
-        DataElement dataElement = dataElementService.getDataElement( dataElementId );
-        DataElementCategoryOptionCombo dataElementCategoryOptionCombo = dataElementCategoryService
-            .getDataElementCategoryOptionCombo( categoryOptionComboId );
-
-        CustomValue customValue = new CustomValue();
-        // customValue.setDataSet( programStage );
-        customValue.setDataElement( dataElement );
-        customValue.setOptionCombo( dataElementCategoryOptionCombo );
-
-        if ( operation.equalsIgnoreCase( "add" ) )
-        {
-            customValue.setCustomValue( value );
-
-            customValueService.addCustomValue( customValue );
-        }
-
-        if ( operation.equalsIgnoreCase( "delete" ) )
-        {
-            customValue = customValueService.getCustomValue( customValueId );
-            customValueService.deleteCustomValue( customValue );
-        }
-
-        List<CustomValue> customValues = null;
-
-        if ( operation.equalsIgnoreCase( "find" ) )
-        {
-            customValues = new ArrayList<CustomValue>( customValueService.findCustomValues( value ) );
-        }
-        else
-        {
-            // customValues = new ArrayList<CustomValue>(
-            // customValueService.getCustomValues( dataSet,
-            // dataElement,dataElementCategoryOptionCombo ) );
-        }
-
-        Iterator<CustomValue> customValueIterator = customValues.iterator();
-
-        if ( operation.equalsIgnoreCase( "find" ) )
-        {
-            while ( customValueIterator.hasNext() )
-            {
-                CustomValue customVal = customValueIterator.next();
-
-                if ( !customValueNames.contains( customVal.getCustomValue() ) )
-                {
-                    customValueIds.add( String.valueOf( customVal.getId() ) );
-                    customValueNames.add( customVal.getCustomValue() );
-                }
-            }
-        }
-        else
-        {
-            while ( customValueIterator.hasNext() )
-            {
-                CustomValue customVal = customValueIterator.next();
-
-                customValueIds.add( String.valueOf( customVal.getId() ) );
-                customValueNames.add( customVal.getCustomValue() );
-            }
-        }
-        if ( operation.equalsIgnoreCase( "delete" ) )
-        {
-            customValueIds.remove( String.valueOf( customValue.getId() ) );
-            customValueNames.remove( customValue.getCustomValue() );
-        }
-
-        if ( operation.equalsIgnoreCase( "add" ) )
-        {
-            if ( !customValueNames.contains( customValue.getCustomValue() ) )
-            {
-                customValueIds.remove( String.valueOf( customValue.getId() ) );
-                customValueNames.remove( customValue.getCustomValue() );
-            }
-        }
-
-        return SUCCESS;
-    }
-}

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/relationship/ValidateRelationshipTypeAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/relationship/ValidateRelationshipTypeAction.java	2010-09-27 07:33:12 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/relationship/ValidateRelationshipTypeAction.java	2011-01-25 23:29:58 +0000
@@ -28,7 +28,6 @@
 package org.hisp.dhis.patient.action.relationship;
 
 import org.hisp.dhis.i18n.I18n;
-import org.hisp.dhis.program.Program;
 import org.hisp.dhis.relationship.RelationshipType;
 import org.hisp.dhis.relationship.RelationshipTypeService;
 

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/META-INF/dhis/beans.xml	2011-01-20 02:15:19 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/META-INF/dhis/beans.xml	2011-01-25 23:29:58 +0000
@@ -891,24 +891,6 @@
 		</property>
 	</bean>
 
-	<bean
-		id="org.hisp.dhis.patient.action.dataentryform.GetCustomValuesAction"
-		class="org.hisp.dhis.patient.action.dataentryform.GetCustomValuesAction"
-		scope="prototype">
-		<property name="dataEntryFormService">
-			<ref bean="org.hisp.dhis.dataentryform.DataEntryFormService" />
-		</property>
-		<property name="dataElementService">
-			<ref bean="org.hisp.dhis.dataelement.DataElementService" />
-		</property>
-		<property name="dataElementCategoryService">
-			<ref bean="org.hisp.dhis.dataelement.DataElementCategoryService" />
-		</property>
-		<property name="customValueService">
-			<ref bean="org.hisp.dhis.customvalue.CustomValueService" />
-		</property>
-	</bean>
-
 	<!-- Patient Attribute Group -->
 
 	<bean

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/struts.xml	2011-01-20 02:15:19 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/struts.xml	2011-01-25 23:29:58 +0000
@@ -865,13 +865,6 @@
 			<result name="success" type="velocity-xml">/dhis-web-maintenance-patient/responseSelDataElementList.vm</result>
 		</action>		
 
-		<action name="getCustomValues"
-			class="org.hisp.dhis.patient.action.dataentryform.GetCustomValuesAction">
-			<result name="success" type="velocity-xml">
-				/dhis-web-maintenance-patient/responseCustomValue.vm
-			</result>
-		</action>
-
 		<action name="showDataEntryForm"
 			class="org.hisp.dhis.patient.action.dataentryform.ShowDataEntryFormAction">
 			<result name="success" type="velocity">