fr.paris.lutece.portal.service.page
Class PageService

java.lang.Object
  extended by fr.paris.lutece.portal.service.cache.AbstractCacheableService
      extended by fr.paris.lutece.portal.service.content.ContentService
          extended by fr.paris.lutece.portal.service.page.PageService
All Implemented Interfaces:
CacheableService, ImageResourceProvider, PageEventListener, LuteceService, java.util.EventListener

public class PageService
extends ContentService
implements ImageResourceProvider, PageEventListener

This class delivers pages to web componants. It handles XML tranformation to HTML and provides a cache feature in order to reduce the number of tranformations.


Field Summary
static java.lang.String TEMPLATE_PAGE_ACCESS_CONTROLED
           
static java.lang.String TEMPLATE_PAGE_ACCESS_DENIED
           
 
Constructor Summary
PageService()
          Creates a new PageService object.
 
Method Summary
 void addPageEventListener(PageEventListener listener)
          Add a new page event listener
 java.lang.String buildPageContent(java.lang.String strIdPage, int nMode, javax.servlet.http.HttpServletRequest request, java.lang.Boolean bCanBeCached)
          Build the page content.
 void createPage(Page page)
          Create a page
 ImageResource getImageResource(int nIdResource)
          Return the Resource id
static PageService getInstance()
           
 java.lang.String getName()
          Returns the Content Service name
 java.lang.String getPage(javax.servlet.http.HttpServletRequest request, int nMode)
          Returns the page for a given ID.
 java.lang.String getPage(java.lang.String strIdPage, int nMode, javax.servlet.http.HttpServletRequest request)
          Returns the page for a given ID.
 java.lang.String getResourceTypeId()
          Returns the resource type Id
 void invalidateContent(int nPageId)
           
 boolean isInvoked(javax.servlet.http.HttpServletRequest request)
          Analyzes request's parameters to see if the request should be handled by the current Content Service
 void processPageEvent(PageEvent event)
          Process a page event
 void removePage(int nPageId)
          Remove a given page
 void updatePage(Page page)
          Update a given page
 
Methods inherited from class fr.paris.lutece.portal.service.cache.AbstractCacheableService
getCache, getCacheSize, getFromCache, initCache, isCacheEnable, putInCache, resetCache
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TEMPLATE_PAGE_ACCESS_DENIED

public static final java.lang.String TEMPLATE_PAGE_ACCESS_DENIED
See Also:
Constant Field Values

TEMPLATE_PAGE_ACCESS_CONTROLED

public static final java.lang.String TEMPLATE_PAGE_ACCESS_CONTROLED
See Also:
Constant Field Values
Constructor Detail

PageService

public PageService()
Creates a new PageService object.

Method Detail

getInstance

public static PageService getInstance()

getName

public java.lang.String getName()
Returns the Content Service name

Specified by:
getName in interface LuteceService
Returns:
The name as a String

isInvoked

public boolean isInvoked(javax.servlet.http.HttpServletRequest request)
Analyzes request's parameters to see if the request should be handled by the current Content Service

Specified by:
isInvoked in class ContentService
Parameters:
request - The HTTP request
Returns:
true if this ContentService should handle this request

getPage

public java.lang.String getPage(javax.servlet.http.HttpServletRequest request,
                                int nMode)
Returns the page for a given ID. The page is built using XML data of each portlet or retrieved from the cache if it's enable.

Specified by:
getPage in class ContentService
Parameters:
request - The page ID
nMode - The current mode.
Returns:
The HTML code of the page as a String.

getPage

public java.lang.String getPage(java.lang.String strIdPage,
                                int nMode,
                                javax.servlet.http.HttpServletRequest request)
Returns the page for a given ID. The page is built using XML data of each portlet or retrieved from the cache if it's enable.

Parameters:
strIdPage - The page ID
nMode - The current mode.
request - The HttpRequest
Returns:
The HTML code of the page as a String.

buildPageContent

public java.lang.String buildPageContent(java.lang.String strIdPage,
                                         int nMode,
                                         javax.servlet.http.HttpServletRequest request,
                                         java.lang.Boolean bCanBeCached)
Build the page content.

Parameters:
strIdPage - The page ID
nMode - The current mode.
request - The HttpRequest
bCanBeCached - The boolean
Returns:
The HTML code of the page as a String.

addPageEventListener

public void addPageEventListener(PageEventListener listener)
Add a new page event listener

Parameters:
listener - An event listener to add

getResourceTypeId

public java.lang.String getResourceTypeId()
Returns the resource type Id

Specified by:
getResourceTypeId in interface ImageResourceProvider
Returns:
The resource type Id

getImageResource

public ImageResource getImageResource(int nIdResource)
Description copied from interface: ImageResourceProvider
Return the Resource id

Specified by:
getImageResource in interface ImageResourceProvider
Parameters:
nIdResource - The Resource identifier
Returns:
The Resource Image

createPage

public void createPage(Page page)
Create a page

Parameters:
The - page to create

updatePage

public void updatePage(Page page)
Update a given page

Parameters:
The - page to update

removePage

public void removePage(int nPageId)
Remove a given page

Parameters:
nPageId - The page Id

processPageEvent

public void processPageEvent(PageEvent event)
Description copied from interface: PageEventListener
Process a page event

Specified by:
processPageEvent in interface PageEventListener
Parameters:
event - The event to process

invalidateContent

public void invalidateContent(int nPageId)


Copyright © 2007 Mairie de Paris. All Rights Reserved.