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.HandlerInterceptorAdapterDefault 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 Constructor Description PageWorkflowInterceptor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.StringfindValueFromRequestPayload(javax.servlet.http.HttpServletRequest request, java.lang.String key)Retrieves the value associated to the given key from the provided request payload.protected java.lang.StringfindValueFromRequestUrl(javax.servlet.http.HttpServletRequest request, java.lang.String key)Retrieves the value associated to the given key from the provided request URL: path or query parameter.protected CMSAdminContentSlotServicegetCmsAdminContentSlotService()protected CMSAdminPageServicegetCmsAdminPageService()protected CMSWorkflowAttachmentServicegetCmsWorkflowAttachmentService()booleanpreHandle(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.Object handler)protected java.lang.StringresolveValueFromRequest(javax.servlet.http.HttpServletRequest request, java.lang.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)
-
-
-
Method Detail
-
preHandle
public boolean preHandle(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.Object handler) throws java.io.IOException- Specified by:
preHandlein interfaceorg.springframework.web.servlet.HandlerInterceptor- Overrides:
preHandlein classorg.springframework.web.servlet.handler.HandlerInterceptorAdapter- Throws:
java.io.IOException
-
resolveValueFromRequest
protected java.lang.String resolveValueFromRequest(javax.servlet.http.HttpServletRequest request, java.lang.String key)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 java.lang.String findValueFromRequestPayload(javax.servlet.http.HttpServletRequest request, java.lang.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
protected java.lang.String findValueFromRequestUrl(javax.servlet.http.HttpServletRequest request, java.lang.String key)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
protected CMSAdminPageService getCmsAdminPageService()
-
setCmsAdminPageService
public void setCmsAdminPageService(CMSAdminPageService cmsAdminPageService)
-
getCmsAdminContentSlotService
protected CMSAdminContentSlotService getCmsAdminContentSlotService()
-
setCmsAdminContentSlotService
public void setCmsAdminContentSlotService(CMSAdminContentSlotService cmsAdminContentSlotService)
-
getCmsWorkflowAttachmentService
protected CMSWorkflowAttachmentService getCmsWorkflowAttachmentService()
-
setCmsWorkflowAttachmentService
public void setCmsWorkflowAttachmentService(CMSWorkflowAttachmentService cmsWorkflowAttachmentService)
-
-