Class PageWorkflowInterceptor
java.lang.Object
org.springframework.web.servlet.handler.HandlerInterceptorAdapter
de.hybris.platform.cmswebservices.interceptor.PageWorkflowInterceptor
- All Implemented Interfaces:
org.springframework.web.servlet.AsyncHandlerInterceptor,org.springframework.web.servlet.HandlerInterceptor
public class PageWorkflowInterceptor
extends org.springframework.web.servlet.handler.HandlerInterceptorAdapter
Default interceptor to run before the Pages controller's execution to verify if the affected page is already attached
to a workflow. If the page is already a workflow attachment, users should not be able to modify it anymore in order
to preserve a consistent state. In such case, we return an error in the HTTP response using the status code 409 -
Conflict.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringfindValueFromRequestPayload(javax.servlet.http.HttpServletRequest request, String key) Retrieves the value associated to the given key from the provided request payload.protected StringfindValueFromRequestUrl(javax.servlet.http.HttpServletRequest request, String key) Retrieves the value associated to the given key from the provided request URL: path or query parameter.protected CMSAdminContentSlotServiceprotected CMSAdminPageServiceprotected CMSWorkflowAttachmentServicebooleanpreHandle(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Object handler) protected StringresolveValueFromRequest(javax.servlet.http.HttpServletRequest request, String key) Retrieves the value associated to the given key from the provided request using the payload or the URL.voidsetCmsAdminContentSlotService(CMSAdminContentSlotService cmsAdminContentSlotService) voidsetCmsAdminPageService(CMSAdminPageService cmsAdminPageService) voidsetCmsWorkflowAttachmentService(CMSWorkflowAttachmentService cmsWorkflowAttachmentService) 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
-
PageWorkflowInterceptor
public PageWorkflowInterceptor()
-
-
Method Details
-
preHandle
public boolean preHandle(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Object handler) throws IOException - Throws:
IOException
-
resolveValueFromRequest
Retrieves the value associated to the given key from the provided request using the payload or the URL.- Parameters:
request- - the HTTP request containing the request body and URLkey- - the key used to extract the desired value- Returns:
- the value associated to the provided key; can be null
-
findValueFromRequestPayload
protected String findValueFromRequestPayload(javax.servlet.http.HttpServletRequest request, String key) Retrieves the value associated to the given key from the provided request payload.- Parameters:
request- - the HTTP request containing the request bodykey- - the key used to extract the desired value- Returns:
- the value associated to the provided key; can be null
-
findValueFromRequestUrl
Retrieves the value associated to the given key from the provided request URL: path or query parameter.- Parameters:
request- - the HTTP request containing the request URLkey- - the key used to extract the desired value- Returns:
- the value associated to the provided key; can be null
-
getCmsAdminPageService
-
setCmsAdminPageService
-
getCmsAdminContentSlotService
-
setCmsAdminContentSlotService
-
getCmsWorkflowAttachmentService
-
setCmsWorkflowAttachmentService
public void setCmsWorkflowAttachmentService(CMSWorkflowAttachmentService cmsWorkflowAttachmentService)
-