atg.repository.servlet
Class PossibleValues

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.repository.servlet.PossibleValues
All Implemented Interfaces:
NameContextBindingListener, NameContextElement, NameResolver, AdminableService, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, atg.nucleus.logging.VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, ParameterServlet, java.util.EventListener, javax.servlet.Servlet
Direct Known Subclasses:
CatalogPossibleValues, FilteringCatalogPossibleValues

public class PossibleValues
extends DynamoServlet

This servlet queries a repository and returns all tag values or repository items for a given itemDescriptorName and propertyName depending on the type of the property identified by propertyName. If the optional parameter propertyName is omitted, the droplet will return all repository values for itemType.

A complete description of the parameters to the servlet are:

itemDescriptorName
This is the name of the item-descriptor in the repository XML file
output
This parameter is rendered for once with the results of the search
propertyName
The optional value that, if used, must refer to a linked property. If this parameter is specified, repository items of the linked type will be returned.
repository
This parameter defines the repository to search. It can also be set via a properties file.
sortProperties
A string that specifies how to sort the list of repository items. This parameter is specified as a comma separated list of property names. The first name specifies the primary sort, the second specifies the secondary sort, etc. If the first character of each keyword is a -, this sort is performed in descending order. If it is a + or it is not a -, it is sorted in ascending order.

Note: This parameter is only valid for repository items, it will not work with enumerated data-types.

values
Within the body of the "output" oparam, this parameter is set to the list of possible values for the named item descriptor and property. The value will either be a list of tags (for enumerated properties) or an array of repository items.


Field Summary
static java.lang.String CLASS_VERSION
           
static java.lang.String ENUMERATED
           
static ParameterName ITEM_NAME
           
static ParameterName OUTPUT
           
static ParameterName PROPERTY_NAME
           
static ParameterName REPOSITORY
           
static java.lang.String RESOURCE_BUNDLE
           
protected static java.util.ResourceBundle smResourceBundle
           
static ParameterName SORT_PROPERTIES
           
static ParameterName USE_CODE_FOR_VALUE
           
static java.lang.String VALUES
           
 
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
PossibleValues()
           
 
Method Summary
static SortDirectives buildSortDirectives(java.lang.String[] pSortProperties)
          Build sort directives
 Repository getRepository()
          Get the respository
protected  Query getRepositoryItemQuery(RepositoryItemDescriptor pItemDescriptor, QueryBuilder pBuilder)
          Get the query that is used by getRepositoryItems By default, this is just an unconstrained query
protected  RepositoryItem[] getRepositoryItems(RepositoryItemDescriptor pItemDescriptor, RepositoryPropertyDescriptor pPropertyDescriptor, SortDirectives pSortDirectives)
          Get repository items
 java.lang.Object getRepositoryValues(Repository pRepository, java.lang.String pItemDescriptorName, java.lang.String pPropertyName, boolean pUseCodeForValue, SortDirectives pSortDirectives)
          Get repository values for either enumerated types or for linked property values, using the specified repository
protected  java.lang.Object getRepositoryValues(java.lang.String pItemDescriptorName, java.lang.String pPropertyName, java.lang.String pUseCodeForValue, SortDirectives pSortDirectives)
          Get repository values for either enumerated types or for linked property values, use the configured repository
 void service(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Service routine
 void setRepository(Repository pRepository)
          Set the repository
 
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, 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

RESOURCE_BUNDLE

public static java.lang.String RESOURCE_BUNDLE

ENUMERATED

public static java.lang.String ENUMERATED

VALUES

public static java.lang.String VALUES

REPOSITORY

public static final ParameterName REPOSITORY

ITEM_NAME

public static final ParameterName ITEM_NAME

PROPERTY_NAME

public static final ParameterName PROPERTY_NAME

SORT_PROPERTIES

public static final ParameterName SORT_PROPERTIES

USE_CODE_FOR_VALUE

public static final ParameterName USE_CODE_FOR_VALUE

OUTPUT

public static final ParameterName OUTPUT

smResourceBundle

protected static java.util.ResourceBundle smResourceBundle
Constructor Detail

PossibleValues

public PossibleValues()
Method Detail

setRepository

public void setRepository(Repository pRepository)
Set the repository

Parameters:
pRepository - a repository

getRepository

public Repository getRepository()
Get the respository

Returns:
the repository or null

service

public void service(DynamoHttpServletRequest pRequest,
                    DynamoHttpServletResponse pResponse)
             throws javax.servlet.ServletException,
                    java.io.IOException
Service routine

Overrides:
service in class DynamoServlet
Parameters:
pRequest - the request to be processed
pResponse - the response object for this request
Throws:
javax.servlet.ServletException - an application specific error occurred processing this request
java.io.IOException - an error occurred reading data from the request or writing data to the response.

buildSortDirectives

public static SortDirectives buildSortDirectives(java.lang.String[] pSortProperties)
Build sort directives

Parameters:
pSortProperties - a list of sort directives
Returns:
a possibly empty SortDirectives object

getRepositoryValues

protected java.lang.Object getRepositoryValues(java.lang.String pItemDescriptorName,
                                               java.lang.String pPropertyName,
                                               java.lang.String pUseCodeForValue,
                                               SortDirectives pSortDirectives)
Get repository values for either enumerated types or for linked property values, use the configured repository

Parameters:
pItemDescriptorName - item descriptor name
pPropertyName - the property name
pSortProperties - sort directives
Returns:
results or null

getRepositoryValues

public java.lang.Object getRepositoryValues(Repository pRepository,
                                            java.lang.String pItemDescriptorName,
                                            java.lang.String pPropertyName,
                                            boolean pUseCodeForValue,
                                            SortDirectives pSortDirectives)
Get repository values for either enumerated types or for linked property values, using the specified repository

Parameters:
pRepository - the repository
pItemDescriptorName - item descriptor name
pPropertyName - the property name
pSortProperties - sort directives
Returns:
results or null

getRepositoryItems

protected RepositoryItem[] getRepositoryItems(RepositoryItemDescriptor pItemDescriptor,
                                              RepositoryPropertyDescriptor pPropertyDescriptor,
                                              SortDirectives pSortDirectives)
Get repository items

Parameters:
pItemDescriptorName - the name of the item descriptor
pPropertyName - an optional linked property name
pSortDirectives - a possibly empty or null SortDirectives object
Returns:
an array of repository items or null

getRepositoryItemQuery

protected Query getRepositoryItemQuery(RepositoryItemDescriptor pItemDescriptor,
                                       QueryBuilder pBuilder)
                                throws RepositoryException
Get the query that is used by getRepositoryItems By default, this is just an unconstrained query

Parameters:
pItemDescriptor - The type of item that is return by this query
pBuilder - The query builder used to build the query
Returns:
A query object
Throws:
RepositoryException