Package de.hybris.platform.category.jalo
Class Category
- All Implemented Interfaces:
Serializable,Comparable
- Direct Known Subclasses:
GeneratedClassificationClass,GeneratedConfigurationCategory,GeneratedVariantCategory,GeneratedVariantValueCategory
This class represents a simple category, which could have assigned subcategories, products, pictures and thumbnails.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class de.hybris.platform.jalo.GenericItem
GenericItem.GenericItemImplNested classes/interfaces inherited from class de.hybris.platform.jalo.c2l.LocalizableItem
LocalizableItem.LocalizableItemImplNested classes/interfaces inherited from class de.hybris.platform.jalo.ExtensibleItem
ExtensibleItem.ExtensibleItemImplNested classes/interfaces inherited from class de.hybris.platform.jalo.Item
Item.AttributeFilter, Item.AttributeMode, Item.CachedGetter, Item.CachedSetter, Item.ItemAttributeMap, Item.ItemConstraint, Item.ItemImpl, Item.JaloCachedComputationException -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDeprecated.since ages - please use Constants.DISABLED_CYCLIC_CHECKS insteadstatic final StringSessionContext attribute flag for set allowed principals.static final StringSessionContext attribute flag for disabling the subcategory check when removing categoryFields inherited from class de.hybris.platform.category.jalo.GeneratedCategory
ALLOWEDPRINCIPALS, CATALOG, CATALOGVERSION, CATEGORIES, CATEGORY2KEYWORDRELATION_MARKMODIFIED, CATEGORY2KEYWORDRELATION_SRC_ORDERED, CATEGORY2KEYWORDRELATION_TGT_ORDERED, CATEGORY2PRINCIPALRELATION_MARKMODIFIED, CATEGORY2PRINCIPALRELATION_SRC_ORDERED, CATEGORY2PRINCIPALRELATION_TGT_ORDERED, CATEGORYCATEGORYRELATION_MARKMODIFIED, CATEGORYCATEGORYRELATION_SRC_ORDERED, CATEGORYCATEGORYRELATION_TGT_ORDERED, CATEGORYMEDIARELATION_MARKMODIFIED, CATEGORYMEDIARELATION_SRC_ORDERED, CATEGORYMEDIARELATION_TGT_ORDERED, CATEGORYPRODUCTRELATION_MARKMODIFIED, CATEGORYPRODUCTRELATION_SRC_ORDERED, CATEGORYPRODUCTRELATION_TGT_ORDERED, CODE, DATA_SHEET, DEFAULT_INITIAL_ATTRIBUTES, DESCRIPTION, DETAIL, KEYWORDS, LOGO, MEDIAS, NAME, NORMAL, ORDER, OTHERS, PICTURE, PRODUCTS, SUPERCATEGORIES, THUMBNAIL, THUMBNAILSFields inherited from class de.hybris.platform.jalo.c2l.LocalizableItem
LANGUAGE_FALLBACK_ENABLEDFields inherited from class de.hybris.platform.jalo.Item
_CREATION_TIME_INTERNAL, _MODIFIED_TIME_INTERNAL, accessorLog, CREATION_TIME, DISABLE_ATTRIBUTE_CHECK, DISABLE_ITEMCHECK_BEFORE_REMOVABLE, EVEN, FEATURE_ACCESSMAP_QUALIFIER, HJMPTS, INITIAL_CREATION_FLAG, isJaloOnly, MODIFIED_TIME, NEGATIVE, NOT_FOUND, OWNER, PK, POSITIVE, SAVE_FROM_SERVICE_LAYER, staticTransientObjects, TYPEFields inherited from class de.hybris.platform.util.BridgeAbstraction
impl, tenant -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddProduct(Product product) Deprecated.since agesvoidaddProduct(Product product, int position, boolean shift) Deprecated.since agesvoidaddProduct(SessionContext ctx, Product product) Deprecated.since agesvoidaddProduct(SessionContext ctx, Product product, int position, boolean shift) Deprecated.since agesvoidaddProducts(SessionContext ctx, Collection<Product> products) Deprecated.since agesvoidaddProducts(Collection<Product> products) Deprecated.since agesvoidaddSubcategories(SessionContext ctx, Collection<Category> categories) Deprecated.since agesvoidaddSubcategories(Collection<Category> categories) Deprecated.since agesvoidaddSubcategory(Category category) Deprecated.since agesvoidaddSubcategory(SessionContext ctx, Category category) Deprecated.since agesvoidaddSupercategories(SessionContext ctx, Collection<Category> categories) Deprecated.since agesvoidaddSupercategories(Collection<Category> categories) Deprecated.since agesvoidaddSupercategory(Category category) Deprecated.since agesvoidaddSupercategory(SessionContext ctx, Category category) Deprecated.since agesvoidaddToCategories(SessionContext ctx, Category cat) Deprecated.since agesvoidaddToSupercategories(SessionContext ctx, Category cat) Deprecated.since agesprotected voidassertNoCycle(SessionContext ctx, Collection<Category> toAddTo, Collection<Category> toCheck, boolean sub) Deprecated.since agesprotected voidDeprecated.since ages - covered byCategoryRemovalValidator.booleanDeprecated.since ages - useProductService.containsProductsForCategory(de.hybris.platform.category.model.CategoryModel)instead.protected ItemcreateItem(SessionContext ctx, ComposedType type, Item.ItemAttributeMap allAttributes) Deprecated.since agesprotected booleanDeprecated.since agesintDeprecated.since ages - useProductService.getAllProductsCountForCategory(de.hybris.platform.category.model.CategoryModel)instead.Deprecated.since ages - useCategoryModel.getAllSubcategories()instead.Deprecated.since ages - useCategoryModel.getAllSubcategories()instead.intDeprecated.since ages - useCategoryModel.getAllSubcategories()and methodsize()on result instead.Deprecated.since ages - useCategoryModel.getAllSupercategories()instead.Deprecated.since ages - useCategoryModel.getAllSubcategories()instead.getCode()Deprecated.since agesgetPath()Deprecated.since ages - useCategoryService.getPathForCategory(de.hybris.platform.category.model.CategoryModel)instead.getPaths()Deprecated.since ages - useCategoryService.getPathsForCategory(de.hybris.platform.category.model.CategoryModel)instead.longDeprecated.since ages - useProductService.getProductsCountForCategory(de.hybris.platform.category.model.CategoryModel)instead.Deprecated.since agesDeprecated.since ageslongDeprecated.since agesDeprecated.since agesDeprecated.since ageslongDeprecated.since agesbooleanisEmpty()Deprecated.since ages - useCategoryService.isEmpty(de.hybris.platform.category.model.CategoryModel)instead.isRoot()Deprecated.since ages - useCategoryService.isRoot(de.hybris.platform.category.model.CategoryModel)instead.isRoot(SessionContext ctx) Deprecated.since ages - useCategoryService.isRoot(de.hybris.platform.category.model.CategoryModel)instead.booleanbooleanprotected booleanDeprecated.since ages - covered byCategoryPrincipalStrategy.protected booleanDeprecated.since ages - covered byCategoryRemovalValidator.protected voidpullUpAllowedPrincipalInternals(SessionContext ctx, Category superCat, List<Principal> newOnes) Deprecated.since ages - covered byCategoryPrincipalStrategy.voidremoveProduct(Product product) Deprecated.since agesvoidremoveProduct(SessionContext ctx, Product product) Deprecated.since agesvoidremoveProducts(SessionContext ctx, Collection<Product> products) Deprecated.since agesvoidremoveProducts(Collection<Product> products) Deprecated.since agesvoidremoveSubcategories(SessionContext ctx, Collection<Category> categories) Deprecated.since agesvoidremoveSubcategories(Collection<Category> categories) Deprecated.since agesvoidremoveSubcategory(Category category) Deprecated.since agesvoidremoveSubcategory(SessionContext ctx, Category category) Deprecated.since agesvoidremoveSupercategories(SessionContext ctx, Collection<Category> categories) Deprecated.since agesvoidremoveSupercategories(Collection<Category> categories) Deprecated.since agesvoidremoveSupercategory(Category category) Deprecated.since agesvoidremoveSupercategory(SessionContext ctx, Category category) Deprecated.since agesvoidsetAllowedPrincipals(SessionContext ctx, List<Principal> newOnes) Deprecated.since ages - useCategoryService.setAllowedPrincipalsForCategory(de.hybris.platform.category.model.CategoryModel, List)instead.voidvoidsetCategories(Category... categories) Deprecated.since agesvoidsetCategories(SessionContext ctx, Category... categories) Deprecated.since agesvoidsetCategories(SessionContext ctx, List<Category> categories) Deprecated.since agesvoidsetSubcategories(SessionContext ctx, List<Category> subcategories) Deprecated.since agesvoidsetSubcategories(List<Category> subcategories) Deprecated.since agesvoidsetSupercategories(Category... superCategories) Deprecated.since agesvoidsetSupercategories(SessionContext ctx, Category... superCategories) Deprecated.since agesvoidsetSupercategories(SessionContext ctx, List<Category> categories) Deprecated.since agestoString()Returns theStringrepresentation of this item.Methods inherited from class de.hybris.platform.category.jalo.GeneratedCategory
addToAllowedPrincipals, addToAllowedPrincipals, addToCategories, addToKeywords, addToKeywords, addToMedias, addToMedias, addToProducts, addToProducts, addToSupercategories, getAllDescription, getAllDescription, getAllKeywords, getAllKeywords, getAllName, getAllName, getAllowedPrincipals, getAllowedPrincipals, getAllowedPrincipalsCount, getAllowedPrincipalsCount, getCatalogVersion, getCatalogVersion, getCategories, getCategories, getCategoriesCount, getCategoriesCount, getCode, getData_sheet, getData_sheet, getDefaultAttributeModes, getDescription, getDescription, getDetail, getDetail, getKeywords, getKeywords, getKeywordsCount, getKeywordsCount, getKeywordsCount, getKeywordsCount, getLogo, getLogo, getMedias, getMedias, getMediasCount, getMediasCount, getName, getName, getNormal, getNormal, getOrder, getOrder, getOrderAsPrimitive, getOrderAsPrimitive, getOthers, getOthers, getPicture, getPicture, getProducts, getProducts, getProductsCount, getSupercategories, getSupercategories, getSupercategoriesCount, getSupercategoriesCount, getThumbnail, getThumbnail, getThumbnails, getThumbnails, isMarkModifiedDisabled, removeFromAllowedPrincipals, removeFromAllowedPrincipals, removeFromCategories, removeFromCategories, removeFromKeywords, removeFromKeywords, removeFromMedias, removeFromMedias, removeFromProducts, removeFromProducts, removeFromSupercategories, removeFromSupercategories, setAllDescription, setAllDescription, setAllKeywords, setAllKeywords, setAllName, setAllName, setAllowedPrincipals, setCatalogVersion, setCatalogVersion, setCategories, setCode, setCode, setData_sheet, setData_sheet, setDescription, setDescription, setDetail, setDetail, setKeywords, setKeywords, setLogo, setLogo, setMedias, setMedias, setName, setName, setNormal, setNormal, setOrder, setOrder, setOrder, setOrder, setOthers, setOthers, setPicture, setPicture, setProducts, setProducts, setSupercategories, setThumbnail, setThumbnail, setThumbnails, setThumbnailsMethods inherited from class de.hybris.platform.jalo.GenericItem
getImplementation, getInitialProperties, getNonInitialAttributes, getRelatedItems, getRelatedItems, setRelatedItemsMethods inherited from class de.hybris.platform.jalo.c2l.LocalizableItem
getAllLocalizedProperties, getAllLocalizedProperties, getAllLocalizedProperties, getAllLocalizedProperties, getAllValuesSessionContext, getLocalizedProperty, getLocalizedProperty, getLocalizedPropertyInternal, getLocalizedPropertyNames, getLocalizedPropertyNames, hasLanguage, isEmptyValue, isFallbackEnabled, removeLocalizedProperty, removeLocalizedProperty, setAllLocalizedProperties, setAllLocalizedProperties, setLocalizedProperty, setLocalizedPropertyMethods inherited from class de.hybris.platform.jalo.ExtensibleItem
createNonClassAccessor, getAllProperties, getAllProperties, getProperty, getProperty, getPropertyNames, getPropertyNames, removeProperty, removeProperty, setAllProperties, setAllProperties, setProperty, setPropertyMethods inherited from class de.hybris.platform.jalo.Item
addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addNegativePermission, addPermission, addPositivePermission, assureExtensionsLoaded, changeTypeAfterCreation, checkConstraint, checkItemPermission, checkMandatoryAttribute, checkMandatoryAttribute, checkPermission, checkPermission, clearPermission, compareTo, ctx, doAfterRemove, doBeforeRemove, equals, getAccessorFor, getAllAttributes, getAllAttributes, getAllAttributes, getAllAttributes, getAllAttributesInternal, getAllLinkedItems, getAndCheckCacheBoundItem, getAttribute, getAttribute, getCacheBoundItem, getComposedType, getComposedTypePK, getCreationTime, getCurrentlyRemovingCount, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItemsCount, getLinkedItemsCount, getLinkedItemsCount, getModificationTime, getNegativePermissions, getOwner, getPartOfRemovedSessionMarker, getPermissionMap, getPermissions, getPersistenceVersion, getPK, getPositivePermissions, getRestrictedPrincipals, getSession, getSyncObject, getTenant, getTransientObject, getTransientObjectMap, hashCode, hasRegisteredClassAccessorFor, internal_registerClassAccessorFor, internal_registerNonClassAccessorFor, invalidateLocalCaches, isAlive, isCacheBound, isCurrentlyRemoving, isCurrentlyRemoving, isEmptyRelationValue, isInCreate, isInstanceOf, isItemCheckBeforeRemoveableDisabled, isRelationLocalizationFallbackEnabled, newInstance, notifyExtensionsAfterItemCreation, notifyExtensionsBeforeItemCreation, notifyItemRemoval, notifyManagerAboutItemRemoval, readResolve, registerAccessFor, registerAccessFor, registerJaloInvalidationListeners, remove, remove, removeItemCollection, removeItemCollection, removeLinkedItems, removeLinkedItems, removeLinkedItems, removeLinkedItems, removeLinks, removePartOfItems, removePartOfItems, setAllAttributes, setAllAttributes, setAllAttributesInternal, setAllLinkedItems, setAllLinkedItems, setAllLinkedItems, setAllLinkedItems, setAttribute, setAttribute, setAttributeFromString, setAttributeFromString, setCacheBound, setComposedType, setCreationTime, setImplementation, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setModificationTime, setNonInitialAttributes, setOwner, setPermissionsByMap, setTransientObject, setUseTA, suppressRelation, useTA, writeReplaceMethods inherited from class de.hybris.platform.util.BridgeAbstraction
setTenant
-
Field Details
-
DISABLE_SUBCATEGORY_REMOVALCHECK
SessionContext attribute flag for disabling the subcategory check when removing category- See Also:
-
DISABLE_SETALLOWEDPRINCIPAL_RECURSIVELY
SessionContext attribute flag for set allowed principals. If the flag is enabled only for the given category the principals are set- See Also:
-
DISABLE_CYCLIC_CHECKS
Deprecated.since ages - please use Constants.DISABLED_CYCLIC_CHECKS insteadSession attribute to disable checking for cyclic structures. Since cyclic structures are not supported by the category model the caller has to do own checking!
SessionContext myCtx = jaloSesson.createSessionContext(); myCtx.setAttribute(Constants.DISABLE_CYCLIC_CHECKS, Boolean.TRUE); // now this will not raise an error : category.addToSubcategory(category.getSuperCategory());
- Since:
- 1.31
-
-
Constructor Details
-
Category
public Category()
-
-
Method Details
-
createItem
@Deprecated(since="ages", forRemoval=false) protected Item createItem(SessionContext ctx, ComposedType type, Item.ItemAttributeMap allAttributes) throws JaloBusinessException Deprecated.since agescreate the item you can delete this method if you don't want to intercept the creation of this item- Overrides:
createItemin classGenericItem- Parameters:
ctx- the current session context which this item is created withintype- the actual item type ( since subtypes may not provide a own jalo class this may be different from the type which this method was implemented for )- Returns:
- the new item instance
- Throws:
JaloBusinessException- indicates an error during creation - any changes will be rollbacked
-
toString
Description copied from class:ItemReturns theStringrepresentation of this item. This is by default the representation of the primary key of this item. -
getCode
Deprecated.since agesDescription copied from class:GeneratedCategoryGenerated method - Getter of theCategory.codeattribute.- Overrides:
getCodein classGeneratedCategory- Returns:
- the code - Code
-
getSubcategories
Deprecated.since agesGets subcategories of this category.- Returns:
- subcategories of this category
-
getSubcategories
@Deprecated(since="ages", forRemoval=false) public List<Category> getSubcategories(SessionContext ctx) Deprecated.since agesGets subcategories of this category.- Parameters:
ctx- session context- Returns:
- subcategories of this category
-
getSubcategoryCount
Deprecated.since agesReturns the amount of subcategories of this category. This method should be preferred overgetSubcategories().size()since it does not actually load the subcategories. -
getAllSubcategories
Deprecated.since ages - useCategoryModel.getAllSubcategories()instead.Gets all subcategories of this category. This includes its own subcategories and all their subcategories.- Returns:
- all categories below this category
- Since:
- 1.3.1
-
getAllSubcategories
@Deprecated(since="ages", forRemoval=false) public Collection<Category> getAllSubcategories(SessionContext ctx) Deprecated.since ages - useCategoryModel.getAllSubcategories()instead.Gets all subcategories of this category. This includes its own subcategories and all their subcategories.- Parameters:
ctx- session context- Returns:
- all categories below this category
- Since:
- 1.3.1
-
getAllSubcategoriesCount
Deprecated.since ages - useCategoryModel.getAllSubcategories()and methodsize()on result instead.Counts all subcategories of this category excluding duplicately linked categories.- Since:
- 2.10
-
getAllProductsCount
Deprecated.since ages - useProductService.getAllProductsCountForCategory(de.hybris.platform.category.model.CategoryModel)instead.Counts all products of this category excluding double linked products. This includes all own products and products belonging to any sub category.- Since:
- 2.10
-
setCategories
@Deprecated(since="ages", forRemoval=false) public void setCategories(SessionContext ctx, List<Category> categories) throws JaloInvalidParameterException Deprecated.since agesSuperclass method overridden to check cyclic dependencies.Checking may be disabled using session context attribute
Constants.DISABLE_CYCLIC_CHECKS.- Overrides:
setCategoriesin classGeneratedCategorycategories- the categories - Sub Categories- Throws:
JaloInvalidParameterException- if any of these categories is already super category of this categroy
-
setCategories
Deprecated.since ages -
setCategories
@Deprecated(since="ages", forRemoval=false) public void setCategories(SessionContext ctx, Category... categories) Deprecated.since ages -
addToCategories
@Deprecated(since="ages", forRemoval=false) public void addToCategories(SessionContext ctx, Category cat) throws JaloInvalidParameterException Deprecated.since agesSuperclass method overridden to check cyclic dependencies.Checking may be disabled using session context attribute
Constants.DISABLE_CYCLIC_CHECKS.- Overrides:
addToCategoriesin classGeneratedCategorycat- the item to add to categories - Sub Categories- Throws:
JaloInvalidParameterException- if the new category is already super category of this category
-
setSupercategories
@Deprecated(since="ages", forRemoval=false) public void setSupercategories(SessionContext ctx, List<Category> categories) throws JaloInvalidParameterException Deprecated.since agesSuperclass method overridden to check cyclic dependencies.Checking may be disabled using session context attribute
Constants.DISABLE_CYCLIC_CHECKS.- Overrides:
setSupercategoriesin classGeneratedCategorycategories- the supercategories - Super Categories- Throws:
JaloInvalidParameterException- if any of these categories is already subcategory of this category
-
setSupercategories
@Deprecated(since="ages", forRemoval=false) public void setSupercategories(Category... superCategories) Deprecated.since ages -
setSupercategories
@Deprecated(since="ages", forRemoval=false) public void setSupercategories(SessionContext ctx, Category... superCategories) Deprecated.since ages -
addToSupercategories
@Deprecated(since="ages", forRemoval=false) public void addToSupercategories(SessionContext ctx, Category cat) throws JaloInvalidParameterException Deprecated.since agesSuperclass method overridden to check cyclic dependencies.Checking may be disabled using session context attribute
Constants.DISABLE_CYCLIC_CHECKS.- Overrides:
addToSupercategoriesin classGeneratedCategorycat- the item to add to supercategories - Super Categories- Throws:
JaloInvalidParameterException- if the new category is already subcategory of this category
-
disableChecks
Deprecated.since ages -
assertNoCycle
@Deprecated(since="ages", forRemoval=false) protected void assertNoCycle(SessionContext ctx, Collection<Category> toAddTo, Collection<Category> toCheck, boolean sub) throws JaloInvalidParameterException Deprecated.since ages- Throws:
JaloInvalidParameterException
-
setSubcategories
@Deprecated(since="ages", forRemoval=false) public void setSubcategories(List<Category> subcategories) Deprecated.since agesSets the subcategories of this category.- Parameters:
subcategories- subcategories to set
-
setSubcategories
@Deprecated(since="ages", forRemoval=false) public void setSubcategories(SessionContext ctx, List<Category> subcategories) Deprecated.since agesSets the subcategories of this category.- Parameters:
ctx- session contextsubcategories- subcategories to set
-
addSubcategory
Deprecated.since agesAdds given category to subcategories of this category.- Parameters:
category- the category to be added
-
addSubcategory
@Deprecated(since="ages", forRemoval=false) public void addSubcategory(SessionContext ctx, Category category) Deprecated.since agesAdds given category to subcategories of this category.- Parameters:
ctx- session contextcategory- the category to be added
-
addSubcategories
@Deprecated(since="ages", forRemoval=false) public void addSubcategories(Collection<Category> categories) Deprecated.since agesAdds given categories to subcategories of this category.- Parameters:
categories- Categories to be added
-
addSubcategories
@Deprecated(since="ages", forRemoval=false) public void addSubcategories(SessionContext ctx, Collection<Category> categories) Deprecated.since agesAdds given categories to subcategories of this category.- Parameters:
ctx- session contextcategories- Categories to be added
-
removeSubcategory
Deprecated.since agesRemoves given category from subcategories of this category.- Parameters:
category- the category to be removed from subcategories
-
removeSubcategory
@Deprecated(since="ages", forRemoval=false) public void removeSubcategory(SessionContext ctx, Category category) Deprecated.since agesRemoves given category from subcategories of this category.- Parameters:
ctx- session contextcategory- the category to be removed from subcategories
-
removeSubcategories
@Deprecated(since="ages", forRemoval=false) public void removeSubcategories(Collection<Category> categories) Deprecated.since agesRemoves given categories from subcategories of this category.- Parameters:
categories- Categories to be removed from subcategories
-
removeSubcategories
@Deprecated(since="ages", forRemoval=false) public void removeSubcategories(SessionContext ctx, Collection<Category> categories) Deprecated.since agesRemoves given categories from subcategories of this category.- Parameters:
ctx- session contextcategories- Categories to be removed from subcategories
-
getSupercategory
Deprecated.since agesGets one supercategory of this category or null if none is found. This method should be used only in cases without multiple supercategories - otherwise it cannot be predicted which supercategories is chosen!
To get all supercategories useGeneratedCategory.getSupercategories().- Returns:
- the first found supercategory or
nullif this category has no supercategories
-
getSupercategory
Deprecated.since agesGets one supercategory of this category or null if none is found. This method should be used only in cases without multiple supercategories - otherwise it cannot be predicted which supercategors is chosen!
To get all supercategories useGeneratedCategory.getSupercategories().- Parameters:
ctx- the session context- Returns:
- the first found supercategory or
nullif this category has no supercategories
-
getSupercategoryCount
Deprecated.since agesReturns the amount of supercategories of this category. This method should be preferred overgetSupercategories().size()since it does not actually load the subcategories. -
getProductsCount
Deprecated.since ages - useProductService.getProductsCountForCategory(de.hybris.platform.category.model.CategoryModel)instead.Returns the amount of products of this category. This method should be preferred overgetProducts().size()since it does not actually load the products.- Overrides:
getProductsCountin classGeneratedCategory
-
isEmpty
Deprecated.since ages - useCategoryService.isEmpty(de.hybris.platform.category.model.CategoryModel)instead.Returnstrueif neither products nor subcategories belong to this category. This method should be preferred overgetProducts().size().isEmpty() && getSubcategories().isEmpty()since it does not actually load the products and categories. -
containsProducts
Deprecated.since ages - useProductService.containsProductsForCategory(de.hybris.platform.category.model.CategoryModel)instead.Opposing toisEmpty()this method tells whether or not this category or any of its subcategories contains a product.- Since:
- 2.10
-
getAllSupercategories
Deprecated.since ages - useCategoryModel.getAllSupercategories()instead.Gets all supercategories of this category. This includes its own supercategories and all their supercategories.- Returns:
- all categories above this category
- Since:
- 1.3.1
-
getAllSupercategories
@Deprecated(since="ages", forRemoval=false) public Collection<Category> getAllSupercategories(SessionContext ctx) Deprecated.since ages - useCategoryModel.getAllSubcategories()instead.Gets all supercategories of this category. This includes its own supercategories and all their supercategories.- Parameters:
ctx- session context- Returns:
- all categories above this category
- Since:
- 1.3.1
-
addSupercategory
Deprecated.since agesAdds given category to supercategories of this category.- Parameters:
category- the category to be added
-
addSupercategory
@Deprecated(since="ages", forRemoval=false) public void addSupercategory(SessionContext ctx, Category category) Deprecated.since agesAdds given category to supercategories of this category.- Parameters:
ctx- session contextcategory- the category to be added
-
addSupercategories
@Deprecated(since="ages", forRemoval=false) public void addSupercategories(Collection<Category> categories) Deprecated.since agesAdds given categories to supercategories of this category.- Parameters:
categories- Categories to be added
-
addSupercategories
@Deprecated(since="ages", forRemoval=false) public void addSupercategories(SessionContext ctx, Collection<Category> categories) Deprecated.since agesAdds given categories to supercategories of this category.- Parameters:
ctx- session contextcategories- Categories to be added
-
removeSupercategory
Deprecated.since agesRemoves given category from supercategories of this category.- Parameters:
category- the category to be removed from supercategories
-
removeSupercategory
@Deprecated(since="ages", forRemoval=false) public void removeSupercategory(SessionContext ctx, Category category) Deprecated.since agesRemoves given category from supercategories of this category.- Parameters:
ctx- session contextcategory- the category to be removed from supercategories
-
removeSupercategories
@Deprecated(since="ages", forRemoval=false) public void removeSupercategories(Collection<Category> categories) Deprecated.since agesRemoves given categories from supercategories of this category.- Parameters:
categories- Categories to be removed from supercategories
-
removeSupercategories
@Deprecated(since="ages", forRemoval=false) public void removeSupercategories(SessionContext ctx, Collection<Category> categories) Deprecated.since agesRemoves given categories from supercategories of this category.- Parameters:
ctx- session contextcategories- Categories to be removed from supercategories
-
addProduct
Deprecated.since agesAdds given product to this category.- Parameters:
product- product to be added
-
addProduct
@Deprecated(since="ages", forRemoval=false) public void addProduct(SessionContext ctx, Product product) Deprecated.since agesAdds given product to this category.- Parameters:
ctx- session contextproduct- to be added
-
addProduct
@Deprecated(since="ages", forRemoval=false) public void addProduct(Product product, int position, boolean shift) Deprecated.since agesAdds given product to this category at given position.- Parameters:
product- product to be addedposition- which will be set and used for sorting productsshift- whether succeeding products should shift their positions according to new product position or not
-
addProduct
@Deprecated(since="ages", forRemoval=false) public void addProduct(SessionContext ctx, Product product, int position, boolean shift) Deprecated.since agesAdds given product to this category at given position.- Parameters:
ctx- session contextproduct- to be addedposition- which will be set and used for sorting productsshift- whether succeeding products should shift their positions according to new product position or not
-
addProducts
Deprecated.since agesAdds given products to this category at position 0. Existing products will be shifted.- Parameters:
products- to be added
-
addProducts
@Deprecated(since="ages", forRemoval=false) public void addProducts(SessionContext ctx, Collection<Product> products) Deprecated.since agesAdds given products to this category at position 0. Existing products will be shifted.- Parameters:
ctx- session contextproducts- to be added
-
removeProduct
Deprecated.since agesRemoves given product from this category.- Parameters:
product- to be removed from this category
-
removeProduct
@Deprecated(since="ages", forRemoval=false) public void removeProduct(SessionContext ctx, Product product) Deprecated.since agesRemoves given product from this category.- Parameters:
ctx- session contextproduct- to be removed from this category
-
removeProducts
@Deprecated(since="ages", forRemoval=false) public void removeProducts(Collection<Product> products) Deprecated.since agesRemoves given products from this category.- Parameters:
products- to be removed from this category
-
removeProducts
@Deprecated(since="ages", forRemoval=false) public void removeProducts(SessionContext ctx, Collection<Product> products) Deprecated.since agesRemoves given products from this category.- Parameters:
ctx- session contextproducts- to be removed from this category
-
getPath
Deprecated.since ages - useCategoryService.getPathForCategory(de.hybris.platform.category.model.CategoryModel)instead.Returns the path from root down to this category. This method should be used only in cases without multiple supercategories - otherwise it cannot be predicted which path is chosen!
To get all supercategories useGeneratedCategory.getSupercategories().- Returns:
- the first found path for this category or
nullif this category has no supercategories
-
getPaths
Deprecated.since ages - useCategoryService.getPathsForCategory(de.hybris.platform.category.model.CategoryModel)instead.Returns all paths for this category. Each path is a list of all categories in the path from root to this category.- Returns:
- all paths for this category or empty Collection if this category has no supercategories
-
checkRemovable
@Deprecated(since="ages", forRemoval=false) protected void checkRemovable(SessionContext ctx) throws ConsistencyCheckException Deprecated.since ages - covered byCategoryRemovalValidator.Denies removal request if this category holds subcategories. You can disable this by setting the attributeDISABLE_SUBCATEGORY_REMOVALCHECKin the Sessioncontext toBoolean.TRUE- Overrides:
checkRemovablein classItem- Throws:
ConsistencyCheckException- to indicate that the item cannot be removed
-
isRoot
Deprecated.since ages - useCategoryService.isRoot(de.hybris.platform.category.model.CategoryModel)instead.- Returns:
- true of this is a root category.
-
isRoot
Deprecated.since ages - useCategoryService.isRoot(de.hybris.platform.category.model.CategoryModel)instead.- Returns:
- true of this is a root category
-
isRootAsPrimitive
- Returns:
- true of this is a root category
-
isRootAsPrimitive
public boolean isRootAsPrimitive()- Returns:
- true of this is a root category
-
setAllowedPrincipals
@Deprecated(since="ages", forRemoval=false) public void setAllowedPrincipals(SessionContext ctx, List<Principal> newOnes) Deprecated.since ages - useCategoryService.setAllowedPrincipalsForCategory(de.hybris.platform.category.model.CategoryModel, List)instead.Copies changed visibilities down to subcategories and assures that added principals are allowed to all super categories too. If in the SessionContextDISABLE_SETALLOWEDPRINCIPAL_RECURSIVELYis set to true the given principal list is only set to the given category.- Overrides:
setAllowedPrincipalsin classGeneratedCategory- Parameters:
ctx- theSessionContextnewOnes- the list with the new allowed principals of this category- See Also:
-
setAllowedPrincipalsOnlyForPassedCategory
-
isSetAllowedPrincipalsRecursivelyDisabled
@Deprecated(since="ages", forRemoval=false) protected boolean isSetAllowedPrincipalsRecursivelyDisabled(SessionContext ctx) Deprecated.since ages - covered byCategoryPrincipalStrategy.If this method returns true the methodsetAllowedPrincipals(SessionContext, List)will only set the given list of principals to the given category only.- Parameters:
ctx- SessionContext- Returns:
- true if in the given Sessioncontext the Attribute
DISABLE_SETALLOWEDPRINCIPAL_RECURSIVELYexists and is set to true. false otherwise.
-
pullUpAllowedPrincipalInternals
@Deprecated(since="ages", forRemoval=false) protected void pullUpAllowedPrincipalInternals(SessionContext ctx, Category superCat, List<Principal> newOnes) Deprecated.since ages - covered byCategoryPrincipalStrategy.Just adds principals which are not yet included in allowed principal set. Missing principals are not removed here!- Parameters:
ctx-newOnes- the principal set to pull up
-
isSubcategoryRemovalCheckDisabled
@Deprecated(since="ages", forRemoval=false) protected boolean isSubcategoryRemovalCheckDisabled(SessionContext ctx) Deprecated.since ages - covered byCategoryRemovalValidator.- Parameters:
ctx- the session context- Returns:
- true if in the given SessionContext the attribute
DISABLE_SUBCATEGORY_REMOVALCHECKexists AND the value of this attribute is true
-