use of org.jmesa.view.html.HtmlBuilder in project OpenClinica by OpenClinica.
the class StudyStatisticsView method customHeader.
private String customHeader() {
HtmlBuilder html = new HtmlBuilder();
html.thead(0).tr(0).styleClass("header").close();
html.td(0).colspan("4").style("border-bottom: 1px solid white;background-color:white;color:grey;").align("center").close().append(resword.getString("subject_enrollment_for_study")).tdEnd();
html.theadEnd(0);
return html.toString();
}
use of org.jmesa.view.html.HtmlBuilder in project OpenClinica by OpenClinica.
the class StudySubjectStatusView method customHeader.
private String customHeader() {
HtmlBuilder html = new HtmlBuilder();
html.thead(0).tr(0).styleClass("header").close();
html.td(0).colspan("4").style("border-bottom: 1px solid white;background-color:white;color:grey;").align("center").close().append(resword.getString("subject_status_count")).tdEnd();
html.theadEnd(0);
return html.toString();
}
use of org.jmesa.view.html.HtmlBuilder in project OpenClinica by OpenClinica.
the class ListSubjectTableFactory method viewSubjectLink.
private String viewSubjectLink(Integer subjectId) {
HtmlBuilder builder = new HtmlBuilder();
builder.a().href("ViewSubject?action=show&id=" + subjectId);
builder.onmouseout("javascript:setImage('bt_View1','images/bt_View_d.gif');");
builder.onmouseover("javascript:setImage('bt_View1','images/bt_View.gif');");
builder.close();
builder.img().name("bt_View1").src("images/bt_View.gif").border("0").alt(resword.getString("view")).title(resword.getString("view")).align("left").append("hspace=\"6\"").close();
builder.aEnd();
return builder.toString();
}
use of org.jmesa.view.html.HtmlBuilder in project OpenClinica by OpenClinica.
the class ListSubjectTableFactory method removeSubjectLink.
private String removeSubjectLink(Integer subjectId) {
HtmlBuilder builder = new HtmlBuilder();
builder.a().href("RemoveSubject?action=confirm&id=" + subjectId);
builder.onmouseout("javascript:setImage('bt_Remove1','images/bt_Remove_d.gif');");
builder.onmouseover("javascript:setImage('bt_Remove1','images/bt_Remove.gif');");
builder.close();
builder.img().name("bt_Remove1").src("images/bt_Remove.gif").border("0").alt(resword.getString("remove")).title(resword.getString("remove")).append("hspace=\"2\"").close();
builder.aEnd();
return builder.toString();
}
use of org.jmesa.view.html.HtmlBuilder in project OpenClinica by OpenClinica.
the class ViewCRFServlet method html.
private String html(TableFacade tableFacade) {
// set the column properties
tableFacade.setColumnProperties("versionName", "ruleName", "ruleExpression", "executeOnPlaceHolder", "actionTypePlaceHolder", "actionSummaryPlaceHolder", "link");
HtmlTable table = (HtmlTable) tableFacade.getTable();
table.setCaption(resword.getString("rule_rules"));
table.getTableRenderer().setWidth("800px");
HtmlRow row = table.getRow();
HtmlColumn versionName = row.getColumn("versionName");
versionName.setTitle(resword.getString("CRF_version"));
HtmlColumn ruleName = row.getColumn("ruleName");
ruleName.setTitle(resword.getString("rule_name"));
HtmlColumn career = row.getColumn("ruleExpression");
career.setWidth("100px");
career.setTitle(resword.getString("rule_expression"));
HtmlColumn executeOn = row.getColumn("executeOnPlaceHolder");
executeOn.setSortable(false);
executeOn.setFilterable(false);
executeOn.setTitle(resword.getString("rule_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 += "<hr>";
}
}
return value;
}
});
HtmlColumn actionTypePlaceHolder = row.getColumn("actionTypePlaceHolder");
actionTypePlaceHolder.setSortable(false);
actionTypePlaceHolder.setFilterable(false);
actionTypePlaceHolder.setTitle(resword.getString("rule_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 += "<hr>";
}
}
return value;
}
});
HtmlColumn actionSummaryPlaceHolder = row.getColumn("actionSummaryPlaceHolder");
actionSummaryPlaceHolder.setSortable(false);
actionSummaryPlaceHolder.setFilterable(false);
actionSummaryPlaceHolder.setTitle(resword.getString("rule_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 += "<hr>";
}
}
return value;
}
});
HtmlColumn link = row.getColumn("link");
link.setSortable(false);
link.setFilterable(false);
link.setTitle(resword.getString("action"));
link.getCellRenderer().setCellEditor(new CellEditor() {
@SuppressWarnings("unchecked")
public Object getValue(Object item, String property, int rowcount) {
String param1 = (String) new BasicCellEditor().getValue(item, "ruleSetRuleId", rowcount);
String param2 = (String) new BasicCellEditor().getValue(item, "versionId", rowcount);
HtmlBuilder html = new HtmlBuilder();
html.a().href().quote().append(request.getContextPath() + "/RunRule?ruleSetRuleId=" + param1 + "&versionId=" + param2 + "&action=dryRun").quote().close();
html.img().name("bt_View1").src("images/bt_ExexuteRules.gif").border("0").end();
html.aEnd();
return html.toString();
}
});
// Return the Html.
return tableFacade.render();
}
Aggregations