ClassName

atg.repository.servlet.RQLQueryRange

Component

/atg/dynamo/droplet/RQLQueryRange

The RQLQueryRange servlet bean executes an RQL query and renders its output open parameter for a selected subset of the elements returned by the query. The query can be a simple query or can include parameters. Note that the syntax for specifying a parameter is different from the syntax normally used in RQL. For example, you might want to issue this RQL query:

age > ?0

In the RQLQueryRange servlet bean, the query could be specified like this:

<dsp:param name="queryRQL" value="age > :whatAge"/>

The value for the whatAge argument is supplied through a parameter. For example, the link to the page containing the servlet bean might be:

<dsp:a href="http://www.example.com/over35.jsp">Click here if you are
  over 35<dsp:param name="whatAge" value="35"/>
</dsp:a>

For more information about RQL, see the RepositoryQueries chapter of the ATG Repository Guide.

Input Parameters

repository
The repository to query.

itemDescriptor
The name of the item type to query.

queryRQL
The RQL query to execute.

transactionManager
The Transaction Manager to use (optional). For example:

<dsp:param name="transactionManager"
  bean="/atg/dynamo/transaction/TransactionManager"/>

start
Specifies which element of the array to start with. Setting start=1 renders the array beginning with its first element. If start is greater than the number of elements in the array and the empty output parameter is supplied in your implementation, the empty parameter is rendered.

howMany
Specifies the number of items in the array to display. If the combination of start and howMany points past the end of the array, Range stops rendering when the end of the array is reached.

sortProperties
A string that specifies how to sort the list of items in the output array. Sorting can be performed on properties of JavaBeans, Dynamic Beans, or on Dates, Numbers, or Strings.

To sort JavaBeans, specify the value of sortProperties as a comma-separated list of property names. The first name specifies the primary sort, the second specifies the secondary sort, and so on. If the first character of each keyword is a +, this sort is performed in ascending order. If it has a , it is performed in descending order.

Example: To sort an output array of JavaBeans first alphabetically by title property and second in descending order of the size property:

<dsp:param name="sortProperties" value="+title,size"/>

To sort Dates, Numbers, or Strings, specify the value of sortProperties with either a single + or a single to indicate ascending or descending order respectively.

Example: To sort an output array of Strings in alphabetical order:

<dsp:param name="sortProperties" value="+"/>

When the items you want sorted are stored in a Map or Dictionary, use a slightly different syntax. Set the value equal to the ascending/descending indicator, an underscore, and then the key or Dictionary name. For example:

<dsp:param name="sortProperties" value="_id"/>

If this example involved a Map property, id would be a key of the Map indicated in the array attribute. All IDs associated with the id key would be returned in descending order.

When one servlet bean is nested in another and both accept the sortProperties parameter, the child servlet bean inherits the sortProperties setting applied by the enclosing servlet bean unless the child specifies another sortProperties setting or is assigned an empty value:

<dsp:param name="sortProperties" value=""/>

Output Parameters

index
The 0-based index of the returned row.

count
The 1-based number of the returned row.

element
A dynamic bean that has properties for accessing the values returned in the result set. To return a particular property value for each item in the result set, use the convention element.name, where name is any property name supported by the item descriptor.

size
This parameter causes the number of items in the resultant array to display.

end
When the result set is divided into subsets, this parameter causes the last element in a subset to display its numbered value. This parameter uses a 1-based count.

hasPrev
This parameter is set to true before any of the output parameters are rendered. It indicates whether the array includes any items that precede the current array set.

prevStart
This parameter is set before any of the output parameters are rendered, and only if hasPrev is true. It indicates the value of start that should be used to display the previous array set. You can use this parameter to create a link or form submission that displays the previous elements of the array.

prevEnd
This parameter is set before any of the output parameters are rendered, and only if hasPrev is true. It indicates the (1-based) count of the last element in the previous array set.

prevHowMany
This parameter is set before any of the output parameters are rendered, and only if hasPrev is true. It indicates the number of elements in the previous array set.

hasNext
This parameter is set to true before any of the output parameters are rendered. It indicates whether the array includes any items that follow the current array set.

nextStart
This parameter is set before any of the output parameters are rendered, and only if hasNext is true. It indicates the value of start that should be used to display the next array set.

nextEnd
This parameter is set before any of the output parameters are rendered, and only if hasNext is true. It indicates the (1-based) count of the last element in the next array set.

nextHowMany
This parameter is set before any of the output parameters are rendered, and only if hasNext is true. It indicates the number of elements in the next array set.

repositoryException
If a RepositoryException is thrown, this parameter is set to the exception.

Open Parameters

The following open parameters control the formatting for the returned results:

output
This parameter is rendered once for each element in the array.

outputStart
This parameter is rendered before any output tags if the array is not empty.

outputEnd
This parameter is rendered after all output tags if the array is not empty.

empty
This optional parameter is rendered if the array contains no elements.

error
This optional parameter is rendered if there is an error when the query executes.

 
loading table of contents...