atg.repository.servlet
Class RQLQueryForEach

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.ForEach
                              extended by atg.repository.servlet.RQLQueryForEach
All Implemented Interfaces:
atg.naming.AbsoluteNameable, NameContextBindingListener, NameContextElement, atg.naming.NameContextParentable, NameResolver, AdminableService, atg.nucleus.Configured, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, ParameterServlet, java.util.EventListener, javax.servlet.Servlet

public class RQLQueryForEach
extends ForEach

This servlet executes a RQL query and renders its output parameter for each element 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 JSP page.
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:
   <dsp:param name="firstName" bean="MyUser.firstName"/>
   <dsp:param name="repository" value="/atg/userprofiling/ProfileAdapterRepository"/>
   <dsp:param name="itemDescriptor" value="user"/>
   <dsp:param name="queryRQL" value="firstName=:firstName"/>
   <dsp:param name="transactionManager" bean="/atg/dynamo/transaction/TransactionManager"/>
 

The values for the ":name" constructs in your query are taken from the parameters in your request. 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.

See Also:
ForEach, SQLQueryForEach

Nested Class Summary
static class RQLQueryForEach.RQLQueryReturnData
          RQLQueryReturnData
 
Field Summary
static java.lang.String CLASS_VERSION
           
static ParameterName ERROR
           
static ParameterName ITEM_DESCRIPTOR
           
static ParameterName QUERY_RQL
           
static ParameterName REPOSITORY
           
static java.lang.String REPOSITORY_EXCEPTION
          returned if query failed with a RepositoryException
static ParameterName TRANSACTION_MANAGER
           
 
Fields inherited from class atg.droplet.ForEach
ARRAY, COUNT, DEBUG, ELEMENT, ELEMENT_NAME, EMPTY, INDEX, INDEX_NAME, KEY, OUTPUT, OUTPUT_END, OUTPUT_START, REVERSE_ORDER, SIZE, SORT_PROPERTIES
 
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
RQLQueryForEach()
           
 
Method Summary
 void service(DynamoHttpServletRequest pReq, DynamoHttpServletResponse pRes)
          Renders the list of items retrieved by the query
 
Methods inherited from class atg.droplet.ForEach
getArray, getSortedArray, serviceArray, serviceCollection, serviceDictionary, serviceEnumeration, serviceIndexedList, serviceIterator, serviceMap, serviceMapArray, servicePrimitiveArray, setElementParameter
 
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, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, 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, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, 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

REPOSITORY

public static final ParameterName REPOSITORY

ITEM_DESCRIPTOR

public static final ParameterName ITEM_DESCRIPTOR

QUERY_RQL

public static final ParameterName QUERY_RQL

TRANSACTION_MANAGER

public static final ParameterName TRANSACTION_MANAGER

ERROR

public static final ParameterName ERROR

REPOSITORY_EXCEPTION

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

See Also:
Constant Field Values
Constructor Detail

RQLQueryForEach

public RQLQueryForEach()
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 ForEach
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.