From 018e27936b0fd24eecc952e8936edae4e6c010d7 Mon Sep 17 00:00:00 2001 From: ivansugi Date: Sun, 11 Oct 2015 16:22:40 +0700 Subject: [PATCH 1/3] fix error on RunRuleSet... on ExpressionService, i just commented it, but i have no idea about it --- core/OpenClinica-core.iml | 28 +++++++++-- .../rule/expression/ExpressionService.java | 3 +- web/OpenClinica-web.iml | 48 +++++++++++++++++-- .../submit/ViewRuleAssignmentServlet.java | 2 +- ws/OpenClinica-ws.iml | 42 ++++++++++++++-- 5 files changed, 108 insertions(+), 15 deletions(-) diff --git a/core/OpenClinica-core.iml b/core/OpenClinica-core.iml index f760d8fc6a..4b01ad3eb5 100644 --- a/core/OpenClinica-core.iml +++ b/core/OpenClinica-core.iml @@ -1,5 +1,22 @@ + + + + + file://$MODULE_DIR$/src/main/resources/org/akaza/openclinica/applicationContext-core-db.xml + file://$MODULE_DIR$/src/main/resources/org/akaza/openclinica/applicationContext-core-spring.xml + file://$MODULE_DIR$/src/main/resources/org/akaza/openclinica/applicationContext-core-timer.xml + file://$MODULE_DIR$/src/main/resources/org/akaza/openclinica/applicationContext-core-email.xml + file://$MODULE_DIR$/src/main/resources/org/akaza/openclinica/applicationContext-core-service.xml + file://$MODULE_DIR$/src/main/resources/org/akaza/openclinica/applicationContext-core-scheduler.xml + file://$MODULE_DIR$/src/main/resources/org/akaza/openclinica/ws/client/client-config.xml + file://$MODULE_DIR$/src/main/resources/org/akaza/openclinica/applicationContext-core-security.xml + file://$MODULE_DIR$/src/main/resources/org/akaza/openclinica/applicationContext-core-hibernate.xml + + + + @@ -81,7 +98,6 @@ - @@ -91,8 +107,8 @@ - + @@ -142,6 +158,10 @@ + + + + + - - + \ No newline at end of file diff --git a/core/src/main/java/org/akaza/openclinica/service/rule/expression/ExpressionService.java b/core/src/main/java/org/akaza/openclinica/service/rule/expression/ExpressionService.java index 6e2fd7f99e..327ffd6ba2 100644 --- a/core/src/main/java/org/akaza/openclinica/service/rule/expression/ExpressionService.java +++ b/core/src/main/java/org/akaza/openclinica/service/rule/expression/ExpressionService.java @@ -841,7 +841,8 @@ private String getOidFromExpression(String expression, int patternIndex, int exp // int patternIndex = ?; if (!match(splitExpression[splitExpression.length - 1 - expressionIndex], pattern[patternIndex])) { if (!match(splitExpression[splitExpression.length - 1 - expressionIndex], ruleActionPattern[patternIndex])) { - throw new OpenClinicaSystemException("OCRER'R_0019", new String[] { expression }); + //throw new OpenClinicaSystemException("OCRER'R_0019", new String[] { expression }); + return expression; } } return splitExpression[splitExpression.length - 1 - expressionIndex]; diff --git a/web/OpenClinica-web.iml b/web/OpenClinica-web.iml index 8d972b57a4..5c40118331 100644 --- a/web/OpenClinica-web.iml +++ b/web/OpenClinica-web.iml @@ -1,5 +1,41 @@ + + + + + + + + + + + + + + + + + + + file://$MODULE_DIR$/src/main/webapp/WEB-INF/createSubject-servlet-config.xml + file://$MODULE_DIR$/src/main/webapp/WEB-INF/security-config.xml + file://$MODULE_DIR$/src/main/webapp/WEB-INF/ws-servlet-config.xml + file://$MODULE_DIR$/src/main/resources/org/akaza/openclinica/applicationContext-web-beans.xml + file://$MODULE_DIR$/src/main/resources/org/akaza/openclinica/application-context-web-beans.xml + file://$MODULE_DIR$/src/main/resources/org/akaza/openclinica/applicationContext-security.xml + file://$MODULE_DIR$/src/main/webapp/WEB-INF/pages-servlet.xml + + + + + + + + + + + @@ -38,7 +74,6 @@ - @@ -120,8 +155,8 @@ - + @@ -166,6 +201,11 @@ + + + + + + - - + \ No newline at end of file diff --git a/web/src/main/java/org/akaza/openclinica/control/submit/ViewRuleAssignmentServlet.java b/web/src/main/java/org/akaza/openclinica/control/submit/ViewRuleAssignmentServlet.java index 9a05a788fa..c6d62ae96a 100644 --- a/web/src/main/java/org/akaza/openclinica/control/submit/ViewRuleAssignmentServlet.java +++ b/web/src/main/java/org/akaza/openclinica/control/submit/ViewRuleAssignmentServlet.java @@ -56,7 +56,7 @@ public void processRequest() throws Exception { String[] columns = { resword.getString("rule_study_event_definition"), resword.getString("CRF_name"), resword.getString("rule_group_label"), - resword.getString("rule_item_name"), resword.getString("rule_rules"), resword.getString("rule_ref_oid"), resword.getString("rule_action_type"), resword.getString("actions") }; + resword.getString("rule_item_name"), resword.getString("rule_rules"), resword.getString("rule_ref_oid"), resword.getString("rule_action_type"), resword.getString("actions")}; table.setColumns(new ArrayList(Arrays.asList(columns))); table.hideColumnLink(4); diff --git a/ws/OpenClinica-ws.iml b/ws/OpenClinica-ws.iml index 6ba9335469..6d41930460 100644 --- a/ws/OpenClinica-ws.iml +++ b/ws/OpenClinica-ws.iml @@ -1,5 +1,34 @@ + + + + + + + + + + + + + + + + + + + + file://$MODULE_DIR$/src/main/webapp/WEB-INF/pages-servlet.xml + file://$MODULE_DIR$/src/main/resources/org/akaza/openclinica/applicationContext-web-beans.xml + file://$MODULE_DIR$/src/main/resources/org/akaza/openclinica/applicationContext-security.xml + file://$MODULE_DIR$/src/main/webapp/WEB-INF/createSubject-servlet-config.xml + file://$MODULE_DIR$/src/main/webapp/WEB-INF/security-config.xml + file://$MODULE_DIR$/src/main/webapp/WEB-INF/ws-servlet-config.xml + + + + @@ -10,7 +39,6 @@ - @@ -43,7 +71,6 @@ - @@ -75,6 +102,7 @@ + @@ -115,8 +143,8 @@ - + @@ -164,6 +192,10 @@ + + + + + - - + \ No newline at end of file From df08d98a815655b98a3650b46e3b295e8763b280 Mon Sep 17 00:00:00 2001 From: ivansugi Date: Wed, 14 Oct 2015 22:37:34 +0700 Subject: [PATCH 2/3] fixing bugs --- .../dao/hibernate/ViewRuleAssignmentFilter.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/org/akaza/openclinica/dao/hibernate/ViewRuleAssignmentFilter.java b/core/src/main/java/org/akaza/openclinica/dao/hibernate/ViewRuleAssignmentFilter.java index cbb315745a..885fc45ec6 100644 --- a/core/src/main/java/org/akaza/openclinica/dao/hibernate/ViewRuleAssignmentFilter.java +++ b/core/src/main/java/org/akaza/openclinica/dao/hibernate/ViewRuleAssignmentFilter.java @@ -29,7 +29,8 @@ public ViewRuleAssignmentFilter() { columnMapping.put("actionExecuteOn", "ra.expression_evaluates_to"); columnMapping.put("actionType", "ra.action_type"); columnMapping.put("actionSummary", "ra.message"); - + columnMapping.put("ruleSetRunSchedule", "rs.run_schedule"); + columnMapping.put("ruleSetRunTime", "rs.run_time"); } public List getFilters() { @@ -68,9 +69,14 @@ public String execute(String criteria) { private String buildCriteria(String criteria, String property, Object value) { value = StringEscapeUtils.escapeSql(value.toString()); if (value != null) { - if (property.equals("studyId") || property.equals("actionType") || property.equals("actionExecuteOn") || property.equals("ruleSetRuleStatus")) { + if (property.equals("studyId") || property.equals("ruleSetRunSchedule") || property.equals("actionType") || property.equals("actionExecuteOn") || property.equals("ruleSetRuleStatus")) { criteria = criteria + " " + columnMapping.get(property) + " = " + value.toString() + " "; - } else { + } + if (property.equals("ruleSetRunTime") ){ + criteria = criteria + " " + columnMapping.get(property) + " = '" + value.toString() + "' "; + + } + else { criteria += " UPPER(" + columnMapping.get(property) + ") like UPPER('%" + value.toString() + "%')" + " "; } } From 9c44adca64832f21d2a332daad950a99027888f1 Mon Sep 17 00:00:00 2001 From: ivansugi Date: Wed, 14 Oct 2015 23:08:47 +0700 Subject: [PATCH 3/3] another fix --- .../openclinica/dao/hibernate/ViewRuleAssignmentFilter.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/org/akaza/openclinica/dao/hibernate/ViewRuleAssignmentFilter.java b/core/src/main/java/org/akaza/openclinica/dao/hibernate/ViewRuleAssignmentFilter.java index 885fc45ec6..dacd84bc95 100644 --- a/core/src/main/java/org/akaza/openclinica/dao/hibernate/ViewRuleAssignmentFilter.java +++ b/core/src/main/java/org/akaza/openclinica/dao/hibernate/ViewRuleAssignmentFilter.java @@ -72,12 +72,12 @@ private String buildCriteria(String criteria, String property, Object value) { if (property.equals("studyId") || property.equals("ruleSetRunSchedule") || property.equals("actionType") || property.equals("actionExecuteOn") || property.equals("ruleSetRuleStatus")) { criteria = criteria + " " + columnMapping.get(property) + " = " + value.toString() + " "; } - if (property.equals("ruleSetRunTime") ){ + else if (property.equals("ruleSetRunTime") ){ criteria = criteria + " " + columnMapping.get(property) + " = '" + value.toString() + "' "; } else { - criteria += " UPPER(" + columnMapping.get(property) + ") like UPPER('%" + value.toString() + "%')" + " "; + criteria = " UPPER(" + columnMapping.get(property) + ") like UPPER('%" + value.toString() + "%')" + " "; } } return criteria;