public class PageService extends Object implements IPageService, ImageResourceProvider, PageEventListener, PortletEventListener
| Modifier and Type | Field and Description |
|---|---|
static String |
REDIRECTION_KEY
Key for redirections
|
static String |
TEMPLATE_PAGE_ACCESS_CONTROLED
Access Controled template
|
static String |
TEMPLATE_PAGE_ACCESS_DENIED
Access denied template
|
| Constructor and Description |
|---|
PageService(PageCacheService pageCacheService,
PortletCacheService portletCacheService)
Creates a new PageService object.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
addPageEventListener(PageEventListener listener)
Add a new page event listener
|
String |
buildPageContent(String strIdPage,
int nMode,
javax.servlet.http.HttpServletRequest request)
Build the page content.
|
void |
createPage(Page page)
Create a page
|
ImageResource |
getImageResource(int nIdResource)
Gets the image resource for a given resource
|
String |
getName()
Returns the Content Service name
|
String |
getPage(javax.servlet.http.HttpServletRequest request,
int nMode)
Returns the page for a given ID.
|
String |
getPage(String strIdPage,
int nMode,
javax.servlet.http.HttpServletRequest request)
Returns the page for a given ID.
|
PageCacheService |
getPageCacheService()
Gets the page cache service.
|
String |
getPageContent(int nIdPage,
int nMode,
javax.servlet.http.HttpServletRequest request)
Build the page content.
|
PortletCacheService |
getPortletCacheService()
Gets the portlet cache service
|
String |
getResourceImagePage(String strPageId)
Management of the image associated to the page
|
String |
getResourceTypeId()
Returns the resource type Id
|
void |
invalidateContent(int nPageId)
Invalidate Page Content
|
boolean |
isAuthorizedAdminPage(int nIdPage,
String strPermission,
AdminUser user)
Check that a given user is allowed to access a page for a given permission
|
void |
processPageEvent(PageEvent event)
Process a page event
|
void |
processPortletEvent(PortletEvent event)
Process a portlet event
|
void |
removePage(int nPageId)
Remove a given page
|
void |
setPageCacheKeyService(ICacheKeyService cacheKeyService) |
void |
setPageCacheService(PageCacheService pageCacheService)
Sets the cache page service
|
void |
setPortletCacheKeyService(ICacheKeyService cacheKeyService) |
void |
setPortletCacheService(PortletCacheService portletCacheService)
Gets the portlet cache service
|
void |
setRoleRemovalService(RemovalListenerService removalService) |
static void |
updateChildrenAuthorizationNode(int nIdParentPage,
Integer nIdNewAuthorizationNode)
update authorization node of children page
|
void |
updatePage(Page page)
Update a given page
|
public static final String REDIRECTION_KEY
public static final String TEMPLATE_PAGE_ACCESS_DENIED
public static final String TEMPLATE_PAGE_ACCESS_CONTROLED
@Inject public PageService(PageCacheService pageCacheService, PortletCacheService portletCacheService)
pageCacheService - the page cache serviceportletCacheService - the portlet cache servicepublic String getName()
public String getPage(javax.servlet.http.HttpServletRequest request, int nMode) throws SiteMessageException
getPage in interface IPageServicerequest - The page IDnMode - The current mode.SiteMessageException - If a message shouldbe displayedpublic String getPage(String strIdPage, int nMode, javax.servlet.http.HttpServletRequest request) throws SiteMessageException
getPage in interface IPageServicestrIdPage - The page IDnMode - The current mode.request - The HttpRequestSiteMessageException - occurs when a site message need to be displayedpublic String buildPageContent(String strIdPage, int nMode, javax.servlet.http.HttpServletRequest request) throws SiteMessageException
strIdPage - The page IDnMode - The current mode.request - The HttpRequestSiteMessageException - occurs when a site message need to be displayedpublic String getPageContent(int nIdPage, int nMode, javax.servlet.http.HttpServletRequest request) throws SiteMessageException
getPageContent in interface IPageServicenIdPage - The page IDnMode - The current mode.request - The HttpRequestSiteMessageException - occurs when a site message need to be displayedpublic void setPageCacheKeyService(ICacheKeyService cacheKeyService)
cacheKeyService - the _cacheKeyService to setpublic void setPortletCacheKeyService(ICacheKeyService cacheKeyService)
cacheKeyService - the _cacheKeyService to setpublic void setRoleRemovalService(RemovalListenerService removalService)
removalService - the removal listener servicepublic static void addPageEventListener(PageEventListener listener)
listener - An event listener to addpublic String getResourceTypeId()
getResourceTypeId in interface ImageResourceProvidergetResourceTypeId in interface IPageServicepublic ImageResource getImageResource(int nIdResource)
getImageResource in interface ImageResourceProvidernIdResource - The Resource idpublic void createPage(Page page)
createPage in interface IPageServicepage - The page to createpublic void updatePage(Page page)
updatePage in interface IPageServicepage - The page to updatepublic void removePage(int nPageId)
removePage in interface IPageServicenPageId - The page Idpublic void processPageEvent(PageEvent event)
processPageEvent in interface PageEventListenerevent - The event to processpublic void processPortletEvent(PortletEvent event)
processPortletEvent in interface PortletEventListenerevent - The event to processpublic void invalidateContent(int nPageId)
invalidateContent in interface IPageServicenPageId - The Page IDpublic boolean isAuthorizedAdminPage(int nIdPage,
String strPermission,
AdminUser user)
isAuthorizedAdminPage in interface IPageServicenIdPage - the id of the page to checkstrPermission - the permission neededuser - The current userpublic String getResourceImagePage(String strPageId)
strPageId - The page identifierpublic PageCacheService getPageCacheService()
public void setPageCacheService(PageCacheService pageCacheService)
pageCacheService - the page cache servicepublic PortletCacheService getPortletCacheService()
public void setPortletCacheService(PortletCacheService portletCacheService)
portletCacheService - the portlet cache servicepublic static void updateChildrenAuthorizationNode(int nIdParentPage,
Integer nIdNewAuthorizationNode)
nIdParentPage - id of the parent pagenIdNewAuthorizationNode - the new authorization idCopyright © 2020 City of Paris. All rights reserved.