Class PageRendererUtil


  • public class PageRendererUtil
    extends java.lang.Object
    Contains utility methods to help the page render.
    Since:
    5.6.0
    • Constructor Detail

      • PageRendererUtil

        public PageRendererUtil()
    • Method Detail

      • getServiceInterfaceInstanceSafeModeHTML

        public static java.lang.String getServiceInterfaceInstanceSafeModeHTML​(java.lang.String serviceInterfaceInstanceId)
                                                                        throws PortalException
        Returns the HTML used for a service interface instance rendering in safe mode.
        Returns:
        the HTML code.
        Throws:
        PortalException
        Since:
        5.6.0
      • renderServiceInterfaceInstance

        public static java.lang.CharSequence renderServiceInterfaceInstance​(java.lang.String baseServiceInterfaceInstanceId,
                                                                            LayoutFilePage page)
        Returns the HTML source code for the service interface instance instantiated on a page.
        Parameters:
        baseServiceInterfaceInstanceId - the service interface instance identifier (before replacements).
        page - the page that contains the service instance to be rendered.
        Returns:
        the HTML source code for the service interface instance instantiated on a page.
        Since:
        6.0.0
      • getExceptionRenderingInterfaceInstanceHtml

        public static java.lang.String getExceptionRenderingInterfaceInstanceHtml​(java.lang.String serviceInterfaceInstanceId)
        Returns the HTML to be used when a given interface instance render threw some exception.
        Parameters:
        serviceInterfaceInstanceId - the interface instance identifier
        Returns:
        the HTML to be used when a given interface instance render threw some exception
        Since:
        17.1.0
      • containsExceptionRenderingInterfaceInstanceHtml

        public static boolean containsExceptionRenderingInterfaceInstanceHtml​(java.lang.String html)
        Returns whether the given HTML contains the HTML of an exception thrown by an interface instance.
        Parameters:
        html - the HTML
        Returns:
        whether the given HTML contains the HTML of an exception thrown by an interface instance.
        Since:
        17.1.0
      • getPageLayout

        public static org.w3c.dom.Document getPageLayout​(SessionConfig sessionConfig,
                                                         PageWebResource pageWebResource,
                                                         ITransaction transaction,
                                                         int mode)
        Returns current page's layout document. Result is cached during the request's live time.
        Returns:
        current page's layout.
        Since:
        6.0.0
      • getHolderServiceInterfaceInstanceIds

        public static java.util.List<java.lang.String> getHolderServiceInterfaceInstanceIds​(java.lang.String holderId,
                                                                                            org.w3c.dom.Document layoutDocument)
        Returns the identifiers of the service interface instances in a holder.
        Parameters:
        holderId - the holder identifier.
        Returns:
        the service interface instance identifiers, ordered according to their place in the holder.
        Since:
        6.0.0
      • getLayoutFilePath

        public static java.net.URL getLayoutFilePath​(PageWebResource pageWebResource)
        Returns the path to the layout file.
        Returns:
        the path to the layout file, or null if no layout file is set.
        Since:
        6.0.0
      • getPageLayoutHolderIds

        public static java.util.Collection<java.lang.String> getPageLayoutHolderIds​(org.w3c.dom.Document pageLayout,
                                                                                    PageWebResource pageWebResource)
        Returns a collection of holder ids for the given page layout Document if the PageWebResource has a layout file path, else returns null.
        Parameters:
        pageLayout - the page layout document.
        pageWebResource - the page web resource.
        Returns:
        A collection of holder ids for the given page layout Document if the PageWebResource has a layout file path, else returns null.
        Since:
        6.0.0