atg.repository.servlet
Class RQLQueryForEach
java.lang.Object
atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
atg.nucleus.GenericService
atg.nucleus.TimedOperationService
atg.nucleus.servlet.ServletService
atg.nucleus.servlet.HttpServletService
atg.servlet.DynamoServlet
atg.droplet.ForEach
atg.repository.servlet.RQLQueryForEach
- 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 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
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 interface atg.nucleus.logging.TraceApplicationLogging |
DEFAULT_LOG_TRACE_STATUS |
Methods inherited from class atg.droplet.ForEach |
getArray, getSortedArray, serviceArray, serviceCollection, serviceDictionary, serviceEnumeration, serviceIndexedList, serviceIterator, serviceMap, serviceMapArray, servicePrimitiveArray, setElementParameter |
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 |
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
RQLQueryForEach
public RQLQueryForEach()
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 builtDyanamoHttpServletResponse
- 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.