com.ibm.commerce.foundation.client.util.oagis

Class SelectionCriteriaHelper

  • java.lang.Object
    • com.ibm.commerce.foundation.client.util.oagis.SelectionCriteriaHelper


  • public class SelectionCriteriaHelper
    extends java.lang.Object

    This class helps to build the OAGIS GET verb selection criteria expression. A GET selection criteria expression consists of an XPath expression and a series of control parameters that provide additional information.

    For example, consider the following selection criteria expression: {_wcf.ap=IBM_Admin_Details;_wcf.dataLanguageIds='-1,-2'}/CatalogEntry[CatalogEntryIdentifier[(UniqueID=10001)]]

    This expression contains:

    • XPath expression: /CatalogEntry[CatalogEntryIdentifier[(UniqueID=10001)]]
    • Access profile control parameter: _wcf.ap=IBM_Admin_Details
    • Data language Id control parameter: _wcf.dataLanguageIds='-1,-2'

    To create the above expression using the SelectionCriteriaHelper: SelectionCriteriaHelper selectionCriteriaHelper = new SelectionCriteriaHelper("/CatalogEntry[CatalogEntryIdentifier[(UniqueID=10001)]]"); selectionCriteriaHelper.addAccessProfile("IBM_Admin_Details"); selectionCriteriaHelper.setDataLanguageIds("-1,-2"); ExpressionType queryExpression = selectionCriteriaHelper.getSelectionCriteriaExpression();

    Use the addNameValuePair(RelationalExpression) method to add additional control parameters.

    • Constructor Summary

      Constructors 
      Constructor and Description
      SelectionCriteriaHelper(java.lang.String astrXPath)
      Initializes a newly created SelectionCriteriaHelper.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void addAccessProfile(java.lang.String astrAccessProfile)
      Add an access profile to the extended query expression.
      void addNameValuePair(RelationalExpression aNVP)
      Add a name-value pair to the extended query expression.
      java.lang.StringBuffer appendThisToString(java.lang.StringBuffer asbBuffer, int additionalCapacity)
      Append the String object that represents this class to the specified buffer.
      ExpressionType getSelectionCriteriaExpression()
      Returns an OAGIS selection criteria expression.
      java.lang.String getXPath()
      Get the XPath expression
      void setDataLanguageIds(java.lang.String astrDataLanguageIds)
      Set data language identifiers to the extended query expression.
      void setSearchProfile(java.lang.String astrSearchProfile)
      Add a search profile to the extended query expression.
      void setUsage(java.lang.String astrUsage)
      Add an usage to the extended query expression.
      void setXPath(java.lang.String path)
      Set the XPath expression
      java.lang.String toString()
      Returns the String object that represents this class.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        IBM Copyright notice field.
        See Also:
        Constant Field Values
      • STR_XPATH_LANG

        public static final java.lang.String STR_XPATH_LANG
        XPath language
        See Also:
        Constant Field Values
      • STR_ACCESS_PROFILE_PARAMETER

        public static final java.lang.String STR_ACCESS_PROFILE_PARAMETER
        Name of the access profile NVP
        See Also:
        Constant Field Values
      • STR_DATA_LANG_IDS_PARAMETER

        public static final java.lang.String STR_DATA_LANG_IDS_PARAMETER
        Name of the language ids NVP
        See Also:
        Constant Field Values
      • STR_DATA_RETRIEVAL_PARAMETER

        public static final java.lang.String STR_DATA_RETRIEVAL_PARAMETER
        Name of the data retrieval parameter.
        See Also:
        Constant Field Values
      • STR_SEARCH_PROFILE_PARAMETER

        public static final java.lang.String STR_SEARCH_PROFILE_PARAMETER
        Name of the search profile NVP
        See Also:
        Constant Field Values
      • STR_USAGE_PARAMETER

        public static final java.lang.String STR_USAGE_PARAMETER
        Name of the usage NVP
        See Also:
        Constant Field Values
      • STR_NVP_SEPARATOR

        public static final java.lang.String STR_NVP_SEPARATOR
        Name-value pair separator in the extended query expression.
        See Also:
        Constant Field Values
    • Constructor Detail

      • SelectionCriteriaHelper

        public SelectionCriteriaHelper(java.lang.String astrXPath)
        Initializes a newly created SelectionCriteriaHelper.
        Parameters:
        astrXPath - - the XPath expression used for this selection criteria.
    • Method Detail

      • getSelectionCriteriaExpression

        public ExpressionType getSelectionCriteriaExpression()
        Returns an OAGIS selection criteria expression.
        Returns:
        Selection criteria expression.
      • appendThisToString

        public final java.lang.StringBuffer appendThisToString(java.lang.StringBuffer asbBuffer,
                                                               int additionalCapacity)
        Append the String object that represents this class to the specified buffer. Calling this method is equivalent to calling asbBuffer.append(this.toString()).
        Parameters:
        asbBuffer - the buffer. If this is null, a new buffer is created and returned.
        additionalCapacity - the buffer returned will have at least the specified additonal capacity.
        Returns:
        the buffer.
      • toString

        public java.lang.String toString()
        Returns the String object that represents this class.

        The following is the String representation for the example discussed in the Class Javadoc: {_wcf.ap=IBM_Admin_Details;_wcf.dataLanguageIds='-1,-2'}/CatalogEntry[CatalogEntryIdentifier[(UniqueID=10001)]]

        Overrides:
        toString in class java.lang.Object
        Returns:
        a String object which represents this class.
      • addAccessProfile

        public final void addAccessProfile(java.lang.String astrAccessProfile)
        Add an access profile to the extended query expression.
        Parameters:
        astrAccessProfile - - access profile name
      • setDataLanguageIds

        public final void setDataLanguageIds(java.lang.String astrDataLanguageIds)
        Set data language identifiers to the extended query expression.
        Parameters:
        astrDataLanguageIds - comma separated list of language identifiers
      • addNameValuePair

        public final void addNameValuePair(RelationalExpression aNVP)
        Add a name-value pair to the extended query expression.
        Parameters:
        aNVP - - name value pair
      • getXPath

        public final java.lang.String getXPath()
        Get the XPath expression
        Returns:
        XPath expression
      • setXPath

        public final void setXPath(java.lang.String path)
        Set the XPath expression
        Parameters:
        path - - xpath expression
      • setSearchProfile

        public final void setSearchProfile(java.lang.String astrSearchProfile)
        Add a search profile to the extended query expression.
        Parameters:
        astrSearchProfile - - search profile name
      • setUsage

        public final void setUsage(java.lang.String astrUsage)
        Add an usage to the extended query expression.
        Parameters:
        astrUsage - - usage name