Class ProductConfigurationStrategyImpl

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static java.lang.String ATAUT  
      protected static java.lang.String ATNAM  
      protected static java.lang.String ATVAL  
      protected static java.lang.String HANDLE_ITEM  
      protected static java.lang.String INSTANCE  
      protected static java.lang.String PARENT  
      static java.lang.String RFC_NAME
      FM for reading product configuration via LO-API: ERP_LORD_SET_VCFG_ALL
      static java.lang.String RFC_NAME_READ
      FM for writing product configuration via LO-API: ERP_WEC_GET_VCFG_ALL
      protected static java.lang.String TABLE_ET_VCFG_CHAR  
      protected static java.lang.String TABLE_ET_VCFG_INST  
      protected static java.lang.String TABLE_IT_CHAR_EXT  
      protected static java.lang.String TABLE_IT_INST_EXT  
      protected static java.lang.String TABLE_MESSAGES  
      protected static java.lang.String TABLE_TT_REFCHAR  
      protected static java.lang.String TABLE_UNPROCESSED  
      protected static java.lang.String UPDMOD  
      static java.lang.String WEIGHTED_CHARACTERISTICS
      Import attribute for read call
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void addKbKey​(Configuration configuration, SalesDocument salesDoc)
      Adds date information for the current configuration
      protected void addMessages​(BusinessObject cart, com.sap.conn.jco.JCoTable messages)  
      protected void addMessagesUnprocessed​(BusinessObject bo, InstanceModel rootInstance, com.sap.conn.jco.JCoTable unprocessed)
      Evaluate unprocessed cstics and add message to BO if needed
      protected boolean checkAuthorValid​(java.lang.String author)  
      protected void createCharacteristics​(java.lang.String handle, Configuration configuration, com.sap.conn.jco.JCoTable csticsTableRead)
      Creates the characteristic value assignment for the instance specified
      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.
      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
      protected void createContextAttributes​(java.lang.String handle, Configuration configuration, com.sap.conn.jco.JCoTable refCharTableRead)
      Creates context attributes from data provided in ERP
      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
      protected PartOfRelation createPartOfRelation​(com.sap.conn.jco.JCoTable instancesTableRead)
      Create a parent/child relation
      protected void fillImportParameters​(com.sap.conn.jco.JCoParameterList importParameters, java.lang.String handle)  
      protected void fillImportParametersRead​(com.sap.conn.jco.JCoParameterList importParametersRead, java.util.List<java.lang.String> configurableItems)
      Fill import parameters for configuration read call
      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.
      BackendMessageMapper getMessageMapper()  
      protected boolean isParentInitial​(java.lang.String parent)
      Does this instance ID point to an empty parent, i.e.
      protected java.lang.String mapObjectCategory​(java.lang.String objectCategory)
      Maps object category received from ERP into object type for external configuration
      void readConfiguration​(JCoConnection connection, SalesDocument salesDoc, java.util.List<java.lang.String> configurableItems)
      Reads configurations from backend for all configurable items specified
      void setMessageMapper​(BackendMessageMapper messageMapper)  
      protected void toCsticTable​(InstanceModel instance, com.sap.conn.jco.JCoTable charExt, CsticModel characteristic)  
      protected void toTables​(ConfigModel configModel, com.sap.conn.jco.JCoTable instExt, com.sap.conn.jco.JCoTable charExt)  
      protected void toTables​(InstanceModel instance, java.lang.String parentId, com.sap.conn.jco.JCoTable instExt, com.sap.conn.jco.JCoTable charExt)  
      void writeConfiguration​(JCoConnection connection, ConfigModel configModel, java.lang.String handle, BusinessObject bo)
      Writes a configuration to the backend
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ProductConfigurationStrategyImpl

        public ProductConfigurationStrategyImpl()
    • Method Detail

      • 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)
      • 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 attached
        unprocessed - Table of unprocessed cstics
      • readConfiguration

        public void readConfiguration​(JCoConnection connection,
                                      SalesDocument salesDoc,
                                      java.util.List<java.lang.String> configurableItems)
        Description copied from interface: ProductConfigurationStrategy
        Reads configurations from backend for all configurable items specified
        Specified by:
        readConfiguration in interface ProductConfigurationStrategy
        Parameters:
        connection - JCO connection to the back end
        salesDoc - Cart or order
        configurableItems - 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 for
        instancesTableRead - Instances table
        csticsTableRead - Characteristics table
        refCharTableRead - 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 for
        configuration - Configuration Model
        instancesTableRead - 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 to
        configuration - External configuration
        csticsTableRead - 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 in
        configuration - External representation of configuration
        refCharTableRead - 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 for
        characteristicValues - 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 -