Search in sources :

Example 11 with Row

use of org.jmesa.view.component.Row in project OpenClinica by OpenClinica.

the class ListEventsForSubjectTableFactory method configureColumns.

@Override
protected void configureColumns(TableFacade tableFacade, Locale locale) {
    resword = ResourceBundleProvider.getWordsBundle(locale);
    resformat = ResourceBundleProvider.getFormatBundle(locale);
    tableFacade.setColumnProperties(columnNames);
    Row row = tableFacade.getTable().getRow();
    int index = 0;
    configureColumn(row.getColumn(columnNames[index]), resword.getString("study_subject_ID"), null, null);
    ++index;
    configureColumn(row.getColumn(columnNames[index]), resword.getString("subject_status"), new StatusCellEditor(), new StatusDroplistFilterEditor());
    ++index;
    configureColumn(row.getColumn(columnNames[index]), resword.getString("site_id"), null, null);
    ++index;
    configureColumn(row.getColumn(columnNames[index]), resword.getString("gender"), null, null, true, false);
    ++index;
    // group class columns
    for (int i = index; i < index + studyGroupClasses.size(); i++) {
        StudyGroupClassBean studyGroupClass = studyGroupClasses.get(i - index);
        configureColumn(row.getColumn(columnNames[i]), studyGroupClass.getName(), new StudyGroupClassCellEditor(studyGroupClass), new SubjectGroupClassDroplistFilterEditor(studyGroupClass), true, false);
    }
    configureColumn(row.getColumn(columnNames[index + studyGroupClasses.size()]), resword.getString("event_status"), new EventStatusCellEditor(), new SubjectEventStatusDroplistFilterEditor(), true, false);
    ++index;
    configureColumn(row.getColumn(columnNames[index + studyGroupClasses.size()]), resword.getString("event_date"), new EventStartDateCellEditor(), null);
    ++index;
    // crf columns
    for (int i = index + studyGroupClasses.size(); i < columnNames.length - 1; i++) {
        CRFBean crfBean = crfBeans.get(i - (index + studyGroupClasses.size()));
        configureColumn(row.getColumn(columnNames[i]), crfBean.getName(), new EventCrfCellEditor(), new SubjectEventCRFStatusDroplistFilterEditor(), true, false);
    }
    String actionsHeader = resword.getString("rule_actions") + "&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;";
    configureColumn(row.getColumn(columnNames[columnNames.length - 1]), actionsHeader, new ActionsCellEditor(), new DefaultActionsEditor(locale), true, false);
}
Also used : EventDefinitionCRFBean(org.akaza.openclinica.bean.managestudy.EventDefinitionCRFBean) EventCRFBean(org.akaza.openclinica.bean.submit.EventCRFBean) CRFBean(org.akaza.openclinica.bean.admin.CRFBean) StudyGroupClassBean(org.akaza.openclinica.bean.managestudy.StudyGroupClassBean) DefaultActionsEditor(org.akaza.openclinica.control.DefaultActionsEditor) Row(org.jmesa.view.component.Row)

Example 12 with Row

use of org.jmesa.view.component.Row in project OpenClinica by OpenClinica.

the class ViewCRFServlet method export.

private void export(TableFacade tableFacade) {
    // set the column properties
    tableFacade.setColumnProperties("versionName", "ruleName", "ruleExpression", "executeOnPlaceHolder", "actionTypePlaceHolder", "actionSummaryPlaceHolder");
    Table table = tableFacade.getTable();
    table.setCaption("Rules");
    Row row = table.getRow();
    Column executeOn = row.getColumn("executeOnPlaceHolder");
    executeOn.setTitle("Execute On");
    executeOn.getCellRenderer().setCellEditor(new CellEditor() {

        @SuppressWarnings("unchecked")
        public Object getValue(Object item, String property, int rowcount) {
            String value = "";
            List<RuleActionBean> ruleActions = (List<RuleActionBean>) new BasicCellEditor().getValue(item, "actions", rowcount);
            for (int i = 0; i < ruleActions.size(); i++) {
                value += ruleActions.get(i).getExpressionEvaluatesTo();
                // Do not add horizontal line after last Summary
                if (i != ruleActions.size() - 1) {
                    value += " | ";
                }
            }
            return value;
        }
    });
    Column actionTypePlaceHolder = row.getColumn("actionTypePlaceHolder");
    actionTypePlaceHolder.setTitle("Action Type");
    actionTypePlaceHolder.getCellRenderer().setCellEditor(new CellEditor() {

        @SuppressWarnings("unchecked")
        public Object getValue(Object item, String property, int rowcount) {
            String value = "";
            List<RuleActionBean> ruleActions = (List<RuleActionBean>) new BasicCellEditor().getValue(item, "actions", rowcount);
            for (int i = 0; i < ruleActions.size(); i++) {
                value += ruleActions.get(i).getActionType().name();
                // Do not add horizontal line after last Summary
                if (i != ruleActions.size() - 1) {
                    value += " | ";
                }
            }
            return value;
        }
    });
    Column actionSummaryPlaceHolder = row.getColumn("actionSummaryPlaceHolder");
    actionSummaryPlaceHolder.setTitle("Action Summary");
    actionSummaryPlaceHolder.getCellRenderer().setCellEditor(new CellEditor() {

        @SuppressWarnings("unchecked")
        public Object getValue(Object item, String property, int rowcount) {
            String value = "";
            List<RuleActionBean> ruleActions = (List<RuleActionBean>) new BasicCellEditor().getValue(item, "actions", rowcount);
            for (int i = 0; i < ruleActions.size(); i++) {
                value += ruleActions.get(i).getSummary();
                // Do not add horizontal line after last Summary
                if (i != ruleActions.size() - 1) {
                    value += " | ";
                }
            }
            return value;
        }
    });
    tableFacade.render();
}
Also used : RuleActionBean(org.akaza.openclinica.domain.rule.action.RuleActionBean) HtmlTable(org.jmesa.view.html.component.HtmlTable) Table(org.jmesa.view.component.Table) BasicCellEditor(org.jmesa.view.editor.BasicCellEditor) HtmlColumn(org.jmesa.view.html.component.HtmlColumn) Column(org.jmesa.view.component.Column) CellEditor(org.jmesa.view.editor.CellEditor) BasicCellEditor(org.jmesa.view.editor.BasicCellEditor) ArrayList(java.util.ArrayList) List(java.util.List) Row(org.jmesa.view.component.Row) HtmlRow(org.jmesa.view.html.component.HtmlRow)

