Class DefaultRelatedPageRejectionService

    • Constructor Detail

      • DefaultRelatedPageRejectionService

        public DefaultRelatedPageRejectionService()
    • Method Detail

      • 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
        Returns:
        TRUE if approval status was manually changed, FALSE otherwise.
      • setRelatedItemsService

        public void setRelatedItemsService​(RelatedItemsService relatedItemsService)
      • getModelService

        protected ModelService getModelService()
      • setModelService

        public void setModelService​(ModelService modelService)
      • getPageTypePredicate

        protected java.util.function.Predicate<ItemModel> getPageTypePredicate()
      • setPageTypePredicate

        public void setPageTypePredicate​(java.util.function.Predicate<ItemModel> pageTypePredicate)
      • setCmsWorkflowService

        public void setCmsWorkflowService​(CMSWorkflowService cmsWorkflowService)
      • setCmsAdminSiteService

        public void setCmsAdminSiteService​(CMSAdminSiteService cmsAdminSiteService)