Class PortalService
java.lang.Object
fr.paris.lutece.portal.service.portal.PortalService
This class provides methods to build the pages of the portal and manage the cache
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringbuildPageContent(int nCurrentPageId, PageData data, int nMode, jakarta.servlet.http.HttpServletRequest request) Returns the html code which represents the page contentstatic StringbuildPageContent(PageData data, int nMode, jakarta.servlet.http.HttpServletRequest request) Returns the html code which represents the page contentstatic StringformatPath(String strPath, int nMode, jakarta.servlet.http.HttpServletRequest request) Formats the path specified in parameter and returns itstatic StringGet the list of CSS links for session less pagesstatic Collection<ContentService>Returns all registered Content servicesstatic StringgetDefaultPage(jakarta.servlet.http.HttpServletRequest request, int nMode) Return the default page of the portal (the home page)static ContentServicegetInvokedContentService(jakarta.servlet.http.HttpServletRequest request) Analyzes request's parameters to find the ContentService that should handle the requeststatic Collection<Page>getPagePath(int nPageId) Builds a collection of pages corresponding to the path of the page specified in parameterstatic StringgetPagePathContent(int nPageId, int nMode, jakarta.servlet.http.HttpServletRequest request) Returns the formated path of the site page whose identifier is specified in parameterstatic intReturns the identifier of the root page of the portal read in the lutece.properties filestatic StringReturns the site namestatic StringgetXmlPagesList(Collection<Page> listPages) Return the xml content of the pages contained in the list specified in parameterstatic StringgetXPagePathContent(String strXPageName, int nMode, jakarta.servlet.http.HttpServletRequest request) Returns the formated path of a xpage (ex : result of a seek)static StringgetXPagePathContent(String strXPageName, int nMode, String strTitlesUrls, jakarta.servlet.http.HttpServletRequest request) Returns the formated extended path of an xpage.static booleanCheck if the cotnact plugin is activatedstatic booleanCheck if the extend plugin is activatedstatic voidregisterContentService(String strName, ContentService cs) Registers a new ContentServicestatic voidsetXslPortalPath(Map<String, String> mapParameters, int nMode) Sets XSL portal path
-
Method Details
-
getInvokedContentService
public static ContentService getInvokedContentService(jakarta.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
Registers a new ContentService- Parameters:
strName- The namecs- The 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(jakarta.servlet.http.HttpServletRequest request, int nMode) throws SiteMessageException Return the default page of the portal (the home page)- Parameters:
request- The requestnMode- the mode id- Returns:
- default page as a String
- Throws:
SiteMessageException- occurs when a site message need to be displayed
-
getXmlPagesList
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, jakarta.servlet.http.HttpServletRequest request) Returns the html code which represents the page content- Parameters:
data- The structure which contains the informations about the pagenMode- The mode in which displaying the page : normal or administrationrequest- The request- Returns:
- The html code of a page
-
buildPageContent
public static String buildPageContent(int nCurrentPageId, PageData data, int nMode, jakarta.servlet.http.HttpServletRequest request) Returns the html code which represents the page content- Parameters:
nCurrentPageId- the current page iddata- The structure which contains the informations about the pagenMode- The mode in which displaying the page : normal or administrationrequest- The request- Returns:
- The html code of a page
-
getPagePathContent
public static String getPagePathContent(int nPageId, int nMode, jakarta.servlet.http.HttpServletRequest request) Returns the formated path of the site page whose identifier is specified in parameter- Parameters:
nPageId- The identifier of the pagenMode- The mode to use for the formattingrequest- The HTTP request- Returns:
- the formated path
-
getXPagePathContent
public static String getXPagePathContent(String strXPageName, int nMode, jakarta.servlet.http.HttpServletRequest request) Returns the formated path of a xpage (ex : result of a seek)- Parameters:
strXPageName- The xpage namenMode- The mode to use for the formattingrequest- The HTTP request- Returns:
- the formated path
-
getPagePath
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, jakarta.servlet.http.HttpServletRequest request) Formats the path specified in parameter and returns it- Parameters:
strPath- The path to formatnMode- The mode to use for the formattingrequest- The HTTP request- Returns:
- the html code to display the path
-
getXPagePathContent
public static String getXPagePathContent(String strXPageName, int nMode, String strTitlesUrls, jakarta.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 namenMode- The mode to use for the formattingstrTitlesUrls- list of links (url and titles)request- The HTTP request- Returns:
- the formatted path
-
setXslPortalPath
Sets XSL portal path- Parameters:
mapParameters- Parameters as a mapnMode- The mode
-
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
Get the list of CSS links for session less pages- Returns:
- The HTML code providing the list of CSS links.
-