Example 13 with Row

use of org.jmesa.view.component.Row in project OpenClinica by OpenClinica.

the class ListNotesTableFactory method configureColumns.

@Override
protected void configureColumns(TableFacade tableFacade, Locale locale) {
    tableFacade.setColumnProperties("studySubject.label", "discrepancyNoteBean.disType", "discrepancyNoteBean.resolutionStatus", "siteId", "discrepancyNoteBean.createdDate", "discrepancyNoteBean.updatedDate", "age", "days", "eventName", "eventStartDate", "crfName", "crfStatus", "entityName", "entityValue", "discrepancyNoteBean.entityType", "discrepancyNoteBean.description", "discrepancyNoteBean.detailedNotes", "numberOfNotes", "discrepancyNoteBean.user", "discrepancyNoteBean.owner", "actions");
    Row row = tableFacade.getTable().getRow();
    configureColumn(row.getColumn("studySubject.label"), resword.getString("study_subject_ID"), null, null, true, true);
    configureColumn(row.getColumn("siteId"), resword.getString("site_id"), null, null, true, false);
    configureColumn(row.getColumn("discrepancyNoteBean.createdDate"), resword.getString("date_created"), new DateCellEditor(getDateFormat()), null, true, true);
    configureColumn(row.getColumn("discrepancyNoteBean.updatedDate"), resword.getString("date_updated"), new DateCellEditor(getDateFormat()), null, true, false);
    configureColumn(row.getColumn("eventStartDate"), resword.getString("event_date"), new DateCellEditor(getDateFormat()), null, false, false);
    configureColumn(row.getColumn("eventName"), resword.getString("event_name"), null, null, true, false);
    configureColumn(row.getColumn("crfName"), resword.getString("CRF"), null, null, true, false);
    configureColumn(row.getColumn("crfStatus"), resword.getString("CRF_status"), null, null, false, false);
    configureColumn(row.getColumn("entityName"), resword.getString("entity_name"), new EntityNameCellEditor(), null, true, false);
    configureColumn(row.getColumn("entityValue"), resword.getString("entity_value"), null, null, true, false);
    configureColumn(row.getColumn("discrepancyNoteBean.description"), resword.getString("description"), null, null, true, false);
    configureColumn(row.getColumn("discrepancyNoteBean.detailedNotes"), resword.getString("detailed_notes"), null, null, false, false);
    configureColumn(row.getColumn("numberOfNotes"), resword.getString("of_notes"), null, null, false, false);
    configureColumn(row.getColumn("discrepancyNoteBean.user"), resword.getString("assigned_user"), new AssignedUserCellEditor(), null, true, false);
    configureColumn(row.getColumn("discrepancyNoteBean.resolutionStatus"), resword.getString("resolution_status"), new ResolutionStatusCellEditor(), resolutionStatusDropdown, true, false);
    configureColumn(row.getColumn("discrepancyNoteBean.disType"), resword.getString("type"), new DiscrepancyNoteTypeCellEditor(), discrepancyNoteTypeDropdown, true, false);
    configureColumn(row.getColumn("discrepancyNoteBean.entityType"), resword.getString("entity_type"), null, null, true, false);
    configureColumn(row.getColumn("discrepancyNoteBean.owner"), resword.getString("owner"), new OwnerCellEditor(), null, false, false);
    String actionsHeader = resword.getString("actions") + "&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;";
    configureColumn(row.getColumn("actions"), actionsHeader, new ActionsCellEditor(), new DefaultActionsEditor(locale), true, false);
    configureColumn(row.getColumn("age"), resword.getString("days_open"), null, null);
    configureColumn(row.getColumn("days"), resword.getString("days_since_updated"), null, null);
}
Also used : DefaultActionsEditor(org.akaza.openclinica.control.DefaultActionsEditor) Row(org.jmesa.view.component.Row) DateCellEditor(org.jmesa.view.editor.DateCellEditor)

