Creating a search expression

Creating a new search expression highlights the customization benefits of the BOD programming model - no Java code changes are required.

About this task

The search is defined using XPath expressions and query templates in the Data Service Layer. The client of the Web service can then call the service using the new XPath expression, and new SQL is called in the persistence layer.

To create a new search expression in your service:

Procedure

  1. Define the XPath expression to represent the search expression query.
    Note: When you use the XPath language, the XPath should match the logical schema of the response Noun.

    See HCL Commerce extended XPath notation for a list of sample XPath expressions.

    Tip:
    • Optional items enclosed in square brackets. For example, ['<PredicateExpr']
    • Items repeating 0 or more times are suffixed with an asterisk.
    • Items repeating 1 or more times are followed by a '+'
    • Alternative choices in a production are separated by the ‘|' symbol. For example, <Alternative A>|<Alternative B>.
    • Where items need to be grouped they are enclosed in simple parenthesis ().
  2. Map the XPath expression to the SQL required.