Search in sources :

Example 1 with XeDirectives

use of org.takes.rs.xe.XeDirectives in project wring by yegor256.

the class TkEvents method source.

/**
 * Convert event to Xembly.
 * @param event The event
 * @return Xembly
 * @throws IOException If fails
 */
private static XeSource source(final Event event) throws IOException {
    final Iterable<Directive> dirs = event.asXembly();
    final String title = new XePrint(dirs).text("{/event/title/text()}");
    final String hash = new XePrint(dirs).text("{/event/md5/text()}");
    return new XeDirectives(new Directives().append(dirs).append(new XeLink("delete", new Href("/event-delete").with("title", title).with("hash", hash)).toXembly()).append(new XeLink("down", new Href("/event-down").with("title", title)).toXembly()));
}
Also used : Directives(org.xembly.Directives) XeDirectives(org.takes.rs.xe.XeDirectives) Href(org.takes.misc.Href) XePrint(io.wring.model.XePrint) XeLink(org.takes.rs.xe.XeLink) Directive(org.xembly.Directive) XeDirectives(org.takes.rs.xe.XeDirectives)

Aggregations

XePrint (io.wring.model.XePrint)1 Href (org.takes.misc.Href)1 XeDirectives (org.takes.rs.xe.XeDirectives)1 XeLink (org.takes.rs.xe.XeLink)1 Directive (org.xembly.Directive)1 Directives (org.xembly.Directives)1