Package de.hybris.platform.sap.sapproductconfigsombol.transaction.salesdocument.backend.impl.erp.strategy
Class ProductConfigurationStrategyImpl
java.lang.Object
de.hybris.platform.sap.sapproductconfigsombol.transaction.salesdocument.backend.impl.erp.strategy.ProductConfigurationStrategyImpl
- All Implemented Interfaces:
ProductConfigurationStrategy
public class ProductConfigurationStrategyImpl
extends Object
implements ProductConfigurationStrategy
Handles the exchange of product configuration data between RFC / LO-API and BOL
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringstatic final StringFM for reading product configuration via LO-API: ERP_LORD_SET_VCFG_ALLstatic final StringFM for writing product configuration via LO-API: ERP_WEC_GET_VCFG_ALLprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringstatic final StringImport attribute for read call -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddKbKey(de.hybris.platform.sap.productconfig.runtime.interf.external.Configuration configuration, SalesDocument salesDoc) Adds date information for the current configurationprotected voidaddMessages(BusinessObject cart, com.sap.conn.jco.JCoTable messages) protected voidaddMessagesUnprocessed(BusinessObject bo, de.hybris.platform.sap.productconfig.runtime.interf.model.InstanceModel rootInstance, com.sap.conn.jco.JCoTable unprocessed) Evaluate unprocessed cstics and add message to BO if neededprotected booleancheckAuthorValid(String author) protected voidcreateCharacteristics(String handle, de.hybris.platform.sap.productconfig.runtime.interf.external.Configuration configuration, com.sap.conn.jco.JCoTable csticsTableRead) Creates the characteristic value assignment for the instance specifiedprotected de.hybris.platform.sap.productconfig.runtime.interf.external.ConfigurationcreateConfigModel(String handle, com.sap.conn.jco.JCoTable instancesTableRead, com.sap.conn.jco.JCoTable csticsTableRead, com.sap.conn.jco.JCoTable refCharTableRead) Creates a configuration model from the JCO tables read via ERP_WEC_GET_VCFG_ALL.voidcreateConfigModels(List<String> configurableItems, SalesDocument salesDoc, com.sap.conn.jco.JCoTable instancesTableRead, com.sap.conn.jco.JCoTable csticsTableRead, com.sap.conn.jco.JCoTable refCharTableRead) Creates the configuration models attached to the specified sales document itemsprotected voidcreateContextAttributes(String handle, de.hybris.platform.sap.productconfig.runtime.interf.external.Configuration configuration, com.sap.conn.jco.JCoTable refCharTableRead) Creates context attributes from data provided in ERPprotected voidcreateInstances(String handle, de.hybris.platform.sap.productconfig.runtime.interf.external.Configuration configuration, com.sap.conn.jco.JCoTable instancesTableRead) Creates the instance tree from the instances tables read from ERPprotected de.hybris.platform.sap.productconfig.runtime.interf.external.PartOfRelationcreatePartOfRelation(com.sap.conn.jco.JCoTable instancesTableRead) Create a parent/child relationprotected voidfillImportParameters(com.sap.conn.jco.JCoParameterList importParameters, String handle) protected voidfillImportParametersRead(com.sap.conn.jco.JCoParameterList importParametersRead, List<String> configurableItems) Fill import parameters for configuration read callprotected List<de.hybris.platform.sap.productconfig.runtime.interf.external.CharacteristicValue>getCharacteristicValues(String characteristicName, List<de.hybris.platform.sap.productconfig.runtime.interf.external.CharacteristicValue> characteristicValues) Filters the characteristic value list with a given characteristic name.protected booleanisParentInitial(String parent) Does this instance ID point to an empty parent, i.e.protected StringmapObjectCategory(String objectCategory) Maps object category received from ERP into object type for external configurationvoidreadConfiguration(JCoConnection connection, SalesDocument salesDoc, List<String> configurableItems) Reads configurations from backend for all configurable items specifiedvoidsetMessageMapper(BackendMessageMapper messageMapper) protected voidtoCsticTable(de.hybris.platform.sap.productconfig.runtime.interf.model.InstanceModel instance, com.sap.conn.jco.JCoTable charExt, de.hybris.platform.sap.productconfig.runtime.interf.model.CsticModel characteristic) protected voidtoTables(de.hybris.platform.sap.productconfig.runtime.interf.model.ConfigModel configModel, com.sap.conn.jco.JCoTable instExt, com.sap.conn.jco.JCoTable charExt) protected voidtoTables(de.hybris.platform.sap.productconfig.runtime.interf.model.InstanceModel instance, String parentId, com.sap.conn.jco.JCoTable instExt, com.sap.conn.jco.JCoTable charExt) voidwriteConfiguration(JCoConnection connection, de.hybris.platform.sap.productconfig.runtime.interf.model.ConfigModel configModel, String handle, BusinessObject bo) Writes a configuration to the backend
-
Field Details
-
UPDMOD
- See Also:
-
ATAUT
- See Also:
-
HANDLE_ITEM
- See Also:
-
ATNAM
- See Also:
-
ATVAL
- See Also:
-
INSTANCE
- See Also:
-
PARENT
- See Also:
-
TABLE_IT_CHAR_EXT
- See Also:
-
TABLE_IT_INST_EXT
- See Also:
-
TABLE_MESSAGES
- See Also:
-
TABLE_UNPROCESSED
- See Also:
-
TABLE_ET_VCFG_INST
- See Also:
-
TABLE_ET_VCFG_CHAR
- See Also:
-
TABLE_TT_REFCHAR
- See Also:
-
RFC_NAME
FM for reading product configuration via LO-API: ERP_LORD_SET_VCFG_ALL- See Also:
-
RFC_NAME_READ
FM for writing product configuration via LO-API: ERP_WEC_GET_VCFG_ALL- See Also:
-
WEIGHTED_CHARACTERISTICS
Import attribute for read call- See Also:
-
-
Constructor Details
-
ProductConfigurationStrategyImpl
public ProductConfigurationStrategyImpl()
-
-
Method Details
-
writeConfiguration
public void writeConfiguration(JCoConnection connection, de.hybris.platform.sap.productconfig.runtime.interf.model.ConfigModel configModel, String handle, BusinessObject bo) Description copied from interface:ProductConfigurationStrategyWrites a configuration to the backend- Specified by:
writeConfigurationin interfaceProductConfigurationStrategy- Parameters:
connection- JCO connection to the backend
-
fillImportParameters
protected void fillImportParameters(com.sap.conn.jco.JCoParameterList importParameters, String handle) -
toTables
protected void toTables(de.hybris.platform.sap.productconfig.runtime.interf.model.ConfigModel configModel, com.sap.conn.jco.JCoTable instExt, com.sap.conn.jco.JCoTable charExt) -
toTables
protected void toTables(de.hybris.platform.sap.productconfig.runtime.interf.model.InstanceModel instance, String parentId, com.sap.conn.jco.JCoTable instExt, com.sap.conn.jco.JCoTable charExt) -
toCsticTable
protected void toCsticTable(de.hybris.platform.sap.productconfig.runtime.interf.model.InstanceModel instance, com.sap.conn.jco.JCoTable charExt, de.hybris.platform.sap.productconfig.runtime.interf.model.CsticModel characteristic) - Parameters:
instance-charExt-characteristic-
-
checkAuthorValid
-
addMessages
-
getMessageMapper
- Returns:
- the messageMapper
-
setMessageMapper
- Parameters:
messageMapper- the messageMapper to set
-
addMessagesUnprocessed
protected void addMessagesUnprocessed(BusinessObject bo, de.hybris.platform.sap.productconfig.runtime.interf.model.InstanceModel rootInstance, com.sap.conn.jco.JCoTable unprocessed) Evaluate unprocessed cstics and add message to BO if needed- Parameters:
bo- Will get the messages attachedunprocessed- Table of unprocessed cstics
-
readConfiguration
public void readConfiguration(JCoConnection connection, SalesDocument salesDoc, List<String> configurableItems) Description copied from interface:ProductConfigurationStrategyReads configurations from backend for all configurable items specified- Specified by:
readConfigurationin interfaceProductConfigurationStrategy- Parameters:
connection- JCO connection to the back endsalesDoc- Cart or orderconfigurableItems- List of configurable items, identified by their handles
-
fillImportParametersRead
protected void fillImportParametersRead(com.sap.conn.jco.JCoParameterList importParametersRead, List<String> configurableItems) Fill import parameters for configuration read call- Parameters:
importParametersRead-configurableItems-
-
createConfigModel
protected de.hybris.platform.sap.productconfig.runtime.interf.external.Configuration createConfigModel(String handle, com.sap.conn.jco.JCoTable instancesTableRead, com.sap.conn.jco.JCoTable csticsTableRead, com.sap.conn.jco.JCoTable refCharTableRead) Creates a configuration model from the JCO tables read via ERP_WEC_GET_VCFG_ALL. Filters the tables on the specified item handle- Parameters:
handle- Reference to the item we want to create the configuration forinstancesTableRead- Instances tablecsticsTableRead- Characteristics tablerefCharTableRead- Table of reference characteristics, ABAP type TDT_RFC_WEC_REFCHAR- Returns:
- Configuration
-
createInstances
protected void createInstances(String handle, de.hybris.platform.sap.productconfig.runtime.interf.external.Configuration configuration, com.sap.conn.jco.JCoTable instancesTableRead) Creates the instance tree from the instances tables read from ERP- Parameters:
handle- Key of item we want to create the instance tree forconfiguration- Configuration ModelinstancesTableRead- Instance table of type TDT_RFC_WEC_VCFG_INST
-
createCharacteristics
protected void createCharacteristics(String handle, de.hybris.platform.sap.productconfig.runtime.interf.external.Configuration configuration, com.sap.conn.jco.JCoTable csticsTableRead) Creates the characteristic value assignment for the instance specified- Parameters:
handle- Handle of item we want to attach the characters toconfiguration- External configurationcsticsTableRead- JCO table containing the characteristics, of ABAP type TDT_RFC_WEC_VCFG_CHAR
-
createConfigModels
public void createConfigModels(List<String> configurableItems, SalesDocument salesDoc, com.sap.conn.jco.JCoTable instancesTableRead, com.sap.conn.jco.JCoTable csticsTableRead, com.sap.conn.jco.JCoTable refCharTableRead) Creates the configuration models attached to the specified sales document items- Parameters:
configurableItems-salesDoc-instancesTableRead-csticsTableRead-refCharTableRead-
-
isParentInitial
Does this instance ID point to an empty parent, i.e. is no parent assigned?- Parameters:
parent-- Returns:
- No parent?
-
createPartOfRelation
protected de.hybris.platform.sap.productconfig.runtime.interf.external.PartOfRelation createPartOfRelation(com.sap.conn.jco.JCoTable instancesTableRead) Create a parent/child relation- Parameters:
instancesTableRead- JCO table reflecting the instance information passed from ERP- Returns:
- PartOf relation build from the current row of JCO table
-
mapObjectCategory
Maps object category received from ERP into object type for external configuration- Parameters:
objectCategory-- Returns:
- Object type of BOM item
-
createContextAttributes
protected void createContextAttributes(String handle, de.hybris.platform.sap.productconfig.runtime.interf.external.Configuration configuration, com.sap.conn.jco.JCoTable refCharTableRead) Creates context attributes from data provided in ERP- Parameters:
handle- Handle of sales document item we are interested inconfiguration- External representation of configurationrefCharTableRead- JCO table of context or 'reference characteristic' attributes. ABAP type TDT_RFC_WEC_REFCHAR
-
getCharacteristicValues
protected List<de.hybris.platform.sap.productconfig.runtime.interf.external.CharacteristicValue> getCharacteristicValues(String characteristicName, List<de.hybris.platform.sap.productconfig.runtime.interf.external.CharacteristicValue> characteristicValues) Filters the characteristic value list with a given characteristic name.- Parameters:
characteristicName- The characteristic we want to get the values forcharacteristicValues- Entire list of characteristics- Returns:
- Filtered list
-
addKbKey
protected void addKbKey(de.hybris.platform.sap.productconfig.runtime.interf.external.Configuration configuration, SalesDocument salesDoc) Adds date information for the current configuration- Parameters:
configuration-salesDoc-
-