Personnalisation du service HCL Commerce getEntitledPrice

Vous pouvez personnaliser le service GetEntitledPrice pour créer de nouvelles classes de commandes pour remplacer les commandes fournies.

Avant de commencer

Téléchargez le fichier CustomizeGetEntitledPrice.zip dans un emplacement temporaire de votre environnement de développement et décompressez-le. Ce fichier, qui fait partie du système Sterling Order Management, se trouve sur le site Web IBM Sterling Order Management Software.

Pourquoi et quand exécuter cette tâche

Dans cette étape, vous créez des classes de commandes pour remplacer la commande fournie, FetchEntitledPrice. FetchEntitledPrice est utilisé par le service GetEntitledPrice pour communiquer avec le moteur de tarification.

Pour personnaliser le service GetEntitledPrice :

Procédure

  1. Ouvrez HCL Commerce Developer.
  2. Ouverture de la perspective Java EE
  3. Trouvez les commandes qui doivent être remplacées.
    1. Dans la vue des serveurs, démarrez le serveur de test HCL Commerce
    2. Ouvrir http://localhost/webapp/wcs/admin/servlet/db.jsp
    3. Entrez le SQL : SELECT interfacename, nom de classe de FROM CMDREG WHERE nom de classe LIKE '%FetchEntitledPrice%';
    4. Les résultats suivants s'affichent. Les résultats affichés sont les commandes à remplacer.

      Commandes à remplacer

      Nom de l'interface Nom de classe
      'com.ibm.commerce.price.facade.server.commands.FetchEntitledPriceCmd+/EntitledPrice[(CatalogEntryIdentifier[UniqueID=] et ContractIdentifier[UniqueID=] and UnitPrice[Price[@currency=] and (Quantity= and Quantity[@uom=])])]' 'com.ibm.commerce.price.facade.server.commands.FetchEntitledPriceByContractAndCatentryIdCmdImpl'
      'com.ibm.commerce.price.facade.server.commands.FetchEntitledPriceCmd+/EntitledPrice[(CatalogEntryIdentifier[ExternalIdentifier[PartNumber=]] and ContractIdentifier[UniqueID=] and UnitPrice[Price[@currency=] and (Quantity= and Quantity[@uom=])])]' 'com.ibm.commerce.price.facade.server.commands.FetchEntitledPriceByContractAndPartNumberCmdImpl'
      'com.ibm.commerce.price.facade.server.commands.FetchEntitledPriceCmd+/EntitledPrice[(CatalogEntryIdentifier[UniqueID=] and UnitPrice[Price[@currency=] and (Quantity= and Quantity[@uom=])])]' 'com.ibm.commerce.price.facade.server.commands.FetchEntitledPriceByCatentryIdCmdImpl'
      'com.ibm.commerce.price.facade.server.commands.FetchEntitledPriceCmd+/EntitledPrice[(CatalogEntryIdentifier[ExternalIdentifier[PartNumber=]] and UnitPrice[Price[@currency=] and (Quantity= and Quantity[@uom=])])]' 'com.ibm.commerce.price.facade.server.commands.FetchEntitledPriceByPartNumberCmdImpl'
  4. Définissez les nouvelles commandes.

    Nom de l'interface Nom de classe
    'com.ibm.commerce.price.facade.server.commands.FetchEntitledPriceCmd+/EntitledPrice[(CatalogEntryIdentifier[UniqueID=] and ContractIdentifier[UniqueID=] and UnitPrice[Price[@currency=] and (Quantity= and Quantity[@uom=])] and VP=)]' 'com.mycompany.commerce.price.facade.server.commands. ExtFetchEntitledPriceByContractAndCatentryIdCmdImpl'
    'com.ibm.commerce.price.facade.server.commands.FetchEntitledPriceCmd+/EntitledPrice[(CatalogEntryIdentifier[ExternalIdentifier[PartNumber=]] and ContractIdentifier[UniqueID=] and UnitPrice[Price[@currency=] and (Quantity= and Quantity[@uom=])] and VP=)]' 'com.mycompany.commerce.price.facade.server.commands. ExtFetchEntitledPriceByContractAndPartNumberCmdImpl'
    'com.ibm.commerce.price.facade.server.commands.FetchEntitledPriceCmd+/EntitledPrice[(CatalogEntryIdentifier[UniqueID=] and UnitPrice[Price[@currency=] and (Quantity= and Quantity[@uom=])] and VP=)]' 'com.mycompany.commerce.price.facade.server.commands. ExtFetchEntitledPriceByCatentryIdCmdImpl'
    'com.ibm.commerce.price.facade.server.commands.FetchEntitledPriceCmd+/EntitledPrice[(CatalogEntryIdentifier[ExternalIdentifier[PartNumber=]] and UnitPrice[Price[@currency=] and (Quantity= and Quantity[@uom=])] and VP=)]' 'com.mycompany.commerce.price.facade.server.commands. ExtFetchEntitledPriceByPartNumberCmdImpl'
  5. Développez le projet WebSphereCommerceServerExtensionsLogic sous src. Créer un package et le nommer com.mycompany.commerce.price.facade.server.commands.
  6. Importer le code source.
    1. Cliquez avec le bouton droit de la souris sur le module com.mycompany.commerce.price.facade.server.commands.
    2. Cliquez sur Importer>Général>Système de fichiers>Suivant.
    3. Accédez à l'emplacement temporaire où vous avez décompressé CustomizeGetEntitledPrice.zip et accédez au sous-répertoire WebSphereCommerceServerExtensionsLogic\src\com\mycompany\commerce\price\facade\server\commands.
    4. Choisissez tous les fichiers et cliquez sur Terminer. Cliquez sur Oui pour tout pour remplacer les fichiers existants.
  7. Organisez les importations pour le projet WebSphereCommerceServerExtensionsLogic.
    1. Ouvrez la perspective Java dans HCL Commerce Developer.
    2. Développez le projet WebSphereCommerceServerExtensionsLogc, cliquez à droite sur src.
    3. Cliquez sur Source>Organiser les importations.
  8. Ajoutez de nouvelles configurations pour prendre en charge le nouveau paramètre de point de valeur. Les configurations pour prendre en charge le nouveau paramètre sont requises lorsque l'utilisateur utilise OR pour combiner plusieurs conditions dans une seule demande.
    1. Accédez à WC>xml>config.
    2. À l'aide du bouton droit de la souris, cliquez sur le dossier config. Cliquez sur Nouveau>Dossier. Créer un dossier nommé com.ibm.commerce.price-ext.
    3. Cliquez avec le bouton droit sur com.ibm.commerce.price-ext. Cliquez sur Nouveau>Fichier. Créer un nouveau fichier nommé wc-component.xml.
    4. Copiez et collez le contenu suivant dans wc-component.xml :
      <?xml version="1.0" encoding="UTF-8"?>
      
      <_config:DevelopmentComponentConfiguration
      				xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      				xsi:schemaLocation="http://www.ibm.com/xmlns/prod/commerce/founda
      tion/config ../xsd/wc-component.xsd "
      			xmlns:_config="http://www.ibm.com/xmlns/prod/commerce/foundation/
      config">
      
      				<_config:valuemappingservice>
      							<_config:valuemapping externalName="XPathKey"
      										internalName="XPathKey">
      
      										<_config:valuemap
      
      				externalValue="/EntitledPrice\[\(CatalogEntryIdentifier\[External
      Identifier\[PartNumber=\]\] and \(Quantity= and Quantity\[@uom=\]\]\]
      and VP+\) ( or
      \(CatalogEntryIdentifier\[ExternalIdentifier\{PartNumber+\]\] and
      ContractIdentifier\[UniqueID=\] and UnitPrice\[Price\[@currency+\] and
      \(Quantity= and Quantity\[@uom=\]\)\] and VP+\))*\]"
      
      				internalValue="/EntitledPrice[ (CatalogEntryIdentifier[ExternalIde
      ntifier{PartNumber=]] and ContractIdentifier[UniqueID=] and
      UnitPrice[Price[@currency=} and (Quantity= and Quantity{@uom=])] and
      VP+)]" />
      
      									<_config:valuemap
      
      				externalValue="/EntitledPrice\[\(CatalogEntryIdentifier\[External
      Identifier\[PartNumber=\]\] and ContractIdentifier\[UniqueID=\] and
      PricingDate= and UnitPrice\[Price\[@currency=\] and \(Quantity= and
      Quantity\[@uom=\]\)\] and VP=\) ( or
      \(CatalogEntryIdentifier\[ExternalIdentifier\[PartNumber=\]\] and
      ContractIdentifier\[UniqueID+\] and PricingDate= and
      UnitPrice\(Price\[@currency=\] and \(Quantity= and Quantity\[@uom=\]\)\]
      and VP=\))*\]"
      
      				internalValue="/EntitledPrice[(CatalogEntryIdentifier[ExternalIde
      ntifier[PartNumber=]] and ContractIdentifier(UniqueID=] and
      UnitPrice[Price[@currency=} and (Quantity= and Quantity[@uom=])] and
      VP=)]" />
      
      								<_config:valuemap
      
      				externalValue="/EntitledPrice\[\(CatalogEntryIdentifier\[UniqueID
      =\] and ContractIdentifier\[UniqueID=\] and
      UnitPrice\[Price\[@currency=\] and \(Quantity= and Quantity\[@uom=\]\)\]
      and VP-\)(or \(CatalogEntryIdentifier\[UniqueID=\] and
      (Quantity= and Quantity[@uom=])] and VP=\))*\]"
      
      				internalValue="/EntitledPrice[(CatalogEntryIdentifier[UniqueID=] 
      and ContractIdentifier[UniqueID=] and UnitPrice[Price[@currency=} and
      (Quantity= and Quantity[@uom=])] and VP=)]" />
      
      								<_config:valuemap
      
      				externalValue="/EntitledPrice\[\(CatalogEntryIdentifier\[UniqueID
      =\] and ContractIdentifier\[UniqueID=\] and PricingDate= and
      UnitPrice\[Price\{@currency=\] and \(Quantity= and Quantity\[@uom=\]\)\]
      and VP=\)( or \(CatalogEntryIdentifier\{UniqueID=\} and
      ContractIdentifier\[UniqueID=\] and PricingDate= and
      UnitPrice\[Price\[@currency=\] and \(Quantity= and Quantity\[@uom=\]\)\]
      and VP=\))*\]"
      
      				internalValue="/EntitledPrice[(CatalogEntryIdentifier[UniqueID=]
      and ContractIdentifier[UniqueID=] and UnitPrice[Price[@currency=] and
      (Quantity= and Quantity[@uom=])] and VP=)]" />
      
      							<_config:valuemap
      
      				externalValue="/EntitledPrice\[\(CatalogEntryIdentifier\[UniqueID
      =\} and UnitPrice\[Price\[@currency=\] and \(Quantity= and
      Quantity\[@uom=\]\)\] and VP=\) ( or
      \(CatalogEntryIdentifier\[UniqueID=\] and UnitPrice\[Price\[@currency=\]
      and \(Quantity= and Quantity\[@uom=\]\)]\] and VP=\))*\]"
      
      				internalValue="/EntitledPrice[(CatalogEntryIdentifier[UniqueID=]
      and UnitPrice[Price[@currency=] and (Quantity= and Quantity[@uom=])]
      and VP=)]" />
      
      							<_config:valuemap
      
      				externalValue="/EntitledPrice\[\(CatalogEntryIdentifier\[UniqueID
      =\] and PricingDate= and UnitPrice\[Price\[@currency=\] and \(Quantity=
      and Quantity/[@uom=\]\)\] and VP=\)( or
      \(CatalogEntryIdentifier\[UniqueID=\] and PricingDate= and
      UnitPrice\[Price\[@currency=\] and \(Quantity= and Quantity\[@uom=\]\)\]
      and VP=\))*)]"
      
      				internalValue="/EntitledPrice[(CatalogEntryIdentifier[UniqueID=]
      and UnitPrice[Price[@currency=] and (Quantity= and Quantity[@uom=])]
      and VP=)]" />
      
      							<_config:valuemap
      
      				externalValue="/EntitledPrice\[\(CatalogEntryIdentifier\[UniqueID
      =\] and UnitPrice\[Price\[@currency=\]\] and VP=\)( or
      \(CatalogEntryIdentifier\[UniqueID=\] and
      UnitPrice\[Price\[@currency=\]\] and VP=/))*\]"
      
      				internalValue="/EntitledPrice[(CatalogEntryIdentifier[UniqueID=]
      and UnitPrice[Price[@currency=]] and VP=)]" />
      
      							<_config:valuemap
      
      				externalValue="/EntitledPrice\[\(CatalogEntryIdentifier\[UniqueID
      =\] and PricingDate= and UnitPrice\[Price\[@currency=\]\] and VP=\)( or
      \(CatalogEntryIdentifier\[UniqueID=\] and PricingDate= and
      UnitPrice\[Price\[@currency=\]\] and VP=\))*\]"
      
      				internalValue="/EntitledPrice[(CatalogEntryIdentifier[UniqueID=]
      and UnitPrice[Price[@currency=]] and VP=)]" />
      
      							<_config:valuemap
      
      				externalValue="/EntitledPrice\]\(CatalogEntryIdentifier\[External
      Identifier\[PartNumber=\]\] and UnitPrice\[Price\[@currency=\] and
      \(quantity= and Quantity\[@uom=\]\)\] and VP=\)( or
      \(CatalogEntryIdentifier\[ExternalIdentifier\[PartNumber=\]\] and
      UnitPrice\[Price\[@currency=\] and \(Quantity= and Quantity\[@uom=\])\]
      and VP=\))*\]"
      
      				internalValue="/EntitledPrice[(CatalogEntryIdentifier[ExternalIde
      ntifier[PartNumber=]] and UnitPrice[Price[@currency=] and (Quantity=
      and Quantity[@uom=])] and VP=)]" />
      
      							<_config:valuemap
      
      				externalValue="/EntitledPrice\[\(CatalogEntryIdentifier\[External
      Identifier\[PartNumber=\]\] and \(Quantity= and Quantity\[@uom=\]\)\]
      and VP=\)( or
      \(CatalogEntryIdentifier\[ExternalIdentifier\[PartNumber=\]\] and
      PricingDate= and UnitPrice\[Price\[@currency=\] and \(Quantity= and
      Quantity\[@uom=\]\)\] and VP=\))*\]"
      
      				internalValue-"/EntitledPrice[(CatalogEntryIdentifier[ExternalIde
      ntifier[PartNumber=]] and UnitPrice[Price[@currency=] and (Quantity=
      and Quantity[@uom=])] and VP=)]" />	
      
      							<_config:valuemap
      
      				externalValue="/EntitledPrice\[\(CatalogEntryIdentifier\[External
      Identifier\[PartNumber=\]\] and UnitPrice\(Price\[@currency=\]\] and
      VP=\)( or\(CatalogEntryIdentifier\[ExternalIdentifier\[PartNumber=\]\]
      and UnitPrice\[Price\[@currency=\]\] and VP=\)*\]" 
      
      				internalValue="/EntitledPrice[(CatalogEntryIdentifier[ExternalIde
      ntifier[PartNumber=]] and UnitPrice[Price[@currency=]] and VP=)]" />
      
      							<_config:valuemap
      
      				externalValue="/EntitledPrice\]\(CatalogEntryIdentifier\[External
      Identifier\[PartNumber=\]\] and PricingDate= and
      UnitPrice\[Price\\[@currency=\]\] and VP=\)(or
      \(CatalogEntryIdentifier\[ExternalIdentifier\[PartNumber=\]\] and
      PricingDate= and UnitPrice\[Price\[@currency=\]\] and VP=\))*\]"
      
      				internalValue="/EntitledPrice[(CatalogEntryIdentifier[ExternalIde
      ntifier[PartNumber=]] and UnitPrice[Price[@currency=]] and VP=)]" />
      
      						</_config:valuemapping>
      				</_config:valuemappingservice>
      </_config:DevelopmentComponentConfiguration>