dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #12389
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 3801: Removed type="chain" into dhis-web-validationrule.
------------------------------------------------------------
revno: 3801
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2011-05-31 12:38:55 +0700
message:
Removed type="chain" into dhis-web-validationrule.
added:
dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/ShowRunValidationFormAction.java
dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/ShowUpdateValidationRuleFormAction.java
dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/validationrulegroup/ShowUpdateValidationRuleGroupFormAction.java
modified:
dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/GetValidationRuleAction.java
dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/SetupTreeAction.java
dhis-2/dhis-web/dhis-web-validationrule/src/main/resources/META-INF/dhis/beans.xml
dhis-2/dhis-web/dhis-web-validationrule/src/main/resources/struts.xml
dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/responseValidationRule.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-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/GetValidationRuleAction.java'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/GetValidationRuleAction.java 2011-05-05 21:28:46 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/GetValidationRuleAction.java 2011-05-31 05:38:55 +0000
@@ -101,12 +101,6 @@
return rightSideTextualExpression;
}
- private String validationOperator;
-
- public String getValidationOperator()
- {
- return validationOperator;
- }
private PeriodType periodType;
public PeriodType getPeriodType()
@@ -130,8 +124,6 @@
leftSideTextualExpression = VALID.equals( leftSideResult ) ? expressionService.getExpressionDescription( leftSideFormula ) : i18n.getString( leftSideResult );
rightSideTextualExpression = VALID.equals( rightSideResult ) ? expressionService.getExpressionDescription( rightSideFormula ) : i18n.getString( rightSideResult );
- validationOperator = validationRule.getOperator().toString();
-
periodType = validationRule.getPeriodType();
return SUCCESS;
=== modified file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/SetupTreeAction.java'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/SetupTreeAction.java 2011-05-05 21:15:45 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/SetupTreeAction.java 2011-05-31 05:38:55 +0000
@@ -27,12 +27,18 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+import java.util.ArrayList;
import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
import org.hisp.dhis.organisationunit.OrganisationUnit;
import org.hisp.dhis.oust.manager.SelectionTreeManager;
import org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager;
import org.hisp.dhis.user.CurrentUserService;
+import org.hisp.dhis.validation.ValidationRuleGroup;
+import org.hisp.dhis.validation.ValidationRuleService;
+import org.hisp.dhis.validation.comparator.ValidationRuleGroupNameComparator;
import com.opensymphony.xwork2.Action;
@@ -53,14 +59,14 @@
{
this.selectionTreeManager = selectionTreeManager;
}
-
+
private OrganisationUnitSelectionManager selectionManager;
public void setSelectionManager( OrganisationUnitSelectionManager selectionManager )
{
this.selectionManager = selectionManager;
}
-
+
private CurrentUserService currentUserService;
public void setCurrentUserService( CurrentUserService currentUserService )
@@ -68,13 +74,31 @@
this.currentUserService = currentUserService;
}
+ private ValidationRuleService validationRuleService;
+
+ public void setValidationRuleService( ValidationRuleService validationRuleService )
+ {
+ this.validationRuleService = validationRuleService;
+ }
+
+ // -------------------------------------------------------------------------
+ // Input & Output
+ // -------------------------------------------------------------------------
+
+ private List<ValidationRuleGroup> validationRuleGroups;
+
+ public List<ValidationRuleGroup> getValidationRuleGroups()
+ {
+ return validationRuleGroups;
+ }
+
// -------------------------------------------------------------------------
// Action implementation
// -------------------------------------------------------------------------
-
+
public String execute()
throws Exception
- {
+ {
if ( currentUserService.getCurrentUser() != null )
{
Collection<OrganisationUnit> orgUnits = currentUserService.getCurrentUser().getOrganisationUnits();
@@ -91,7 +115,11 @@
{
selectionTreeManager.setSelectedOrganisationUnits( selectionManager.getSelectedOrganisationUnits() );
}
-
+
+ validationRuleGroups = new ArrayList<ValidationRuleGroup>( validationRuleService.getAllValidationRuleGroups() );
+
+ Collections.sort( validationRuleGroups, new ValidationRuleGroupNameComparator() );
+
return SUCCESS;
}
}
=== added file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/ShowRunValidationFormAction.java'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/ShowRunValidationFormAction.java 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/ShowRunValidationFormAction.java 2011-05-31 05:38:55 +0000
@@ -0,0 +1,116 @@
+/*
+ * 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.
+ */
+
+package org.hisp.dhis.validationrule.action;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import org.hisp.dhis.organisationunit.OrganisationUnit;
+import org.hisp.dhis.oust.manager.SelectionTreeManager;
+import org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager;
+import org.hisp.dhis.user.CurrentUserService;
+import org.hisp.dhis.validation.ValidationRuleGroup;
+import org.hisp.dhis.validation.ValidationRuleService;
+
+import com.opensymphony.xwork2.Action;
+
+/**
+ * @author Chau Thu Tran
+ * @version $ ShowRunValidationFormAction.java May 31, 2011 11:30:17 AM $
+ *
+ */
+public class ShowRunValidationFormAction
+ implements Action
+{
+ // -------------------------------------------------------------------------
+ // Dependencies
+ // -------------------------------------------------------------------------
+
+ private SelectionTreeManager selectionTreeManager;
+
+ public void setSelectionTreeManager( SelectionTreeManager selectionTreeManager )
+ {
+ this.selectionTreeManager = selectionTreeManager;
+ }
+
+ private OrganisationUnitSelectionManager selectionManager;
+
+ public void setSelectionManager( OrganisationUnitSelectionManager selectionManager )
+ {
+ this.selectionManager = selectionManager;
+ }
+
+ private CurrentUserService currentUserService;
+
+ public void setCurrentUserService( CurrentUserService currentUserService )
+ {
+ this.currentUserService = currentUserService;
+ }
+
+ private ValidationRuleService validationRuleService;
+
+ public void setValidationRuleService( ValidationRuleService validationRuleService )
+ {
+ this.validationRuleService = validationRuleService;
+ } private List<ValidationRuleGroup> validationRuleGroups;
+
+ public List<ValidationRuleGroup> getValidationRuleGroups()
+ {
+ return validationRuleGroups;
+ }
+
+ // -------------------------------------------------------------------------
+ // Action implementation
+ // -------------------------------------------------------------------------
+
+ public String execute()
+ throws Exception
+ {
+ if ( currentUserService.getCurrentUser() != null )
+ {
+ Collection<OrganisationUnit> orgUnits = currentUserService.getCurrentUser().getOrganisationUnits();
+
+ if ( orgUnits.size() > 0 )
+ {
+ selectionTreeManager.setRootOrganisationUnits( orgUnits );
+ }
+ }
+
+ selectionTreeManager.clearSelectedOrganisationUnits();
+
+ if ( selectionManager.getSelectedOrganisationUnits() != null )
+ {
+ selectionTreeManager.setSelectedOrganisationUnits( selectionManager.getSelectedOrganisationUnits() );
+ }
+
+ validationRuleGroups = new ArrayList<ValidationRuleGroup>( validationRuleService.getAllValidationRuleGroups() );
+
+ return SUCCESS;
+ }
+}
=== added file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/ShowUpdateValidationRuleFormAction.java'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/ShowUpdateValidationRuleFormAction.java 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/ShowUpdateValidationRuleFormAction.java 2011-05-31 05:38:55 +0000
@@ -0,0 +1,154 @@
+/*
+ * 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.
+ */
+
+package org.hisp.dhis.validationrule.action;
+
+import static org.hisp.dhis.expression.ExpressionService.VALID;
+
+import java.util.Collection;
+
+import org.hisp.dhis.expression.ExpressionService;
+import org.hisp.dhis.i18n.I18n;
+import org.hisp.dhis.period.PeriodService;
+import org.hisp.dhis.period.PeriodType;
+import org.hisp.dhis.validation.ValidationRule;
+import org.hisp.dhis.validation.ValidationRuleService;
+
+import com.opensymphony.xwork2.Action;
+
+/**
+ * @author Chau Thu Tran
+ * @version $ ShowUpdateValidationRuleFormAction.java May 31, 2011 10:48:14 AM $
+ *
+ */
+public class ShowUpdateValidationRuleFormAction
+ implements Action
+{
+ // -------------------------------------------------------------------------
+ // Dependencies
+ // -------------------------------------------------------------------------
+
+ private ValidationRuleService validationRuleService;
+
+ public void setValidationRuleService( ValidationRuleService validationRuleService )
+ {
+ this.validationRuleService = validationRuleService;
+ }
+
+ private ExpressionService expressionService;
+
+ public void setExpressionService( ExpressionService expressionService )
+ {
+ this.expressionService = expressionService;
+ }
+
+ private PeriodService periodService;
+
+ public void setPeriodService( PeriodService periodService )
+ {
+ this.periodService = periodService;
+ }
+
+ private I18n i18n;
+
+ public void setI18n( I18n i18n )
+ {
+ this.i18n = i18n;
+ }
+
+ // -------------------------------------------------------------------------
+ // Input/output
+ // -------------------------------------------------------------------------
+
+ private int id;
+
+ public void setId( int id )
+ {
+ this.id = id;
+ }
+
+ private ValidationRule validationRule;
+
+ public ValidationRule getValidationRule()
+ {
+ return validationRule;
+ }
+
+ private String leftSideTextualExpression;
+
+ public String getLeftSideTextualExpression()
+ {
+ return leftSideTextualExpression;
+ }
+
+ private String rightSideTextualExpression;
+
+ public String getRightSideTextualExpression()
+ {
+ return rightSideTextualExpression;
+ }
+
+ private Collection<PeriodType> periodTypes;
+
+ public Collection<PeriodType> getPeriodTypes()
+ {
+ return periodTypes;
+ }
+
+ // -------------------------------------------------------------------------
+ // Action implementation
+ // -------------------------------------------------------------------------
+
+ public String execute()
+ throws Exception
+ {
+ // ---------------------------------------------------------------------
+ // Get periodTypes
+ // ---------------------------------------------------------------------
+
+ periodTypes = periodService.getAllPeriodTypes();
+
+ // ---------------------------------------------------------------------
+ // Get validationRule
+ // ---------------------------------------------------------------------
+
+ validationRule = validationRuleService.getValidationRule( id );
+
+ String leftSideFormula = validationRule.getLeftSide().getExpression();
+ String rightSideFormula = validationRule.getRightSide().getExpression();
+
+ String leftSideResult = expressionService.expressionIsValid( leftSideFormula );
+ String rightSideResult = expressionService.expressionIsValid( rightSideFormula );
+
+ leftSideTextualExpression = VALID.equals( leftSideResult ) ? expressionService
+ .getExpressionDescription( leftSideFormula ) : i18n.getString( leftSideResult );
+ rightSideTextualExpression = VALID.equals( rightSideResult ) ? expressionService
+ .getExpressionDescription( rightSideFormula ) : i18n.getString( rightSideResult );
+
+ return SUCCESS;
+ }
+}
=== added file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/validationrulegroup/ShowUpdateValidationRuleGroupFormAction.java'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/validationrulegroup/ShowUpdateValidationRuleGroupFormAction.java 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/validationrulegroup/ShowUpdateValidationRuleGroupFormAction.java 2011-05-31 05:38:55 +0000
@@ -0,0 +1,126 @@
+/*
+ * 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.
+ */
+
+package org.hisp.dhis.validationrule.action.validationrulegroup;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.hisp.dhis.validation.ValidationRule;
+import org.hisp.dhis.validation.ValidationRuleGroup;
+import org.hisp.dhis.validation.ValidationRuleService;
+import org.hisp.dhis.validation.comparator.ValidationRuleNameComparator;
+
+import com.opensymphony.xwork2.Action;
+
+/**
+ * @author Chau Thu Tran
+ * @version $ ShowUpdateValidationRuleGroupFormAction.java May 31, 2011 11:23:59
+ * AM $
+ *
+ */
+public class ShowUpdateValidationRuleGroupFormAction
+ implements Action
+{
+ // -------------------------------------------------------------------------
+ // Dependencies
+ // -------------------------------------------------------------------------
+
+ private ValidationRuleService validationRuleService;
+
+ public void setValidationRuleService( ValidationRuleService validationRuleService )
+ {
+ this.validationRuleService = validationRuleService;
+ }
+
+ // -------------------------------------------------------------------------
+ // Input
+ // -------------------------------------------------------------------------
+
+ private Integer id;
+
+ public void setId( Integer id )
+ {
+ this.id = id;
+ }
+
+ // -------------------------------------------------------------------------
+ // Output
+ // -------------------------------------------------------------------------
+
+ private ValidationRuleGroup validationRuleGroup;
+
+ public ValidationRuleGroup getValidationRuleGroup()
+ {
+ return validationRuleGroup;
+ }
+
+ private List<ValidationRule> groupMembers = new ArrayList<ValidationRule>();
+
+ public List<ValidationRule> getGroupMembers()
+ {
+ return groupMembers;
+ }
+
+ private List<ValidationRule> availableValidationRules = new ArrayList<ValidationRule>();
+
+ public List<ValidationRule> getAvailableValidationRules()
+ {
+ return availableValidationRules;
+ }
+
+ // -------------------------------------------------------------------------
+ // Action implementation
+ // -------------------------------------------------------------------------
+
+ public String execute()
+ {
+ // ---------------------------------------------------------------------
+ // Get selected group
+ // ---------------------------------------------------------------------
+
+ validationRuleGroup = validationRuleService.getValidationRuleGroup( id );
+
+ groupMembers = new ArrayList<ValidationRule>( validationRuleGroup.getMembers() );
+
+ Collections.sort( groupMembers, new ValidationRuleNameComparator() );
+
+ // ---------------------------------------------------------------------
+ // Get available ValidationRules
+ // ---------------------------------------------------------------------
+
+ availableValidationRules = new ArrayList<ValidationRule>( validationRuleService.getAllValidationRules() );
+
+ availableValidationRules.removeAll( groupMembers );
+
+ Collections.sort( availableValidationRules, new ValidationRuleNameComparator() );
+
+ return SUCCESS;
+ }
+
+}
=== modified file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/resources/META-INF/dhis/beans.xml 2011-03-01 04:17:29 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/resources/META-INF/dhis/beans.xml 2011-05-31 05:38:55 +0000
@@ -24,6 +24,20 @@
</property>
</bean>
+ <bean id="org.hisp.dhis.validationrule.action.ShowUpdateValidationRuleFormAction"
+ class="org.hisp.dhis.validationrule.action.ShowUpdateValidationRuleFormAction"
+ scope="prototype">
+ <property name="validationRuleService">
+ <ref bean="org.hisp.dhis.validation.ValidationRuleService"/>
+ </property>
+ <property name="expressionService">
+ <ref bean="org.hisp.dhis.expression.ExpressionService"/>
+ </property>
+ <property name="periodService">
+ <ref bean="org.hisp.dhis.period.PeriodService"/>
+ </property>
+ </bean>
+
<bean id="org.hisp.dhis.validationrule.action.GetValidationRuleAction"
class="org.hisp.dhis.validationrule.action.GetValidationRuleAction"
scope="prototype">
@@ -84,7 +98,10 @@
</property>
<property name="selectionManager">
<ref bean="org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager"/>
- </property>
+ </property>
+ <property name="validationRuleService">
+ <ref bean="org.hisp.dhis.validation.ValidationRuleService"/>
+ </property>
</bean>
<bean id="org.hisp.dhis.validationrule.action.GetPeriodTypesAction"
@@ -137,6 +154,14 @@
</property>
</bean>
+ <bean id="org.hisp.dhis.validationrule.action.validationrulegroup.ShowUpdateValidationRuleGroupFormAction"
+ class="org.hisp.dhis.validationrule.action.validationrulegroup.ShowUpdateValidationRuleGroupFormAction"
+ scope="prototype">
+ <property name="validationRuleService">
+ <ref bean="org.hisp.dhis.validation.ValidationRuleService"/>
+ </property>
+ </bean>
+
<bean id="org.hisp.dhis.validationrule.action.validationrulegroup.UpdateValidationRuleGroupAction"
class="org.hisp.dhis.validationrule.action.validationrulegroup.UpdateValidationRuleGroupAction"
scope="prototype">
=== modified file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/resources/struts.xml 2011-03-29 08:15:49 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/resources/struts.xml 2011-05-31 05:38:55 +0000
@@ -59,11 +59,7 @@
<param name="onExceptionReturn">plainTextError</param>
</action>
- <action name="showUpdateValidationRuleForm" class="org.hisp.dhis.validationrule.action.GetPeriodTypesAction">
- <result name="success" type="chain">showUpdateValidationRuleFormChain</result>
- </action>
-
- <action name="showUpdateValidationRuleFormChain" class="org.hisp.dhis.validationrule.action.GetValidationRuleAction">
+ <action name="showUpdateValidationRuleForm" class="org.hisp.dhis.validationrule.action.ShowUpdateValidationRuleFormAction">
<result name="success" type="velocity">/main.vm</result>
<param name="page">/dhis-web-validationrule/updateValidationRuleForm.vm</param>
<param name="javascripts">javascript/general.js,javascript/validationForm.js,javascript/expression.js, javascript/updateValidationRuleForm.js</param>
@@ -112,15 +108,12 @@
<param name="requiredAuthorities">F_VALIDATIONRULEGROUP_ADD</param>
</action>
- <action name="showUpdateValidationRuleGroupForm" class="org.hisp.dhis.validationrule.action.validationrulegroup.GetValidationRuleGroupAction">
- <result name="success" type="chain">getGroupMembersAndAvailableValidationRules</result>
- <param name="requiredAuthorities">F_VALIDATIONRULEGROUP_UPDATE</param>
- </action>
-
- <action name="getGroupMembersAndAvailableValidationRules" class="org.hisp.dhis.validationrule.action.validationrulegroup.GetValidationRuleGroupMembersAction">
+ <action name="showUpdateValidationRuleGroupForm"
+ class="org.hisp.dhis.validationrule.action.validationrulegroup.ShowUpdateValidationRuleGroupFormAction">
<result name="success" type="velocity">/main.vm</result>
<param name="page">/dhis-web-validationrule/updateValidationRuleGroupForm.vm</param>
<param name="javascripts">javascript/validationRuleGroup.js, javascript/updateValidationRuleGroupForm.js</param>
+ <param name="requiredAuthorities">F_VALIDATIONRULEGROUP_UPDATE</param>
</action>
<action name="updateValidationRuleGroup" class="org.hisp.dhis.validationrule.action.validationrulegroup.UpdateValidationRuleGroupAction">
@@ -136,11 +129,7 @@
<!-- Run validation -->
- <action name="showRunValidationForm" class="org.hisp.dhis.validationrule.action.validationrulegroup.GetValidationRuleGroupListAction">
- <result name="success" type="chain">showRunValidationFormChain</result>
- </action>
-
- <action name="showRunValidationFormChain" class="org.hisp.dhis.validationrule.action.SetupTreeAction">
+ <action name="showRunValidationForm" class="org.hisp.dhis.validationrule.action.SetupTreeAction">
<result name="success" type="velocity">/main.vm</result>
<param name="page">/dhis-web-validationrule/runValidationForm.vm</param>
<param name="menu">/dhis-web-validationrule/menu.vm</param>
=== modified file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/responseValidationRule.vm'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/responseValidationRule.vm 2011-02-10 23:09:13 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/responseValidationRule.vm 2011-05-31 05:38:55 +0000
@@ -3,7 +3,7 @@
<name>$!encoder.xmlEncode( $validationRule.name )</name>
<description>$!encoder.xmlEncode( $validationRule.description )</description>
<type>$!encoder.xmlEncode( $validationRule.type )</type>
- <operator>$!encoder.xmlEncode( $validationRule.operator.mathematicalOperator )</operator>
+ <operator>$validationRule.operator</operator>
<leftSideDescription>$!encoder.xmlEncode( $validationRule.leftSide.description )</leftSideDescription>
<rightSideDescription>$!encoder.xmlEncode( $validationRule.rightSide.description )</rightSideDescription>
</validationRule>
\ No newline at end of file