Class UpdatePageContentSlotComponentValidator

java.lang.Object
de.hybris.platform.cmsfacades.pagescontentslotscomponents.validator.UpdatePageContentSlotComponentValidator
All Implemented Interfaces:
org.springframework.validation.Validator

public class UpdatePageContentSlotComponentValidator extends Object implements org.springframework.validation.Validator
Validates DTO for moving existing component in a content slot or across 2 different content slots.

Rules:

  • componentId not null
  • position not null
  • position > 0
  • pageId not null
  • page exists: PageExistsPredicate
  • content slotId not null
  • content slot exists: ContentSlotExistsPredicate
  • component exists: ComponentExistsPredicate
  • component type not valid for content slot: ComponentTypeAllowedForContentSlotPredicate

  • Field Details

  • Constructor Details

    • UpdatePageContentSlotComponentValidator

      public UpdatePageContentSlotComponentValidator()
  • Method Details

    • supports

      public boolean supports(Class<?> clazz)
      Specified by:
      supports in interface org.springframework.validation.Validator
    • validate

      public void validate(Object obj, org.springframework.validation.Errors errors)
      Specified by:
      validate in interface org.springframework.validation.Validator
    • validatePageAndComponent

      protected void validatePageAndComponent(PageContentSlotComponentData target, org.springframework.validation.Errors errors)
    • getComponentExistsInCatalogVersionsPredicate

      protected Predicate<String> getComponentExistsInCatalogVersionsPredicate()
    • setComponentExistsInCatalogVersionsPredicate

      public void setComponentExistsInCatalogVersionsPredicate(Predicate<String> componentExistsInCatalogVersionsPredicate)
    • getComponentTypeAllowedForContentSlotPredicate

      protected Predicate<ComponentTypeAndContentSlotValidationDto> getComponentTypeAllowedForContentSlotPredicate()
    • setComponentTypeAllowedForContentSlotPredicate

      public void setComponentTypeAllowedForContentSlotPredicate(Predicate<ComponentTypeAndContentSlotValidationDto> componentTypeAllowedForContentSlotPredicate)
    • getValidationDtoFactory

      protected ValidationDtoFactory getValidationDtoFactory()
    • setValidationDtoFactory

      public void setValidationDtoFactory(ValidationDtoFactory validationDtoFactory)
    • getContentSlotExistsInCatalogVersionsPredicate

      protected Predicate<String> getContentSlotExistsInCatalogVersionsPredicate()
    • setContentSlotExistsInCatalogVersionsPredicate

      public void setContentSlotExistsInCatalogVersionsPredicate(Predicate<String> contentSlotExistsInCatalogVersionsPredicate)
    • getPageExistsPredicate

      protected Predicate<String> getPageExistsPredicate()
    • setPageExistsPredicate

      public void setPageExistsPredicate(Predicate<String> pageExistsPredicate)