Class PortalService
- java.lang.Object
-
- fr.paris.lutece.portal.service.portal.PortalService
-
public final class PortalService extends java.lang.ObjectThis 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.StringbuildPageContent(int nCurrentPageId, PageData data, int nMode, javax.servlet.http.HttpServletRequest request)Returns the html code which represents the page contentstatic java.lang.StringbuildPageContent(PageData data, int nMode, javax.servlet.http.HttpServletRequest request)Returns the html code which represents the page contentstatic java.lang.StringformatPath(java.lang.String strPath, int nMode, javax.servlet.http.HttpServletRequest request)Formats the path specified in parameter and returns itstatic java.lang.StringgetAdminCssLinks()Get the list of CSS links for session less pagesstatic java.util.Collection<ContentService>getContentServicesList()Returns all registered Content servicesstatic java.lang.StringgetDefaultPage(javax.servlet.http.HttpServletRequest request, int nMode)Return the default page of the portal (the home page)static ContentServicegetInvokedContentService(javax.servlet.http.HttpServletRequest request)Analyzes request's parameters to find the ContentService that should handle the requeststatic java.util.Collection<Page>getPagePath(int nPageId)Builds a collection of pages corresponding to the path of the page specified in parameterstatic java.lang.StringgetPagePathContent(int nPageId, int nMode, javax.servlet.http.HttpServletRequest request)Returns the formated path of the site page whose identifier is specified in parameterstatic intgetRootPageId()Returns the identifier of the root page of the portal read in the lutece.properties filestatic java.lang.StringgetSiteName()Returns the site namestatic java.lang.StringgetXmlPagesList(java.util.Collection<Page> listPages)Return the xml content of the pages contained in the list specified in parameterstatic java.lang.StringgetXPagePathContent(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.StringgetXPagePathContent(java.lang.String strXPageName, int nMode, javax.servlet.http.HttpServletRequest request)Returns the formated path of a xpage (ex : result of a seek)static booleanisContactActivated()Check if the cotnact plugin is activatedstatic booleanisExtendActivated()Check if the extend plugin is activatedstatic voidregisterContentService(java.lang.String strName, ContentService cs)Registers a new ContentServicestatic voidsetXslPortalPath(java.util.Map<java.lang.String,java.lang.String> mapParameters, int nMode)Sets XSL portal path
-
-
-
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 namecs- 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 SiteMessageExceptionReturn 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
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 pagenMode- The mode in which displaying the page : normal or administrationrequest- 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 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 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 pagenMode- The mode to use for the formattingrequest- 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 namenMode- The mode to use for the formattingrequest- 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 formatnMode- The mode to use for the formattingrequest- 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 namenMode- The mode to use for the formattingstrTitlesUrls- 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 mapnMode- 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.
-
-