Search in sources :

Example 6 with HtmlTable

use of org.jmesa.view.html.component.HtmlTable in project OpenClinica by OpenClinica.

the class SDVUtil method renderSubjectsAggregateTable.

public String renderSubjectsAggregateTable(int studyId, HttpServletRequest request) {
    List<StudySubjectBean> studySubjectBeans = new ArrayList<StudySubjectBean>();
    StudySubjectDAO studySubjectDAO = new StudySubjectDAO(dataSource);
    studySubjectBeans = studySubjectDAO.findAllByStudyId(studyId);
    Collection<SubjectSDVContainer> items = getSubjectAggregateRows(studySubjectBeans);
    //The number of items represents the total number of returned rows
    int totalRowCount = 0;
    if (items != null && items.size() > 0) {
        totalRowCount = items.size();
    }
    TableFacade tableFacade = createTableFacade("sdv", request);
    //set to the total row count
    if (totalRowCount > 1) {
        tableFacade.setMaxRowsIncrements(15, 50, totalRowCount);
    }
    tableFacade.setColumnProperties("studySubjectId", "studySubjectStatus", "numberOfCRFsSDV", "percentageOfCRFsSDV", "group", "sdvStatusActions");
    tableFacade.setItems(items);
    //Fix column titles
    HtmlTable table = (HtmlTable) tableFacade.getTable();
    //i18n caption; TODO: convert to Spring messages
    ResourceBundle resword = ResourceBundle.getBundle("org.akaza.openclinica.i18n.words", LocaleResolver.getLocale(request));
    String[] allTitles = { resword.getString("study_subject_ID"), resword.getString("study_subject_status"), resword.getString("num_CRFs_SDV"), resword.getString("porc_CRFs_SDV"), resword.getString("group") };
    setTitles(allTitles, table);
    table.getTableRenderer().setWidth("800");
    return tableFacade.render();
}
Also used : HtmlTable(org.jmesa.view.html.component.HtmlTable) StudySubjectBean(org.akaza.openclinica.bean.managestudy.StudySubjectBean) TableFacadeFactory.createTableFacade(org.jmesa.facade.TableFacadeFactory.createTableFacade) TableFacade(org.jmesa.facade.TableFacade) ArrayList(java.util.ArrayList) ResourceBundle(java.util.ResourceBundle) SubjectSDVContainer(org.akaza.openclinica.controller.helper.table.SubjectSDVContainer) StudySubjectDAO(org.akaza.openclinica.dao.managestudy.StudySubjectDAO)

Example 7 with HtmlTable

use of org.jmesa.view.html.component.HtmlTable in project OpenClinica by OpenClinica.

the class AuditDatabaseServlet method renderAuditDatabaseTable.

private String renderAuditDatabaseTable(List<DatabaseChangeLogBean> databaseChangeLogs) {
    // Collection<StudyRowContainer> items = getStudyRows(studyBeans);
    TableFacade tableFacade = createTableFacade("databaseChangeLogs", request);
    tableFacade.setColumnProperties("id", "author", "fileName", "dataExecuted", "md5Sum", "description", "comments", "tag", "liquibase");
    tableFacade.setItems(databaseChangeLogs);
    // Fix column titles
    HtmlTable table = (HtmlTable) tableFacade.getTable();
    table.setCaption("");
    HtmlRow row = table.getRow();
    HtmlColumn id = row.getColumn("id");
    id.setTitle("Id");
    HtmlColumn author = row.getColumn("author");
    author.setTitle("Author");
    HtmlColumn fileName = row.getColumn("fileName");
    fileName.setTitle("File Name");
    HtmlColumn dataExecuted = row.getColumn("dataExecuted");
    dataExecuted.setTitle("Date Executed");
    dataExecuted.getCellRenderer().setCellEditor(new DateCellEditor("yyyy-MM-dd hh:mm:ss"));
    HtmlColumn md5Sum = row.getColumn("md5Sum");
    md5Sum.setTitle("md5 sum");
    HtmlColumn description = row.getColumn("description");
    description.setTitle("Description");
    HtmlColumn comments = row.getColumn("comments");
    comments.setTitle("Comments");
    HtmlColumn tag = row.getColumn("tag");
    tag.setTitle("Tag");
    HtmlColumn liquibase = row.getColumn("liquibase");
    liquibase.setTitle("Liquibase");
    return tableFacade.render();
}
Also used : HtmlTable(org.jmesa.view.html.component.HtmlTable) TableFacadeFactory.createTableFacade(org.jmesa.facade.TableFacadeFactory.createTableFacade) TableFacade(org.jmesa.facade.TableFacade) HtmlRow(org.jmesa.view.html.component.HtmlRow) DateCellEditor(org.jmesa.view.editor.DateCellEditor) HtmlColumn(org.jmesa.view.html.component.HtmlColumn)

Example 8 with HtmlTable

use of org.jmesa.view.html.component.HtmlTable in project OpenClinica by OpenClinica.

