Class Name

atg.commerce.approval.ApprovalRequiredDroplet

Component(s)

/atg/commerce/approval/ApprovalRequiredDroplet

/atg/commerce/gears/orderapproval/ApprovalResolvedDroplet
(Order Approval portal gear only)

The ApprovalRequiredDroplet servlet bean supports the order approval process by retrieving all orders requiring approval by a given approver. It queries the order repository and returns all orders that meet the following criteria:

Note that the ApprovalRequiredDroplet servlet bean has a security feature that allows the current user, the approver, to view only the orders of customers for whom he or she is allowed to approve orders. This feature is enabled by default. To disable the feature, set the enableSecurity property to false.

Input Parameters

approverid (Required)
The ID of the current user profile; the approver.

numOrders
The number of orders to return from the query. This parameter is optional and typically is used to break large result sets into manageable pieces.

siteIds

A collection of site IDs used to limit the query to orders associated with the specified sites. If siteIds is specified, siteScope is ignored.

siteScope

If you are using Oracle ATG Web Commerce’s multisite feature, you can filter orders by site. Use siteScope as an alternative to siteIds, and provide one of the following scopes:

The default siteScope can be set through a configurable property on the component. The default value is all.

startIndex
The index of the first order to return. If startIndex is null, then it defaults to 0. This parameter is optional and typically is used to break large result sets into manageable pieces.

Output Parameters

result
The array of Order objects.

count
The number of Order objects in the result output parameter.

totalCount
The total number of Order objects that satisfied the criteria.

nextIndex
The index of the first order in the next set of results. If startIndex or numOrders was null, then this parameter will also be null.

previousIndex
The index of the first order in the previous set of results. If startIndex or numOrders was null, then this parameter will also be null.

nextIndex and previousIndex allow the user to cycle back and forth between result sets.

startRange
The 1-based index of the first Order in the set of results.

endRange
The 1-based index of the last Order in the set of results.

errorMessage
The error message to display to the user if an error occurs.

Open Parameters

output
This open parameter renders the array of order objects set in the result output parameter.

empty
This parameter is rendered if there are no orders that require approval by the current user.

error
This parameter is rendered if an error occurs.

Example

The following example retrieves from the repository the orders requiring approval by the current user, an approver, and lists each order’s repository id on the page.

<dsp:droplet name="ApprovalRequiredDroplet">
 <dsp:param bean="/atg/userprofiling/Profile.repositoryId"
name="approverid"/>
 <dsp:param value="0" name="startIndex"/>
 <dsp:param value="10" name="numOrders"/>
 <dsp:oparam name="output">
<dsp:droplet name="ForEach">
   <dsp:param param="result" name="array"/>
   <dsp:setvalue param="order" paramvalue="element"/>
       <dsp:oparam name="output">
          <dsp:valueof param="order.repositoryId"/><br>
       </dsp:oparam>
       <dsp:oparam name="error">
          <dsp:valueof param="errorMsg"/><br>
       </dsp:oparam>
    </dsp:droplet>
 </dsp:oparam>
</dsp:droplet>