Class MasterDataContainerResolverImpl
java.lang.Object
de.hybris.platform.sap.productconfig.runtime.cps.masterdata.service.impl.MasterDataContainerResolverImpl
- All Implemented Interfaces:
MasterDataContainerResolver
Utility class to extract specific data from
CPSMasterDataKnowledgeBaseContainer.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetCharacteristic(CPSMasterDataKnowledgeBaseContainer kBContainer, String characteristicId) Gets localized master data for characteristicgetCharacteristicNameWithFallback(MasterDataContext ctxt, String csticId) Gets localized name for characteristic.protected CPSMasterDataClassContainergetClass(CPSMasterDataKnowledgeBaseContainer kbMasterData, String id) protected StringgetClassName(CPSMasterDataKnowledgeBaseContainer kbMasterData, String id) protected StringgetClassNameFromFallbackKbContainer(MasterDataContext ctxt, String itemKey) Returns the fallback knowledgebase cache containerprotected CPSMasterDataCharacteristicGroupgetGroup(CPSMasterDataKnowledgeBaseContainer kbMasterData, String itemKey, String groupId) getGroupCharacteristicIDs(CPSMasterDataKnowledgeBaseContainer kbMasterData, String itemKey, String itemType, String groupId) Gets characteristic ids for group.getGroupName(CPSMasterDataKnowledgeBaseContainer kbMasterData, String itemKey, String itemType, String groupId) Gets localized name for group.protected StringgetGroupNameFromFallbackKbContainer(MasterDataContext ctxt, String itemKey, String groupId) getGroupNameWithFallback(MasterDataContext ctxt, String itemKey, String itemType, String groupId) Gets localized name for group.getItemName(CPSMasterDataKnowledgeBaseContainer kbMasterData, String id, String type) Gets localized name for itemgetItemNameWithFallback(MasterDataContext ctxt, String id, String type) Gets localized name for item.getKbBuildNumber(CPSMasterDataKnowledgeBaseContainer kbContainer) Retrieves knowledgebase build number for given master data containerprotected ConfigurationMasterDataServicegetPossibleValueIds(CPSMasterDataKnowledgeBaseContainer kbContainer, String characteristicId) Get all possible value ids for a given characteristicprotected CPSMasterDataProductContainergetProduct(CPSMasterDataKnowledgeBaseContainer kbMasterData, String id) protected StringgetProductName(CPSMasterDataKnowledgeBaseContainer kbMasterData, String id) protected StringgetProductNameFromFallbackKbContainer(MasterDataContext ctxt, String itemKey) getSpecificPossibleValueIds(CPSMasterDataKnowledgeBaseContainer masterData, String productId, String itemType, String characteristicId) Get all specific (that have a variant condition) possible value ids for a given characteristic.getValueDescription(CPSMasterDataKnowledgeBaseContainer kbContainer, String characteristicId, String valueId) Gets localized description for valueprotected StringgetValueDescriptionFromFallbackKbContainer(MasterDataContext ctxt, String characteristicId, String valueId) getValueDescriptionWithFallback(MasterDataContext ctxt, String characteristicId, String valueId) Gets localized description for value.getValueName(CPSMasterDataKnowledgeBaseContainer kBContainer, String characteristicId, String valueId) Gets localized name for valueprotected StringgetValueNameFromFallbackKbContainer(MasterDataContext ctxt, String characteristicId, String valueId) getValueNameWithFallback(MasterDataContext ctxt, String characteristicId, String valueId) Gets localized name for value.getValuePricingKey(CPSMasterDataKnowledgeBaseContainer masterData, String productId, String csticId, String valueId) Get pricing key for valueprotected StringhandleClassNameFallback(MasterDataContext ctxt, String itemKey) protected StringhandleGroupNameFallback(MasterDataContext ctxt, String itemKey, String groupId) protected StringhandleProductNameFallback(MasterDataContext ctxt, String itemKey) protected StringhandleValueDescriptionFallback(MasterDataContext ctxt, String characteristicId, String valueId, CPSMasterDataPossibleValue value) protected StringhandleValueNameFallback(MasterDataContext ctxt, String characteristicId, String valueId, CPSMasterDataPossibleValue value) booleanisCharacteristicNumeric(CPSMasterDataKnowledgeBaseContainer kbContainer, String csticId) Checks if a characteristic is numericprotected booleanisCsticNumericType(CPSMasterDataCharacteristicContainer csticContainer) protected booleanbooleanisProductMultilevel(CPSMasterDataKnowledgeBaseContainer masterData, String id) Gives information whether product is multilevelretrieveIdsForPossibleValueSpecificsWithVariantCondition(CPSMasterDataCharacteristicSpecificContainer csticSpecific) voidsetMasterDataService(ConfigurationMasterDataService configurationMasterDataService)
-
Field Details
-
CSTIC_TYPE_FLOAT
- See Also:
-
CSTIC_TYPE_INTEGER
- See Also:
-
-
Constructor Details
-
MasterDataContainerResolverImpl
public MasterDataContainerResolverImpl()
-
-
Method Details
-
getCharacteristic
public CPSMasterDataCharacteristicContainer getCharacteristic(CPSMasterDataKnowledgeBaseContainer kBContainer, String characteristicId) Description copied from interface:MasterDataContainerResolverGets localized master data for characteristic- Specified by:
getCharacteristicin interfaceMasterDataContainerResolver- Parameters:
kBContainer- container with cached master datacharacteristicId- id of the characteristic- Returns:
- localized master data of the characteristic
-
getPossibleValueIds
public Set<String> getPossibleValueIds(CPSMasterDataKnowledgeBaseContainer kbContainer, String characteristicId) Description copied from interface:MasterDataContainerResolverGet all possible value ids for a given characteristic- Specified by:
getPossibleValueIdsin interfaceMasterDataContainerResolver- Parameters:
kbContainer- container with cached master datacharacteristicId- id of the characteristic- Returns:
- list of possible value ids
-
getValueDescription
public String getValueDescription(CPSMasterDataKnowledgeBaseContainer kbContainer, String characteristicId, String valueId) Description copied from interface:MasterDataContainerResolverGets localized description for value- Specified by:
getValueDescriptionin interfaceMasterDataContainerResolver- Parameters:
kbContainer- container with cached master datacharacteristicId- id of the characteristicvalueId- id of the value- Returns:
- localized description of the value
-
getValueDescriptionFromFallbackKbContainer
protected String getValueDescriptionFromFallbackKbContainer(MasterDataContext ctxt, String characteristicId, String valueId) -
handleValueDescriptionFallback
protected String handleValueDescriptionFallback(MasterDataContext ctxt, String characteristicId, String valueId, CPSMasterDataPossibleValue value) -
getValueDescriptionWithFallback
public String getValueDescriptionWithFallback(MasterDataContext ctxt, String characteristicId, String valueId) Description copied from interface:MasterDataContainerResolverGets localized description for value. If it is not maintained it retrieves the localized description from the fallback language (if maintained). Otherwise null is returned- Specified by:
getValueDescriptionWithFallbackin interfaceMasterDataContainerResolver- Parameters:
ctxt- master data contextcharacteristicId- id of the characteristicvalueId- id of the value- Returns:
- localized description of the value (or localized name from fallback language)
-
getValueName
public String getValueName(CPSMasterDataKnowledgeBaseContainer kBContainer, String characteristicId, String valueId) Description copied from interface:MasterDataContainerResolverGets localized name for value- Specified by:
getValueNamein interfaceMasterDataContainerResolver- Parameters:
kBContainer- container with cached master datacharacteristicId- id of the characteristicvalueId- id of the value- Returns:
- localized name of the value
-
getValueNameWithFallback
public String getValueNameWithFallback(MasterDataContext ctxt, String characteristicId, String valueId) Description copied from interface:MasterDataContainerResolverGets localized name for value. If it is not maintained it retrieves the localized name from the fallback language (if maintained). Otherwise null is returned- Specified by:
getValueNameWithFallbackin interfaceMasterDataContainerResolver- Parameters:
ctxt- master data contextcharacteristicId- id of the characteristicvalueId- id of the value- Returns:
- localized name of the value (or localized name from fallback language)
-
handleValueNameFallback
protected String handleValueNameFallback(MasterDataContext ctxt, String characteristicId, String valueId, CPSMasterDataPossibleValue value) -
getValueNameFromFallbackKbContainer
protected String getValueNameFromFallbackKbContainer(MasterDataContext ctxt, String characteristicId, String valueId) -
isCsticNumericType
-
isCsticStringType
-
isCharacteristicNumeric
public boolean isCharacteristicNumeric(CPSMasterDataKnowledgeBaseContainer kbContainer, String csticId) Description copied from interface:MasterDataContainerResolverChecks if a characteristic is numeric- Specified by:
isCharacteristicNumericin interfaceMasterDataContainerResolver- Parameters:
kbContainer- container with cached master datacsticId- Id of the characteristic- Returns:
- whether characteristic is numeric
-
getGroupCharacteristicIDs
public List<String> getGroupCharacteristicIDs(CPSMasterDataKnowledgeBaseContainer kbMasterData, String itemKey, String itemType, String groupId) Description copied from interface:MasterDataContainerResolverGets characteristic ids for group. In case we are requesting the characteristics for class nodes, all characteristic assigned to the class node will be returned as the class node does not carry any group besides the 'general' dummy group- Specified by:
getGroupCharacteristicIDsin interfaceMasterDataContainerResolver- Parameters:
kbMasterData- container with cached master dataitemKey- id of the product or a class nodeitemType- EitherSapproductconfigruntimecpsConstants.ITEM_TYPE_MARAorSapproductconfigruntimecpsConstants.ITEM_TYPE_KLAHgroupId- id of the group. Not relevant for class nodes- Returns:
- list of characteristic ids belonging to the group
-
getGroup
protected CPSMasterDataCharacteristicGroup getGroup(CPSMasterDataKnowledgeBaseContainer kbMasterData, String itemKey, String groupId) -
getClass
protected CPSMasterDataClassContainer getClass(CPSMasterDataKnowledgeBaseContainer kbMasterData, String id) -
getClassName
-
getProduct
protected CPSMasterDataProductContainer getProduct(CPSMasterDataKnowledgeBaseContainer kbMasterData, String id) -
getProductName
-
getProductNameFromFallbackKbContainer
-
getItemName
Description copied from interface:MasterDataContainerResolverGets localized name for item- Specified by:
getItemNamein interfaceMasterDataContainerResolver- Parameters:
kbMasterData- container with cached master dataid- id of the itemtype- type of the item- Returns:
- localized name of the item
-
getItemNameWithFallback
Description copied from interface:MasterDataContainerResolverGets localized name for item. If it is not maintained it retrieves the localized name from the fallback language (if maintained). Otherwise null is returned- Specified by:
getItemNameWithFallbackin interfaceMasterDataContainerResolverid- id of the itemtype- type of the item- Returns:
- localized name of the item
-
getGroupName
public String getGroupName(CPSMasterDataKnowledgeBaseContainer kbMasterData, String itemKey, String itemType, String groupId) Description copied from interface:MasterDataContainerResolverGets localized name for group. In case we are requesting the group name for class nodes, the class name will be returned as the class node doesn't carry UI groups, except for the 'general' dummy group- Specified by:
getGroupNamein interfaceMasterDataContainerResolver- Parameters:
kbMasterData- container with cached master dataitemKey- id of the product or classitemType- EitherSapproductconfigruntimecpsConstants.ITEM_TYPE_MARAorSapproductconfigruntimecpsConstants.ITEM_TYPE_KLAHgroupId- id of the group. Not relevant for class nodes- Returns:
- localized name of the group
-
getGroupNameWithFallback
public String getGroupNameWithFallback(MasterDataContext ctxt, String itemKey, String itemType, String groupId) Description copied from interface:MasterDataContainerResolverGets localized name for group. In case we are requesting the group name for class nodes, the class name will be returned as the class node doesn't carry UI groups, except for the 'general' dummy group. If a localized name is not maintained it retrieves the localized name from the fallback language (if maintained). Otherwise null is returned- Specified by:
getGroupNameWithFallbackin interfaceMasterDataContainerResolver- Parameters:
ctxt- master data contextitemKey- id of the product or classitemType- EitherSapproductconfigruntimecpsConstants.ITEM_TYPE_MARAorSapproductconfigruntimecpsConstants.ITEM_TYPE_KLAHgroupId- id of the group. Not relevant for class nodes- Returns:
- localized name of the group (of localized name from fallback language)
-
getGroupNameFromFallbackKbContainer
protected String getGroupNameFromFallbackKbContainer(MasterDataContext ctxt, String itemKey, String groupId) -
handleGroupNameFallback
-
getClassNameFromFallbackKbContainer
-
handleClassNameFallback
-
handleProductNameFallback
-
getValuePricingKey
public String getValuePricingKey(CPSMasterDataKnowledgeBaseContainer masterData, String productId, String csticId, String valueId) Description copied from interface:MasterDataContainerResolverGet pricing key for value- Specified by:
getValuePricingKeyin interfaceMasterDataContainerResolver- Parameters:
masterData- container with cached master dataproductId- id of the productcsticId- id of the characteristicvalueId- id of the value- Returns:
- pricing key for the given value
-
getSpecificPossibleValueIds
public Set<String> getSpecificPossibleValueIds(CPSMasterDataKnowledgeBaseContainer masterData, String productId, String itemType, String characteristicId) Description copied from interface:MasterDataContainerResolverGet all specific (that have a variant condition) possible value ids for a given characteristic. For class nodes, which don't carry variant key assignments, an empty Set is returned- Specified by:
getSpecificPossibleValueIdsin interfaceMasterDataContainerResolver- Parameters:
masterData- container with cached master dataproductId- id of the product of of a class nodeitemType- EitherSapproductconfigruntimecpsConstants.ITEM_TYPE_MARAorSapproductconfigruntimecpsConstants.ITEM_TYPE_KLAHcharacteristicId- id of the characteristic- Returns:
- list of possible value ids
-
retrieveIdsForPossibleValueSpecificsWithVariantCondition
protected Set<String> retrieveIdsForPossibleValueSpecificsWithVariantCondition(CPSMasterDataCharacteristicSpecificContainer csticSpecific) -
isProductMultilevel
Description copied from interface:MasterDataContainerResolverGives information whether product is multilevel- Specified by:
isProductMultilevelin interfaceMasterDataContainerResolver- Parameters:
masterData- container with cached master dataid- id of the product- Returns:
- whether product is multilevel
-
getKbBuildNumber
Description copied from interface:MasterDataContainerResolverRetrieves knowledgebase build number for given master data container- Specified by:
getKbBuildNumberin interfaceMasterDataContainerResolver- Parameters:
kbContainer- container with cached master data- Returns:
- build number of the knowledgebase
-
getFallbackKbCacheContainer
Description copied from interface:MasterDataContainerResolverReturns the fallback knowledgebase cache container- Specified by:
getFallbackKbCacheContainerin interfaceMasterDataContainerResolver- Returns:
- knowledgebase cache container
-
getMasterDataService
-
setMasterDataService
-
getCharacteristicNameWithFallback
Description copied from interface:MasterDataContainerResolverGets localized name for characteristic. If it is not maintained it retrieves the localized name from the fallback language (if maintained). Otherwise null is returned- Specified by:
getCharacteristicNameWithFallbackin interfaceMasterDataContainerResolver- Parameters:
ctxt- master data contextcsticId- id of the characteristic- Returns:
- Localized name for characteristic
-