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()));
}
Aggregations