Tutorials > Program model > Web services > Customize Web services and WebSphere Portal to support a new search

< Previous | Next >


Register the new command

This section explains how to register the new command.

The XPath interfacename for the FetchCatalogEntryByPriceRangeTaskCmdImpl2 is...

'com.ibm.commerce.catalog.facade.server.commands.FetchCatalogEntryCmd+/CatalogEntry[Description[Attributes[published=]] and Price[StandardPrice[Price[(Price[@criteria=]

and Price >=) and (Price[@criteria=] and Price
<= ) ]]]]'

The first section references the name of the fetch command which in this case is:

com.ibm.commerce.catalog.facade.server.commands.FetchCatalogEntryCmd

The second part references an XPath key based on the catalog sub-system logical model. In the second part there are attributes, in this case price and criteria, which can hold values. The values are not stored in this XPath key because this key is generic to any value. When the client library API receives an XPath formatted in this way, there is logic to interpret which fetch command to call, and where to place the values for the corresponding attributes in the XPath key.

The other important column in the CMDREG table is the classname column. This column holds the name of the actual class to call when the WebSphere Commerce Server receives an XPath key as defined in the interface name column. For this sample, the classname is :

com.mycompany.commerce.customization.catalog.FetchCatalogEntryByPriceRangeTaskCmdImpl2

To register this new command, do the following steps:


Procedure

  1. Open a database window:

    1. For WebSphere Commerce Developer:

      1. Browse to WCDE_INSTALL directory.

      2. Open the hints and tips file.

      3. Find the link named Database Access

    2. On a WebSphere Commerce production server, consult your DB2 or Oracle documentation.

  2. Register the command.

    insert into cmdreg values (0, 
    'com.ibm.commerce.catalog.facade.server.commands.FetchCatalogEntryCmd+/CatalogEntry[Description[Attributes[published=]] 
    and Price[StandardPrice[Price[(Price<= and Price[@criteria=]) and (Price>= and Price[@criteria=])]]]]',NULL, 
    'com.mycompany.commerce.catalog.FetchCatalogEntryByPriceRangeTaskCmdImpl2','versionCheck=false' ,NULL,'Local',1); 
    

  3. If it is already started, restart the server.


Related concepts

Nouns

< Previous | Next >


+

Search Tips   |   Advanced Search