private ExperienceFragmentSocialVariation findExperienceFragmentSocialVariation() { Page variantPage = currentPage.getPageManager().getPage(variantPath); if (variantPage == null) return null; ExperienceFragmentSocialVariation socialVariant = variantPage.adaptTo(ExperienceFragmentSocialVariation.class); return socialVariant; }
/** * Checks if the request is in {@link AuthoringUIMode#TOUCH} * * @param request * request to check * @return true if the request is in Touch authoring mode */ public static boolean isTouch(SlingHttpServletRequest request) { return AuthoringUIMode.TOUCH == AuthoringUIMode.fromRequest(request); }
private Page findRootPage() { Page page = currentPage; while (true) { Page parent = page.getParent(); if (parent == null) { return page; } else { page = parent; } } } }
/** * @param page Page * @param urlHandler Url handler instance */ UrlBuilderImpl(Page page, UrlHandlerImpl urlHandler) { this.path = page != null ? page.getPath() : null; this.resource = null; this.page = page; this.urlHandler = urlHandler; }
public Iterator<Page> getChildPages() { return page.listChildren(new PageFilter()); }
/** * Checks if the request is in mode {@link WCMMode#ANALYTICS} * * @param request * request to check * @return true if the request is in analytics mode */ public static boolean isAnalytics(SlingHttpServletRequest request) { return WCMMode.ANALYTICS == WCMMode.fromRequest(request); }
Resource pageA; //LiveCopy of Page B; LiveRelationshipManager liveRelationshipManager = resourceResolver.adaptTo(LiveRelationshipManager.class); PageManager pageManager = resourceResolver.adaptTo(PageManager.class); LiveRelationship liveRelationship = liveRelationshipManager.getLiveRelationship(pageA, false); String pageBPath = liveRelationship.getSourcePath(); Page pageB = pageManager.getPage(pageBPath);
@Override public Resource apply(Page page) { return page.adaptTo(Resource.class); } });
@Override public Locale getLocale() { if (locale == null) { // looks up jcr:language properties to the root, then considers the page name, falls back to system default // we therefore assume the language structure is correctly configured for the site for this to be accurate locale = page.getLanguage(false); } return locale; }
@Override public Calendar getLastModified() { return page.getLastModified(); }
/** * @return the resource path to this content. Does not include the extension. */ public String getPath() { return page.getPath(); }
/** * Checks if the request is in mode {@link WCMMode#DESIGN} * * @param request * request to check * @return true if the request is in design mode */ public static boolean isDesign(SlingHttpServletRequest request) { return WCMMode.DESIGN == WCMMode.fromRequest(request); }
/** * Checks if the request is in {@link AuthoringUIMode#CLASSIC} * * @param request * request to check * @return true if the request is in Classic authoring mode */ public static boolean isClassic(SlingHttpServletRequest request) { return AuthoringUIMode.CLASSIC == AuthoringUIMode.fromRequest(request); }
/** * @return the resource path to this content. Does not include the extension. */ public String getPath() { return page.getPath(); } }
/** * Checks if the request is in mode {@link WCMMode#DISABLED} * * @param request * request to check * @return true if the request is in disabled mode */ public static boolean isDisabled(SlingHttpServletRequest request) { return WCMMode.DISABLED == WCMMode.fromRequest(request); }
/** * Checks if the request is in {@link AuthoringUIMode#CLASSIC} * * @param request * request to check * @return true if the request is in Classic authoring mode */ public static boolean isClassic(SlingHttpServletRequest request) { return AuthoringUIMode.CLASSIC == AuthoringUIMode.fromRequest(request); }
/** * Checks if the request is in mode {@link WCMMode#PREVIEW} * * @param request * request to check * @return true if the request is in preview mode */ public static boolean isPreview(SlingHttpServletRequest request) { return WCMMode.PREVIEW == WCMMode.fromRequest(request); }
/** * Checks if the request is in {@link AuthoringUIMode#TOUCH} * * @param request * request to check * @return true if the request is in Touch authoring mode */ public static boolean isTouch(SlingHttpServletRequest request) { return AuthoringUIMode.TOUCH == AuthoringUIMode.fromRequest(request); }
/** * Checks if the request is in mode {@link WCMMode#READ_ONLY} * * @param request * request to check * @return true if the request is in read-only mode */ public static boolean isReadOnly(SlingHttpServletRequest request) { return WCMMode.READ_ONLY == WCMMode.fromRequest(request); }
/** * Checks if the request is in mode {@link WCMMode#EDIT} * * @param request * request to check * @return true if the request is in edit mode */ public static boolean isEdit(SlingHttpServletRequest request) { return WCMMode.EDIT == WCMMode.fromRequest(request); }