3

有没有办法获取 IBM Websphere Commerce Foundation 框架 (WCF) 排序数据?

例如,来自 Websphere Commerce JSP 文件的这个片段:

<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>

如何通过 GeoNodeType 中的给定数据字段对数据进行排序?我可以添加类似的东西<wcf:param name="sortBy" value="Description" />吗?

4

1 回答 1

3

您的示例中的 ExpressionBuilder“findChildGeoNodesByGeoNodeUniqueID”在/Stores/WebContent/WEB_INF/config/com.ibm.commerce.store/get-data-config.xml中声明如下:

<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>

根据表达式生成器标记文档,如果表达式生成器标记内未指定表达式语言,则默认使用 XPath 语言。不幸的是,XPath 不支持排序。

我想你仍然可以实现自己的 ExpressionBuilder 类(我没有这样做),在这个新类中实现任何类型的排序,然后在 get-data-config.xml 中指定它

于 2013-02-01T13:03:44.913 回答