public Object apply(List<String> args) throws TemplateModelException { final ContentType contentType = getContentType(context, args, 0); if (contentType == null) { return EMPTY; } NavigationKey nk = null; final PageKey actual = context.getPageKey(); if (actual instanceof WithNavigation) { NavigationKey pnk = ((WithNavigation) actual).getNavigationKey(); if (pnk != null) { nk = pnk.withoutContentType(); } } final PageKey key = PageKey.contentType(nk, contentType); return returnUri(context, key, args, 1); } };
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); } };
public Object apply(List<String> args) throws TemplateModelException { final String id = arg(args, 1); if (id == null) { return EMPTY; } final ContentType contentType = getContentType(context, args, 0); if (contentType == null) { return EMPTY; } NavigationKey nk = null; final PageKey actual = context.getPageKey(); if (actual instanceof WithNavigation) { NavigationKey pnk = ((WithNavigation) actual).getNavigationKey(); if (pnk != null) { nk = pnk.withoutContentType(); } } final PageKey key = PageKey.content(nk, ContentKey.of(contentType, id)); return returnUri(context, key, args, 2); } };
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); }