the class SDVController method renderSubjectsTable.

/*
    Create a JMesa-based table for showing the event CRFs.
    */
private String renderSubjectsTable(List<EventCRFBean> eventCRFBeans, int studySubjectId, HttpServletRequest request) {
    StudySubjectDAO studySubjectDAO = new StudySubjectDAO(dataSource);
    StudySubjectBean subjectBean = (StudySubjectBean) studySubjectDAO.findByPK(studySubjectId);
    Collection<SubjectSDVContainer> items = sdvUtil.getSubjectRows(eventCRFBeans, request);
    //The number of items represents the total number of returned rows
    int totalRowCount = 0;
    if (items != null && items.size() > 0) {
        totalRowCount = items.size();
    }
    TableFacade tableFacade = createTableFacade("sdv", request);
    //set to the total row count
    if (totalRowCount > 1) {
        tableFacade.setMaxRowsIncrements(15, 50, totalRowCount);
    }
    tableFacade.setColumnProperties("studySubjectId", "personId", "secondaryId", "eventName", "eventDate", "enrollmentDate", "subjectStatus", "crfNameVersion", "crfStatus", "lastUpdatedDate", "lastUpdatedBy", "sdvStatusActions");
    tableFacade.setItems(items);
    //Fix column titles
    HtmlTable table = (HtmlTable) tableFacade.getTable();
    //i18n caption; TODO: convert to Spring messages
    ResourceBundle resourceBundle = ResourceBundle.getBundle("org.akaza.openclinica.i18n.words", LocaleResolver.getLocale(request));
    String[] allTitles = { resourceBundle.getString("study_subject_ID"), resourceBundle.getString("person_ID"), resourceBundle.getString("secondary_ID"), resourceBundle.getString("event_name"), resourceBundle.getString("event_date"), resourceBundle.getString("enrollment_date"), resourceBundle.getString("subject_status"), resourceBundle.getString("CRF_name") + " / " + resourceBundle.getString("version"), resourceBundle.getString("CRF_status"), resourceBundle.getString("last_updated_date"), resourceBundle.getString("last_updated_by"), resourceBundle.getString("SDV_status") + " / " + resourceBundle.getString("actions") };
    setTitles(allTitles, table);
    table.getTableRenderer().setWidth("800");
    return tableFacade.render();
}
Also used : HtmlTable(org.jmesa.view.html.component.HtmlTable) StudySubjectBean(org.akaza.openclinica.bean.managestudy.StudySubjectBean) TableFacadeFactory.createTableFacade(org.jmesa.facade.TableFacadeFactory.createTableFacade) TableFacade(org.jmesa.facade.TableFacade) ResourceBundle(java.util.ResourceBundle) SubjectSDVContainer(org.akaza.openclinica.controller.helper.table.SubjectSDVContainer) StudySubjectDAO(org.akaza.openclinica.dao.managestudy.StudySubjectDAO)

Example 9 with HtmlTable

use of org.jmesa.view.html.component.HtmlTable in project OpenClinica by OpenClinica.

the class AbstractTableFactory method configureUnexportedTable.

protected void configureUnexportedTable(TableFacade tableFacade, Locale locale) {
    HtmlTable table = (HtmlTable) tableFacade.getTable();
    table.setCaption(getCaptionName());
}
Also used : HtmlTable(org.jmesa.view.html.component.HtmlTable)

Aggregations

HtmlTable (org.jmesa.view.html.component.HtmlTable)9 TableFacade (org.jmesa.facade.TableFacade)6 TableFacadeFactory.createTableFacade (org.jmesa.facade.TableFacadeFactory.createTableFacade)6 HtmlColumn (org.jmesa.view.html.component.HtmlColumn)6 HtmlRow (org.jmesa.view.html.component.HtmlRow)6 ResourceBundle (java.util.ResourceBundle)4 ArrayList (java.util.ArrayList)2 StudySubjectBean (org.akaza.openclinica.bean.managestudy.StudySubjectBean)2 SDVToolbar (org.akaza.openclinica.controller.helper.table.SDVToolbar)2 SubjectSDVContainer (org.akaza.openclinica.controller.helper.table.SubjectSDVContainer)2 StudySubjectDAO (org.akaza.openclinica.dao.managestudy.StudySubjectDAO)2 MatcherKey (org.jmesa.core.filter.MatcherKey)2 List (java.util.List)1 DefaultActionsEditor (org.akaza.openclinica.control.DefaultActionsEditor)1 RuleActionBean (org.akaza.openclinica.domain.rule.action.RuleActionBean)1 SDVUtil (org.akaza.openclinica.web.table.sdv.SDVUtil)1 BasicCellEditor (org.jmesa.view.editor.BasicCellEditor)1 CellEditor (org.jmesa.view.editor.CellEditor)1 DateCellEditor (org.jmesa.view.editor.DateCellEditor)1 HtmlBuilder (org.jmesa.view.html.HtmlBuilder)1