Class CatalogServiceImpl
java.lang.Object
de.hybris.platform.cockpit.services.impl.AbstractServiceImpl
de.hybris.platform.productcockpit.services.catalog.impl.CatalogServiceImpl
- All Implemented Interfaces:
CatalogService
- Direct Known Subclasses:
CatalogListServiceImpl
-
Field Summary
Fields inherited from class de.hybris.platform.cockpit.services.impl.AbstractServiceImpl
modelService, typeService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddToCategories(TypedObject categorizableItem, List<TypedObject> categories) Adds given categorizable item to given categories.booleanassignProduct(TypedObject product, CatalogVersionModel catalogVersionModel, CategoryModel removeFromCategory) Assigns product to catalog versionbooleanassignProduct(TypedObject product, CategoryModel newSuperCategory, CategoryModel removeFromCategory) Assigns product to categorybooleanassignProducts(Collection<TypedObject> products, CategoryModel newSuperCategory, CategoryModel oldSuperCategory) Assigns products to categoryGet all available catalog versions for an usergetAllSupercategories(CategoryModel category) Get the available catalogs for an userGet the available catalog versions for the current usergetCatalog(CatalogVersionModel version) Get the catalog for the given catalog versiongetCatalogVersion(CategoryModel category) Get the catalog versions containing the given categorygetCatalogVersion(PK pk) Get the CatalogVersion for a Catalog item, specified by PKgetCatalogVersions(CatalogModel catalog, UserModel u) Get the catalog versions for a catalogConverts catalog version intoTypedObjectgetCategories(CatalogVersionModel version) Get all root categories under a catalog versiongetCategories(CategoryModel category) Get all direct sub-categories for a categorylonggetCategoryCount(CatalogVersionModel version) get the number of root categories under a catalog versionlonggetCategoryCount(CategoryModel category) Get the number of sub-categories for a categorygetCategoryPath(CategoryModel category) Get a list of categories representing the path from the given category through all supercategories to the root categoryprotected Collection<List<Category>>getCategoryPaths(Category category) intgetItemCount(MacFinderTreeNode wrappedCategory, CatalogVersionModel version, boolean includeSubCategory, MacFinderTreeNode connectedItem) Counts subitems in MacFinder tree for specified node.getItems(MacFinderTreeNode wrappedCategory, CatalogVersionModel version, boolean includSubCategory, MacFinderTreeNode connectedItem) Get the products for a given category.protected Collection<Product>getProducts(Category category) protected List<ProductModel>getProducts(CategoryModel category) Get the available catalog versions for an user in an alternative orderGet a collection of all non-empty sub-categories for a given category or catalog versiongetSupercategories(TypedObject categorizableItem, boolean fromSameCatalogVersionOnly) Returns list of supercategories of the given categorizable item.protected booleanbooleanisAssignProductPermitted(TypedObject product, CategoryModel newSuperCategory, CategoryModel removeFromCategory) Checks if user is allowed to assing product to a categoryprotected booleanisAssignProductsPermitted(Collection<TypedObject> products, CategoryModel newSuperCategory, CategoryModel removeFromCategory) protected booleanisAssignProductsPermitted(Collection<TypedObject> products, CategoryModel newSuperCategory, List<CategoryModel> removeFromCategories) booleanisMoveCategoriesPermitted(Collection<TypedObject> categories, CategoryModel newSuperCategory, CategoryModel removeFromCategory) Checks if user is allowed to move categories from one to otherbooleanisMoveCategoryPermitted(CategoryModel category, CategoryModel newSuperCategory, CategoryModel removeCategory) Checks if user is allowed to move category from one to otherbooleanmoveCategories(Collection<TypedObject> categories, CategoryModel newSuperCategory, CategoryModel removeCategory) Moves categories from one to otherbooleanmoveCategory(CategoryModel category, CategoryModel newSuperCategory, CategoryModel removeCategory) Moves category from one to othervoidremoveFromCategories(TypedObject categorizableItem, List<TypedObject> categories) Removes given categorizable item from given categories.booleansetAsRootCategory(CategoryModel category) Marks a category as rootvoidsetCatalogService(CatalogService catalogService) voidsetCatalogVersionService(CatalogVersionService catalogVersionService) voidsetSearchRestrictionService(SearchRestrictionService searchRestrictionService) voidsetSessionService(SessionService sessionService) voidsetUiAccessRightService(UIAccessRightService accessService) voidsetUserService(UserService userService) wrapCatalogVersion(TypedObject typedObject) Extracts catalog version model from provided typedObjectwrapCategory(TypedObject typedObject) Extracts category model from provided typedObjectMethods inherited from class de.hybris.platform.cockpit.services.impl.AbstractServiceImpl
getEnum, getEnums, getLocalizedLabel, getLocalizedLabel, getModelService, getTypeService, setCockpitTypeService, setLabelResolver, setModelService
-
Constructor Details
-
CatalogServiceImpl
public CatalogServiceImpl()
-
-
Method Details
-
getAvailableCatalogs
Description copied from interface:CatalogServiceGet the available catalogs for an user- Specified by:
getAvailableCatalogsin interfaceCatalogService- Parameters:
u- the user- Returns:
- a list of catalogs
-
getCatalogVersions
Description copied from interface:CatalogServiceGet the catalog versions for a catalog- Specified by:
getCatalogVersionsin interfaceCatalogService- Parameters:
catalog- the catalog containing the versionsu- the user- Returns:
- a list of catalog versions
-
getAllCatalogVersions
Description copied from interface:CatalogServiceGet all available catalog versions for an user- Specified by:
getAllCatalogVersionsin interfaceCatalogService- Parameters:
u- the user- Returns:
- a list of catalog versions
-
getSortedCatalogVersions
Description copied from interface:CatalogServiceGet the available catalog versions for an user in an alternative order- Specified by:
getSortedCatalogVersionsin interfaceCatalogService- Parameters:
u- the user- Returns:
- a list of catalog versions
-
getSubcategoriesHavingSubcategories
Description copied from interface:CatalogServiceGet a collection of all non-empty sub-categories for a given category or catalog version- Specified by:
getSubcategoriesHavingSubcategoriesin interfaceCatalogService- Parameters:
item- the catalog or catalog version- Returns:
- a list of categories
-
getCategories
Description copied from interface:CatalogServiceGet all root categories under a catalog version- Specified by:
getCategoriesin interfaceCatalogService- Parameters:
version- the catalog version- Returns:
- a list of categories
-
getCategories
Description copied from interface:CatalogServiceGet all direct sub-categories for a category- Specified by:
getCategoriesin interfaceCatalogService- Parameters:
category- the super-category- Returns:
- the list of sub-categories
-
getCatalog
Description copied from interface:CatalogServiceGet the catalog for the given catalog version- Specified by:
getCatalogin interfaceCatalogService- Parameters:
version- the catalog version- Returns:
- the catalog containing the catalog version
-
getCatalogVersion
Description copied from interface:CatalogServiceGet the catalog versions containing the given category- Specified by:
getCatalogVersionin interfaceCatalogService- Parameters:
category- the category- Returns:
- the containing catalog version
-
getAllSupercategories
-
getCategoryPath
Description copied from interface:CatalogServiceGet a list of categories representing the path from the given category through all supercategories to the root category- Specified by:
getCategoryPathin interfaceCatalogService- Parameters:
category- the category- Returns:
- a list of categories
-
getAvailableCatalogVersions
Description copied from interface:CatalogServiceGet the available catalog versions for the current user- Specified by:
getAvailableCatalogVersionsin interfaceCatalogService- Returns:
- a list of catalog versions
-
getCategoryCount
Description copied from interface:CatalogServiceget the number of root categories under a catalog version- Specified by:
getCategoryCountin interfaceCatalogService- Parameters:
version- the catalog version- Returns:
- the number of root categories
-
getCategoryCount
Description copied from interface:CatalogServiceGet the number of sub-categories for a category- Specified by:
getCategoryCountin interfaceCatalogService- Parameters:
category- the category- Returns:
- the number of direct sub-categories
-
getItems
public List<MacFinderTreeNode> getItems(MacFinderTreeNode wrappedCategory, CatalogVersionModel version, boolean includSubCategory, MacFinderTreeNode connectedItem) Description copied from interface:CatalogServiceGet the products for a given category.- Specified by:
getItemsin interfaceCatalogService- Parameters:
wrappedCategory- the categoryincludSubCategory- if true, also include products from sub-categories- Returns:
- a list of products
-
getItemCount
public int getItemCount(MacFinderTreeNode wrappedCategory, CatalogVersionModel version, boolean includeSubCategory, MacFinderTreeNode connectedItem) Description copied from interface:CatalogServiceCounts subitems in MacFinder tree for specified node.- Specified by:
getItemCountin interfaceCatalogService- Parameters:
wrappedCategory- category tree nodeversion- catalog versionincludeSubCategory-trueif subitems in subcategories should also be countedconnectedItem- item which subitems should be counted- Returns:
- number of subitems matching requirements
- See Also:
-
getCatalogVersion
Description copied from interface:CatalogServiceGet the CatalogVersion for a Catalog item, specified by PK- Specified by:
getCatalogVersionin interfaceCatalogService- Parameters:
pk- the pk of the item- Returns:
- the catalog version if it exists, null otherwise
-
assignProduct
public boolean assignProduct(TypedObject product, CatalogVersionModel catalogVersionModel, CategoryModel removeFromCategory) Description copied from interface:CatalogServiceAssigns product to catalog version- Specified by:
assignProductin interfaceCatalogService- Parameters:
product- product to be assignedcatalogVersionModel- new catalog versionremoveFromCategory- parent category from which product should be removed- Returns:
trueif moving was successfully performed
-
assignProduct
public boolean assignProduct(TypedObject product, CategoryModel newSuperCategory, CategoryModel removeFromCategory) Description copied from interface:CatalogServiceAssigns product to category- Specified by:
assignProductin interfaceCatalogService- Parameters:
product- product to be assignednewSuperCategory- new parent categoryremoveFromCategory- parent category from which product should be removed- Returns:
trueif moving was successfully performed
-
assignProducts
public boolean assignProducts(Collection<TypedObject> products, CategoryModel newSuperCategory, CategoryModel oldSuperCategory) Description copied from interface:CatalogServiceAssigns products to category- Specified by:
assignProductsin interfaceCatalogService- Parameters:
products- products to be assignednewSuperCategory- new parent categoryoldSuperCategory- parent category from which products should be removed- Returns:
trueif moving was successfully performed
-
moveCategories
public boolean moveCategories(Collection<TypedObject> categories, CategoryModel newSuperCategory, CategoryModel removeCategory) Description copied from interface:CatalogServiceMoves categories from one to other- Specified by:
moveCategoriesin interfaceCatalogService- Parameters:
categories- categories to be movednewSuperCategory- new parent category for categoriesremoveCategory- parent category from which categories should be removed- Returns:
trueif moving was successfully performed
-
moveCategory
public boolean moveCategory(CategoryModel category, CategoryModel newSuperCategory, CategoryModel removeCategory) Description copied from interface:CatalogServiceMoves category from one to other- Specified by:
moveCategoryin interfaceCatalogService- Parameters:
category- category to be movednewSuperCategory- new parent category for categoryremoveCategory- parent category from which category should be removed- Returns:
trueif moving was successfully performed
-
isAssignProductPermitted
public boolean isAssignProductPermitted(TypedObject product, CategoryModel newSuperCategory, CategoryModel removeFromCategory) Description copied from interface:CatalogServiceChecks if user is allowed to assing product to a category- Specified by:
isAssignProductPermittedin interfaceCatalogService- Parameters:
product- product to be assignednewSuperCategory- new parent categoryremoveFromCategory- parent category from which product should be removed- Returns:
trueif allowed
-
isAssignCatalogVersionPermitted
-
getCategoryPaths
-
getProducts
-
getProducts
-
isAssignProductsPermitted
protected boolean isAssignProductsPermitted(Collection<TypedObject> products, CategoryModel newSuperCategory, CategoryModel removeFromCategory) -
isAssignProductsPermitted
protected boolean isAssignProductsPermitted(Collection<TypedObject> products, CategoryModel newSuperCategory, List<CategoryModel> removeFromCategories) -
isMoveCategoriesPermitted
public boolean isMoveCategoriesPermitted(Collection<TypedObject> categories, CategoryModel newSuperCategory, CategoryModel removeFromCategory) Description copied from interface:CatalogServiceChecks if user is allowed to move categories from one to other- Specified by:
isMoveCategoriesPermittedin interfaceCatalogService- Parameters:
categories- categories to be movednewSuperCategory- new parent category for categoriesremoveFromCategory- parent category from which categories should be removed- Returns:
trueif allowed
-
isMoveCategoryPermitted
public boolean isMoveCategoryPermitted(CategoryModel category, CategoryModel newSuperCategory, CategoryModel removeCategory) Description copied from interface:CatalogServiceChecks if user is allowed to move category from one to other- Specified by:
isMoveCategoryPermittedin interfaceCatalogService- Parameters:
category- category to be movednewSuperCategory- new parent category for categoryremoveCategory- parent category from which category should be removed- Returns:
trueif allowed
-
setAsRootCategory
Description copied from interface:CatalogServiceMarks a category as root- Specified by:
setAsRootCategoryin interfaceCatalogService- Parameters:
category- root category- Returns:
trueis category was successfully marked as root
-
wrapCategory
Description copied from interface:CatalogServiceExtracts category model from provided typedObject- Specified by:
wrapCategoryin interfaceCatalogService- Parameters:
typedObject- object to extract category from- Returns:
- category extracted or
nullif @typedObject is not category
-
wrapCatalogVersion
Description copied from interface:CatalogServiceExtracts catalog version model from provided typedObject- Specified by:
wrapCatalogVersionin interfaceCatalogService- Parameters:
typedObject- object to extract catalog version from- Returns:
- catalog version extracted or
nullif @typedObject is not catalog version
-
getCatalogVersionTypedObject
Description copied from interface:CatalogServiceConverts catalog version intoTypedObject- Specified by:
getCatalogVersionTypedObjectin interfaceCatalogService- Parameters:
catVer- catalog version to be converted- Returns:
- converted catalog version
-
getSupercategories
public List<TypedObject> getSupercategories(TypedObject categorizableItem, boolean fromSameCatalogVersionOnly) Description copied from interface:CatalogServiceReturns list of supercategories of the given categorizable item.- Specified by:
getSupercategoriesin interfaceCatalogService- Parameters:
categorizableItem- a categorizable item (product, category..)fromSameCatalogVersionOnly- if true, only supercategories belonging to the same catalog version as given categorizable item are returned- Returns:
- list of supercategories of the given categorizable item
-
addToCategories
Description copied from interface:CatalogServiceAdds given categorizable item to given categories.- Specified by:
addToCategoriesin interfaceCatalogService- Parameters:
categorizableItem- the categorizable item to be addedcategories- the categories to add to
-
removeFromCategories
Description copied from interface:CatalogServiceRemoves given categorizable item from given categories.- Specified by:
removeFromCategoriesin interfaceCatalogService- Parameters:
categorizableItem- the categorizable item to be removedcategories- the categories to remove from
-
setUiAccessRightService
-
getUiAccessRightService
-
setSessionService
-
setSearchRestrictionService
-
setCatalogService
-
setCatalogVersionService
-
setUserService
-