atg.targeting
Class TargetingServices

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.targeting.TargetingServices
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, java.util.EventListener

public class TargetingServices
extends GenericService

A collection of services that execute targeters and return Repo2XML items. Additional methods have been added that return RepositoryItem[] for use with the REST web services.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
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
TargetingServices()
          Constructs an instanceof TargetingServices
 
Method Summary
 java.lang.String[] executeRepositoryTargeter(java.lang.String pTargeterPath)
          Executes the repository targeter that exists at pTargeterPath in the config layer, and returns the results as Repo2XML items.
 java.lang.String[] executeRepositoryTargeter(java.lang.String pTargeterPath, int pMaxNumber)
          Executes the repository targeter that exists at pTargeterPath in the config layer, and returns the results as Repo2XML items.
 java.lang.String[] executeRepositoryTargeter(java.lang.String pTargeterPath, int pStartingIndex, int pMaxNumber)
          Executes the repository targeter that exists at pTargeterPath in the config layer, and returns the results as Repo2XML items.
 java.lang.String[] executeRepositoryTargeter(java.lang.String pTargeterPath, int pStartingIndex, int pMaxNumber, java.lang.String pMappingFile)
          Executes the repository targeter that exists at pTargeterPath in the config layer, and returns the results as Repo2XML items.
 java.lang.String[] executeRepositoryTargeter(java.lang.String pTargeterPath, int pMaxNumber, java.lang.String pMappingFile)
          Executes the repository targeter that exists at pTargeterPath in the config layer, and returns the results as Repo2XML items.
 java.lang.String[] executeRepositoryTargeter(java.lang.String pTargeterPath, java.lang.String pMappingFile)
          Executes the repository targeter that exists at pTargeterPath in the config layer, and returns the results as Repo2XML items.
protected  RepositoryItem[] executeRepositoryTargeterItems(NameResolver pResolver, java.lang.Object pTargeter, int pStartingIndex, int pMaxNumber)
          Executes the repository targeter and returns the results as RepositoryItem[].
 RepositoryItem[] executeRepositoryTargeterItems(java.lang.String pTargeterPath)
          Executes the repository targeter that exists at pTargeterPath in the config layer, and returns the results as RepositoryItem[].
 RepositoryItem[] executeRepositoryTargeterItems(java.lang.String pTargeterPath, int pMaxNumber)
          Executes the repository targeter that exists at pTargeterPath in the config layer, and returns the results as RepositoryItem[].
 RepositoryItem[] executeRepositoryTargeterItems(java.lang.String pTargeterPath, int pStartingIndex, int pMaxNumber)
          Executes the repository targeter that exists at pTargeterPath in the config layer, and returns the results as RepositoryItem[].
 atg.repository.xml.ItemDescriptorMappingManager getMappingManager()
          Get property MappingManager
protected  NameResolver getTargerterResolver()
          Get the NameResolver to get the targeter.
 TargetingSourceMap getTargetingSourceMap()
          Get property TargetingSourceMap
 GetService getXmlGetService()
          Get property XmlGetService
 boolean isUseDefaultMappings()
          Get property UseDefaultMappings DEFAULT: true
protected  Targeter resolveTargeter(NameResolver pTargeterResolver, java.lang.String pTargeterPath)
          Get the targeter denoted by a path.
 void setMappingManager(atg.repository.xml.ItemDescriptorMappingManager pMappingManager)
          Set property MappingManager
 void setTargetingSourceMap(TargetingSourceMap pTargetingSourceMap)
          Set property TargetingSourceMap
 void setUseDefaultMappings(boolean pUseDefaultMappings)
          Set property UseDefaultMappings DEFAULT: true
 void setXmlGetService(GetService pXmlGetService)
          Set property XmlGetService
 
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
Class version string

Constructor Detail

TargetingServices

public TargetingServices()
Constructs an instanceof TargetingServices

Method Detail

setXmlGetService

public void setXmlGetService(GetService pXmlGetService)
Set property XmlGetService

Parameters:
pXmlGetService - the service that turns a RepositoryItem into an XML file

getXmlGetService

public GetService getXmlGetService()
Get property XmlGetService

Returns:
the service that turns a RepositoryItem into an XML file

setMappingManager

public void setMappingManager(atg.repository.xml.ItemDescriptorMappingManager pMappingManager)
Set property MappingManager

Parameters:
pMappingManager - the service that controls mapping files for all item descriptors

getMappingManager

public atg.repository.xml.ItemDescriptorMappingManager getMappingManager()
Get property MappingManager

Returns:
the service that controls mapping files for all item descriptors

setUseDefaultMappings

public void setUseDefaultMappings(boolean pUseDefaultMappings)
Set property UseDefaultMappings DEFAULT: true

