Package de.hybris.platform.category.jalo
Class Category
- java.lang.Object
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable
- Direct Known Subclasses:
GeneratedClassificationClass,GeneratedConfigurationCategory,GeneratedVariantCategory,GeneratedVariantValueCategory
public class Category extends GeneratedCategory
This class represents a simple category, which could have assigned subcategories, products, pictures and thumbnails.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class de.hybris.platform.jalo.GenericItem
GenericItem.GenericItemImpl
-
Nested classes/interfaces inherited from class de.hybris.platform.jalo.c2l.LocalizableItem
LocalizableItem.LocalizableItemImpl
-
Nested classes/interfaces inherited from class de.hybris.platform.jalo.ExtensibleItem
ExtensibleItem.ExtensibleItemImpl
-
Nested 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
Fields Modifier and Type Field Description static java.lang.StringDISABLE_CYCLIC_CHECKSDeprecated.since ages - please use Constants.DISABLED_CYCLIC_CHECKS insteadstatic java.lang.StringDISABLE_SETALLOWEDPRINCIPAL_RECURSIVELYSessionContext attribute flag for set allowed principals.static java.lang.StringDISABLE_SUBCATEGORY_REMOVALCHECKSessionContext attribute flag for disabling the subcategory check when removing category-
Fields 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, THUMBNAILS
-
Fields inherited from class de.hybris.platform.jalo.c2l.LocalizableItem
LANGUAGE_FALLBACK_ENABLED
-
Fields 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, TYPE
-
Fields inherited from class de.hybris.platform.util.BridgeAbstraction
impl, tenant
-
-
Constructor Summary
Constructors Constructor Description Category()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddProduct(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, java.util.Collection<Product> products)Deprecated.since agesvoidaddProducts(java.util.Collection<Product> products)Deprecated.since agesvoidaddSubcategories(SessionContext ctx, java.util.Collection<Category> categories)Deprecated.since agesvoidaddSubcategories(java.util.Collection<Category> categories)Deprecated.since agesvoidaddSubcategory(Category category)Deprecated.since agesvoidaddSubcategory(SessionContext ctx, Category category)Deprecated.since agesvoidaddSupercategories(SessionContext ctx, java.util.Collection<Category> categories)Deprecated.since agesvoidaddSupercategories(java.util.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, java.util.Collection<Category> toAddTo, java.util.Collection<Category> toCheck, boolean sub)Deprecated.since agesprotected voidcheckRemovable(SessionContext ctx)Deprecated.since ages - covered byCategoryRemovalValidator.booleancontainsProducts()Deprecated.since ages - useProductService.containsProductsForCategory(de.hybris.platform.category.model.CategoryModel)instead.protected ItemcreateItem(SessionContext ctx, ComposedType type, Item.ItemAttributeMap allAttributes)Deprecated.since agesprotected booleandisableChecks(SessionContext ctx)Deprecated.since agesintgetAllProductsCount()Deprecated.since ages - useProductService.getAllProductsCountForCategory(de.hybris.platform.category.model.CategoryModel)instead.java.util.Collection<Category>getAllSubcategories()Deprecated.since ages - useCategoryModel.getAllSubcategories()instead.java.util.Collection<Category>getAllSubcategories(SessionContext ctx)Deprecated.since ages - useCategoryModel.getAllSubcategories()instead.intgetAllSubcategoriesCount()Deprecated.since ages - useCategoryModel.getAllSubcategories()and methodsize()on result instead.java.util.Collection<Category>getAllSupercategories()Deprecated.since ages - useCategoryModel.getAllSupercategories()instead.java.util.Collection<Category>getAllSupercategories(SessionContext ctx)Deprecated.since ages - useCategoryModel.getAllSubcategories()instead.java.lang.StringgetCode()Deprecated.since agesjava.util.List<Category>getPath()Deprecated.since ages - useCategoryService.getPathForCategory(de.hybris.platform.category.model.CategoryModel)instead.java.util.Collection<java.util.List<Category>>getPaths()Deprecated.since ages - useCategoryService.getPathsForCategory(de.hybris.platform.category.model.CategoryModel)instead.longgetProductsCount()Deprecated.since ages - useProductService.getProductsCountForCategory(de.hybris.platform.category.model.CategoryModel)instead.java.util.Collection<Category>getSubcategories()Deprecated.since agesjava.util.List<Category>getSubcategories(SessionContext ctx)Deprecated.since ageslonggetSubcategoryCount()Deprecated.since agesCategorygetSupercategory()Deprecated.since agesCategorygetSupercategory(SessionContext ctx)Deprecated.since ageslonggetSupercategoryCount()Deprecated.since agesbooleanisEmpty()Deprecated.since ages - useCategoryService.isEmpty(de.hybris.platform.category.model.CategoryModel)instead.java.lang.BooleanisRoot()Deprecated.since ages - useCategoryService.isRoot(de.hybris.platform.category.model.CategoryModel)instead.java.lang.BooleanisRoot(SessionContext ctx)Deprecated.since ages - useCategoryService.isRoot(de.hybris.platform.category.model.CategoryModel)instead.booleanisRootAsPrimitive()booleanisRootAsPrimitive(SessionContext ctx)protected booleanisSetAllowedPrincipalsRecursivelyDisabled(SessionContext ctx)Deprecated.since ages - covered byCategoryPrincipalStrategy.protected booleanisSubcategoryRemovalCheckDisabled(SessionContext ctx)Deprecated.since ages - covered byCategoryRemovalValidator.protected voidpullUpAllowedPrincipalInternals(SessionContext ctx, Category superCat, java.util.List<Principal> newOnes)Deprecated.since ages - covered byCategoryPrincipalStrategy.voidremoveProduct(Product product)Deprecated.since agesvoidremoveProduct(SessionContext ctx, Product product)Deprecated.since agesvoidremoveProducts(SessionContext ctx, java.util.Collection<Product> products)Deprecated.since agesvoidremoveProducts(java.util.Collection<Product> products)Deprecated.since agesvoidremoveSubcategories(SessionContext ctx, java.util.Collection<Category> categories)Deprecated.since agesvoidremoveSubcategories(java.util.Collection<Category> categories)Deprecated.since agesvoidremoveSubcategory(Category category)Deprecated.since agesvoidremoveSubcategory(SessionContext ctx, Category category)Deprecated.since agesvoidremoveSupercategories(SessionContext ctx, java.util.Collection<Category> categories)Deprecated.since agesvoidremoveSupercategories(java.util.Collection<Category> categories)Deprecated.since agesvoidremoveSupercategory(Category category)Deprecated.since agesvoidremoveSupercategory(SessionContext ctx, Category category)Deprecated.since agesvoidsetAllowedPrincipals(SessionContext ctx, java.util.List<Principal> newOnes)Deprecated.since ages - useCategoryService.setAllowedPrincipalsForCategory(de.hybris.platform.category.model.CategoryModel, List)instead.voidsetAllowedPrincipalsOnlyForPassedCategory(SessionContext ctx, java.util.List<Principal> value)voidsetCategories(Category... categories)Deprecated.since agesvoidsetCategories(SessionContext ctx, Category... categories)Deprecated.since agesvoidsetCategories(SessionContext ctx, java.util.List<Category> categories)Deprecated.since agesvoidsetSubcategories(SessionContext ctx, java.util.List<Category> subcategories)Deprecated.since agesvoidsetSubcategories(java.util.List<Category> subcategories)Deprecated.since agesvoidsetSupercategories(Category... superCategories)Deprecated.since agesvoidsetSupercategories(SessionContext ctx, Category... superCategories)Deprecated.since agesvoidsetSupercategories(SessionContext ctx, java.util.List<Category> categories)Deprecated.since agesjava.lang.StringtoString()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, setThumbnails
-
Methods inherited from class de.hybris.platform.jalo.GenericItem
getImplementation, getInitialProperties, getNonInitialAttributes, getRelatedItems, setRelatedItems
-
Methods 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, setLocalizedProperty
-
Methods inherited from class de.hybris.platform.jalo.ExtensibleItem
createNonClassAccessor, getAllProperties, getAllProperties, getProperty, getProperty, getPropertyNames, getPropertyNames, removeProperty, removeProperty, setAllProperties, setAllProperties, setProperty, setProperty
-
Methods 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, 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, useTA, writeReplace
-
Methods inherited from class de.hybris.platform.util.BridgeAbstraction
setTenant
-
-
-
-
Field Detail
-
DISABLE_SUBCATEGORY_REMOVALCHECK
public static final java.lang.String DISABLE_SUBCATEGORY_REMOVALCHECK
SessionContext attribute flag for disabling the subcategory check when removing category- See Also:
- Constant Field Values
-
DISABLE_SETALLOWEDPRINCIPAL_RECURSIVELY
public static final java.lang.String 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:
- Constant Field Values
-
DISABLE_CYCLIC_CHECKS
@Deprecated public static final java.lang.String 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
-
-
Method Detail
-
createItem
@Deprecated 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
public java.lang.String 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 public java.lang.String getCode()
Deprecated.since agesDescription copied from class:GeneratedCategoryGenerated method - Getter of theCategory.codeattribute.- Overrides:
getCodein classGeneratedCategory- Returns:
- the code - Code
-
getSubcategories
@Deprecated public java.util.Collection<Category> getSubcategories()
Deprecated.since agesGets subcategories of this category.- Returns:
- subcategories of this category
-
getSubcategories
@Deprecated public java.util.List<Category> getSubcategories(SessionContext ctx)
Deprecated.since agesGets subcategories of this category.- Parameters:
ctx- session context- Returns:
- subcategories of this category
-
getSubcategoryCount
@Deprecated public long 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 public java.util.Collection<Category> 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 public java.util.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 public int 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 public int 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 public void setCategories(SessionContext ctx, java.util.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 public void setCategories(Category... categories)
Deprecated.since ages
-
setCategories
@Deprecated public void setCategories(SessionContext ctx, Category... categories)
Deprecated.since ages
-
addToCategories
@Deprecated 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 public void setSupercategories(SessionContext ctx, java.util.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 public void setSupercategories(Category... superCategories)
Deprecated.since ages
-
setSupercategories
@Deprecated public void setSupercategories(SessionContext ctx, Category... superCategories)
Deprecated.since ages
-
addToSupercategories
@Deprecated 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 protected boolean disableChecks(SessionContext ctx)
Deprecated.since ages
-
assertNoCycle
@Deprecated protected void assertNoCycle(SessionContext ctx, java.util.Collection<Category> toAddTo, java.util.Collection<Category> toCheck, boolean sub) throws JaloInvalidParameterException
Deprecated.since ages- Throws:
JaloInvalidParameterException
-
setSubcategories
@Deprecated public void setSubcategories(java.util.List<Category> subcategories)
Deprecated.since agesSets the subcategories of this category.- Parameters:
subcategories- subcategories to set
-
setSubcategories
@Deprecated public void setSubcategories(SessionContext ctx, java.util.List<Category> subcategories)
Deprecated.since agesSets the subcategories of this category.- Parameters:
ctx- session contextsubcategories- subcategories to set
-
addSubcategory
@Deprecated public void addSubcategory(Category category)
Deprecated.since agesAdds given category to subcategories of this category.- Parameters:
category- the category to be added
-
addSubcategory
@Deprecated 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 public void addSubcategories(java.util.Collection<Category> categories)
Deprecated.since agesAdds given categories to subcategories of this category.- Parameters:
categories- Categories to be added
-
addSubcategories
@Deprecated public void addSubcategories(SessionContext ctx, java.util.Collection<Category> categories)
Deprecated.since agesAdds given categories to subcategories of this category.- Parameters:
ctx- session contextcategories- Categories to be added
-
removeSubcategory
@Deprecated public void removeSubcategory(Category category)
Deprecated.since agesRemoves given category from subcategories of this category.- Parameters:
category- the category to be removed from subcategories
-
removeSubcategory
@Deprecated 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 public void removeSubcategories(java.util.Collection<Category> categories)
Deprecated.since agesRemoves given categories from subcategories of this category.- Parameters:
categories- Categories to be removed from subcategories
-
removeSubcategories
@Deprecated public void removeSubcategories(SessionContext ctx, java.util.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 public Category 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 public Category getSupercategory(SessionContext ctx)
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 public long 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 public long 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 public boolean 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 public boolean 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 public java.util.Collection<Category> 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 public java.util.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 public void addSupercategory(Category category)
Deprecated.since agesAdds given category to supercategories of this category.- Parameters:
category- the category to be added
-
addSupercategory
@Deprecated 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 public void addSupercategories(java.util.Collection<Category> categories)
Deprecated.since agesAdds given categories to supercategories of this category.- Parameters:
categories- Categories to be added
-
addSupercategories
@Deprecated public void addSupercategories(SessionContext ctx, java.util.Collection<Category> categories)
Deprecated.since agesAdds given categories to supercategories of this category.- Parameters:
ctx- session contextcategories- Categories to be added
-
removeSupercategory
@Deprecated public void removeSupercategory(Category category)
Deprecated.since agesRemoves given category from supercategories of this category.- Parameters:
category- the category to be removed from supercategories
-
removeSupercategory
@Deprecated 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 public void removeSupercategories(java.util.Collection<Category> categories)
Deprecated.since agesRemoves given categories from supercategories of this category.- Parameters:
categories- Categories to be removed from supercategories
-
removeSupercategories
@Deprecated public void removeSupercategories(SessionContext ctx, java.util.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 public void addProduct(Product product)
Deprecated.since agesAdds given product to this category.- Parameters:
product- product to be added
-
addProduct
@Deprecated public void addProduct(SessionContext ctx, Product product)
Deprecated.since agesAdds given product to this category.- Parameters:
ctx- session contextproduct- to be added
-
addProduct
@Deprecated 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 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 public void addProducts(java.util.Collection<Product> products)
Deprecated.since agesAdds given products to this category at position 0. Existing products will be shifted.- Parameters:
products- to be added
-
addProducts
@Deprecated public void addProducts(SessionContext ctx, java.util.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 public void removeProduct(Product product)
Deprecated.since agesRemoves given product from this category.- Parameters:
product- to be removed from this category
-
removeProduct
@Deprecated 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 public void removeProducts(java.util.Collection<Product> products)
Deprecated.since agesRemoves given products from this category.- Parameters:
products- to be removed from this category
-
removeProducts
@Deprecated public void removeProducts(SessionContext ctx, java.util.Collection<Product> products)
Deprecated.since agesRemoves given products from this category.- Parameters:
ctx- session contextproducts- to be removed from this category
-
getPath
@Deprecated public java.util.List<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 public java.util.Collection<java.util.List<Category>> 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 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 public java.lang.Boolean isRoot(SessionContext ctx)
Deprecated.since ages - useCategoryService.isRoot(de.hybris.platform.category.model.CategoryModel)instead.- Returns:
- true of this is a root category.
-
isRoot
@Deprecated public java.lang.Boolean isRoot()
Deprecated.since ages - useCategoryService.isRoot(de.hybris.platform.category.model.CategoryModel)instead.- Returns:
- true of this is a root category
-
isRootAsPrimitive
public boolean isRootAsPrimitive(SessionContext ctx)
- Returns:
- true of this is a root category
-
isRootAsPrimitive
public boolean isRootAsPrimitive()
- Returns:
- true of this is a root category
-
setAllowedPrincipals
@Deprecated public void setAllowedPrincipals(SessionContext ctx, java.util.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:
setAllowedPrincipals(de.hybris.platform.jalo.SessionContext, java.util.List)
-
setAllowedPrincipalsOnlyForPassedCategory
public void setAllowedPrincipalsOnlyForPassedCategory(SessionContext ctx, java.util.List<Principal> value)
-
isSetAllowedPrincipalsRecursivelyDisabled
@Deprecated 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 protected void pullUpAllowedPrincipalInternals(SessionContext ctx, Category superCat, java.util.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 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
-
-