Interface VeneeredPage

    • Method Detail

      • getPage

        com.day.cq.wcm.api.Page getPage()
        Get the underlying WCM page.
        Returns:
        page
      • listChildren

        Iterator<VeneeredPage> listChildren()
        List children of the current page.
        Returns:
        iterator of child pages
      • listChildren

        Iterator<VeneeredPage> listChildren​(Predicate<VeneeredPage> predicate)
        List child pages of the current page filtered using the given predicate.
        Parameters:
        predicate - predicate to filter pages
        Returns:
        filtered iterator of child pages
      • listChildren

        Iterator<VeneeredPage> listChildren​(Predicate<VeneeredPage> predicate,
                                            boolean deep)
        List child pages of the current page filtered using the given predicate.
        Parameters:
        predicate - predicate to filter pages
        deep - if true, recursively iterate over all descendant pages
        Returns:
        filtered iterator of child pages
      • getChild

        Optional<VeneeredPage> getChild​(String name)
        Get the child page of the current page by name.
        Parameters:
        name - name of the child
        Returns:
        page or absent Optional
      • getContentResource

        Optional<VeneeredResource> getContentResource()
        Get the veneered resource for the "jcr:content" node for this page. If the page does not have a content node, an "absent" Optional is returned.
        Returns:
        optional veneered resource for page content
      • getContentResource

        Optional<VeneeredResource> getContentResource​(String relativePath)
        Get the veneered resource for the node at the given path relative to the "jcr:content" node for this page. If the node does not exist, an "absent" Optional is returned.
        Parameters:
        relativePath - relative path to resource
        Returns:
        optional veneered resource for resource relative to page content
      • getLink

        Link getLink​(TitleType titleType)
        Get a link with a specified title type for this item.
        Parameters:
        titleType - type of title to set on link
        Returns:
        link
      • getLinkBuilder

        LinkBuilder getLinkBuilder​(TitleType titleType)
        Get a link builder for the current page path.
        Parameters:
        titleType - type of title to set on builder
        Returns:
        builder instance for this item
      • getNavigationLink

        Link getNavigationLink​(boolean isActive)
        Get a navigation link for this page containing an active state. The returned link will use the navigation title as the link title, defaulting to the JCR title if it does not exist.
        Parameters:
        isActive - active state to be set on returned link
        Returns:
        navigation link
      • getTemplatePath

        String getTemplatePath()
        Get the template path for this page. This method is preferred over getTemplate().getPath(), which is dependent on access to /apps and will therefore fail in publish mode.
        Returns:
        value of cq:template property or empty string if none exists
      • getTitle

        Optional<String> getTitle​(TitleType titleType)
        Get the title with the given type for this page. If the title value is empty or non-existent, an absent Optional is returned.
        Parameters:
        titleType - type of title to retrieve
        Returns:
        title value or absent Optional
      • getAbsoluteParent

        VeneeredPage getAbsoluteParent​(int level)
        Returns the absolute parent page. If no page exists at that level, null is returned.

        Example (this path == /content/geometrixx/en/products)

         | level | returned                        |
         |     0 | /content                        |
         |     1 | /content/geometrixx             |
         |     2 | /content/geometrixx/en          |
         |     3 | /content/geometrixx/en/products |
         |     4 | null                            |
         
        Parameters:
        level - hierarchy level of the parent page to retrieve
        Returns:
        the respective parent page or null
      • getParent

        VeneeredPage getParent()
        Returns the parent page if it's resource adapts to page.
        Returns:
        the parent page or null
      • getParent

        VeneeredPage getParent​(int level)
        Returns the relative parent page. If no page exists at that level, null is returned.

        Example (this path == /content/geometrixx/en/products)

         | level | returned                        |
         |     0 | /content/geometrixx/en/products |
         |     1 | /content/geometrixx/en          |
         |     2 | /content/geometrixx             |
         |     3 | /content                        |
         |     4 | null                            |
         
        Parameters:
        level - hierarchy level of the parent page to retrieve
        Returns:
        the respective parent page or null
      • getPageManager

        VeneeredPageManager getPageManager()
        Get the page manager for this page.
        Returns:
        the page manager