fr.paris.lutece.portal.service.portal
Class PortalService

java.lang.Object
  extended by fr.paris.lutece.portal.service.portal.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
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.util.Collection<CacheableService> getCacheableServicesList()
          Deprecated. Use CacheService.getCacheableServicesList() instead
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.lang.String getLuteceFavourite()
          Get the lutece.favourite from the webmaster.properties
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 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, javax.servlet.http.HttpServletRequest request)
          Returns the formated path of a xpage (ex : result of a seek)
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 void registerCacheableService(java.lang.String strName, CacheableService cs)
          Deprecated. Use CacheService.registerCacheableService( String strName, CacheableService cs ) instead
static void registerContentService(java.lang.String strName, ContentService cs)
          Registers a new ContentService
static void resetCache()
          Deprecated. use CacheService.resetCaches()
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

resetCache

@Deprecated
public static void resetCache()
Deprecated. use CacheService.resetCaches()

Reset the cache


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

registerCacheableService

@Deprecated
public static void registerCacheableService(java.lang.String strName,
                                                       CacheableService cs)
Deprecated. Use CacheService.registerCacheableService( String strName, CacheableService cs ) instead

Registers a new CacheableService

Parameters:
strName - The name
cs - The CacheableService

getCacheableServicesList

@Deprecated
public static java.util.Collection<CacheableService> getCacheableServicesList()
Deprecated. Use CacheService.getCacheableServicesList() instead

Returns all registered Cacheable services

Returns:
A collection containing all registered Cacheable 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

getLuteceFavourite

public static java.lang.String getLuteceFavourite()
Get the lutece.favourite from the webmaster.properties

Returns:
the lutece.favourite value


Copyright © 2011 Mairie de Paris. All Rights Reserved.