Search in sources :

Example 1 with EntityBeanTable

use of org.akaza.openclinica.web.domain.EntityBeanTable 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);
}
Also used : HashMap(java.util.HashMap) FormProcessor(org.akaza.openclinica.control.form.FormProcessor) EntityBeanTable(org.akaza.openclinica.web.domain.EntityBeanTable) ArrayList(java.util.ArrayList) RuleSetBean(org.akaza.openclinica.domain.rule.RuleSetBean)

Aggregations

ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 FormProcessor (org.akaza.openclinica.control.form.FormProcessor)1 RuleSetBean (org.akaza.openclinica.domain.rule.RuleSetBean)1 EntityBeanTable (org.akaza.openclinica.web.domain.EntityBeanTable)1