Class CatalogVersionInterceptor
java.lang.Object
org.springframework.web.servlet.handler.HandlerInterceptorAdapter
de.hybris.platform.cmswebservices.interceptor.CatalogVersionInterceptor
- All Implemented Interfaces:
org.springframework.web.servlet.AsyncHandlerInterceptor,org.springframework.web.servlet.HandlerInterceptor
public class CatalogVersionInterceptor
extends org.springframework.web.servlet.handler.HandlerInterceptorAdapter
Default interceptor to run before controllers' execution to extract the catalog-id and version-id from the request URI and to set the
current session values. Also determines if the current user has the required permission to access the catalog version.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected CatalogServiceprotected CatalogVersionPermissionServiceprotected CatalogVersionServiceprotected CMSAdminSiteServiceprotected CMSCatalogVersionServiceprotected RequestMethodResolverbooleanpreHandle(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Object handler) Adds the catalog and version to the session.voidsetCatalogService(CatalogService catalogService) voidsetCatalogVersionPermissionService(CatalogVersionPermissionService catalogVersionPermissionService) voidsetCatalogVersionService(CatalogVersionService catalogVersionService) voidsetCmsAdminSiteService(CMSAdminSiteService cmsAdminSiteService) voidsetCmsCatalogVersionService(CMSCatalogVersionService cmsCatalogVersionService) voidsetRequestMethodResolver(RequestMethodResolver requestMethodResolver) protected voidsetSessionParentCatalogVersionsForSite(String siteId, String catalog, String catalogVersion) Add the active catalog versions for all parent catalog defined for a given site.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.web.servlet.AsyncHandlerInterceptor
afterConcurrentHandlingStartedMethods inherited from interface org.springframework.web.servlet.HandlerInterceptor
afterCompletion, postHandle
-
Constructor Details
-
CatalogVersionInterceptor
public CatalogVersionInterceptor()
-
-
Method Details
-
preHandle
public boolean preHandle(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Object handler) throws Exception Adds the catalog and version to the session. Also determines if the current user has read or write permission to the catalog version for an operation given by the request's HTTP method. In the case that the user does not have permission, we return an error in the HTTP response using the status code 403 - Forbidden.- Throws:
Exception-UnknownIdentifierExceptionif no CatalogVersion with the specified catalog id and version existsAmbiguousIdentifierExceptionif more than one CatalogVersion is found with the specified catalog id and version
-
setSessionParentCatalogVersionsForSite
protected void setSessionParentCatalogVersionsForSite(String siteId, String catalog, String catalogVersion) Add the active catalog versions for all parent catalog defined for a given site. This is used in a multi-country setup.- Parameters:
siteId- the site identifiercatalog- the catalog identifiercatalogVersion- the catalog version
-
getCmsAdminSiteService
-
setCmsAdminSiteService
-
getCatalogService
-
setCatalogService
-
getCatalogVersionService
-
setCatalogVersionService
-
getCmsCatalogVersionService
-
setCmsCatalogVersionService
-
getCatalogVersionPermissionService
-
setCatalogVersionPermissionService
public void setCatalogVersionPermissionService(CatalogVersionPermissionService catalogVersionPermissionService) -
getRequestMethodResolver
-
setRequestMethodResolver
-