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();
}
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();
}
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();
}
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());
}
Aggregations