Class CMSSearchRestrictionsSetup


  • @SystemSetup(extension="cms2")
    public class CMSSearchRestrictionsSetup
    extends java.lang.Object
    This class creates the search restrictions that are necessary to properly execute catalog synchronizations.
    • Constructor Detail

      • CMSSearchRestrictionsSetup

        public CMSSearchRestrictionsSetup()
    • Method Detail

      • createSyncSearchRestrictions

        @SystemSetup(type=ESSENTIAL,
                     process=ALL)
        public void createSyncSearchRestrictions()
        Creates search restrictions needed to safely perform catalog synchronization.
      • createSearchRestriction

        protected void createSearchRestriction​(java.lang.String restrictionCode,
                                               java.lang.Class restrictedTypeClass,
                                               UserModel principal,
                                               java.lang.String query)
        Creates and saves a search restriction with the given data.
        Parameters:
        restrictionCode - The code used to identify the search restriction to create
        restrictedTypeClass - The type that will be restricted by this search restriction
        principal - The principal for which the search restriction will be applied
        query - The query used to perform the search restriction
      • getOrCreateSearchRestrictionByCode

        protected SearchRestrictionModel getOrCreateSearchRestrictionByCode​(java.lang.String restrictionCode)
        This method gets the search restriction identified by the given code. If no search restriction is found this method generates a new one.
        Parameters:
        restrictionCode - The code used to identify the search restriction to get or create
        Returns:
        the search restriction found or created.
      • getSyncPrincipal

        protected UserModel getSyncPrincipal()
        Gets the principal in charge of executing synchronization jobs. If the user is not found this method creates and saves the principal.
        Returns:
        the user in charge of executing synchronization jobs.
      • setTypeService

        public void setTypeService​(TypeService typeService)
      • setUserService

        public void setUserService​(UserService userService)
      • setModelService

        public void setModelService​(ModelService modelService)
      • setFlexibleSearchService

        public void setFlexibleSearchService​(FlexibleSearchService flexibleSearchService)