dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #20593
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 9443: Don't create uid for objects in patient module when to add new an object.
------------------------------------------------------------
revno: 9443
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2013-01-07 12:07:05 +0700
message:
Don't create uid for objects in patient module when to add new an object.
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/caseaggregation/CaseAggregationConditionStore.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageSection.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStore.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramValidation.java
dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/caseaggregation/jdbc/JdbcCaseAggregationConditionStore.java
dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientAttributeGroupStore.java
dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientAttributeStore.java
dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientIdentifierTypeStore.java
dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/startup/TableAlteror.java
dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramStageSectionService.java
dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStore.java
dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramValidationStore.java
dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/relationship/hibernate/HibernateRelationshipTypeStore.java
dhis-2/dhis-services/dhis-service-patient/src/main/resources/META-INF/dhis/beans.xml
dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/ProgramValidation.hbm.xml
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/validation/AddProgramValidationAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/validation/UpdateProgramValidationAction.java
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/webapp/dhis-web-maintenance-patient/programValidationList.vm
--
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/caseaggregation/CaseAggregationConditionStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/caseaggregation/CaseAggregationConditionStore.java 2012-03-16 07:50:14 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/caseaggregation/CaseAggregationConditionStore.java 2013-01-07 05:07:05 +0000
@@ -30,7 +30,7 @@
import java.util.Collection;
import java.util.List;
-import org.hisp.dhis.common.GenericStore;
+import org.hisp.dhis.common.GenericNameableObjectStore;
import org.hisp.dhis.dataelement.DataElement;
import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
@@ -40,7 +40,7 @@
* @version PatientAggregationExpressionStore.java Nov 18, 2010 9:27:59 AM
*/
public interface CaseAggregationConditionStore
- extends GenericStore<CaseAggregationCondition>
+ extends GenericNameableObjectStore<CaseAggregationCondition>
{
String ID = CaseAggregationConditionStore.class.getName();
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageSection.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageSection.java 2012-08-24 10:09:45 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageSection.java 2013-01-07 05:07:05 +0000
@@ -30,20 +30,14 @@
import java.util.ArrayList;
import java.util.List;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlRootElement;
-
import org.hisp.dhis.common.BaseIdentifiableObject;
-import org.hisp.dhis.common.Dxf2Namespace;
/**
* @author Chau Thu Tran
*
* @version ProgramStageSection.java 11:07:27 AM Aug 22, 2012 $
*/
-@XmlRootElement( name = "ProgramStageSection", namespace = Dxf2Namespace.NAMESPACE )
-@XmlAccessorType( value = XmlAccessType.NONE )
+
public class ProgramStageSection
extends BaseIdentifiableObject
{
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStore.java 2012-05-23 15:02:50 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStore.java 2013-01-07 05:07:05 +0000
@@ -45,11 +45,4 @@
Collection<Program> getByType( int type );
Collection<Program> get( int type, OrganisationUnit orgunit );
-
- // Collection<Program> get( boolean singleEvent );
- //
- // Collection<Program> get( boolean singleEvent, boolean anonymous );
- //
- // Collection<Program> get( boolean singleEvent, boolean anonymous,
- // OrganisationUnit orgunit );
}
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramValidation.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramValidation.java 2012-11-12 07:04:25 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramValidation.java 2013-01-07 05:07:05 +0000
@@ -29,6 +29,7 @@
import java.io.Serializable;
+import org.hisp.dhis.common.BaseIdentifiableObject;
import org.hisp.dhis.expression.Operator;
/**
@@ -36,7 +37,7 @@
* @version $ ProgramValidation.java Apr 28, 2011 10:27:29 AM $
*/
public class ProgramValidation
- implements Serializable
+ extends BaseIdentifiableObject
{
/**
* Determines if a de-serialized file is compatible with this class.
@@ -48,7 +49,6 @@
public static final String SEPARATOR_OBJECT = ":";
public static String OBJECT_PROGRAM_STAGE_DATAELEMENT = "DE";
-
public static final int BEFORE_CURRENT_DATE = 1;
@@ -57,7 +57,6 @@
public static final int AFTER_CURRENT_DATE = 3;
public static final int AFTER_OR_EQUALS_TO_CURRENT_DATE = 4;
-
public static final int BEFORE_DUE_DATE = -1;
@@ -66,28 +65,23 @@
public static final int AFTER_DUE_DATE = -3;
public static final int AFTER_OR_EQUALS_TO_DUE_DATE = -4;
-
+
public static final int BEFORE_DUE_DATE_PLUS_OR_MINUS_MAX_DAYS = -5;
-
public static final String NOT_NULL_VALUE_IN_EXPRESSION = "{NOT-NULL-VALUE}";
// -------------------------------------------------------------------------
// Fields
// -------------------------------------------------------------------------
-
- private int id;
-
- private String description;
-
+
private ProgramExpression leftSide;
-
+
private Operator operator;
private ProgramExpression rightSide;
private Program program;
-
+
// -------------------------------------------------------------------------
// Constructor
// -------------------------------------------------------------------------
@@ -97,9 +91,10 @@
}
- public ProgramValidation( String description, ProgramExpression leftSide, ProgramExpression rightSide, Program program )
+ public ProgramValidation( String name, ProgramExpression leftSide, ProgramExpression rightSide,
+ Program program )
{
- this.description = description;
+ this.name = name;
this.leftSide = leftSide;
this.rightSide = rightSide;
this.program = program;
@@ -182,27 +177,7 @@
// -------------------------------------------------------------------------
// Getters && Setters
// -------------------------------------------------------------------------
-
- public int getId()
- {
- return id;
- }
-
- public void setId( int id )
- {
- this.id = id;
- }
-
- public String getDescription()
- {
- return description;
- }
-
- public void setDescription( String description )
- {
- this.description = description;
- }
-
+
public ProgramExpression getLeftSide()
{
return leftSide;
=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/caseaggregation/jdbc/JdbcCaseAggregationConditionStore.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/caseaggregation/jdbc/JdbcCaseAggregationConditionStore.java 2012-07-26 08:53:44 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/caseaggregation/jdbc/JdbcCaseAggregationConditionStore.java 2013-01-07 05:07:05 +0000
@@ -35,6 +35,7 @@
import org.hibernate.criterion.Restrictions;
import org.hisp.dhis.caseaggregation.CaseAggregationCondition;
import org.hisp.dhis.caseaggregation.CaseAggregationConditionStore;
+import org.hisp.dhis.common.hibernate.HibernateIdentifiableObjectStore;
import org.hisp.dhis.dataelement.DataElement;
import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
import org.hisp.dhis.hibernate.HibernateGenericStore;
@@ -47,7 +48,7 @@
* @version JdbcCaseAggregationConditionStore.java Nov 18, 2010 9:36:20 AM
*/
public class JdbcCaseAggregationConditionStore
- extends HibernateGenericStore<CaseAggregationCondition>
+ extends HibernateIdentifiableObjectStore<CaseAggregationCondition>
implements CaseAggregationConditionStore
{
// -------------------------------------------------------------------------
=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientAttributeGroupStore.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientAttributeGroupStore.java 2012-03-27 04:22:51 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientAttributeGroupStore.java 2013-01-07 05:07:05 +0000
@@ -31,7 +31,7 @@
import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;
-import org.hisp.dhis.hibernate.HibernateGenericStore;
+import org.hisp.dhis.common.hibernate.HibernateIdentifiableObjectStore;
import org.hisp.dhis.patient.PatientAttributeGroup;
import org.hisp.dhis.patient.PatientAttributeGroupStore;
import org.hisp.dhis.program.Program;
@@ -42,7 +42,7 @@
* @version $HibernatePatientAttributeGroupStore.java Mar 26, 2012 1:45:26 PM$
*/
public class HibernatePatientAttributeGroupStore
- extends HibernateGenericStore<PatientAttributeGroup>
+ extends HibernateIdentifiableObjectStore<PatientAttributeGroup>
implements PatientAttributeGroupStore
{
=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientAttributeStore.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientAttributeStore.java 2012-09-05 14:30:23 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientAttributeStore.java 2013-01-07 05:07:05 +0000
@@ -30,7 +30,7 @@
import java.util.Collection;
import org.hibernate.criterion.Restrictions;
-import org.hisp.dhis.hibernate.HibernateGenericStore;
+import org.hisp.dhis.common.hibernate.HibernateIdentifiableObjectStore;
import org.hisp.dhis.patient.PatientAttribute;
import org.hisp.dhis.patient.PatientAttributeStore;
@@ -39,7 +39,7 @@
* @version $Id$
*/
public class HibernatePatientAttributeStore
- extends HibernateGenericStore<PatientAttribute>
+ extends HibernateIdentifiableObjectStore<PatientAttribute>
implements PatientAttributeStore
{
@SuppressWarnings( "unchecked" )
=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientIdentifierTypeStore.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientIdentifierTypeStore.java 2012-09-05 14:30:23 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientIdentifierTypeStore.java 2013-01-07 05:07:05 +0000
@@ -30,12 +30,12 @@
import java.util.Collection;
import org.hibernate.criterion.Restrictions;
-import org.hisp.dhis.hibernate.HibernateGenericStore;
+import org.hisp.dhis.common.hibernate.HibernateIdentifiableObjectStore;
import org.hisp.dhis.patient.PatientIdentifierType;
import org.hisp.dhis.patient.PatientIdentifierTypeStore;
public class HibernatePatientIdentifierTypeStore
- extends HibernateGenericStore<PatientIdentifierType>
+ extends HibernateIdentifiableObjectStore<PatientIdentifierType>
implements PatientIdentifierTypeStore
{
@SuppressWarnings( "unchecked" )
=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/startup/TableAlteror.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/startup/TableAlteror.java 2012-12-26 03:02:05 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/startup/TableAlteror.java 2013-01-07 05:07:05 +0000
@@ -40,6 +40,7 @@
import org.amplecode.quick.StatementManager;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.hisp.dhis.common.CodeGenerator;
import org.hisp.dhis.system.startup.AbstractStartupRoutine;
import org.springframework.transaction.annotation.Transactional;
@@ -160,6 +161,9 @@
executeSql( "UPDATE patientidentifiertype SET personDisplayName=false WHERE personDisplayName is null");
+ executeSql( "ALTER TABLE programvalidation RENAME description TO name" );
+
+ updateUid();
}
// -------------------------------------------------------------------------
@@ -397,6 +401,47 @@
}
}
+ private void updateUid()
+ {
+ updateUidColumn( "patientattribute" );
+ updateUidColumn( "patientattributegroup" );
+ updateUidColumn( "patientidentifiertype" );
+ updateUidColumn( "program" );
+ updateUidColumn( "patientattribute" );
+ updateUidColumn( "programstage" );
+ updateUidColumn( "programstagesection" );
+ updateUidColumn( "programvalidation" );
+ }
+
+ private void updateUidColumn( String tableName )
+ {
+ StatementHolder holder = statementManager.getHolder();
+
+ try
+ {
+ Statement statement = holder.getStatement();
+
+ ResultSet resultSet = statement
+ .executeQuery( "SELECT " + tableName + "id FROM " + tableName + " where uid is null" );
+
+ while ( resultSet.next() )
+ {
+ String uid = CodeGenerator.generateCode();
+
+ executeSql( "UPDATE " + tableName + " SET uid='" + uid
+ + "' WHERE " + tableName + "id=" + resultSet.getInt( 1 ) );
+ }
+ }
+ catch ( Exception ex )
+ {
+ log.debug( ex );
+ }
+ finally
+ {
+ holder.close();
+ }
+ }
+
private int executeSql( String sql )
{
try
=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramStageSectionService.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramStageSectionService.java 2012-08-24 10:09:45 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramStageSectionService.java 2013-01-07 05:07:05 +0000
@@ -78,7 +78,7 @@
@Override
public ProgramStageSection getProgramStageSection( int id )
{
- return programStageSectionStore.get( id );
+ return programStageSectionStore.get( id );
}
@Override
=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStore.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStore.java 2012-06-27 09:20:13 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStore.java 2013-01-07 05:07:05 +0000
@@ -30,7 +30,7 @@
import java.util.Collection;
import org.hibernate.criterion.Restrictions;
-import org.hisp.dhis.hibernate.HibernateGenericStore;
+import org.hisp.dhis.common.hibernate.HibernateIdentifiableObjectStore;
import org.hisp.dhis.organisationunit.OrganisationUnit;
import org.hisp.dhis.program.Program;
import org.hisp.dhis.program.ProgramStore;
@@ -41,7 +41,7 @@
* @version $Id: HibernateProgramStore.java Dec 14, 2011 9:24:21 AM $
*/
public class HibernateProgramStore
- extends HibernateGenericStore<Program>
+ extends HibernateIdentifiableObjectStore<Program>
implements ProgramStore
{
@SuppressWarnings( "unchecked" )
=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramValidationStore.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramValidationStore.java 2012-11-12 07:04:25 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramValidationStore.java 2013-01-07 05:07:05 +0000
@@ -30,7 +30,7 @@
import java.util.Collection;
import org.hibernate.criterion.Restrictions;
-import org.hisp.dhis.hibernate.HibernateGenericStore;
+import org.hisp.dhis.common.hibernate.HibernateIdentifiableObjectStore;
import org.hisp.dhis.program.Program;
import org.hisp.dhis.program.ProgramValidation;
import org.hisp.dhis.program.ProgramValidationStore;
@@ -40,7 +40,7 @@
* @version $ HibernateProgramValidationStore.java Apr 28, 2011 10:43:09 AM $
*/
public class HibernateProgramValidationStore
- extends HibernateGenericStore<ProgramValidation>
+ extends HibernateIdentifiableObjectStore<ProgramValidation>
implements ProgramValidationStore
{
@SuppressWarnings( "unchecked" )
=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/relationship/hibernate/HibernateRelationshipTypeStore.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/relationship/hibernate/HibernateRelationshipTypeStore.java 2011-03-31 01:55:06 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/relationship/hibernate/HibernateRelationshipTypeStore.java 2013-01-07 05:07:05 +0000
@@ -28,7 +28,7 @@
package org.hisp.dhis.relationship.hibernate;
import org.hibernate.criterion.Restrictions;
-import org.hisp.dhis.hibernate.HibernateGenericStore;
+import org.hisp.dhis.common.hibernate.HibernateIdentifiableObjectStore;
import org.hisp.dhis.relationship.RelationshipType;
import org.hisp.dhis.relationship.RelationshipTypeStore;
@@ -37,7 +37,7 @@
* @version $Id$
*/
public class HibernateRelationshipTypeStore
- extends HibernateGenericStore<RelationshipType>
+ extends HibernateIdentifiableObjectStore<RelationshipType>
implements RelationshipTypeStore
{
public RelationshipType getRelationshipType( String aIsToB, String bIsToA )
=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-services/dhis-service-patient/src/main/resources/META-INF/dhis/beans.xml 2013-01-05 03:03:21 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/META-INF/dhis/beans.xml 2013-01-07 05:07:05 +0000
@@ -40,12 +40,14 @@
<property name="sessionFactory" ref="sessionFactory" />
</bean>
- <bean id="org.hisp.dhis.program.ProgramStageStore" class="org.hisp.dhis.hibernate.HibernateGenericStore">
+ <bean id="org.hisp.dhis.program.ProgramStageStore"
+ class="org.hisp.dhis.common.hibernate.HibernateIdentifiableObjectStore">
<property name="clazz" value="org.hisp.dhis.program.ProgramStage" />
<property name="sessionFactory" ref="sessionFactory" />
</bean>
- <bean id="org.hisp.dhis.program.ProgramStageSectionStore" class="org.hisp.dhis.hibernate.HibernateGenericStore">
+ <bean id="org.hisp.dhis.program.ProgramStageSectionStore"
+ class="org.hisp.dhis.common.hibernate.HibernateIdentifiableObjectStore">
<property name="clazz" value="org.hisp.dhis.program.ProgramStageSection" />
<property name="sessionFactory" ref="sessionFactory" />
</bean>
=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/ProgramValidation.hbm.xml'
--- dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/ProgramValidation.hbm.xml 2012-11-12 07:04:25 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/ProgramValidation.hbm.xml 2013-01-07 05:07:05 +0000
@@ -1,7 +1,9 @@
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
- "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
+ "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"
+ [<!ENTITY identifiableProperties SYSTEM "classpath://org/hisp/dhis/common/identifiableProperties.hbm">]
+>
<hibernate-mapping>
<class name="org.hisp.dhis.program.ProgramValidation" table="programvalidation">
@@ -10,7 +12,7 @@
<generator class="native" />
</id>
- <property name="description" type="text" />
+ &identifiableProperties;
<many-to-one name="leftSide" column="leftprogramexpressionid"
class="org.hisp.dhis.program.ProgramExpression" cascade="all"
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/validation/AddProgramValidationAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/validation/AddProgramValidationAction.java 2012-11-12 07:04:25 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/validation/AddProgramValidationAction.java 2013-01-07 05:07:05 +0000
@@ -65,11 +65,11 @@
// Input/Output
// -------------------------------------------------------------------------
- private String description;
+ private String name;
- public void setDescription( String description )
+ public void setName( String name )
{
- this.description = description;
+ this.name = name;
}
private String operator;
@@ -131,7 +131,7 @@
ProgramExpression rightExpression = new ProgramExpression( rightSideExpression, rightSideDescription );
ProgramValidation validation = new ProgramValidation();
- validation.setDescription( description.trim() );
+ validation.setName( name.trim() );
validation.setOperator( Operator.valueOf( operator ) );
validation.setLeftSide( leftExpression );
validation.setRightSide( rightExpression );
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/validation/UpdateProgramValidationAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/validation/UpdateProgramValidationAction.java 2012-11-12 07:04:25 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/validation/UpdateProgramValidationAction.java 2013-01-07 05:07:05 +0000
@@ -64,11 +64,11 @@
this.id = id;
}
- private String description;
+ private String name;
- public void setDescription( String description )
+ public void setName( String name )
{
- this.description = description;
+ this.name = name;
}
private String operator;
@@ -134,15 +134,15 @@
throws Exception
{
ProgramValidation validation = programValidationService.getProgramValidation( id );
-
+
ProgramExpression leftExpression = new ProgramExpression( leftSideExpression, leftSideDescription );
ProgramExpression rightExpression = new ProgramExpression( rightSideExpression, rightSideDescription );
- validation.setDescription( description.trim() );
+ validation.setName( name.trim() );
validation.setOperator( Operator.valueOf( operator ) );
validation.setLeftSide( leftExpression );
validation.setRightSide( rightExpression );
-
+
programValidationService.updateProgramValidation( validation );
return SUCCESS;
=== 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 2012-12-21 09:23:20 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/struts.xml 2013-01-07 05:07:05 +0000
@@ -432,7 +432,7 @@
<action name="getProgramStageSection"
class="org.hisp.dhis.patient.action.programstage.GetProgramStageSectionAction">
<result name="success" type="velocity-json">
- /dhis-web-maintenance-patient/jsonProgramStageSection.vm
+ /dhis-web-commons/ajax/jsonProgramStageSection.vm
</result>
</action>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programValidationList.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programValidationList.vm 2012-11-12 07:21:17 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programValidationList.vm 2013-01-07 05:07:05 +0000
@@ -28,7 +28,7 @@
<td></td>
</tr>
<tr>
- <th>$i18n.getString( "description" )</th>
+ <th>$i18n.getString( "name" )</th>
<th colspan='2'>$i18n.getString( "operations" )</th>
</tr>
@@ -36,7 +36,7 @@
#foreach( $validation in $validations )
<tr id="tr${validation.id}">
- <td onclick="showProgramValidationDetails( $validation.id )">$validation.description</td>
+ <td onclick="showProgramValidationDetails( $validation.id )">$validation.name</td>
<td>
<a href="showUpdateSingleProgramValidationForm.action?validationId=$validation.id&id=$program.id" title="$i18n.getString( "edit" )"><img src="../images/edit.png" alt="$i18n.getString( 'edit' )"></a>
<a href="javascript:removeProgramValidation( '$validation.id', '$encoder.jsEncode( $validation.description )' )" title="$i18n.getString( "remove" )"><img src="../images/delete.png" alt="$i18n.getString( 'remove' )"></a>