use of j2html.tags.ContainerTag in project midpoint by Evolveum.
the class HtmlReportDataWriter method createTableBox.
protected String createTableBox(String aggregatedData, CommonHtmlSupport support, boolean parseData) {
StringBuilder table = new StringBuilder();
String style = support.getCssStyleOfTable();
String classes = support.getCssClassOfTable();
ContainerTag div = TagCreator.div().withClasses("box-body", "no-padding").with(TagCreator.h1(support.getTableName(localizationService))).with(TagCreator.p(GenericSupport.getMessage(localizationService, CommonHtmlSupport.REPORT_GENERATED_ON, support.getActualTime())));
String tableBox = TagCreator.div().withClasses("box", "boxed-table", classes).withStyle(style).with(div).render();
tableBox = tableBox.substring(0, tableBox.length() - 6);
String parsedData;
if (parseData) {
parsedData = parseAgregatedData(aggregatedData);
} else {
parsedData = aggregatedData;
}
table.append(tableBox).append("<table class=\"table table-striped table-hover table-bordered\">").append(parsedData).append("</table>").append("</div>");
return table.toString();
}
use of j2html.tags.ContainerTag in project midpoint by Evolveum.
the class HtmlReportDataWriter method formatColumn.
private ContainerTag formatColumn(List<String> values) {
ContainerTag div = TagCreator.div().withStyle("white-space: pre-wrap");
values.forEach((value) -> {
if (div.getNumChildren() != 0) {
div.with(TagCreator.br());
}
div.withText(value);
});
return div;
}
use of j2html.tags.ContainerTag in project miso-lims by miso-lims.
the class NotificationManager method makeLibraryAliquotTable.
private static ContainerTag makeLibraryAliquotTable(Collection<TransferLibraryAliquot> transferLibraryAliquots) {
ContainerTag headerRow = tr(makeTh("Alias"), makeTh("Barcode"), makeTh("Location"), makeTh("Platform"), makeTh("Type"), makeTh("i7 Index Name"), makeTh("i7 Index"), makeTh("i5 Index Name"), makeTh("i5 Index"), makeTh("Targeted Sequencing"));
List<ContainerTag> rows = new ArrayList<>();
List<TransferLibraryAliquot> sorted = sortByAlias(transferLibraryAliquots);
for (TransferLibraryAliquot transferLibraryAliquot : sorted) {
LibraryAliquot libraryAliquot = transferLibraryAliquot.getItem();
Library library = libraryAliquot.getLibrary();
List<DomContent> cells = new ArrayList<>();
cells.add(makeTd(libraryAliquot.getAlias()));
cells.add(makeTd(libraryAliquot.getIdentificationBarcode()));
cells.add(makeTd(makeLocationLabel(transferLibraryAliquot)));
cells.add(makeTd(library.getPlatformType().getKey()));
cells.add(makeTd(library.getLibraryType().getDescription()));
cells.add(makeTd(library.getIndex1() == null ? null : library.getIndex1().getName()));
cells.add(makeTd(library.getIndex1() == null ? null : library.getIndex1().getSequence()));
cells.add(makeTd(library.getIndex2() == null ? null : library.getIndex2().getName()));
cells.add(makeTd(library.getIndex2() == null ? null : library.getIndex2().getSequence()));
rows.add(tr().with(cells));
}
return makeTable(headerRow, rows);
}
use of j2html.tags.ContainerTag in project miso-lims by miso-lims.
the class NotificationManager method sendFailedNotification.
private void sendFailedNotification(TransferNotification notification) throws EmailException {
HtmlEmail email = new HtmlEmail();
email.addTo(notification.getCreator().getEmail(), notification.getCreator().getFullName());
email.setSubject("Transfer Notification Failed");
ContainerTag error = p("Failed to send the following transfer notification to ").withText(notification.getRecipientName()).withText(" <").with(a(notification.getRecipientEmail()).withHref("mailto:" + notification.getRecipientEmail())).withText(">:");
email.setHtmlMsg(makeTransferNotificationHtmlMessage(notification, error));
sendMail(email);
}
use of j2html.tags.ContainerTag in project mapton by trixon.
the class BookmarkReport method getContent.
@Override
public ContainerTag getContent() {
final TreeMap<String, ArrayList<MBookmark>> bookmarkCategories = new TreeMap<>();
for (MBookmark bookmark : mManager.dbLoad("*", false)) {
bookmarkCategories.computeIfAbsent(bookmark.getCategory(), k -> new ArrayList<>()).add(bookmark);
}
ContainerTag html = html(head(title(mName)), body(h1(mName), hr(), div(each(bookmarkCategories.keySet(), category -> div(h2(category), table(tr(th(Dict.NAME.toString()), th(Dict.DESCRIPTION.toString()), th("URL"), th(Dict.LATITUDE.toString()), th(Dict.LONGITUDE.toString())), tbody(each(filter(mManager.dbLoad(), bookmark -> bookmark.getCategory().equals(category)), bookmark -> tr(td(bookmark.getName()), td(StringUtils.defaultString(bookmark.getDescription())), td(StringUtils.defaultString(bookmark.getUrl())), td(String.format("%.6f", bookmark.getLatitude())), td(String.format("%.6f", bookmark.getLongitude())))))))))));
return html;
}
Aggregations