Class CmsJsonRendererContainerPage

    • Constructor Detail

      • CmsJsonRendererContainerPage

        public CmsJsonRendererContainerPage​(CmsObject cms,
                                            CmsResource page,
                                            java.util.function.Predicate<java.lang.String> propertyFilter)
        Creates a new renderer instance.
        Parameters:
        cms - the CMS context
        page - the container page to render
        propertyFilter - the property filter
    • Method Detail

      • buildTree

        public CmsJsonRendererContainerPage.ElementNode buildTree​(CmsContainerPageBean page,
                                                                  java.lang.String rootPath)
        Builds a tree from the given container page bean.

        The returned tree consists of container nodes (which have children corresponding the container elements) and element nodes (which have children corresponding to the nested containers of the element). The root of the tree is a dummy element node which does not correspond to any element in the page, but just acts as a container for the top-level containers of the page.

        Parameters:
        page - the container page bean
        rootPath - the root path of the container page
        Returns:
        the dummy root element node
      • renderJson

        public java.lang.Object renderJson()
                                    throws java.lang.Exception
        Renders the JSON for the container page.
        Returns:
        the JSON for the container page
        Throws:
        java.lang.Exception - if something goes wrong