Class CMSItemNameExistsPredicate

  • All Implemented Interfaces:
    java.util.function.Predicate<CMSItemModel>

    public class CMSItemNameExistsPredicate
    extends java.lang.Object
    implements java.util.function.Predicate<CMSItemModel>
    Predicate to test if a given cms item name maps to an existing cms item.

    Returns TRUE if the cms item exists; FALSE otherwise.

    • Constructor Detail

      • CMSItemNameExistsPredicate

        public CMSItemNameExistsPredicate()
    • Method Detail

      • test

        public boolean test​(CMSItemModel cmsItemModel)
        Suppress sonar warning (squid:S1166 | Exception handlers should preserve the original exception) : The exception is correctly handled in the catch clause.
        Specified by:
        test in interface java.util.function.Predicate<CMSItemModel>
      • findCMSItemByTypeCodeAndName

        protected java.util.List<CMSItemModel> findCMSItemByTypeCodeAndName​(java.lang.String name,
                                                                            java.lang.String typeCode)
        Find all CMSItemModel having the same name as the provided value. The result list is filter by applying all the predicates specified by #getFilters().
        Parameters:
        name - - the name of the item
        typeCode - - the typecode of the item where the lookup takes place
        Returns:
        a list of items containing the same name
      • findAbstractParentTypeCode

        protected java.lang.String findAbstractParentTypeCode​(CMSItemModel cmsItemModel)
        Find the abstract parent typecode for a given item model
        Parameters:
        cmsItemModel - - the item model for which to find the abstract parent typecode
        Returns:
        the abstract parent typecode
      • setCmsAdminItemService

        public void setCmsAdminItemService​(CMSAdminItemService cmsAdminItemService)
      • setCmsAdminSiteService

        public void setCmsAdminSiteService​(CMSAdminSiteService cmsAdminSiteService)
      • getCloneContextSameAsActiveCatalogVersionPredicate

        protected java.util.function.Predicate<java.lang.Object> getCloneContextSameAsActiveCatalogVersionPredicate()
      • setCloneContextSameAsActiveCatalogVersionPredicate

        public void setCloneContextSameAsActiveCatalogVersionPredicate​(java.util.function.Predicate<java.lang.Object> cloneContextSameAsActiveCatalogVersionPredicate)
      • getTypeService

        protected TypeService getTypeService()
      • setTypeService

        public void setTypeService​(TypeService typeService)
      • getFilters

        protected java.util.List<java.util.function.Predicate<CMSItemModel>> getFilters()
      • setFilters

        public void setFilters​(java.util.List<java.util.function.Predicate<CMSItemModel>> filters)