|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfr.paris.lutece.portal.service.cache.AbstractCacheableService
fr.paris.lutece.portal.service.content.ContentService
fr.paris.lutece.portal.service.page.PageService
public class PageService
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.
Nested Class Summary | |
---|---|
class |
PageService.CustomAction
CustomAction define a customized action for portlet types |
Field Summary | |
---|---|
static java.lang.String |
REDIRECTION_KEY
|
static java.lang.String |
TEMPLATE_PAGE_ACCESS_CONTROLED
Access Controled template |
static java.lang.String |
TEMPLATE_PAGE_ACCESS_DENIED
Access denied template |
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. |
java.lang.Object |
clone()
|
void |
createPage(Page page)
Create a page |
void |
dispose()
|
static java.lang.String |
getBaseUrl(javax.servlet.http.HttpServletRequest request)
Evaluate base URL from request Useful when a Lutece instance can be accessed from different virtual hosts |
ImageResource |
getImageResource(int nIdResource)
Gets the image resource for a given resource |
static PageService |
getInstance()
Gets the service instance |
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 |
getPageContent(int nIdPage,
int nMode,
javax.servlet.http.HttpServletRequest request)
Build the page content. |
java.lang.String |
getResourceTypeId()
Returns the resource type Id |
void |
invalidateContent(int nPageId)
Invalidate Page Content |
boolean |
isAuthorizedAdminPage(int nIdPage,
java.lang.String strPermission,
AdminUser user)
Check that a given user is allowed to access a page for a given permission and his workgroups |
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 |
notifyElementEvicted(net.sf.ehcache.Ehcache cache,
net.sf.ehcache.Element element)
|
void |
notifyElementExpired(net.sf.ehcache.Ehcache cache,
net.sf.ehcache.Element element)
|
void |
notifyElementPut(net.sf.ehcache.Ehcache cache,
net.sf.ehcache.Element element)
|
void |
notifyElementRemoved(net.sf.ehcache.Ehcache cache,
net.sf.ehcache.Element element)
|
void |
notifyElementUpdated(net.sf.ehcache.Ehcache cache,
net.sf.ehcache.Element element)
|
void |
notifyRemoveAll(net.sf.ehcache.Ehcache cache)
|
void |
processPageEvent(PageEvent event)
Process a page event |
void |
removeKeyFromMap(net.sf.ehcache.Element element)
|
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.content.ContentService |
---|
getPluginName, setPluginName |
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 |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String REDIRECTION_KEY
public static final java.lang.String TEMPLATE_PAGE_ACCESS_DENIED
public static final java.lang.String TEMPLATE_PAGE_ACCESS_CONTROLED
Constructor Detail |
---|
public PageService()
Method Detail |
---|
public static PageService getInstance()
public java.lang.String getName()
getName
in interface LuteceService
public boolean isInvoked(javax.servlet.http.HttpServletRequest request)
isInvoked
in class ContentService
request
- The HTTP request
public static java.lang.String getBaseUrl(javax.servlet.http.HttpServletRequest request)
request
- The HTTP servlet request
public java.lang.String getPage(javax.servlet.http.HttpServletRequest request, int nMode) throws SiteMessageException
getPage
in class ContentService
request
- The page IDnMode
- The current mode.
SiteMessageException
- If a message shouldbe displayedpublic java.lang.String getPage(java.lang.String strIdPage, int nMode, javax.servlet.http.HttpServletRequest request) throws SiteMessageException
strIdPage
- The page IDnMode
- The current mode.request
- The HttpRequest
SiteMessageException
- occurs when a site message need to be displayedpublic java.lang.String buildPageContent(java.lang.String strIdPage, int nMode, javax.servlet.http.HttpServletRequest request, java.lang.Boolean bCanBeCached) throws SiteMessageException
strIdPage
- The page IDnMode
- The current mode.request
- The HttpRequestbCanBeCached
- The boolean
SiteMessageException
- occurs when a site message need to be displayedpublic java.lang.String getPageContent(int nIdPage, int nMode, javax.servlet.http.HttpServletRequest request) throws SiteMessageException
nIdPage
- The page IDnMode
- The current mode.request
- The HttpRequest
SiteMessageException
- occurs when a site message need to be displayedpublic void addPageEventListener(PageEventListener listener)
listener
- An event listener to addpublic java.lang.String getResourceTypeId()
getResourceTypeId
in interface ImageResourceProvider
public ImageResource getImageResource(int nIdResource)
getImageResource
in interface ImageResourceProvider
nIdResource
- The Resource id
public void createPage(Page page)
page
- The page to createpublic void updatePage(Page page)
page
- The page to updatepublic void removePage(int nPageId)
nPageId
- The page Idpublic void processPageEvent(PageEvent event)
processPageEvent
in interface PageEventListener
event
- The event to processpublic void invalidateContent(int nPageId)
nPageId
- The Page IDpublic boolean isAuthorizedAdminPage(int nIdPage, java.lang.String strPermission, AdminUser user)
nIdPage
- the id of the page to checkstrPermission
- the permission neededuser
- The current user
public void notifyElementEvicted(net.sf.ehcache.Ehcache cache, net.sf.ehcache.Element element)
notifyElementEvicted
in interface net.sf.ehcache.event.CacheEventListener
CacheEventListener.notifyElementEvicted(net.sf.ehcache.Ehcache,
net.sf.ehcache.Element)
public void notifyElementExpired(net.sf.ehcache.Ehcache cache, net.sf.ehcache.Element element)
notifyElementExpired
in interface net.sf.ehcache.event.CacheEventListener
CacheEventListener.notifyElementExpired(net.sf.ehcache.Ehcache,
net.sf.ehcache.Element)
public void notifyElementPut(net.sf.ehcache.Ehcache cache, net.sf.ehcache.Element element)
notifyElementPut
in interface net.sf.ehcache.event.CacheEventListener
CacheEventListener.notifyElementPut(net.sf.ehcache.Ehcache,
net.sf.ehcache.Element)
public void notifyElementRemoved(net.sf.ehcache.Ehcache cache, net.sf.ehcache.Element element)
notifyElementRemoved
in interface net.sf.ehcache.event.CacheEventListener
CacheEventListener.notifyElementRemoved(net.sf.ehcache.Ehcache,
net.sf.ehcache.Element)
public void notifyElementUpdated(net.sf.ehcache.Ehcache cache, net.sf.ehcache.Element element)
notifyElementUpdated
in interface net.sf.ehcache.event.CacheEventListener
CacheEventListener.notifyElementUpdated(net.sf.ehcache.Ehcache,
net.sf.ehcache.Element)
public void notifyRemoveAll(net.sf.ehcache.Ehcache cache)
notifyRemoveAll
in interface net.sf.ehcache.event.CacheEventListener
cache
- .CacheEventListener.notifyRemoveAll(net.sf.ehcache.Ehcache)
public void removeKeyFromMap(net.sf.ehcache.Element element)
element
- .public java.lang.Object clone()
clone
in interface net.sf.ehcache.event.CacheEventListener
clone
in class java.lang.Object
Object.clone()
public void dispose()
dispose
in interface net.sf.ehcache.event.CacheEventListener
CacheEventListener.dispose()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |