Personalizar el servicio de HCL Commerce getEntitledPrice

Puede personalizar el servicio GetEntitledPrice para crear nuevas clases de mandatos para anular los mandatos proporcionados.

Antes de empezar

Descargue el archivo CustomizeGetEntitledPrice.zip en una ubicación temporal del entorno de desarrollo y descomprímalo. Este archivo, que es una parte del sistema de gestión de pedidos de Sterling, se encuentra en el sitio web de IBM Sterling Order Management Software .

Por qué y cuándo se efectúa esta tarea

En este paso, creará clases de mandatos para anular el mandato proporcionado, FetchEntitledPrice. El servicio GetEntitledPrice usa FetchEntitledPrice para comunicarse con el motor de fijación de precios.

Para personalizar el servicio GetEntitledPrice:

Procedimiento

  1. Abra el desarrollador de HCL Commerce.
  2. Abra la perspectiva EE de Java.
  3. Busque los mandatos que quiera sustituir.
    1. Inicie el servidor de prueba de HCL Commerce desde la vista de servidores.
    2. Abra http://localhost/webapp/wcs/admin/servlet/db.jsp
    3. Especifique el SQL: SELECCIONE InterfaceName, classname DE CMDREG DONDE classname LIKE '%FetchEntitledPrice%';
    4. Se muestran los siguientes resultados. Los resultados que se muestran son los mandatos que se van a anular.

      Mandatos que se van a anular

      Interface nombre Nombre de la clase
      'com.ibm.commerce.price.facade.server.commands.FetchEntitledPriceCmd+/EntitledPrice[(CatalogEntryIdentifier[UniqueID=] y ContractIdentifier[UniqueID=] y UnitPrice[Price[@currency=] y (Quantity= and Quantity[@uom=])])]' 'com.ibm.commerce.price.facade.server.commands.FetchEntitledPriceByContractAndCatentryIdCmdImpl'
      'com.ibm.commerce.price.facade.server.commands.FetchEntitledPriceCmd+/EntitledPrice[(CatalogEntryIdentifier[ExternalIdentifier[PartNumber=]] y ContractIdentifier[UniqueID=] y UnitPrice[Price[@currency=] y (Quantity= and Quantity[@uom=])])]' 'com.ibm.commerce.price.facade.server.commands.FetchEntitledPriceByContractAndPartNumberCmdImpl'
      'com.ibm.commerce.price.facade.server.commands.FetchEntitledPriceCmd+/EntitledPrice[(CatalogEntryIdentifier[UniqueID=] y UnitPrice[Price[@currency=] y (Quantity= and Quantity[@uom=])])]' 'com.ibm.commerce.price.facade.server.commands.FetchEntitledPriceByCatentryIdCmdImpl'
      'com.ibm.commerce.price.facade.server.commands.FetchEntitledPriceCmd+/EntitledPrice[(CatalogEntryIdentifier[ExternalIdentifier[PartNumber=]] y UnitPrice[Price[@currency=] y (Quantity= y Quantity[@uom=])])]' 'com.ibm.commerce.price.facade.server.commands.FetchEntitledPriceByPartNumberCmdImpl'
  4. Defina los nuevos mandatos.

    Interface nombre Nombre de la clase
    '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=]] y ContractIdentifier[UniqueID=] y UnitPrice[Price[@currency=] y (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=] y UnitPrice[Price[@currency=] y (Quantity= and Quantity[@uom=])] y VP=)]' 'com.mycompany.commerce.price.facade.server.commands. ExtFetchEntitledPriceByCatentryIdCmdImpl'
    'com.ibm.commerce.price.facade.server.commands.FetchEntitledPriceCmd+/EntitledPrice[(CatalogEntryIdentifier[ExternalIdentifier[PartNumber=]] y UnitPrice[Price[@currency=] y (Quantity= and Quantity[@uom=])] y VP=)]' 'com.mycompany.commerce.price.facade.server.commands. ExtFetchEntitledPriceByPartNumberCmdImpl'
  5. Expanda el proyecto WebSphereCommerceServerExtensionsLogic bajo src. Cree un paquete y asígnele un nombre com.mycompany.commerce.price.facade.server.commands.
  6. Importe el código fuente.
    1. Pulse el botón derecho del ratón en el paquete com.mycompany.commerce.price.facade.server.commands.
    2. Pulse Importar>General>Sistema de archivos>Siguiente.
    3. Vaya a la ubicación temporal donde ha descomprimido CustomizeGetEntitledPrice.zip y vaya al subdirectorio WebSphereCommerceServerExtensionsLogic\src\com\mycompany\commerce\price\facade\server\commands.
    4. Seleccione todos los archivos y pulse Finalizar. Pulse Sí a todos para sobrescribir los archivos existentes.
  7. Organice las importaciones del proyecto WebSphereCommerceServerExtensionsLogic:
    1. Abra la perspectiva Java en HCL Commerce Developer.
    2. Expanda el proyecto WebSphereCommerceServerExtensionsLogic y pulse src con el botón derecho del ratón.
    3. Pulse Origen>Organizar importaciones.
  8. Añada nuevas configuraciones para dar soporte al nuevo parámetro de punto de valor. Las configuraciones para dar soporte al nuevo parámetro son necesarias cuando el usuario utiliza O para combinar varias condiciones en una solicitud.
    1. Vaya a WC>xml>config.
    2. Con el botón derecho del ratón, pulse la carpeta config. Pulse Nuevo>Carpeta. Cree una carpeta con el nombre com.ibm.commerce.price-ext.
    3. Pulse com.ibm.commerce.price-ext con el botón derecho del ratón. Pulse Nuevo>Archivo. Cree un archivo nuevo con el nombre wc-component.xml.
    4. Copie y pegue el siguiente contenido siguiente en 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>