Package de.hybris.platform.catalog.impl
Class DefaultCatalogTypeService
java.lang.Object
de.hybris.platform.servicelayer.internal.service.AbstractService
de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
de.hybris.platform.catalog.impl.DefaultCatalogTypeService
- All Implemented Interfaces:
CatalogTypeService,Serializable,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.InitializingBean
public class DefaultCatalogTypeService
extends AbstractBusinessService
implements CatalogTypeService
Default implementation of the
CatalogTypeService.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
AbstractService.SerializableDTO -
Field Summary
Fields inherited from class de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
modelService, sessionService, txManagerFields inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
tenant -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAllCatalogVersionAwareTypes(boolean superTypesOnly) Returns all composed types which are catalog version aware (or catalog contained). The method has two modes of operation: If the supertypesOnly argument is false : all the types withComposedTypeModel.CATALOGITEMTYPEequal TRUE will be returned. If the supertypesOnly argument is true : the method will return allComposedTypeModels which fulfill the following:ComposedTypeModel.CATALOGITEMTYPEflag equal TRUE super type is not catalog version aware OR super type is catalog version aware but it's unique attributes are different than unique attributes of the given typegetCatalogVersionAwareModel(CatalogVersionModel version, String typeCode, Map<String, Object> uniqueKeyValues) Returns for the givenCatalogVersionModel, thetypeCodeand the map with the unique catalog key attributes and their values anItemModel(or a given subtype).getCatalogVersionContainerAttribute(String typeCode) Returns for the giventypeCodethe qualifier of the CatalogVersion attribute.Retrieves the owning catalog version for a catalog version contained itemmodel.getCatalogVersionOverview(CatalogVersionModel catalogVersion) Collects all catalog version aware types, where at least one item exists, which belongs to given catalog version.getCatalogVersionUniqueKeyAttribute(String typeCode) Returns a set of attribute qualifiers by which an instance with the giventypeCodecan be identified as unique within any catalog version.booleanChecks if the givenmodelis catalogVersion aware (catalog contained type).booleanChecks if the giventypeis catalog version aware (catalog contained type).booleanisCatalogVersionAwareType(String typeCode) Returnstrueif the giventypeCodestring represents a type that is catalog version aware.voidsetCatalogTypeDao(CatalogTypeDao catalogTypeDao) voidsetFlexibleSearchService(FlexibleSearchService flexibleSearchService) voidsetSearchRestrictionService(SearchRestrictionService searchRestrictionService) voidsetTypeService(TypeService typeService) Methods inherited from class de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
getModelService, getSessionService, getTxManager, setModelService, setSessionService, setTxManagerMethods inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
afterPropertiesSet, getCurrentTenant, setBeanName, setCurrentTenant, writeReplace
-
Constructor Details
-
DefaultCatalogTypeService
public DefaultCatalogTypeService()
-
-
Method Details
-
getCatalogVersionContainerAttribute
Description copied from interface:CatalogTypeServiceReturns for the giventypeCodethe qualifier of the CatalogVersion attribute. This method will try to examine the giventypefor attribute where the CatalogVersion is stored and return it's qualifier.- Specified by:
getCatalogVersionContainerAttributein interfaceCatalogTypeService- Parameters:
typeCode- the typeCode of the targetComposedTypeModel- Returns:
- the catalog version attribute qualifier
-
getCatalogVersionAwareModel
public ItemModel getCatalogVersionAwareModel(CatalogVersionModel version, String typeCode, Map<String, Object> uniqueKeyValues) throws CatalogAwareObjectResolvingExceptionDescription copied from interface:CatalogTypeServiceReturns for the givenCatalogVersionModel, thetypeCodeand the map with the unique catalog key attributes and their values anItemModel(or a given subtype).Please refer to
CatalogTypeService.getCatalogVersionUniqueKeyAttribute(String)to see how a set of the unique catalog key attributes for a given type can be recognized.If the
versionis not persisted or one of theuniqueKeyValuesmembers is a non-persisted model, the method will throwCatalogAwareObjectResolvingException;- Specified by:
getCatalogVersionAwareModelin interfaceCatalogTypeService- Parameters:
version- theCatalogVersionModeltypeCode- String typeCode of theComposedTypeModeluniqueKeyValues- a map with ALL unique catalog key attribute and their values to be searched for. Any non-unique catalog key attribute in the given map will be ignored.- Returns:
- an ItemModel or a subtype of ItemModel which matches the given parameters OR
nullif any item model in theuniqueKeyValuesmap was not persisted yet. - Throws:
CatalogAwareObjectResolvingException- ifversionin not persisted OR one of the unique parameters is a model and is not persisted.
-
getCatalogVersionUniqueKeyAttribute
Description copied from interface:CatalogTypeServiceReturns a set of attribute qualifiers by which an instance with the giventypeCodecan be identified as unique within any catalog version.- Specified by:
getCatalogVersionUniqueKeyAttributein interfaceCatalogTypeService- Parameters:
typeCode- the ComposedType's code- Returns:
- an empty set if the given
typeCodehas no such attributes
-
isCatalogVersionAwareType
Description copied from interface:CatalogTypeServiceReturnstrueif the giventypeCodestring represents a type that is catalog version aware.- Specified by:
isCatalogVersionAwareTypein interfaceCatalogTypeService- Parameters:
typeCode- the typeCode of ComposedType- Returns:
falseif thetypeCodeis not a catalog item type.
-
getAllCatalogVersionAwareTypes
Description copied from interface:CatalogTypeServiceReturns all composed types which are catalog version aware (or catalog contained). The method has two modes of operation:- If the supertypesOnly argument is false : all the types with
ComposedTypeModel.CATALOGITEMTYPEequal TRUE will be returned. - If the supertypesOnly argument is true : the method will return all
ComposedTypeModels which fulfill the following:ComposedTypeModel.CATALOGITEMTYPEflag equal TRUE- super type is not catalog version aware OR super type is catalog version aware but it's unique attributes are different than unique attributes of the given type
- Specified by:
getAllCatalogVersionAwareTypesin interfaceCatalogTypeService- Parameters:
superTypesOnly- if set to true only root types will be returned.- Returns:
- collection of
ComposedTypeModels which haveComposedTypeModel.CATALOGITEMTYPEequal TRUE.
- If the supertypesOnly argument is false : all the types with
-
isCatalogVersionAwareType
Description copied from interface:CatalogTypeServiceChecks if the giventypeis catalog version aware (catalog contained type).- Specified by:
isCatalogVersionAwareTypein interfaceCatalogTypeService- Parameters:
type- targetComposedTypeModel- Returns:
- boolean value
-
isCatalogVersionAwareModel
Description copied from interface:CatalogTypeServiceChecks if the givenmodelis catalogVersion aware (catalog contained type).- Specified by:
isCatalogVersionAwareModelin interfaceCatalogTypeService- Parameters:
model- the target item model- Returns:
- boolean value
-
getCatalogVersionForCatalogVersionAwareModel
Description copied from interface:CatalogTypeServiceRetrieves the owning catalog version for a catalog version contained itemmodel.- Specified by:
getCatalogVersionForCatalogVersionAwareModelin interfaceCatalogTypeService- Parameters:
model- the target item model- See Also:
-
getCatalogVersionOverview
Description copied from interface:CatalogTypeServiceCollects all catalog version aware types, where at least one item exists, which belongs to given catalog version. Some statistics, like the amount of items per type are collected as well.- Specified by:
getCatalogVersionOverviewin interfaceCatalogTypeService- Parameters:
catalogVersion- the catalog version- Returns:
CatalogVersionOverviewobject
-
setTypeService
-
setCatalogTypeDao
-
setFlexibleSearchService
-
setSearchRestrictionService
-