Parameters:
pUseDefaultMappings - true if services that return Repo2Xml items should use default mapping files supplied by the ItemMappingManager configured for this component. This property is ignored if a mapping file is explicitly passed to the service

isUseDefaultMappings

public boolean isUseDefaultMappings()
Get property UseDefaultMappings DEFAULT: true

Returns:
true if services that return Repo2Xml items should use default mapping files supplied by the ItemMappingManager configured for this component. This property is ignored if a mapping file is explicitly passed to the service

setTargetingSourceMap

public void setTargetingSourceMap(TargetingSourceMap pTargetingSourceMap)
Set property TargetingSourceMap

Parameters:
pTargetingSourceMap - The TargetingSourceMap to set

getTargetingSourceMap

public TargetingSourceMap getTargetingSourceMap()
Get property TargetingSourceMap

Returns:
The TargetingSourceMap

executeRepositoryTargeter

public java.lang.String[] executeRepositoryTargeter(java.lang.String pTargeterPath)
                                             throws atg.targeting.TargetingException,
                                                    GetException
Executes the repository targeter that exists at pTargeterPath in the config layer, and returns the results as Repo2XML items. If this targeter is called in the context or a request, then that request is used to resolve and execute the targeter, so that any session or request scoped components referenced (e.g. Profile) can be resolved properly

Parameters:
pTargeterPath - the nucleus path of the targeter to execute
Returns:
an array of Repo2XML items that satisfy the given targeter.
Throws:
TargetingException - if a targeting error occurs
GetException - if an error occurs turning the results into Repo2XML items

executeRepositoryTargeter

public java.lang.String[] executeRepositoryTargeter(java.lang.String pTargeterPath,
                                                    java.lang.String pMappingFile)
                                             throws atg.targeting.TargetingException,
                                                    GetException
Executes the repository targeter that exists at pTargeterPath in the config layer, and returns the results as Repo2XML items. If this targeter is called in the context or a request, then that request is used to resolve and execute the targeter, so that any session or request scoped components referenced (e.g. Profile) can be resolved properly

Parameters:
pTargeterPath - the nucleus path of the targeter to execute
pMappingFile - the mapping file to use when turning the item into an XML document
Returns:
an array of Repo2XML items that satisfy the given targeter.
Throws:
TargetingException - if a targeting error occurs
GetException - if an error occurs turning the results into Repo2XML items

executeRepositoryTargeter

public java.lang.String[] executeRepositoryTargeter(java.lang.String pTargeterPath,
                                                    int pMaxNumber)
                                             throws atg.targeting.TargetingException,
                                                    GetException
Executes the repository targeter that exists at pTargeterPath in the config layer, and returns the results as Repo2XML items. If this targeter is called in the context or a request, then that request is used to resolve and execute the targeter, so that any session or request scoped components referenced (e.g. Profile) can be resolved properly

Parameters:
pTargeterPath - the nucleus path of the targeter to execute
pMaxNumber - the maximum number of elements to return
Returns:
an array of Repo2XML items that satisfy the given targeter.
Throws:
TargetingException - if a targeting error occurs
GetException - if an error occurs turning the results into Repo2XML items

executeRepositoryTargeter

public java.lang.String[] executeRepositoryTargeter(java.lang.String pTargeterPath,
                                                    int pMaxNumber,
                                                    java.lang.String pMappingFile)
                                             throws atg.targeting.TargetingException,
                                                    GetException
Executes the repository targeter that exists at pTargeterPath in the config layer, and returns the results as Repo2XML items. If this targeter is called in the context or a request, then that request is used to resolve and execute the targeter, so that any session or request scoped components referenced (e.g. Profile) can be resolved properly

Parameters:
pTargeterPath - the nucleus path of the targeter to execute
pMaxNumber - the maximum number of elements to return
pMappingFile - the mapping file to use when turning the item into an XML document
Returns:
an array of Repo2XML items that satisfy the given targeter.
Throws:
TargetingException - if a targeting error occurs
GetException - if an error occurs turning the results into Repo2XML items

executeRepositoryTargeter

public java.lang.String[] executeRepositoryTargeter(java.lang.String pTargeterPath,
                                                    int pStartingIndex,
                                                    int pMaxNumber)
                                             throws atg.targeting.TargetingException,
                                                    GetException
Executes the repository targeter that exists at pTargeterPath in the config layer, and returns the results as Repo2XML items. If this targeter is called in the context or a request, then that request is used to resolve and execute the targeter, so that any session or request scoped components referenced (e.g. Profile) can be resolved properly

Parameters:
pTargeterPath - the nucleus path of the targeter to execute
pStartingIndex - if items are returned from the targeter, the index of the result that should be the first item in the result set
pMaxNumber - the maximum number of elements to return
Returns:
an array of Repo2XML items that satisfy the given targeter.
Throws:
TargetingException - if a targeting error occurs
GetException - if an error occurs turning the results into Repo2XML items

