Package lumis.portal.presentation.mode
Class ContextValidatingPortalMode
- java.lang.Object
-
- lumis.portal.presentation.mode.AbstractPortalMode
-
- lumis.portal.presentation.mode.ContextValidatingPortalMode
-
- All Implemented Interfaces:
Serializable
,IPortalMode
,IPortalModeSPI
- Direct Known Subclasses:
ContentPublicationPortalMode
,PortalStudioPortalMode
public abstract class ContextValidatingPortalMode extends AbstractPortalMode
Portal mode that validates against a context (page or channel).- Since:
- 7.1.0
- Version:
- $Revision: 20383 $ $Date: 2017-07-13 18:41:18 -0300 (Thu, 13 Jul 2017) $
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
ContextValidatingPortalMode.PageChannelResolveResult
Stores the context to be validated against.
-
Field Summary
-
Fields inherited from class lumis.portal.presentation.mode.AbstractPortalMode
ROOT_CHANNELS_ONLY_PORTAL
-
-
Constructor Summary
Constructors Constructor Description ContextValidatingPortalMode(int id, String name, String description, IPermissionProvider permissionProvider, Class<? extends HTMLFragmentComponent> renderComponentClass, String[] attributeNames, Class<? extends AbstractLayoutFileMarkupFilter> markupFilterClass, String modeRootUrl)
Constructor for the class.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract ContextValidatingPortalMode.PageChannelResolveResult
resolve(HttpServletRequest request, IPageWebResourceRequest webResourceRequest)
Resolves the context.boolean
validateAccess(IPortalMode currentMode, HttpServletRequest httpServletRequest, IPageWebResourceRequest webResourceRequest)
Checks whether the current user has access to the given portal mode.protected boolean
webResourceExists(NavigationContext.WebResourceResume webResourceResume)
Verifies that the page and channel referenced by the specified web resource exists.-
Methods inherited from class lumis.portal.presentation.mode.AbstractPortalMode
getAttributeNames, getDescription, getId, getMarkupFilterClass, getModeRootUrl, getName, getPermissionProvider, getRenderComponentClass, getValidWebResourceRootChannels, isWebResourceAvailable, writeReplace
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface lumis.portal.presentation.mode.IPortalModeSPI
isAccessWithWebResourceWebsiteRequired
-
-
-
-
Constructor Detail
-
ContextValidatingPortalMode
public ContextValidatingPortalMode(int id, String name, String description, IPermissionProvider permissionProvider, Class<? extends HTMLFragmentComponent> renderComponentClass, String[] attributeNames, Class<? extends AbstractLayoutFileMarkupFilter> markupFilterClass, String modeRootUrl)
Constructor for the class.- Parameters:
id
- the id of the current PortalModename
- the name of the current PortalMode.description
- the description of the current PortalMode.the
- portal mode url provider of the current PortalMode.attributeNames
- attribute names for the current PortalMode.markupFilterClass
- markup filter class for the current PortalMode.- Since:
- 7.1.0
-
-
Method Detail
-
validateAccess
public boolean validateAccess(IPortalMode currentMode, HttpServletRequest httpServletRequest, IPageWebResourceRequest webResourceRequest) throws PortalException
Description copied from interface:IPortalModeSPI
Checks whether the current user has access to the given portal mode.- Parameters:
currentMode
- the portal mode.httpServletRequest
- the HTTP servlet request.webResourceRequest
- the page web resource request- Returns:
- whether the current user has access to the given portal mode.
- Throws:
PortalException
-
resolve
protected abstract ContextValidatingPortalMode.PageChannelResolveResult resolve(HttpServletRequest request, IPageWebResourceRequest webResourceRequest) throws PortalException
Resolves the context.- Parameters:
request
- the request.webResourceRequest
- the request page web resource- Returns:
- the resolved context.
- Throws:
PortalException
- Since:
- 7.1.0
-
webResourceExists
protected boolean webResourceExists(NavigationContext.WebResourceResume webResourceResume)
Verifies that the page and channel referenced by the specified web resource exists.- Parameters:
webResourceResume
- the web resource.- Returns:
true
if page and channel exists,false
otherwise.- Since:
- 7.1.1
-
-