public class CatalogServiceImpl extends AbstractServiceImpl implements CatalogService
modelService, typeService| Constructor and Description |
|---|
CatalogServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
addToCategories(TypedObject categorizableItem,
List<TypedObject> categories)
Adds given categorizable item to given categories.
|
boolean |
assignProduct(TypedObject product,
CatalogVersionModel catalogVersionModel,
CategoryModel removeFromCategory) |
boolean |
assignProduct(TypedObject product,
CategoryModel newSuperCategory,
CategoryModel removeFromCategory) |
boolean |
assignProducts(Collection<TypedObject> products,
CategoryModel newSuperCategory,
CategoryModel oldSuperCategory) |
List<CatalogVersionModel> |
getAllCatalogVersions(UserModel u)
Get all available catalog versions for an user
|
Collection<CategoryModel> |
getAllSupercategories(CategoryModel category) |
List<CatalogModel> |
getAvailableCatalogs(UserModel u)
Get the available catalogs for an user
|
List<CatalogVersionModel> |
getAvailableCatalogVersions()
Get the available catalog versions for the current user
|
CatalogModel |
getCatalog(CatalogVersionModel version)
Get the catalog for the given catalog version
|
CatalogVersionModel |
getCatalogVersion(CategoryModel category)
Get the catalog versions containing the given category
|
CatalogVersionModel |
getCatalogVersion(PK pk)
Get the CatalogVersion for a Catalog item, specified by PK
|
List<CatalogVersionModel> |
getCatalogVersions(CatalogModel catalog,
UserModel u)
Get the catalog versions for a catalog
|
TypedObject |
getCatalogVersionTypedObject(CatalogVersionModel catVer) |
List<CategoryModel> |
getCategories(CatalogVersionModel version)
Get all root categories under a catalog version
|
List<CategoryModel> |
getCategories(CategoryModel category)
Get all direct sub-categories for a category
|
long |
getCategoryCount(CatalogVersionModel version)
get the number of root categories under a catalog version
|
long |
getCategoryCount(CategoryModel category)
Get the number of sub-categories for a category
|
List<CategoryModel> |
getCategoryPath(CategoryModel category)
Get a list of categories representing the path from the given category through all supercategories to the root
category
|
protected Collection<List<Category>> |
getCategoryPaths(Category category) |
int |
getItemCount(MacFinderTreeNode wrappedCategory,
CatalogVersionModel version,
boolean includeSubCategory,
MacFinderTreeNode connectedItem) |
List<MacFinderTreeNode> |
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) |
List<CatalogVersionModel> |
getSortedCatalogVersions(UserModel u)
Get the available catalog versions for an user in an alternative order
|
Collection<String> |
getSubcategoriesHavingSubcategories(ItemModel item)
Get a collection of all non-empty sub-categories for a given category or catalog version
|
List<TypedObject> |
getSupercategories(TypedObject categorizableItem,
boolean fromSameCatalogVersionOnly)
Returns list of supercategories of the given categorizable item.
|
UIAccessRightService |
getUiAccessRightService() |
protected boolean |
isAssignCatalogVersionPermitted(TypedObject product) |
boolean |
isAssignProductPermitted(TypedObject product,
CategoryModel newSuperCategory,
CategoryModel removeFromCategory) |
protected boolean |
isAssignProductsPermitted(Collection<TypedObject> products,
CategoryModel newSuperCategory,
CategoryModel removeFromCategory) |
protected boolean |
isAssignProductsPermitted(Collection<TypedObject> products,
CategoryModel newSuperCategory,
List<CategoryModel> removeFromCategories) |
boolean |
isMoveCategoriesPermitted(Collection<TypedObject> categories,
CategoryModel newSuperCategory,
CategoryModel removeFromCategory) |
boolean |
isMoveCategoryPermitted(CategoryModel category,
CategoryModel newSuperCategory,
CategoryModel removeCategory) |
boolean |
moveCategories(Collection<TypedObject> categories,
CategoryModel newSuperCategory,
CategoryModel removeCategory) |
boolean |
moveCategory(CategoryModel category,
CategoryModel newSuperCategory,
CategoryModel removeCategory) |
void |
removeFromCategories(TypedObject categorizableItem,
List<TypedObject> categories)
Removes given categorizable item from given categories.
|
boolean |
setAsRootCategory(CategoryModel category) |
void |
setCatalogService(CatalogService catalogService) |
void |
setCatalogVersionService(CatalogVersionService catalogVersionService) |
void |
setSearchRestrictionService(SearchRestrictionService searchRestrictionService) |
void |
setSessionService(SessionService sessionService) |
void |
setUiAccessRightService(UIAccessRightService accessService) |
void |
setUserService(UserService userService) |
CatalogVersionModel |
wrapCatalogVersion(TypedObject typedObject) |
CategoryModel |
wrapCategory(TypedObject typedObject) |
getEnum, getEnums, getLocalizedLabel, getLocalizedLabel, getModelService, getTypeService, setCockpitTypeService, setLabelResolver, setModelServicepublic List<CatalogModel> getAvailableCatalogs(UserModel u)
CatalogServicegetAvailableCatalogs in interface CatalogServiceu - the userpublic List<CatalogVersionModel> getCatalogVersions(CatalogModel catalog, UserModel u)
CatalogServicegetCatalogVersions in interface CatalogServicecatalog - the catalog containing the versionsu - the userpublic List<CatalogVersionModel> getAllCatalogVersions(UserModel u)
CatalogServicegetAllCatalogVersions in interface CatalogServiceu - the userpublic List<CatalogVersionModel> getSortedCatalogVersions(UserModel u)
CatalogServicegetSortedCatalogVersions in interface CatalogServiceu - the userpublic Collection<String> getSubcategoriesHavingSubcategories(ItemModel item)
CatalogServicegetSubcategoriesHavingSubcategories in interface CatalogServiceitem - the catalog or catalog versionpublic List<CategoryModel> getCategories(CatalogVersionModel version)
CatalogServicegetCategories in interface CatalogServiceversion - the catalog versionpublic List<CategoryModel> getCategories(CategoryModel category)
CatalogServicegetCategories in interface CatalogServicecategory - the super-categorypublic CatalogModel getCatalog(CatalogVersionModel version)
CatalogServicegetCatalog in interface CatalogServiceversion - the catalog versionpublic CatalogVersionModel getCatalogVersion(CategoryModel category)
CatalogServicegetCatalogVersion in interface CatalogServicecategory - the categorypublic Collection<CategoryModel> getAllSupercategories(CategoryModel category)
public List<CategoryModel> getCategoryPath(CategoryModel category)
CatalogServicegetCategoryPath in interface CatalogServicecategory - the categorypublic List<CatalogVersionModel> getAvailableCatalogVersions()
CatalogServicegetAvailableCatalogVersions in interface CatalogServicepublic long getCategoryCount(CatalogVersionModel version)
CatalogServicegetCategoryCount in interface CatalogServiceversion - the catalog versionpublic long getCategoryCount(CategoryModel category)
CatalogServicegetCategoryCount in interface CatalogServicecategory - the categorypublic List<MacFinderTreeNode> getItems(MacFinderTreeNode wrappedCategory, CatalogVersionModel version, boolean includSubCategory, MacFinderTreeNode connectedItem)
CatalogServicegetItems in interface CatalogServicewrappedCategory - the categoryincludSubCategory - if true, also include products from sub-categoriespublic int getItemCount(MacFinderTreeNode wrappedCategory, CatalogVersionModel version, boolean includeSubCategory, MacFinderTreeNode connectedItem)
getItemCount in interface CatalogServicepublic CatalogVersionModel getCatalogVersion(PK pk)
CatalogServicegetCatalogVersion in interface CatalogServicepk - the pk of the itempublic boolean assignProduct(TypedObject product, CatalogVersionModel catalogVersionModel, CategoryModel removeFromCategory)
assignProduct in interface CatalogServicepublic boolean assignProduct(TypedObject product, CategoryModel newSuperCategory, CategoryModel removeFromCategory)
assignProduct in interface CatalogServicepublic boolean assignProducts(Collection<TypedObject> products, CategoryModel newSuperCategory, CategoryModel oldSuperCategory)
assignProducts in interface CatalogServicepublic boolean moveCategories(Collection<TypedObject> categories, CategoryModel newSuperCategory, CategoryModel removeCategory)
moveCategories in interface CatalogServicepublic boolean moveCategory(CategoryModel category, CategoryModel newSuperCategory, CategoryModel removeCategory)
moveCategory in interface CatalogServicepublic boolean isAssignProductPermitted(TypedObject product, CategoryModel newSuperCategory, CategoryModel removeFromCategory)
isAssignProductPermitted in interface CatalogServiceprotected boolean isAssignCatalogVersionPermitted(TypedObject product)
protected Collection<List<Category>> getCategoryPaths(Category category)
protected Collection<Product> getProducts(Category category)
protected List<ProductModel> getProducts(CategoryModel category)
protected boolean isAssignProductsPermitted(Collection<TypedObject> products, CategoryModel newSuperCategory, CategoryModel removeFromCategory)
protected boolean isAssignProductsPermitted(Collection<TypedObject> products, CategoryModel newSuperCategory, List<CategoryModel> removeFromCategories)
public boolean isMoveCategoriesPermitted(Collection<TypedObject> categories, CategoryModel newSuperCategory, CategoryModel removeFromCategory)
isMoveCategoriesPermitted in interface CatalogServicepublic boolean isMoveCategoryPermitted(CategoryModel category, CategoryModel newSuperCategory, CategoryModel removeCategory)
isMoveCategoryPermitted in interface CatalogServicepublic boolean setAsRootCategory(CategoryModel category)
setAsRootCategory in interface CatalogServicepublic CategoryModel wrapCategory(TypedObject typedObject)
wrapCategory in interface CatalogServicepublic CatalogVersionModel wrapCatalogVersion(TypedObject typedObject)
wrapCatalogVersion in interface CatalogServicepublic TypedObject getCatalogVersionTypedObject(CatalogVersionModel catVer)
getCatalogVersionTypedObject in interface CatalogServicepublic List<TypedObject> getSupercategories(TypedObject categorizableItem, boolean fromSameCatalogVersionOnly)
CatalogServicegetSupercategories in interface CatalogServicecategorizableItem - a categorizable item (product, category..)fromSameCatalogVersionOnly - if true, only supercategories belonging to the same catalog version as given categorizable item are
returnedpublic void addToCategories(TypedObject categorizableItem, List<TypedObject> categories)
CatalogServiceaddToCategories in interface CatalogServicecategorizableItem - the categorizable item to be addedcategories - the categories to add topublic void removeFromCategories(TypedObject categorizableItem, List<TypedObject> categories)
CatalogServiceremoveFromCategories in interface CatalogServicecategorizableItem - the categorizable item to be removedcategories - the categories to remove frompublic void setUiAccessRightService(UIAccessRightService accessService)
public UIAccessRightService getUiAccessRightService()
public void setSessionService(SessionService sessionService)
public void setSearchRestrictionService(SearchRestrictionService searchRestrictionService)
public void setCatalogService(CatalogService catalogService)
public void setCatalogVersionService(CatalogVersionService catalogVersionService)
public void setUserService(UserService userService)
Copyright © 2017 SAP SE. All Rights Reserved.