atg.targeting
Class DynamicContentTargeter

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.targeting.DynamicContentTargeter
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, atg.targeting.ContentHistoryManager, atg.targeting.overrides.TargetingObjectsFactory<atg.targeting.RuleBasedRepositoryTargeter>, atg.targeting.PCCEditableComponent, atg.targeting.RepositoryTargeter, Targeter, java.util.EventListener
Direct Known Subclasses:
PromotionUpsellTargeter

public class DynamicContentTargeter
extends GenericService
implements Targeter, atg.targeting.RepositoryTargeter, atg.targeting.ContentHistoryManager, atg.targeting.PCCEditableComponent, atg.targeting.overrides.TargetingObjectsFactory<atg.targeting.RuleBasedRepositoryTargeter>

This implementation of Targeter exists primarily for use with the Dynamo Personalization Control Center (aka PCC, the business user's interface to targeting in the Dynamo 4 personalization system).

It is like RuleBasedRepositoryTargeter in that it performs rule-based targeting over a Repository, but it adds a number of additional features including "rule breaks" (the ability to cascade through multiple rulesets and stop when any one of them returns content) and the ability to say that this targeter should suppress repository items that have already been seen during this session.

To keep the UI manageable, DynamicContentTargeters generally specify a restricted subset of rules that are easy to parse and easy to display and edit in a graphical user interface. This restriction is enforced only at the GUI level, not in the targeter implementation, but if you construct a DynamicContentTargeter by hand whose rules don't fit the expected pattern, the UI will be unable to cope with it. Caveat emptor.

See Also:
Targeter, RuleBasedRepositoryTargeter, ContentHistoryManager, ContentHistory

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
protected  java.lang.String mContentHistoryPath
          Nucleus component path that points to ContentHistory object
protected  java.lang.String mDescription
          Description of this targeter's behavior for use in a GUI
protected  int mImpressionLimit
          How many times can this targeter show each time in a session?
protected  boolean mImpressionLimitPerTargeter
          Are impression limits local to this targeter, or global?
protected  java.util.Map<java.lang.String,java.lang.String> mOverriddenRulesets
          Definition of all overridden rulesets
protected  atg.targeting.overrides.MultisiteOverrideContainer<atg.targeting.RuleBasedRepositoryTargeter> mOverriddenTargeters
          Container for overridden targeters
protected  Repository mRepository
          The repository from which to select items
protected  java.lang.String mRepositoryViewName
          The name of the repository view from which to select items
protected  StringList mRulesets
          Definitions of all the rulesets used by this targeter
protected  StringList mRuleStrings
          Array of strings representing an anglicized version of the rules
protected  java.lang.String mSortBy
          The criteria used to sort results in this targeter
protected  SortDirectives mSortDirectives
          The SortDirectives object that corresponds to mSortBy
protected  atg.targeting.RuleBasedRepositoryTargeter[] mTargeters
          The set of RuleBasedRepositoryTargeters to use for targeting
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.targeting.Targeter
NO_MAX_NUMBER, NO_START_INDEX
 
Fields inherited from interface atg.nucleus.logging.ApplicationLogging
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
 
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging
DEFAULT_LOG_TRACE_STATUS
 
Constructor Summary
DynamicContentTargeter()
           
 
Method Summary
protected  java.lang.Object[] atMost(int pMaxNumber, java.lang.Object[] pItems)
          Return at most N items from an array.
static SortDirectives buildSortDirectives(java.lang.String pSortBy)
          Build a SortDirectives object from a ...
 atg.targeting.RuleBasedRepositoryTargeter[] buildTargeters(Repository pRepository, java.lang.String pRepositoryViewName, StringList pRulesets, SortDirectives pSortDirectives)
          Build an array of targeters from an array of rule specifications.
 atg.targeting.RuleBasedRepositoryTargeter[] convertRuleSetsToTargetingObjects(java.lang.String[] pRuleSets)
          Converts rulesets (an array of string) to targeters (array of RuleBasedRepositoryTargeter)
 int countContentShown(NameResolver pNameResolver, RepositoryItem pItem)
          Query how many times some repository item has been shown in this session.
static atg.nucleus.ConfigurationState createTargeterConfiguration()
          Return a configuration object describing a new, uninitialized instance of DynamicContentTargeter.
 void doStartService()
          Start this dynamic content targeting service.
 void doStopService()
          Stop this dynamic content targeting service.
protected  java.lang.Object[] filter(NameResolver pNameResolver, java.lang.Object[] pItems)
          Filter an array of items to remove any that have reached their impression limit.
 Targeter[] findSiteTargeters(java.lang.String pSiteId)
           
 atg.targeting.ContentHistory getContentHistory(NameResolver pNameResolver)
          Get the content history object associated with this targeter in a given name context.
 java.lang.Object getContentHistoryContext()
          Get the correct context in which to record content history information
 java.lang.String getContentHistoryPath()
          Get the path to use when looking up the content history object
 java.lang.String getDescription()
          Get this targeter's description
 java.lang.String[] getDisplayRuleStrings()
          Get the display form of the rule strings.
 java.lang.String[] getDisplayRuleStrings(DynamoHttpServletRequest pRequest)
          Get the display form of the rule strings using the context of the given request.
 java.lang.String[] getDisplayRuleStringsUsingCurrentRequest()
          Get the display form of the rule strings using the context of the current request.
 int getImpressionLimit()
          Get the maximum number of times this targeter can return the same item
 ApplicationLogging getLogger()
          Get the object that performs application logging on our behalf.
 int getNumRulesets()
          Return the number of rulesets used by this targeter
 java.util.Map<java.lang.String,java.lang.String> getOverriddenRulesets()
          Gets a map of overridden rulesetss.
 Repository getRepository()
          Get the repository from which to select items
 RepositoryView getRepositoryView()
          Get the repositoryView from which to select items
 java.lang.String getRepositoryViewName()
          Get the name of the repository view from which to select items
 StringList getRulesets()
          Get the definitions for all rulesets used by this targeter
 StringList getRuleStrings()
          Get the StringList representing the rules used by this targeter.
 java.util.Map<java.lang.String,java.lang.String> getSiteRulesets()
          Deprecated. There are other override types besides site override, so API doesn't correspond to existent override model. Method getOverriddenRulesets() should be used instead.
 java.lang.String getSortBy()
          Get the criteria used to sort results in this targeter.
 Targeter[] getTargeters()
           
 boolean isContentShown(NameResolver pNameResolver, RepositoryItem pItem)
          Query whether some repository item has been shown in this session.
 boolean isImpressionLimitPerTargeter()
          Query whether impression limits are per-targeter or global.
 boolean isLoggingDebug()
          This method returns whether or not an debug log event should be broadcast.
 boolean isLoggingError()
          This method returns whether or not an error log event should be broadcast.
 boolean isLoggingInfo()
          This method returns whether or not an info log event should be broadcast.
 boolean isLoggingWarning()
          This method returns whether or not an warning log event should be broadcast.
 void logDebug(java.lang.String pMessage)
          Logs an debug event with the specified message
 void logDebug(java.lang.String pMessage, java.lang.Throwable pThrowable)
          Logs an debug event with the specified message and Throwable
 void logDebug(java.lang.Throwable pThrowable)
          Logs an debug event with the specified Throwable
 void logError(java.lang.String pMessage)
          Logs an error event with the specified message
 void logError(java.lang.String pMessage, java.lang.Throwable pThrowable)
          Logs an error event with the specified message and Throwable
 void logError(java.lang.Throwable pThrowable)
          Logs an error event with the specified Throwable
 void logInfo(java.lang.String pMessage)
          Logs an info event with the specified message
 void logInfo(java.lang.String pMessage, java.lang.Throwable pThrowable)
          Logs an info event with the specified message and Throwable
 void logInfo(java.lang.Throwable pThrowable)
          Logs an info event with the specified Throwable
 void logWarning(java.lang.String pMessage)
          Logs an warning event with the specified message
 void logWarning(java.lang.String pMessage, java.lang.Throwable pThrowable)
          Logs an warning event with the specified message and Throwable
 void logWarning(java.lang.Throwable pThrowable)
          Logs an warning event with the specified Throwable
 void registerContentShown(NameResolver pNameResolver, RepositoryItem pItem)
          Register the fact that some repository item was shown in this session.
 void setContentHistoryPath(java.lang.String pContentHistoryPath)
          Set the component path of the object used to record what content items have been displayed from each repository.
 void setDescription(java.lang.String pDescription)
          Set this targeter's description
 void setImpressionLimit(int pImpressionLimit)
          Set the maximum number of times this targeter can return the same item
 void setImpressionLimitPerTargeter(boolean pImpressionLimitPerTargeter)
          Specify whether impression limits are per-targeter, or global.
 void setLogger(ApplicationLogging pLogger)
          Set the object that performs application logging on our behalf.
 void setLoggingDebug(boolean pLogging)
          Sets whether or not debug log events should be logged.
 void setLoggingError(boolean pLogging)
          Sets whether or not error log events should be logged.
 void setLoggingInfo(boolean pLogging)
          Sets whether or not info log events should be logged.
 void setLoggingWarning(boolean pLogging)
          Sets whether or not warning log events should be logged.
 void setOverriddenRulesets(java.util.Map<java.lang.String,java.lang.String> pOverriddenRulesets)
          Sets a map of overridden rulesets.
 void setRepository(Repository pRepository)
          Set the repository from which to select items
 void setRepositoryViewName(java.lang.String pRepositoryViewName)
          Set the name of the repository view from which to select items
 void setRulesets(StringList pRulesets)
          Set the definitions for all rulesets used by this targeter
 void setRuleStrings(StringList pRuleStrings)
          Set the StringList representing the rules used by this targeter.
 void setSiteRulesets(java.util.Map<java.lang.String,java.lang.String> pSiteReulsets)
          Deprecated. There are other override types besides site override, so API doesn't correspond to existent override model. Method setOverriddenRulesets(java.util.Map) should be used instead.
 void setSortBy(java.lang.String pSortBy)
          Set the criteria used to sort results in this targeter.
 void start()
          Prepare this targeter for use.
 void stop()
          Mark this targeter inactive and clear its internal list of sub-targeters.
 java.lang.Object[] target(NameResolver pNameResolver)
          Performs a targeting operation, returning an array of "target" objects.
 java.lang.Object[] target(NameResolver pNameResolver, int pMaxNumber)
          Performs a targeting operation, returning an array of "target" objects containing at most pMaxNumber entries.
 java.lang.Object[] target(NameResolver pNameResolver, int pStartIndex, int pMaxNumber)
          Performs a targeting operation, returning an array of "target" objects, beginning at the starting index of the entire result set, and containing at most pMaxNumber elements.
protected  void updateTargeters(boolean pCreate)
          Rebuild all targeters.
protected  void zapTargeters()
          Zap all targeters to indicate that this object needs to be reinitialized.
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingTrace, isRunning, logTrace, logTrace, logTrace, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingTrace, 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


mRepository

protected Repository mRepository
The repository from which to select items


mRepositoryViewName

protected java.lang.String mRepositoryViewName
The name of the repository view from which to select items


mRulesets

protected StringList mRulesets
Definitions of all the rulesets used by this targeter


mRuleStrings

protected StringList mRuleStrings
Array of strings representing an anglicized version of the rules


mSortBy

protected java.lang.String mSortBy
The criteria used to sort results in this targeter


mSortDirectives

protected SortDirectives mSortDirectives
The SortDirectives object that corresponds to mSortBy


mTargeters

protected atg.targeting.RuleBasedRepositoryTargeter[] mTargeters
The set of RuleBasedRepositoryTargeters to use for targeting


mImpressionLimit

protected int mImpressionLimit
How many times can this targeter show each time in a session?


mImpressionLimitPerTargeter

protected boolean mImpressionLimitPerTargeter
Are impression limits local to this targeter, or global?


mDescription

protected java.lang.String mDescription
Description of this targeter's behavior for use in a GUI


mContentHistoryPath

protected java.lang.String mContentHistoryPath
Nucleus component path that points to ContentHistory object


mOverriddenRulesets

protected java.util.Map<java.lang.String,java.lang.String> mOverriddenRulesets
Definition of all overridden rulesets


mOverriddenTargeters

protected atg.targeting.overrides.MultisiteOverrideContainer<atg.targeting.RuleBasedRepositoryTargeter> mOverriddenTargeters
Container for overridden targeters

Constructor Detail

DynamicContentTargeter

public DynamicContentTargeter()
Method Detail

setRepository

public void setRepository(Repository pRepository)
                   throws atg.targeting.TargetingException
Set the repository from which to select items

Throws:
atg.targeting.TargetingException

getRepository

public Repository getRepository()
Get the repository from which to select items

Specified by:
getRepository in interface atg.targeting.RepositoryTargeter

setRepositoryViewName

public void setRepositoryViewName(java.lang.String pRepositoryViewName)
                           throws atg.targeting.TargetingException
Set the name of the repository view from which to select items

Throws:
atg.targeting.TargetingException

getRepositoryViewName

public java.lang.String getRepositoryViewName()
Get the name of the repository view from which to select items


getRepositoryView

public RepositoryView getRepositoryView()
                                 throws RepositoryException
Get the repositoryView from which to select items

Specified by:
getRepositoryView in interface atg.targeting.RepositoryTargeter
Throws:
RepositoryException

setRulesets

public void setRulesets(StringList pRulesets)
                 throws atg.targeting.TargetingException
Set the definitions for all rulesets used by this targeter

Parameters:
pRulesets - A StringList, each of whose elements is a complete ruleset as defined in the targeting documentation for Dynamo, including the <ruleset> and </ruleset> tags.

These rulesets should not include sorting directives since they will be overridden by any sort criteria specified in the targeter's sortBy property.

Throws:
atg.targeting.TargetingException

getRulesets

public StringList getRulesets()
Get the definitions for all rulesets used by this targeter


setRuleStrings

public void setRuleStrings(StringList pRuleStrings)
Set the StringList representing the rules used by this targeter. Used to store an anglicized version of the rules for display, printing, etc.


getRuleStrings

public StringList getRuleStrings()
Get the StringList representing the rules used by this targeter.


getDisplayRuleStrings

public java.lang.String[] getDisplayRuleStrings()
Get the display form of the rule strings.


getDisplayRuleStringsUsingCurrentRequest

public java.lang.String[] getDisplayRuleStringsUsingCurrentRequest()
Get the display form of the rule strings using the context of the current request.


getDisplayRuleStrings

public java.lang.String[] getDisplayRuleStrings(DynamoHttpServletRequest pRequest)
Get the display form of the rule strings using the context of the given request.

Parameters:
pRequest - the request context to use. May be null.

getNumRulesets

public int getNumRulesets()
Return the number of rulesets used by this targeter


setSortBy

public void setSortBy(java.lang.String pSortBy)
               throws atg.targeting.TargetingException
Set the criteria used to sort results in this targeter.

Parameters:
pSortBy - The stringified version of a set of targeter sorting rules. This should be a string of the form:
    <sortby>
      <sortbyvalue value=property [dir=direction]>
      ...
    </sortby>
    

Note that the value may not use the src= attribute to incorporate another set of sort criteria by reference.

Throws:
atg.targeting.TargetingException

getSortBy

public java.lang.String getSortBy()
Get the criteria used to sort results in this targeter.

Returns:
The stringified version of a set of targeter sorting rules. This will return a string of the form:
    <sortby>
      <sortbyvalue value=property [dir=direction]>
      ...
    </sortby>
    

setImpressionLimit

public void setImpressionLimit(int pImpressionLimit)
Set the maximum number of times this targeter can return the same item


getImpressionLimit

public int getImpressionLimit()
Get the maximum number of times this targeter can return the same item


setContentHistoryPath

public void setContentHistoryPath(java.lang.String pContentHistoryPath)
Set the component path of the object used to record what content items have been displayed from each repository. The intent is that this path will point to a session scoped object that implements the atg.repository.ContentHistory interface. Targeters that specify the oncePerSession property will use this object to implement once-per-session" semantics on the items they return.


getContentHistoryPath

public java.lang.String getContentHistoryPath()
Get the path to use when looking up the content history object


setImpressionLimitPerTargeter

public void setImpressionLimitPerTargeter(boolean pImpressionLimitPerTargeter)
Specify whether impression limits are per-targeter, or global. content history.

If a per-targeter limit is used, then impressionLimit will only count impressions that come from this targeter. If a global limit is used, then impressionLimit will count impressions from any similarly configured targeter. .


isImpressionLimitPerTargeter

public boolean isImpressionLimitPerTargeter()
Query whether impression limits are per-targeter or global.


setDescription

public void setDescription(java.lang.String pDescription)
Set this targeter's description


getDescription

public java.lang.String getDescription()
Get this targeter's description


setLogger

public void setLogger(ApplicationLogging pLogger)
Set the object that performs application logging on our behalf. If null, the service will perform its own logging.


getLogger

public ApplicationLogging getLogger()
Get the object that performs application logging on our behalf.


setSiteRulesets

@Deprecated
public void setSiteRulesets(java.util.Map<java.lang.String,java.lang.String> pSiteReulsets)
                     throws atg.targeting.TargetingException
Deprecated. There are other override types besides site override, so API doesn't correspond to existent override model. Method setOverriddenRulesets(java.util.Map) should be used instead.

Sets a map of overridden rulesets. The key is a definition of override type. The value is a comma separated string of rulesets.

Throws:
TargetingException

getSiteRulesets

@Deprecated
public java.util.Map<java.lang.String,java.lang.String> getSiteRulesets()
Deprecated. There are other override types besides site override, so API doesn't correspond to existent override model. Method getOverriddenRulesets() should be used instead.

Gets a map of overridden rulesets. The key is a definition of override type. The value is a comma separated string of rulesets.


setOverriddenRulesets

public void setOverriddenRulesets(java.util.Map<java.lang.String,java.lang.String> pOverriddenRulesets)
                           throws atg.targeting.TargetingException
Sets a map of overridden rulesets. The key is a definition of override type. The value is a comma separated string of rulesets.

Throws:
TargetingException

getOverriddenRulesets

public java.util.Map<java.lang.String,java.lang.String> getOverriddenRulesets()
Gets a map of overridden rulesetss. The key is a definition of override type. The value is a comma separated string of rulesets.


target

public java.lang.Object[] target(NameResolver pNameResolver)
                          throws atg.targeting.TargetingException
Performs a targeting operation, returning an array of "target" objects. The NameResolver argument carries information about the source objects associated with the targeting operation - the "context" of the targeting operation.

Returns null if no items are found matching the targeting criteria.

This method automatically cascades down rulesets. If a ruleset returns no suitable items or if all items returned have passed their impression limits, then the targeting operation will automatically try subsequent rulesets. It returns null only after all rulesets have been exhausted.

Specified by:
target in interface Targeter
Throws:
TargetingException - if a problem was encountered during the targeting operation

target

public java.lang.Object[] target(NameResolver pNameResolver,
                                 int pMaxNumber)
                          throws atg.targeting.TargetingException
Performs a targeting operation, returning an array of "target" objects containing at most pMaxNumber entries. The NameResolver argument carries information about the source objects associated with the targeting operation - the "context" of the targeting operation.

Returns null if no items are found matching the targeting criteria.

This method automatically cascades down rulesets. If a ruleset returns no suitable items or if all items returned have passed their impression limits, then the targeting operation will automatically try subsequent rulesets. It returns null only after all rulesets have been exhausted.

Specified by:
target in interface Targeter
Parameters:
pMaxNumber - the maximum number of elements to return; if -1, the entire result set will be retrieved
Throws:
TargetingException - if a problem was encountered during the targeting operation

target

public java.lang.Object[] target(NameResolver pNameResolver,
                                 int pStartIndex,
                                 int pMaxNumber)
                          throws atg.targeting.TargetingException
Performs a targeting operation, returning an array of "target" objects, beginning at the starting index of the entire result set, and containing at most pMaxNumber elements. The NameResolver argument carries information about the source objects associated with the targeting operation - the "context" of the targeting operation.

This method performs cascading differently from the other target methods of this class. In particular, it does not use impression limits to trigger cascading behavior.

Rulesets are tried in turn until one of them produces a non-empty set of items. That set is then filtered by impression limit, and the result is immediately returned.

If the filtering process removes all items from the initial result set this method immediately returns null, where the other targeting methods would automatically try the next available ruleset. Keep this difference in mind when deciding which form of target to call.

Specified by:
target in interface Targeter
Parameters:
pStartIndex - the starting index; must be >= 0
pMaxNumber - the maximum number of elements to return; if -1, the entire result set starting at index pStartIndex will be retrieved
Throws:
TargetingException - if a problem was encountered during the targeting operation

registerContentShown

public void registerContentShown(NameResolver pNameResolver,
                                 RepositoryItem pItem)
Register the fact that some repository item was shown in this session.

Specified by:
registerContentShown in interface atg.targeting.ContentHistoryManager

isContentShown

public boolean isContentShown(NameResolver pNameResolver,
                              RepositoryItem pItem)
Query whether some repository item has been shown in this session.

Specified by:
isContentShown in interface atg.targeting.ContentHistoryManager

countContentShown

public int countContentShown(NameResolver pNameResolver,
                             RepositoryItem pItem)
Query how many times some repository item has been shown in this session.

Specified by:
countContentShown in interface atg.targeting.ContentHistoryManager

doStartService

public void doStartService()
                    throws ServiceException
Start this dynamic content targeting service.

Overrides:
doStartService in class GenericService
Throws:
ServiceException - if the Service had a problem starting up

doStopService

public void doStopService()
Stop this dynamic content targeting service.

Overrides:
doStopService in class GenericService

start

public void start()
           throws atg.targeting.TargetingException
Prepare this targeter for use. This method is called by doStartService to perform any generic initialization required by this service. Any initialization that depends on this object actually being a Nucleus component should be done directly in doStartService.

This allows the object to be instantiated either as a Nucleus component or stand-alone. For example, one could instantiate a DynamicContentTargeter as follows:

DynamicContentTargeter t = new DynamicContentTargeter(); t.setRepository(...); t.setRepositoryViewName(...); t.setRulesets(...); t.start();

Throws:
TargetingException - if the object had a problem starting up

stop

public void stop()
Mark this targeter inactive and clear its internal list of sub-targeters.


getContentHistory

public atg.targeting.ContentHistory getContentHistory(NameResolver pNameResolver)
Get the content history object associated with this targeter in a given name context. The return value may be null.


getContentHistoryContext

public java.lang.Object getContentHistoryContext()
Get the correct context in which to record content history information


updateTargeters

protected void updateTargeters(boolean pCreate)
                        throws atg.targeting.TargetingException
Rebuild all targeters. Updates mTargeters to contain a new list.

Throws:
atg.targeting.TargetingException

zapTargeters

protected void zapTargeters()
Zap all targeters to indicate that this object needs to be reinitialized.


getTargeters

public Targeter[] getTargeters()

findSiteTargeters

public Targeter[] findSiteTargeters(java.lang.String pSiteId)

filter

protected java.lang.Object[] filter(NameResolver pNameResolver,
                                    java.lang.Object[] pItems)
Filter an array of items to remove any that have reached their impression limit.

Parameters:
pNameResolver - An object (usually an HTTP request) used to find the session-scoped ContentHistory object.
pItems - An array of RepositoryItems to filter.
Returns:
pItems if impression limits are not in use or if no items need to be removed, otherwise a newly allocated array containing those items that have not reached their impression limits. Returns null if no unfiltered items remain.

atMost

protected java.lang.Object[] atMost(int pMaxNumber,
                                    java.lang.Object[] pItems)
Return at most N items from an array. Returns the original array if it contains pMaxNumber or fewer elements, or if pMaxNumber is not set; otherwise returns a newly allocated array containing the first pMaxNumber elements of the original array.


buildTargeters

public atg.targeting.RuleBasedRepositoryTargeter[] buildTargeters(Repository pRepository,
                                                                  java.lang.String pRepositoryViewName,
                                                                  StringList pRulesets,
                                                                  SortDirectives pSortDirectives)
                                                           throws atg.targeting.TargetingException
Build an array of targeters from an array of rule specifications.

Parameters:
pRepository - The repository from which these targeters will select content
pRepositoryViewName - The repository view from which these targeters will select content
pRulesets - An array of strings specifying rulesets. These rulesets should not include sorting directives since they will be overridden by pSortDirectives.
pSortDirectives - Sorting directives these targeters will use to sort results.
Returns:
An array of targeters, one per ruleset specification in pRulesets. If no rulesets are specified, an empty array is returned.
Throws:
TargetingException - if anything goes wrong when creating the targeters. In cases where the error involved unparseable rule specifications or other ruleset-related problems, the rootCause of the TargetingException will contain the original exception.

convertRuleSetsToTargetingObjects

public atg.targeting.RuleBasedRepositoryTargeter[] convertRuleSetsToTargetingObjects(java.lang.String[] pRuleSets)
                                                                              throws atg.targeting.TargetingException
Converts rulesets (an array of string) to targeters (array of RuleBasedRepositoryTargeter)

Specified by:
convertRuleSetsToTargetingObjects in interface atg.targeting.overrides.TargetingObjectsFactory<atg.targeting.RuleBasedRepositoryTargeter>
Parameters:
array - of string representations of targeters
Returns:
array of RuleBasedRepositoryTargeter
Throws:
atg.targeting.TargetingException

buildSortDirectives

public static SortDirectives buildSortDirectives(java.lang.String pSortBy)
                                          throws atg.targeting.TargetingException
Build a SortDirectives object from a ... string.

Throws:
atg.targeting.TargetingException

isLoggingInfo

public boolean isLoggingInfo()
Description copied from class: GenericService
This method returns whether or not an info log event should be broadcast.

Specified by:
isLoggingInfo in interface ApplicationLogging
Overrides:
isLoggingInfo in class GenericService
Returns:
boolean true if info log events should be logged
false if info log events should not be logged

setLoggingInfo

public void setLoggingInfo(boolean pLogging)
Description copied from class: GenericService
Sets whether or not info log events should be logged.

Specified by:
setLoggingInfo in interface ApplicationLogging
Overrides:
setLoggingInfo in class GenericService

isLoggingWarning

public boolean isLoggingWarning()
Description copied from class: GenericService
This method returns whether or not an warning log event should be broadcast.

Specified by:
isLoggingWarning in interface ApplicationLogging
Overrides:
isLoggingWarning in class GenericService
Returns:
boolean true if warning log events should be logged
false if warning log events should not be logged

setLoggingWarning

public void setLoggingWarning(boolean pLogging)
Description copied from class: GenericService
Sets whether or not warning log events should be logged.

Specified by:
setLoggingWarning in interface ApplicationLogging
Overrides:
setLoggingWarning in class GenericService

isLoggingError

public boolean isLoggingError()
Description copied from class: GenericService
This method returns whether or not an error log event should be broadcast.

Specified by:
isLoggingError in interface ApplicationLogging
Overrides:
isLoggingError in class GenericService
Returns:
boolean true if error log events should be logged
false if error log events should not be logged

setLoggingError

public void setLoggingError(boolean pLogging)
Description copied from class: GenericService
Sets whether or not error log events should be logged.

Specified by:
setLoggingError in interface ApplicationLogging
Overrides:
setLoggingError in class GenericService

isLoggingDebug

public boolean isLoggingDebug()
Description copied from class: GenericService
This method returns whether or not an debug log event should be broadcast.

Specified by:
isLoggingDebug in interface ApplicationLogging
Overrides:
isLoggingDebug in class GenericService
Returns:
boolean true if debug log events should be logged
false if debug log events should not be logged

setLoggingDebug

public void setLoggingDebug(boolean pLogging)
Description copied from class: GenericService
Sets whether or not debug log events should be logged.

Specified by:
setLoggingDebug in interface ApplicationLogging
Overrides:
setLoggingDebug in class GenericService

logInfo

public void logInfo(java.lang.String pMessage)
Description copied from class: GenericService
Logs an info event with the specified message

Specified by:
logInfo in interface ApplicationLogging
Overrides:
logInfo in class GenericService

logInfo

public void logInfo(java.lang.Throwable pThrowable)
Description copied from class: GenericService
Logs an info event with the specified Throwable

Specified by:
logInfo in interface ApplicationLogging
Overrides:
logInfo in class GenericService

logInfo

public void logInfo(java.lang.String pMessage,
                    java.lang.Throwable pThrowable)
Description copied from class: GenericService
Logs an info event with the specified message and Throwable

Specified by:
logInfo in interface ApplicationLogging
Overrides:
logInfo in class GenericService

logWarning

public void logWarning(java.lang.String pMessage)
Description copied from class: GenericService
Logs an warning event with the specified message

Specified by:
logWarning in interface ApplicationLogging
Overrides:
logWarning in class GenericService

logWarning

public void logWarning(java.lang.Throwable pThrowable)
Description copied from class: GenericService
Logs an warning event with the specified Throwable

Specified by:
logWarning in interface ApplicationLogging
Overrides:
logWarning in class GenericService

logWarning

public void logWarning(java.lang.String pMessage,
                       java.lang.Throwable pThrowable)
Description copied from class: GenericService
Logs an warning event with the specified message and Throwable

Specified by:
logWarning in interface ApplicationLogging
Overrides:
logWarning in class GenericService

logError

public void logError(java.lang.String pMessage)
Description copied from class: GenericService
Logs an error event with the specified message

Specified by:
logError in interface ApplicationLogging
Overrides:
logError in class GenericService

logError

public void logError(java.lang.Throwable pThrowable)
Description copied from class: GenericService
Logs an error event with the specified Throwable

Specified by:
logError in interface ApplicationLogging
Overrides:
logError in class GenericService

logError

public void logError(java.lang.String pMessage,
                     java.lang.Throwable pThrowable)
Description copied from class: GenericService
Logs an error event with the specified message and Throwable

Specified by:
logError in interface ApplicationLogging
Overrides:
logError in class GenericService

logDebug

public void logDebug(java.lang.String pMessage)
Description copied from class: GenericService
Logs an debug event with the specified message

Specified by:
logDebug in interface ApplicationLogging
Overrides:
logDebug in class GenericService

logDebug

public void logDebug(java.lang.Throwable pThrowable)
Description copied from class: GenericService
Logs an debug event with the specified Throwable

Specified by:
logDebug in interface ApplicationLogging
Overrides:
logDebug in class GenericService

logDebug

public void logDebug(java.lang.String pMessage,
                     java.lang.Throwable pThrowable)
Description copied from class: GenericService
Logs an debug event with the specified message and Throwable

Specified by:
logDebug in interface ApplicationLogging
Overrides:
logDebug in class GenericService

createTargeterConfiguration

public static atg.nucleus.ConfigurationState createTargeterConfiguration()
                                                                  throws java.beans.IntrospectionException
Return a configuration object describing a new, uninitialized instance of DynamicContentTargeter. At the very least, the repository property of the configuration must be set before the targeter is editable. In addition, the repositoryView property may need to be set if the targeter selects content from any view other than the default.

Throws:
java.beans.IntrospectionException - If any error occurs while creating the configuration.