Class DefaultRelatedPageRejectionService

java.lang.Object
de.hybris.platform.cms2.relatedpages.service.impl.DefaultRelatedPageRejectionService
All Implemented Interfaces:
RelatedPageRejectionService

public class DefaultRelatedPageRejectionService extends Object implements RelatedPageRejectionService
Default implementation of RelatedPageRejectionService interface. The CmsApprovalStatus.CHECK is used as unapprove status.
  • Constructor Details

    • DefaultRelatedPageRejectionService

      public DefaultRelatedPageRejectionService()
  • Method Details

    • rejectAllRelatedPages

      public void rejectAllRelatedPages(ItemModel itemModel, InterceptorContext interceptorContext)
      Description copied from interface: RelatedPageRejectionService
      Rejects pages related to the given item.
      Specified by:
      rejectAllRelatedPages in interface RelatedPageRejectionService
      Parameters:
      itemModel - the ItemModel that potentially has related pages to be rejected.
      interceptorContext - the InterceptorContext the interceptor context.
    • rejectAllRelatedPages

      @Deprecated(since="2105", forRemoval=true) public void rejectAllRelatedPages(ItemModel itemModel)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Rejects pages related to the given item.
      Specified by:
      rejectAllRelatedPages in interface RelatedPageRejectionService
      Parameters:
      itemModel - the ItemModel that potentially has related pages to be rejected.
    • shouldRejectPage

      protected boolean shouldRejectPage(AbstractPageModel page)
      Verifies whether a page should have its approval status changed to CHECK and saved or not.
      Parameters:
      page - the page to verify
      Returns:
      TRUE if the page should be updated and saved, FALSE otherwise
    • notInActiveWorkflow

      protected boolean notInActiveWorkflow(AbstractPageModel page)
      Determines if the page is in an active workflow or not.
      Parameters:
      page - the page to verify
      Returns:
      TRUE if the page is not in any active workflow, FALSE otherwise
    • isRestoredPageVersion

      protected boolean isRestoredPageVersion(AbstractPageModel page)
      Determines if the given page exists in the CmsVersionSessionContextProvider. If so, this means that the page is being restored from a version. Therefore, the page should be omitted from being saved in this service because it will be saved in the same transaction in another layer, otherwise a ModelSavingException will occur.
      Parameters:
      page - the page to verify
      Returns:
      TRUE if the page exists in the version session context, FALSE otherwise
    • isOriginalItem

      protected boolean isOriginalItem(AbstractPageModel page)
      Determines if the given page is the original item being modified by the CMSItemFacade. If so, the page should be omitted from being saved in this service because it will be saved in the same transaction in the facade layer, otherwise a StackOverflowException may occur.
      Parameters:
      page - the page to verify
      Returns:
      TRUE if the page is the original item being modified in CMSItemFacade, FALSE otherwise
    • hasUserChangedApprovalStatus

      public boolean hasUserChangedApprovalStatus(AbstractPageModel page)
      Description copied from interface: RelatedPageRejectionService
      Verifies whether the approval status was manually changed or not. For example, if the user changed the approval status from CHECK to APPROVED, the service should never change the approval status back to CHECK.
      Specified by:
      hasUserChangedApprovalStatus in interface RelatedPageRejectionService
      Parameters:
      page - the page to verify
      Returns:
      TRUE if approval status was manually changed, FALSE otherwise.
    • getOriginalApprovalStatus

      protected CmsApprovalStatus getOriginalApprovalStatus(AbstractPageModel page)
      Returns original (before the change) approval status for AbstractPageModel.
      Parameters:
      page - the AbstractPageModel to retrieve original approval status.
      Returns:
      original approval status.
    • rejectPage

      public AbstractPageModel rejectPage(AbstractPageModel page)
      Unapproves the page. CHECK is used as a status.
      Specified by:
      rejectPage in interface RelatedPageRejectionService
      Parameters:
      page - the AbstractPageModel to unapprove.
      Returns:
      page model with updated approval status.
    • getRelatedItemsService

      protected RelatedItemsService getRelatedItemsService()
    • setRelatedItemsService

      public void setRelatedItemsService(RelatedItemsService relatedItemsService)
    • getModelService

      protected ModelService getModelService()
    • setModelService

      public void setModelService(ModelService modelService)
    • getPageTypePredicate

      protected Predicate<ItemModel> getPageTypePredicate()
    • setPageTypePredicate

      public void setPageTypePredicate(Predicate<ItemModel> pageTypePredicate)
    • getCmsWorkflowService

      protected CMSWorkflowService getCmsWorkflowService()
    • setCmsWorkflowService

      public void setCmsWorkflowService(CMSWorkflowService cmsWorkflowService)
    • getCmsVersionSessionContextProvider

      protected CMSVersionSessionContextProvider getCmsVersionSessionContextProvider()
    • setCmsVersionSessionContextProvider

      public void setCmsVersionSessionContextProvider(CMSVersionSessionContextProvider cmsVersionSessionContextProvider)
    • getCmsAdminSiteService

      protected CMSAdminSiteService getCmsAdminSiteService()
    • setCmsAdminSiteService

      public void setCmsAdminSiteService(CMSAdminSiteService cmsAdminSiteService)