atg.repository.servlet
Class RQLQueryRange

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.nucleus.TimedOperationService
              extended by atg.nucleus.servlet.ServletService
                  extended by atg.nucleus.servlet.HttpServletService
                      extended by atg.servlet.DynamoServlet
                          extended by atg.droplet.Range
                              extended by atg.repository.servlet.RQLQueryRange
All Implemented Interfaces:
NameContextBindingListener, NameContextElement, NameResolver, AdminableService, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, ParameterServlet, java.util.EventListener, javax.servlet.Servlet

public class RQLQueryRange
extends Range

This servlet executes a RQL query and renders its output parameter for a selected subset of the elements returned by the query. The query is specified inline with parameters.

For each row returned by the query, we set the following 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. You can access the values by name. The name refers to either the column name or the column alias if one was used in the query. To access values by name, you say: "element.name".
queryRQL
The RQL statement is specified directly in the jhtml file.
repository
The nucleus component of the repository.
itemDescriptor
The item descriptor naming the item type to query.
transactionManager
The transaction manager component to use if any.
The repository, itemDescriptor and queryRQL parameters are used together with parameters you specify in the following manner:
   <param name="firstName" value="bean:MyUser.firstName">
   <param name="repository" value="bean:/atg/userprofiling/ProfileAdapterRepository">
   <param name="itemDescriptor" value="user">
   <param name="queryRQL" value="firstName=:firstName">
   <param name="transactionManager" value="bean:/atg/dynamo/transaction/TransactionManager">
 

The values for the ":name" constructs in your query are taken from the parameters in your request. Two input parameters lets you control which subset of elements in the returned query that are displayed. They are:

start
Specifies the starting index (1-based). For example, to start at the beginning of the array, set start to 1. If start points past the end of the array, the empty parameter will be rendered.
howMany
Specifies the number of items in the array set to display. If the combination of start and howMany point past the end of the array, rendering stops after the end of the array is reached.
calculateSize
When set to "true", will cause the RQLQueryRange droplet to calculate the size of the total possible result set. It will do this by issuing a separate count query. You can also define a set of output parameters which you can use to control the formatting for the returned results:
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.
output
This parameter is rendered for once for each element in the array.
empty
This optional parameter is rendered if the array contains no elements.
error
This parameter is rendered if there is a problem constructing or executing the query.
repositoryException
This parameter is set with the RepositoryException if one is thrown.
These parameters are set when rendering the "output" parameters. They allow you to build links to render the next and previous set of elements.
end
This parameter is set before any of the output parameters are rendered. It indicates the (1-based) count of the last element in the current array set.
size
This parameter is only set if the calculateSize input parameter is true.
hasPrev
This parameter is set to true or false before any of the output parameters are rendered. It indicates whether there are any array items before 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.
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 or false before any of the output parameters are rendered. It indicates whether there are any array items after 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.

See Also:
Range, SQLQueryRange

Field Summary
static ParameterName CALCULATE_SIZE
           
static java.lang.String CLASS_VERSION
           
static ParameterName ERROR
          Parameter to this bean.
static java.lang.String FORCE_SIZE_QUERY
           
static java.lang.String REPOSITORY_EXCEPTION
          returned if query failed with a RepositoryException
 
Fields inherited from class atg.droplet.Range
ARRAY, COUNT, ELEMENT, ELEMENT_NAME, EMPTY, END, HAS_NEXT, HAS_PREV, HOW_MANY, INDEX, INDEX_NAME, KEY, NEXT_END, NEXT_HOW_MANY, NEXT_START, OUTPUT, OUTPUT_END, OUTPUT_START, PREV_END, PREV_HOW_MANY, PREV_START, SIZE, START
 
Fields inherited from class atg.servlet.DynamoServlet
mAllowCleanupRequest, mParameters
 
Fields inherited from class atg.nucleus.servlet.ServletService
SERVLET_INFO_KEY
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging
DEFAULT_LOG_TRACE_STATUS
 
Fields inherited from interface atg.nucleus.logging.ApplicationLogging
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
 
Constructor Summary
RQLQueryRange()
           
 
Method Summary
 void service(DynamoHttpServletRequest pReq, DynamoHttpServletResponse pRes)
          Renders the list of items retrieved by the query
 
Methods inherited from class atg.droplet.Range
getArray, serviceArray, serviceCollection, serviceDictionary, serviceEnumeration, serviceIterator, serviceList, serviceMap, setPrevNextParameters
 
Methods inherited from class atg.servlet.DynamoServlet
doDelete, doGet, doPost, doPut, getParameter, getParameters, getServletContext, service, service, setParameter
 
Methods inherited from class atg.nucleus.servlet.ServletService
destroy, getServletConfig, getServletInfo, init, setServletInfo
 
Methods inherited from class atg.nucleus.TimedOperationService
getAverageRequestHandlingTime, getHandledRequestCount, getRequestStartTime, getTotalRequestHandlingTime, isKeepingStatistics, notifyHandledRequest, resetStatistics, setKeepingStatistics
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION

ERROR

public static final ParameterName ERROR
Parameter to this bean.


CALCULATE_SIZE

public static final ParameterName CALCULATE_SIZE

FORCE_SIZE_QUERY

public static final java.lang.String FORCE_SIZE_QUERY
See Also:
Constant Field Values

REPOSITORY_EXCEPTION

public static final java.lang.String REPOSITORY_EXCEPTION
returned if query failed with a RepositoryException

See Also:
Constant Field Values
Constructor Detail

RQLQueryRange

public RQLQueryRange()
Method Detail

service

public void service(DynamoHttpServletRequest pReq,
                    DynamoHttpServletResponse pRes)
             throws javax.servlet.ServletException,
                    java.io.IOException
Renders the list of items retrieved by the query

Overrides:
service in class Range
Parameters:
DynamoHttpServletRequest - Request containing parameters from which the query is built
DyanamoHttpServletResponse - Response built during service.
Throws:
javax.servlet.ServletException - Thrown if servlet interface is used improperly.
java.io.IOException - Thrown if problem servicing output parameters or during the parent's .service() method.