Websphere Commerce: Sorting Results <wcf: getData ...>

Is there a way to get the collation data of an IBM Websphere Commerce Foundation (WCF) database?

eg. this snippet from the WebSphere Commerce JSP file:

<wcf:getData type="com.ibm.commerce.store.facade.datatypes.GeoNodeType[]"
             var="geoNodes" varException="geoNodeException" expressionBuilder="findChildGeoNodesByGeoNodeUniqueID">
  <wcf:param name="accessProfile" value="IBM_Store_All" />
  <wcf:param name="parentUniqueId" value="${provinceId}" />
</wcf:getData>

      

How do I get this to sort the data by a given data field in the GeoNodeType? Can I add something like <wcf:param name="sortBy" value="Description" />

?

+3


source to share


1 answer


The ExpressionBuilder "findChildGeoNodesByGeoNodeUniqueID" from your example is declared in /Stores/WebContent/WEB_INF/config/com.ibm.commerce.store/get-data-config.xml as follows:

<expression-builder>
    <name>findChildGeoNodesByGeoNodeUniqueID</name>
    <data-type-name>GeoNode</data-type-name>
    <expression-template>{_wcf.ap=$accessProfile$}/GeoNode[ParentGeoNodeIdentifier[UniqueID='$parentUniqueId$']]</expression-template>
    <param>
        <name>accessProfile</name>
        <value>IBM_Store_All</value>
    </param>
    <param>
        <name>parentUniqueId</name>
        <value></value>
    </param>
</expression-builder>

      



According to the builder-expression in the docs tag, if no language-expression is specified within the builder - expression , the default language is XPath. Unfortunately XPath doesn't maintain order.

I assume you can still implement your own ExpressionBuilder class (I didn't), implement any sorting inside this new class, and then specify it in get-data-config.xml

+3


source







All Articles