Class CMSSearchRestrictionsSetup
- java.lang.Object
-
- de.hybris.platform.cms2.systemsetup.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 Summary
Constructors Constructor Description CMSSearchRestrictionsSetup()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcreateSearchRestriction(java.lang.String restrictionCode, java.lang.Class restrictedTypeClass, UserModel principal, java.lang.String query)Creates and saves a search restriction with the given data.voidcreateSyncSearchRestrictions()Creates search restrictions needed to safely perform catalog synchronization.FlexibleSearchServicegetFlexibleSearchService()ModelServicegetModelService()protected SearchRestrictionModelgetOrCreateSearchRestrictionByCode(java.lang.String restrictionCode)This method gets the search restriction identified by the given code.protected UserModelgetSyncPrincipal()Gets the principal in charge of executing synchronization jobs.TypeServicegetTypeService()UserServicegetUserService()voidsetFlexibleSearchService(FlexibleSearchService flexibleSearchService)voidsetModelService(ModelService modelService)voidsetTypeService(TypeService typeService)voidsetUserService(UserService userService)
-
-
-
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 createrestrictedTypeClass- The type that will be restricted by this search restrictionprincipal- The principal for which the search restriction will be appliedquery- 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.
-
getTypeService
public TypeService getTypeService()
-
setTypeService
public void setTypeService(TypeService typeService)
-
getUserService
public UserService getUserService()
-
setUserService
public void setUserService(UserService userService)
-
setModelService
public void setModelService(ModelService modelService)
-
getModelService
public ModelService getModelService()
-
getFlexibleSearchService
public FlexibleSearchService getFlexibleSearchService()
-
setFlexibleSearchService
public void setFlexibleSearchService(FlexibleSearchService flexibleSearchService)
-
-