Class PortalService


  • public final class PortalService
    extends Object
    This class provides methods to build the pages of the portal and manage the cache
    • 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​(String strName,
                                                  ContentService cs)
        Registers a new ContentService
        Parameters:
        strName - The name
        cs - The ContentService
      • getContentServicesList

        public static 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 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 String getXmlPagesList​(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 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 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 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 String getXPagePathContent​(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 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 String formatPath​(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 String getXPagePathContent​(String strXPageName,
                                                 int nMode,
                                                 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​(Map<String,​String> mapParameters,
                                            int nMode)
        Sets XSL portal path
        Parameters:
        mapParameters - Parameters as a map
        nMode - The mode
      • getSiteName

        public static 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 String getAdminCssLinks()
        Get the list of CSS links for session less pages
        Returns:
        The HTML code providing the list of CSS links.