Tag: getData

The getData tag retrieves data objects from a WebSphere Commerce service. The param tag and the contextData are sub-tags of the getData tag.

Tag Information
Body Content scriptless
Display Name Get Data

Attributes
Name Required Request-time Type Description
var true false java.lang.String The name of the exported scoped variable that is assigned the data retrieved from the WebSphere Commerce service. The type of variable is specified by the type attribute.
type true false java.lang.String The data type of the data that is to be retrieved. This value must be a fully qualified interface name of a noun SDO that is to be retrieved using the configured client facade. If the type is appended with "[]", then the variable specified by the var attribute is an array. Otherwise, the variable is not an array and is set to the first value found when the WebSphere Commerce service is invoked.
scope false false java.lang.String The scope for the variables specified by var and varShowVerb. Valid scope values are page, request, session and application. The default value is page.
expression false true java.lang.String The search expression that retrieves the data. This expression must be a valid search expression for the configured component service. This attribute must not be specified if the expressionBuilder attribute has been specified.
expressionLanguage false true java.lang.String The expression language that interprets the value of the expression attribute. The default value is wcf:XPath. This attribute must not be specified if the expressionBuilder attribute has been specified.
expressionBuilder false true java.lang.String The name of a configured expression builder. The expression builder will compose the search expression and set the expression language. This attribute must not be specified if the expression attribute has been specified. Named parameter values for the expression builder may be specified using the param sub-tag. The expressions are defined in the get-data-config.xml file for each component.
recordSetReferenceId false true java.lang.String The reference ID for this query. If this is a follow up to a previous query, the reference ID is used so that the result set can be retrieved from the cache. The value of the reference ID can be retrieved from the Show verb object that is stored in the variable specified by the varShowVerb attribute.
recordSetStartNumber false true java.math.BigInteger The starting index from which to retrieve results from the result set.
maxItems false true java.math.BigInteger The maximum number of items to return.
varShowVerb false false java.lang.String The name of the exported scoped variable that holds the Show verb object retrieved from the WebSphere Commerce service. The type of variable is com.ibm.commerce.oagis9.datatypes.ShowType. The Show verb contains status information about the result set including:

  • recordSetReferenceId - The internal identifier for the result set, so that it can be resolved on a subsequent request.

  • recordSetCompleteIndicator - Indicates whether or not you have reached the end of the result set.

  • recordSetTotal - The total number of results in the result set.

  • recordSetCount - The number of records from the resultset that are being returned in this message.

  • recordSetStartNumber - The starting index for the results that are being returned in this message.

Variables
No Variables Defined.

 

Example

The following example gets the order object for the current shopping cart and assigns it to a variable called "order".

<wcf:getData
type="com.ibm.commerce.order.facade.datatypes.OrderType"var="order"

expressionBuilder="findCurrentShoppingCart">
<wcf:contextData name="storeId" data="10001" />
<wcf:param name="accessProfile"
value="WC_OrderDetailsProfile" />
</wcf:getData>


Related Reference


GetData tag configuration
WebSphere Commerce foundation tag library