Class PageOperationsInterceptor

java.lang.Object
org.springframework.web.servlet.handler.HandlerInterceptorAdapter
de.hybris.platform.cmssmarteditwebservices.interceptor.PageOperationsInterceptor
All Implemented Interfaces:
org.springframework.web.servlet.AsyncHandlerInterceptor, org.springframework.web.servlet.HandlerInterceptor

public class PageOperationsInterceptor extends org.springframework.web.servlet.handler.HandlerInterceptorAdapter
Default interceptor to run before controllers' execution to extract the catalogId and sourceCatalogVersion and targetCatalogVersion from the request URI to determine if the current user has required sync permissions.
  • Constructor Details

    • PageOperationsInterceptor

      public PageOperationsInterceptor()
  • Method Details

    • preHandle

      public boolean preHandle(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Object handler) throws Exception
      Determines if the current user has permissions to sync from source catalog version to target catalog version. 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 -
    • getSyncItemJob

      protected Optional<SyncItemJobModel> getSyncItemJob(String catalogId, String sourceCatalgVersion, String targetCatalogVersion)
      Returns first active synchronization job from source catalog.
      Parameters:
      catalogId - the catalog name
      sourceCatalgVersion - the source catalog version name
      targetCatalgVersion - the target catalog version name
      Returns:
      Optional synchronization job
    • getCatalogVersionModel

      protected CatalogVersionModel getCatalogVersionModel(String catalog, String catalogVersion)
      Gets the catalogVersionModel
      Parameters:
      catalog - the catalog name
      catalogVersion - the catalog version name
      Returns:
      the catalogVersionModel
    • getCatalogVersionService

      protected CatalogVersionService getCatalogVersionService()
    • setCatalogVersionService

      public void setCatalogVersionService(CatalogVersionService catalogVersionService)
    • getUserService

      protected UserService getUserService()
    • setUserService

      public void setUserService(UserService userService)
    • getCatalogSynchronizationService

      protected CatalogSynchronizationService getCatalogSynchronizationService()
    • setCatalogSynchronizationService

      public void setCatalogSynchronizationService(CatalogSynchronizationService catalogSynchronizationService)