Example 14 with Row

use of org.jmesa.view.component.Row in project OpenClinica by OpenClinica.

the class AuditUserLoginTableFactory method configureColumns.

@Override
protected void configureColumns(TableFacade tableFacade, Locale locale) {
    tableFacade.setColumnProperties("userName", "loginAttemptDate", "loginStatus", "details", "actions");
    Row row = tableFacade.getTable().getRow();
    configureColumn(row.getColumn("userName"), "User Name", null, null);
    configureColumn(row.getColumn("loginAttemptDate"), "Attempt Date", new DateCellEditor("yyyy-MM-dd HH:mm:ss"), null);
    configureColumn(row.getColumn("loginStatus"), "Status", null, new AvailableDroplistFilterEditor());
    configureColumn(row.getColumn("details"), "Details", null, null);
    String actionsHeader = resword.getString("actions") + "&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;";
    configureColumn(row.getColumn("actions"), actionsHeader, new ActionsCellEditor(), new DefaultActionsEditor(locale), true, false);
}
Also used : DefaultActionsEditor(org.akaza.openclinica.control.DefaultActionsEditor) Row(org.jmesa.view.component.Row) DateCellEditor(org.jmesa.view.editor.DateCellEditor)

Example 15 with Row

use of org.jmesa.view.component.Row in project OpenClinica by OpenClinica.

the class ListSubjectTableFactory method configureColumns.

@Override
protected void configureColumns(TableFacade tableFacade, Locale locale) {
    tableFacade.setColumnProperties("subject.uniqueIdentifier", "studySubjectIdAndStudy", "subject.gender", "subject.createdDate", "subject.owner", "subject.updatedDate", "subject.updater", "subject.status", "actions");
    Row row = tableFacade.getTable().getRow();
    configureColumn(row.getColumn("subject.uniqueIdentifier"), resword.getString("person_ID"), null, null);
    configureColumn(row.getColumn("studySubjectIdAndStudy"), resword.getString("Protocol_Study_subject_IDs"), null, null, true, false);
    configureColumn(row.getColumn("subject.gender"), resword.getString("gender"), null, null);
    configureColumn(row.getColumn("subject.createdDate"), resword.getString("date_created"), new DateCellEditor(getDateFormat()), null);
    configureColumn(row.getColumn("subject.owner"), resword.getString("owner"), new OwnerCellEditor(), null, true, false);
    configureColumn(row.getColumn("subject.updatedDate"), resword.getString("date_updated"), new DateCellEditor(getDateFormat()), null);
    configureColumn(row.getColumn("subject.updater"), resword.getString("last_updated_by"), new UpdaterCellEditor(), null, true, false);
    configureColumn(row.getColumn("subject.status"), resword.getString("status"), new StatusCellEditor(), new StatusDroplistFilterEditor());
    configureColumn(row.getColumn("actions"), resword.getString("actions") + // "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
    "&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;", new ActionsCellEditor(), new DefaultActionsEditor(locale), true, false);
// >> tbh #4003, 08/2009
}
Also used : DefaultActionsEditor(org.akaza.openclinica.control.DefaultActionsEditor) Row(org.jmesa.view.component.Row) DateCellEditor(org.jmesa.view.editor.DateCellEditor)

Aggregations

Row (org.jmesa.view.component.Row)20 DefaultActionsEditor (org.akaza.openclinica.control.DefaultActionsEditor)11 DateCellEditor (org.jmesa.view.editor.DateCellEditor)5 HtmlTableRenderer (org.jmesa.view.html.renderer.HtmlTableRenderer)4 List (java.util.List)2 CRFBean (org.akaza.openclinica.bean.admin.CRFBean)2 EventDefinitionCRFBean (org.akaza.openclinica.bean.managestudy.EventDefinitionCRFBean)2 StudyEventDefinitionBean (org.akaza.openclinica.bean.managestudy.StudyEventDefinitionBean)2 StudyGroupClassBean (org.akaza.openclinica.bean.managestudy.StudyGroupClassBean)2 EventCRFBean (org.akaza.openclinica.bean.submit.EventCRFBean)2 HtmlColumn (org.jmesa.view.html.component.HtmlColumn)2 HtmlRow (org.jmesa.view.html.component.HtmlRow)2 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 Iterator (java.util.Iterator)1 Map (java.util.Map)1 Set (java.util.Set)1 RuleActionBean (org.akaza.openclinica.domain.rule.action.RuleActionBean)1 SDVUtil (org.akaza.openclinica.web.table.sdv.SDVUtil)1 FilterSet (org.jmesa.limit.FilterSet)1