executeRepositoryTargeter

public java.lang.String[] executeRepositoryTargeter(java.lang.String pTargeterPath,
                                                    int pStartingIndex,
                                                    int pMaxNumber,
                                                    java.lang.String pMappingFile)
                                             throws atg.targeting.TargetingException,
                                                    GetException
Executes the repository targeter that exists at pTargeterPath in the config layer, and returns the results as Repo2XML items. If this targeter is called in the context or a request, then that request is used to resolve and execute the targeter, so that any session or request scoped components referenced (e.g. Profile) can be resolved properly

Parameters:
pTargeterPath - the nucleus path of the targeter to execute
pStartingIndex - if items are returned from the targeter, the index of the result that should be the first item in the result set
pMaxNumber - the maximum number of elements to return
pMappingFile - the mapping file to use when turning the item into an XML document
Returns:
an array of Repo2XML items that satisfy the given targeter.
Throws:
TargetingException - if a targeting error occurs
GetException - if an error occurs turning the results into Repo2XML items

executeRepositoryTargeterItems

public RepositoryItem[] executeRepositoryTargeterItems(java.lang.String pTargeterPath,
                                                       int pStartingIndex,
                                                       int pMaxNumber)
                                                throws atg.targeting.TargetingException
Executes the repository targeter that exists at pTargeterPath in the config layer, and returns the results as RepositoryItem[]. If this targeter is called in the context or a request, then that request is used to resolve and execute the targeter, so that any session or request scoped components referenced (e.g. Profile) can be resolved properly

Parameters:
pTargeterPath - the nucleus path of the targeter to execute
pStartingIndex - if items are returned from the targeter, the index of the result that should be the first item in the result set
pMaxNumber - the maximum number of elements to return
Returns:
an array of RepositoryItem that satisfy the given targeter.
Throws:
TargetingException - if a targeting error occurs

executeRepositoryTargeterItems

public RepositoryItem[] executeRepositoryTargeterItems(java.lang.String pTargeterPath)
                                                throws atg.targeting.TargetingException
Executes the repository targeter that exists at pTargeterPath in the config layer, and returns the results as RepositoryItem[]. If this targeter is called in the context or a request, then that request is used to resolve and execute the targeter, so that any session or request scoped components referenced (e.g. Profile) can be resolved properly

Parameters:
pTargeterPath - the nucleus path of the targeter to execute
Returns:
an array of RepositoryItem that satisfy the given targeter.
Throws:
TargetingException - if a targeting error occurs

executeRepositoryTargeterItems

public RepositoryItem[] executeRepositoryTargeterItems(java.lang.String pTargeterPath,
                                                       int pMaxNumber)
                                                throws atg.targeting.TargetingException
Executes the repository targeter that exists at pTargeterPath in the config layer, and returns the results as RepositoryItem[]. If this targeter is called in the context or a request, then that request is used to resolve and execute the targeter, so that any session or request scoped components referenced (e.g. Profile) can be resolved properly

Parameters:
pTargeterPath - the nucleus path of the targeter to execute
pMaxNumber - the maximum number of elements to return
Returns:
an array of RepositoryItem that satisfy the given targeter.
Throws:
TargetingException - if a targeting error occurs

getTargerterResolver

protected NameResolver getTargerterResolver()
Get the NameResolver to get the targeter. This will use the current request is one exists.

Returns:
The NameResolver to use when resolving the targeter.

resolveTargeter

protected Targeter resolveTargeter(NameResolver pTargeterResolver,
                                   java.lang.String pTargeterPath)
                            throws atg.targeting.TargetingException
Get the targeter denoted by a path.

Parameters:
pTargeterResolver - The NameResolver to use when resolving the targeter
pTargeterPath - The path to the targeter
Returns:
The resolved targeter.
Throws:
TargetingException - if a targeting error occurs

executeRepositoryTargeterItems

protected RepositoryItem[] executeRepositoryTargeterItems(NameResolver pResolver,
                                                          java.lang.Object pTargeter,
                                                          int pStartingIndex,
                                                          int pMaxNumber)
                                                   throws atg.targeting.TargetingException
Executes the repository targeter and returns the results as RepositoryItem[]. If this targeter is called in the context or a request, then that request is used to resolve and execute the targeter, so that any session or request scoped components referenced (e.g. Profile) can be resolved properly

Parameters:
pResolver - The NameResolver used to get the targeter
pTargeter - The Targeter
pStartingIndex - if items are returned from the targeter, the index of the result that should be the first item in the result set
pMaxNumber - the maximum number of elements to return
Returns:
an array of RepositoryItem that satisfy the given targeter.
Throws:
TargetingException - if a targeting error occurs