use of org.akaza.openclinica.domain.rule.RuleSetBean in project OpenClinica by OpenClinica.
the class ViewRuleAssignmentRow method compareColumn.
/*
* (non-Javadoc)
*
* @see org.akaza.openclinica.core.EntityBeanRow#compareColumn(java.lang.Object,
* int)
*/
@Override
protected int compareColumn(Object row, int sortingColumn) {
if (!row.getClass().equals(ViewRuleAssignmentRow.class)) {
return 0;
}
RuleSetBean thisRuleSet = (RuleSetBean) bean;
RuleSetBean argRuleSet = (RuleSetBean) ((ViewRuleAssignmentRow) row).bean;
int answer = 0;
switch(sortingColumn) {
case COL_CRF:
answer = thisRuleSet.getCrfWithVersionName().toLowerCase().compareTo(argRuleSet.getCrfWithVersionName().toLowerCase());
break;
case COL_GROUP:
answer = thisRuleSet.getGroupLabel().toLowerCase().compareTo(argRuleSet.getGroupLabel().toLowerCase());
break;
case COL_ITEM:
answer = thisRuleSet.getItemName().toLowerCase().compareTo(argRuleSet.getItemName().toLowerCase());
break;
}
return answer;
}
use of org.akaza.openclinica.domain.rule.RuleSetBean in project OpenClinica by OpenClinica.
the class ViewRuleAssignmentServlet method processRequest.
@Override
public void processRequest() throws Exception {
FormProcessor fp = new FormProcessor(request);
List<RuleSetBean> ruleSets = getRuleSetService().getRuleSetsByStudy(currentStudy);
ruleSets = getRuleSetService().filterByStatusEqualsAvailableOnlyRuleSetRules(ruleSets);
EntityBeanTable table = fp.getWebEntityBeanTable();
ArrayList allRows = ViewRuleAssignmentRow.generateRowsFromBeans((ArrayList) ruleSets);
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") };
table.setColumns(new ArrayList(Arrays.asList(columns)));
table.hideColumnLink(4);
table.hideColumnLink(5);
table.hideColumnLink(6);
table.setQuery("ViewRuleAssignment", new HashMap());
// table.addLink(resword.getString("rule_import_rule"), "ImportRule");
table.addLink(resword.getString("test_rule_title"), "TestRule");
table.setRows(allRows);
table.computeDisplay();
request.setAttribute("table", table);
if (request.getParameter("read") != null && request.getParameter("read").equals("true")) {
request.setAttribute("readOnly", true);
}
forwardPage(Page.VIEW_RULE_SETS);
}
Aggregations