public Object apply(List<String> args) throws TemplateModelException { final URI uri = context.getSamePageURI(getParameters(args, 0)); return returnUri(uri); } };
public Object apply(List<String> args) throws TemplateModelException { return returnUri(context.getAbsolutePageURI(pagination, getInt(args, 0, 1))); } };
public Object apply(List<String> args) throws TemplateModelException { return returnUri(context.getFirstPageURI(pagination)); } };
public SyndEntry apply(Content c) { final ContentKey key = c.getContentKey(); NavigationKey nk = null; if (config != null && config.keepNavigation()) { nk = context.getNavigationKey(); if (nk != null) { nk = nk.withoutContentType(); } } final PageKey pageKey = PageKey.content(nk, key); Route route = context.getRoute().toPage(pageKey); if (config != null && config.toDefaultDevice()) { route = route.toDevice(context.getPortal().getDevice()); } final URI link = context.getAbsoluteURI(route); return ATOMFactory.entry(c, link, config); }
@Renderer public SitemapRenderer sitemap(final RenderContext context) { final List<URLEntry> entries = Lists.newLinkedList(); if (page != null) { Route r = context.getRoute(); r = r.toDevice(context.getPortal().getDevice()); for (Content c : page) { PageKey pk = PageKey.content(c.getContentKey()); URI u = context.getAbsoluteURI(r.toPage(pk)); entries.add(URLEntry.of(u)); } } return SitemapRenderers.set(entries); }
public Object apply(List<String> args) throws TemplateModelException { return returnUri(context.getRelativePageURI(pagination, getInt(args, 0, 0))); } };
private static Route route(RenderContext context, PageKey pageKey) { return context.getRoute().toPage(pageKey); }
@Override public Object apply(List<String> args) throws TemplateModelException { return uri(getContext().getAbsoluteURI(route, merge(args))); } }
public TemplateModel get(final PortalObjectWrapper wrapper, final ContentKey object) throws TemplateModelException { NavigationKey nk = wrapper.getContext().getNavigationKey(); if (nk != null) { nk = nk.withoutContentType(); } final PageKey pk = PageKey.content(nk, object); return wrapper.wrap(pk); } };
static Route toDevice(RenderContext context, Route route, String deviceName) { if (deviceName == null) { return route; } final DevicesInPortal dips = context.getPortal().getDevices(); if (dips.containsName(deviceName)) { final DeviceInPortal dip = dips.getByName(deviceName); return route.toDevice(dip.getDevice()); } return route; }
model.set("imgUri", FreeMarker.uri(context, imgUri)); model.set(Model.COMPONENT_ID, context.getComponentId().toString()); model.set(Model.CONTEXT, context); model.set("localParam", FreeMarker.localParam(context));
public URI getRelativePageURI(Pagination pagination, int delta) { return delegate().getRelativePageURI(pagination, delta); }
public URI getSamePageURI(Multimap<String, ?> parameters) { return delegate().getSamePageURI(parameters); }
public Object apply(List<String> args) throws TemplateModelException { return returnUri(context.getFirstPageURI(pagination)); } };
public URI getAbsolutePageURI(Pagination pagination, int page) { return delegate().getAbsolutePageURI(pagination, page); }
public URI getSamePageURI(Set<String> remove, Multimap<String, ?> parameters) { return delegate().getSamePageURI(remove, parameters); }
public URI getFirstPageURI(Pagination pagination) { return delegate().getFirstPageURI(pagination); }
@Override public HTMLFragment getBody() { Tag p = HTML.create(context).p(); if (result != null) { p.p("Result: " + result); } else { p.p("Nothing to do"); } p.p(context.getSamePageURI(null).toASCIIString()); return p; } };