Search in sources :

Example 11 with HtmlBuilder

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();
}
Also used : HtmlBuilder(org.jmesa.view.html.HtmlBuilder)

Example 12 with HtmlBuilder

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();
}
Also used : HtmlBuilder(org.jmesa.view.html.HtmlBuilder)

Example 13 with HtmlBuilder

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();
}
Also used : HtmlBuilder(org.jmesa.view.html.HtmlBuilder)

Example 14 with HtmlBuilder

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();
}
Also used : HtmlBuilder(org.jmesa.view.html.HtmlBuilder)

Example 15 with HtmlBuilder

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();
}
Also used : RuleActionBean(org.akaza.openclinica.domain.rule.action.RuleActionBean) BasicCellEditor(org.jmesa.view.editor.BasicCellEditor) HtmlTable(org.jmesa.view.html.component.HtmlTable) CellEditor(org.jmesa.view.editor.CellEditor) BasicCellEditor(org.jmesa.view.editor.BasicCellEditor) HtmlBuilder(org.jmesa.view.html.HtmlBuilder) HtmlRow(org.jmesa.view.html.component.HtmlRow) ArrayList(java.util.ArrayList) List(java.util.List) HtmlColumn(org.jmesa.view.html.component.HtmlColumn)

Aggregations

HtmlBuilder (org.jmesa.view.html.HtmlBuilder)53 HtmlSnippets (org.jmesa.view.html.HtmlSnippets)6 SyndEntryImpl (com.sun.syndication.feed.synd.SyndEntryImpl)1 SimpleDateFormat (java.text.SimpleDateFormat)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 StudyBean (org.akaza.openclinica.bean.managestudy.StudyBean)1 RuleActionBean (org.akaza.openclinica.domain.rule.action.RuleActionBean)1 ParticipantPortalRegistrar (org.akaza.openclinica.service.pmanage.ParticipantPortalRegistrar)1 BasicCellEditor (org.jmesa.view.editor.BasicCellEditor)1 CellEditor (org.jmesa.view.editor.CellEditor)1 HtmlColumn (org.jmesa.view.html.component.HtmlColumn)1 HtmlRow (org.jmesa.view.html.component.HtmlRow)1 HtmlTable (org.jmesa.view.html.component.HtmlTable)1