Class PortalService


  • public final class PortalService
    extends java.lang.Object
    This class provides methods to build the pages of the portal and manage the cache
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String buildPageContent​(int nCurrentPageId, PageData data, int nMode, javax.servlet.http.HttpServletRequest request)
      Returns the html code which represents the page content
      static java.lang.String buildPageContent​(PageData data, int nMode, javax.servlet.http.HttpServletRequest request)
      Returns the html code which represents the page content
      static java.lang.String formatPath​(java.lang.String strPath, int nMode, javax.servlet.http.HttpServletRequest request)
      Formats the path specified in parameter and returns it
      static java.lang.String getAdminCssLinks()
      Get the list of CSS links for session less pages
      static java.util.Collection<ContentService> getContentServicesList()
      Returns all registered Content services
      static java.lang.String getDefaultPage​(javax.servlet.http.HttpServletRequest request, int nMode)
      Return the default page of the portal (the home page)
      static ContentService getInvokedContentService​(javax.servlet.http.HttpServletRequest request)
      Analyzes request's parameters to find the ContentService that should handle the request
      static java.util.Collection<Page> getPagePath​(int nPageId)
      Builds a collection of pages corresponding to the path of the page specified in parameter
      static java.lang.String getPagePathContent​(int nPageId, int nMode, javax.servlet.http.HttpServletRequest request)
      Returns the formated path of the site page whose identifier is specified in parameter
      static int getRootPageId()
      Returns the identifier of the root page of the portal read in the lutece.properties file
      static java.lang.String getSiteName()
      Returns the site name
      static java.lang.String getXmlPagesList​(java.util.Collection<Page> listPages)
      Return the xml content of the pages contained in the list specified in parameter
      static java.lang.String getXPagePathContent​(java.lang.String strXPageName, int nMode, java.lang.String strTitlesUrls, javax.servlet.http.HttpServletRequest request)
      Returns the formated extended path of an xpage.
      static java.lang.String getXPagePathContent​(java.lang.String strXPageName, int nMode, javax.servlet.http.HttpServletRequest request)
      Returns the formated path of a xpage (ex : result of a seek)
      static boolean isContactActivated()
      Check if the cotnact plugin is activated
      static boolean isExtendActivated()
      Check if the extend plugin is activated
      static void registerContentService​(java.lang.String strName, ContentService cs)
      Registers a new ContentService
      static void setXslPortalPath​(java.util.Map<java.lang.String,​java.lang.String> mapParameters, int nMode)
      Sets XSL portal path
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getInvokedContentService

        public static ContentService getInvokedContentService​(javax.servlet.http.HttpServletRequest request)
        Analyzes request's parameters to find the ContentService that should handle the request
        Parameters:
        request - The HTTP request
        Returns:
        ContentService that should handle the request
      • registerContentService

        public static void registerContentService​(java.lang.String strName,
                                                  ContentService cs)
        Registers a new ContentService
        Parameters:
        strName - The name
        cs - The ContentService
      • getContentServicesList

        public static java.util.Collection<ContentService> getContentServicesList()
        Returns all registered Content services
        Returns:
        A collection containing all registered Content services
      • getRootPageId

        public static int getRootPageId()
        Returns the identifier of the root page of the portal read in the lutece.properties file
        Returns:
        The identifier of the root page
      • getDefaultPage

        public static java.lang.String getDefaultPage​(javax.servlet.http.HttpServletRequest request,
                                                      int nMode)
                                               throws SiteMessageException
        Return the default page of the portal (the home page)
        Parameters:
        request - The request
        nMode - the mode id
        Returns:
        default page as a String
        Throws:
        SiteMessageException - occurs when a site message need to be displayed
      • getXmlPagesList

        public static java.lang.String getXmlPagesList​(java.util.Collection<Page> listPages)
        Return the xml content of the pages contained in the list specified in parameter
        Parameters:
        listPages - The pages list
        Returns:
        the xml code for the content page
      • buildPageContent

        public static java.lang.String buildPageContent​(PageData data,
                                                        int nMode,
                                                        javax.servlet.http.HttpServletRequest request)
        Returns the html code which represents the page content
        Parameters:
        data - The structure which contains the informations about the page
        nMode - The mode in which displaying the page : normal or administration
        request - The request
        Returns:
        The html code of a page
      • buildPageContent

        public static java.lang.String buildPageContent​(int nCurrentPageId,
                                                        PageData data,
                                                        int nMode,
                                                        javax.servlet.http.HttpServletRequest request)
        Returns the html code which represents the page content
        Parameters:
        nCurrentPageId - the current page id
        data - The structure which contains the informations about the page
        nMode - The mode in which displaying the page : normal or administration
        request - The request
        Returns:
        The html code of a page
      • getPagePathContent

        public static java.lang.String getPagePathContent​(int nPageId,
                                                          int nMode,
                                                          javax.servlet.http.HttpServletRequest request)
        Returns the formated path of the site page whose identifier is specified in parameter
        Parameters:
        nPageId - The identifier of the page
        nMode - The mode to use for the formatting
        request - The HTTP request
        Returns:
        the formated path
      • getXPagePathContent

        public static java.lang.String getXPagePathContent​(java.lang.String strXPageName,
                                                           int nMode,
                                                           javax.servlet.http.HttpServletRequest request)
        Returns the formated path of a xpage (ex : result of a seek)
        Parameters:
        strXPageName - The xpage name
        nMode - The mode to use for the formatting
        request - The HTTP request
        Returns:
        the formated path
      • getPagePath

        public static java.util.Collection<Page> getPagePath​(int nPageId)
        Builds a collection of pages corresponding to the path of the page specified in parameter
        Parameters:
        nPageId - The identifier of the page
        Returns:
        A collection of pages from the home page to the specified page
      • formatPath

        public static java.lang.String formatPath​(java.lang.String strPath,
                                                  int nMode,
                                                  javax.servlet.http.HttpServletRequest request)
        Formats the path specified in parameter and returns it
        Parameters:
        strPath - The path to format
        nMode - The mode to use for the formatting
        request - The HTTP request
        Returns:
        the html code to display the path
      • getXPagePathContent

        public static java.lang.String getXPagePathContent​(java.lang.String strXPageName,
                                                           int nMode,
                                                           java.lang.String strTitlesUrls,
                                                           javax.servlet.http.HttpServletRequest request)
        Returns the formated extended path of an xpage. This method is used when giving the list of elements in the path as a Xml code. This is called when using the Extended Xml path Label.
        Parameters:
        strXPageName - The xpage name
        nMode - The mode to use for the formatting
        strTitlesUrls - list of links (url and titles)
        request - The HTTP request
        Returns:
        the formatted path
      • setXslPortalPath

        public static void setXslPortalPath​(java.util.Map<java.lang.String,​java.lang.String> mapParameters,
                                            int nMode)
        Sets XSL portal path
        Parameters:
        mapParameters - Parameters as a map
        nMode - The mode
      • getSiteName

        public static java.lang.String getSiteName()
        Returns the site name
        Returns:
        The site name
      • isExtendActivated

        public static boolean isExtendActivated()
        Check if the extend plugin is activated
        Returns:
        True if the plugin is activated, false otherwise
      • isContactActivated

        public static boolean isContactActivated()
        Check if the cotnact plugin is activated
        Returns:
        True if the plugin is activated, false otherwise
      • getAdminCssLinks

        public static java.lang.String getAdminCssLinks()
        Get the list of CSS links for session less pages
        Returns:
        The HTML code providing the list of CSS links.