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 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

      protected String resolveValueFromRequest(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.
      Parameters:
      request - - the HTTP request containing the request body and URL
      key - - 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 body
      key - - the key used to extract the desired value
      Returns:
      the value associated to the provided key; can be null
    • findValueFromRequestUrl

      protected String findValueFromRequestUrl(javax.servlet.http.HttpServletRequest request, 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 URL
      key - - 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)