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 java.lang.Object implements ProductConfigurationStrategy
Handles the exchange of product configuration data between RFC / LO-API and BOL
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.StringATAUTprotected static java.lang.StringATNAMprotected static java.lang.StringATVALprotected static java.lang.StringHANDLE_ITEMprotected static java.lang.StringINSTANCEprotected static java.lang.StringPARENTstatic java.lang.StringRFC_NAMEFM for reading product configuration via LO-API: ERP_LORD_SET_VCFG_ALLstatic java.lang.StringRFC_NAME_READFM for writing product configuration via LO-API: ERP_WEC_GET_VCFG_ALLprotected static java.lang.StringTABLE_ET_VCFG_CHARprotected static java.lang.StringTABLE_ET_VCFG_INSTprotected static java.lang.StringTABLE_IT_CHAR_EXTprotected static java.lang.StringTABLE_IT_INST_EXTprotected static java.lang.StringTABLE_MESSAGESprotected static java.lang.StringTABLE_TT_REFCHARprotected static java.lang.StringTABLE_UNPROCESSEDprotected static java.lang.StringUPDMODstatic java.lang.StringWEIGHTED_CHARACTERISTICSImport attribute for read call
-
Constructor Summary
Constructors Constructor Description ProductConfigurationStrategyImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddKbKey(Configuration configuration, SalesDocument salesDoc)Adds date information for the current configurationprotected voidaddMessages(BusinessObject cart, com.sap.conn.jco.JCoTable messages)protected voidaddMessagesUnprocessed(BusinessObject bo, InstanceModel rootInstance, com.sap.conn.jco.JCoTable unprocessed)Evaluate unprocessed cstics and add message to BO if neededprotected booleancheckAuthorValid(java.lang.String author)protected voidcreateCharacteristics(java.lang.String handle, Configuration configuration, com.sap.conn.jco.JCoTable csticsTableRead)Creates the characteristic value assignment for the instance specifiedprotected ConfigurationcreateConfigModel(java.lang.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(java.util.List<java.lang.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(java.lang.String handle, Configuration configuration, com.sap.conn.jco.JCoTable refCharTableRead)Creates context attributes from data provided in ERPprotected voidcreateInstances(java.lang.String handle, Configuration configuration, com.sap.conn.jco.JCoTable instancesTableRead)Creates the instance tree from the instances tables read from ERPprotected PartOfRelationcreatePartOfRelation(com.sap.conn.jco.JCoTable instancesTableRead)Create a parent/child relationprotected voidfillImportParameters(com.sap.conn.jco.JCoParameterList importParameters, java.lang.String handle)protected voidfillImportParametersRead(com.sap.conn.jco.JCoParameterList importParametersRead, java.util.List<java.lang.String> configurableItems)Fill import parameters for configuration read callprotected java.util.List<CharacteristicValue>getCharacteristicValues(java.lang.String characteristicName, java.util.List<CharacteristicValue> characteristicValues)Filters the characteristic value list with a given characteristic name.BackendMessageMappergetMessageMapper()protected booleanisParentInitial(java.lang.String parent)Does this instance ID point to an empty parent, i.e.protected java.lang.StringmapObjectCategory(java.lang.String objectCategory)Maps object category received from ERP into object type for external configurationvoidreadConfiguration(JCoConnection connection, SalesDocument salesDoc, java.util.List<java.lang.String> configurableItems)Reads configurations from backend for all configurable items specifiedvoidsetMessageMapper(BackendMessageMapper messageMapper)protected voidtoCsticTable(InstanceModel instance, com.sap.conn.jco.JCoTable charExt, CsticModel characteristic)protected voidtoTables(ConfigModel configModel, com.sap.conn.jco.JCoTable instExt, com.sap.conn.jco.JCoTable charExt)protected voidtoTables(InstanceModel instance, java.lang.String parentId, com.sap.conn.jco.JCoTable instExt, com.sap.conn.jco.JCoTable charExt)voidwriteConfiguration(JCoConnection connection, ConfigModel configModel, java.lang.String handle, BusinessObject bo)Writes a configuration to the backend
-
-
-
Field Detail
-
UPDMOD
protected static final java.lang.String UPDMOD
- See Also:
- Constant Field Values
-
ATAUT
protected static final java.lang.String ATAUT
- See Also:
- Constant Field Values
-
HANDLE_ITEM
protected static final java.lang.String HANDLE_ITEM
- See Also:
- Constant Field Values
-
ATNAM
protected static final java.lang.String ATNAM
- See Also:
- Constant Field Values
-
ATVAL
protected static final java.lang.String ATVAL
- See Also:
- Constant Field Values
-
INSTANCE
protected static final java.lang.String INSTANCE
- See Also:
- Constant Field Values
-
PARENT
protected static final java.lang.String PARENT
- See Also:
- Constant Field Values
-
TABLE_IT_CHAR_EXT
protected static final java.lang.String TABLE_IT_CHAR_EXT
- See Also:
- Constant Field Values
-
TABLE_IT_INST_EXT
protected static final java.lang.String TABLE_IT_INST_EXT
- See Also:
- Constant Field Values
-
TABLE_MESSAGES
protected static final java.lang.String TABLE_MESSAGES
- See Also:
- Constant Field Values
-
TABLE_UNPROCESSED
protected static final java.lang.String TABLE_UNPROCESSED
- See Also:
- Constant Field Values
-
TABLE_ET_VCFG_INST
protected static final java.lang.String TABLE_ET_VCFG_INST
- See Also:
- Constant Field Values
-
TABLE_ET_VCFG_CHAR
protected static final java.lang.String TABLE_ET_VCFG_CHAR
- See Also:
- Constant Field Values
-
TABLE_TT_REFCHAR
protected static final java.lang.String TABLE_TT_REFCHAR
- See Also:
- Constant Field Values
-
RFC_NAME
public static final java.lang.String RFC_NAME
FM for reading product configuration via LO-API: ERP_LORD_SET_VCFG_ALL- See Also:
- Constant Field Values
-
RFC_NAME_READ
public static final java.lang.String RFC_NAME_READ
FM for writing product configuration via LO-API: ERP_WEC_GET_VCFG_ALL- See Also:
- Constant Field Values
-
WEIGHTED_CHARACTERISTICS
public static final java.lang.String WEIGHTED_CHARACTERISTICS
Import attribute for read call- See Also:
- Constant Field Values
-
-
Method Detail
-
writeConfiguration
public void writeConfiguration(JCoConnection connection, ConfigModel configModel, java.lang.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, java.lang.String handle)
-
toTables
protected void toTables(ConfigModel configModel, com.sap.conn.jco.JCoTable instExt, com.sap.conn.jco.JCoTable charExt)
-
toTables
protected void toTables(InstanceModel instance, java.lang.String parentId, com.sap.conn.jco.JCoTable instExt, com.sap.conn.jco.JCoTable charExt)
-
toCsticTable
protected void toCsticTable(InstanceModel instance, com.sap.conn.jco.JCoTable charExt, CsticModel characteristic)
- Parameters:
instance-charExt-characteristic-
-
checkAuthorValid
protected boolean checkAuthorValid(java.lang.String author)
-
addMessages
protected void addMessages(BusinessObject cart, com.sap.conn.jco.JCoTable messages)
-
getMessageMapper
public BackendMessageMapper getMessageMapper()
- Returns:
- the messageMapper
-
setMessageMapper
public void setMessageMapper(BackendMessageMapper messageMapper)
- Parameters:
messageMapper- the messageMapper to set
-
addMessagesUnprocessed
protected void addMessagesUnprocessed(BusinessObject bo, 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, java.util.List<java.lang.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, java.util.List<java.lang.String> configurableItems)Fill import parameters for configuration read call- Parameters:
importParametersRead-configurableItems-
-
createConfigModel
protected Configuration createConfigModel(java.lang.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(java.lang.String handle, 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(java.lang.String handle, 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(java.util.List<java.lang.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
protected boolean isParentInitial(java.lang.String parent)
Does this instance ID point to an empty parent, i.e. is no parent assigned?- Parameters:
parent-- Returns:
- No parent?
-
createPartOfRelation
protected 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
protected java.lang.String mapObjectCategory(java.lang.String objectCategory)
Maps object category received from ERP into object type for external configuration- Parameters:
objectCategory-- Returns:
- Object type of BOM item
-
createContextAttributes
protected void createContextAttributes(java.lang.String handle, 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 java.util.List<CharacteristicValue> getCharacteristicValues(java.lang.String characteristicName, java.util.List<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(Configuration configuration, SalesDocument salesDoc)
Adds date information for the current configuration- Parameters:
configuration-salesDoc-
-
-