Search in sources :

Example 1 with HtmlBuilder

use of org.jmesa.view.html.HtmlBuilder in project OpenClinica by OpenClinica.

the class RssReaderServlet method feedHtml.

String feedHtml(SyndFeed feed) {
    HtmlBuilder htmlBuilder = new HtmlBuilder();
    htmlBuilder.h1().close().append(resword.getString("news")).h1End().ul().close();
    List<SyndEntryImpl> theFeeds = feed.getEntries();
    for (int i = 0; i < (theFeeds.size() >= 4 ? 4 : theFeeds.size()); i++) {
        SyndEntryImpl syndFeed = theFeeds.get(i);
        String description = null;
        if (syndFeed.getDescription().getValue().length() > 50) {
            Integer k = 50;
            while (syndFeed.getDescription().getValue().charAt(k) != ' ') {
                k--;
            }
            description = syndFeed.getDescription().getValue().substring(0, k) + " ...";
        } else {
            description = syndFeed.getDescription().getValue();
        }
        SimpleDateFormat sdf = new SimpleDateFormat(resformat.getString("mid_date_format"));
        String theDate = sdf.format(syndFeed.getPublishedDate());
        htmlBuilder.li().close().a().href(syndFeed.getLink()).append(" target=\"_blank\"").close().append(theDate + " - " + StringEscapeUtils.escapeHtml(syndFeed.getTitle()) + " - " + description).aEnd().liEnd();
    }
    if (rssMore != null && rssMore.length() > 0) {
        return htmlBuilder.ulEnd().a().href(rssMore).append(" target=\"_blank\"").close().div().align("right").close().append(resword.getString("more") + "...").divEnd().aEnd().toString();
    } else {
        return htmlBuilder.ulEnd().toString();
    }
}
Also used : SyndEntryImpl(com.sun.syndication.feed.synd.SyndEntryImpl) HtmlBuilder(org.jmesa.view.html.HtmlBuilder) SimpleDateFormat(java.text.SimpleDateFormat)

Example 2 with HtmlBuilder

use of org.jmesa.view.html.HtmlBuilder in project OpenClinica by OpenClinica.

the class RssReaderServlet method about.

void about(PrintWriter pw) {
    HtmlBuilder htmlBuilder = new HtmlBuilder();
    htmlBuilder.h1().close().append(resword.getString("about")).h1End().ul().close();
    htmlBuilder.li().close().append(text1).liEnd();
    htmlBuilder.li().close().append(text2).liEnd();
    htmlBuilder.ulEnd().toString();
    pw.println(htmlBuilder.toString());
    pw.close();
}
Also used : HtmlBuilder(org.jmesa.view.html.HtmlBuilder)

Example 3 with HtmlBuilder

use of org.jmesa.view.html.HtmlBuilder in project OpenClinica by OpenClinica.

the class DefaultActionsEditor method getValue.

public Object getValue() {
    HtmlBuilder html = new HtmlBuilder();
    html.append(createFilterItem().getToolbarItemRenderer().render());
    html.append(" ");
    html.append(createResetFilterItem().getToolbarItemRenderer().render());
    return html.toString();
}
Also used : HtmlBuilder(org.jmesa.view.html.HtmlBuilder)

Example 4 with HtmlBuilder

use of org.jmesa.view.html.HtmlBuilder in project OpenClinica by OpenClinica.

the class DefaultView method render.

public Object render() {
    HtmlSnippets snippets = getHtmlSnippets();
    HtmlBuilder html = new HtmlBuilder();
    html.append(snippets.themeStart());
    html.append(snippets.tableStart());
    html.append(snippets.theadStart());
    html.append(snippets.toolbar());
    html.append(snippets.header());
    html.append(snippets.filter());
    html.append(snippets.theadEnd());
    html.append(snippets.tbodyStart());
    html.append(snippets.body());
    html.append(snippets.tbodyEnd());
    html.append(snippets.footer());
    html.append(snippets.statusBar());
    html.append(snippets.tableEnd());
    html.append(snippets.themeEnd());
    html.append(snippets.initJavascriptLimit());
    return html.toString();
}
Also used : HtmlSnippets(org.jmesa.view.html.HtmlSnippets) HtmlBuilder(org.jmesa.view.html.HtmlBuilder)

Example 5 with HtmlBuilder

use of org.jmesa.view.html.HtmlBuilder in project OpenClinica by OpenClinica.

the class StatisticsView 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")).tdEnd();
    html.theadEnd(0);
    return html.toString();
}
Also used : HtmlBuilder(org.jmesa.view.html.HtmlBuilder)

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