public class DynamicContentGroup extends GenericService implements RepositoryItemGroup, atg.targeting.PCCEditableComponent, atg.targeting.RepositoryTargeter, atg.targeting.RepositoryItemGroupTargeter, atg.targeting.overrides.TargetingObjectsFactory<atg.targeting.RuleBasedRepositoryItemGroup>
It is like RuleBasedRepositoryItemGroup in that it defines a group of items relative to a rule based repository and targeter, but it encapsulates all required information within a single class and a single properties file, so that it's easy for the user interface to manage instances of these groups.
To keep the UI manageable, DynamicContentItemGroups 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 item group implementation, but if you construct a DynamicContentItemGroup by hand whose rules don't fit the expected pattern, the UI will be unable to cope with it. Caveat emptor.
RepositoryItemGroup,
RuleBasedRepositoryItemGroup| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CLASS_VERSION
Class version string
|
protected atg.targeting.RuleBasedRepositoryItemGroup |
mGroup
The RuleBasedRepositoryItemGroup that implements group logic
|
protected atg.targeting.overrides.MultisiteOverrideContainer<atg.targeting.RuleBasedRepositoryItemGroup> |
mOverriddenContentGroups
Container that holds overridden groups
|
protected java.util.Map<java.lang.String,java.lang.String> |
mOverriddenRules
Map of override rule strings
|
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 java.lang.String |
mRules
Definitions of the ruleset that defines this group
|
protected StringList |
mRuleStrings
Array of strings representing an anglicized version of the rules
|
protected TargetingSourceMap |
mTargetingSourceMap
An optional TargetingSourceMap
|
protected boolean |
mUseNucleusNameResolver
If true, and if no TargetingSourceMap value is provided, use
Nucleus for a name resolver for Nucleus components used in
rules
|
SERVICE_INFO_KEYDEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS| Constructor and Description |
|---|
DynamicContentGroup() |
| Modifier and Type | Method and Description |
|---|---|
atg.targeting.RuleBasedRepositoryItemGroup |
buildGroup(Repository pRepository,
java.lang.String pRepositoryViewName,
java.lang.String pRules)
Build a RuleBasedRepositoryItemGroup from a rule specification.
|
atg.targeting.RuleBasedRepositoryItemGroup[] |
convertRuleSetsToTargetingObjects(java.lang.String[] pRuleSets)
Converts rulesets (an array of strings) to item groups (array of
RuleBasedRepositoryItemGroup) |
static atg.nucleus.ConfigurationState |
createGroupConfiguration()
Return a configuration object describing a new, uninitialized
instance of DynamicContentGroup.
|
void |
doStartService()
Start this group service.
|
void |
doStopService()
Stop this group service.
|
int |
getGroupCount()
Get the count of members of this group.
|
atg.targeting.RuleBasedRepositoryItemGroup |
getGroupDefinition() |
RepositoryItem[] |
getGroupMembers()
Get the members of this group.
|
java.lang.String |
getGroupName()
Get the name of this group
|
Query |
getGroupQuery()
Return the group query object.
|
ApplicationLogging |
getLogger()
Get the object that performs application logging on our behalf.
|
java.util.Map<java.lang.String,java.lang.String> |
getOverriddenRules()
Gets a map of the overridden rules.
|
Repository |
getRepository()
Get the repository for which a group is being defined
|
RepositoryView |
getRepositoryView()
Get the repositoryView named by repositoryViewName
|
java.lang.String |
getRepositoryViewName()
Get the name of the repository view for which a group is being defined
|
NameResolver |
getRuleNameResolver()
Get the name resolver to use to resolve references to Nucleus
components used in the rules.
|
java.lang.String |
getRules()
Get the rules used to define this group.
|
StringList |
getRuleStrings()
Get the StringList representing the rules used by this targeter.
|
atg.targeting.RuleBasedRepositoryItemGroup |
getSiteGroupDefinition(java.lang.String pSiteId) |
java.util.Map<java.lang.String,java.lang.String> |
getSiteRules()
Deprecated.
There are other override types besides site override, so API doesn't correspond
to existent override model. Use
getOverriddenRules() method instead. |
TargetingSourceMap |
getSourceMap()
An optional TargetingSourceMap component to use to resolve
references to any Nucleus components used in the rules.
|
boolean |
getUseNucleusNameResolver()
If true, use this component's Nucleus as a name resolver when no
TargetingSourceMap component is set in the 'sourceMap'
property.
|
boolean |
isGroupMember(RepositoryItem pItem)
Return true if pItem is a member of this group.
|
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 |
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 |
setOverriddenRules(java.util.Map<java.lang.String,java.lang.String> pOverriddenRules)
Sets the map of overridden rules.
|
void |
setRepository(Repository pRepository)
Set the repository for which a group is being defined
|
void |
setRepositoryViewName(java.lang.String pRepositoryViewName)
Set the name of the repository view for which a group is being defined
|
void |
setRules(java.lang.String pRules)
Set the rules used to define this group.
|
void |
setRuleStrings(StringList pRuleStrings)
Set the StringList representing the rules used by this targeter.
|
void |
setSiteRules(java.util.Map<java.lang.String,java.lang.String> pSiteRules)
Deprecated.
There are other override types besides site override, so API doesn't correspond
to existent override model. Use
setOverriddenRules(java.util.Map<java.lang.String, java.lang.String>) method instead. |
void |
setSourceMap(TargetingSourceMap pTargetingSourceMap)
An optional TargetingSourceMap component to use to resolve
references to any Nucleus components used in the rules.
|
void |
setUseNucleusNameResolver(boolean pUseNucleusNameResolver)
Set to true to use this component's Nucleus as a name resolver
when no TargetingSourceMap component is set in the 'sourceMap'
property.
|
void |
start()
Prepare this group for use.
|
void |
stop()
Mark this group inactive and clear its internal group object.
|
protected void |
updateGroup(boolean pCreate)
Rebuild the internal group object.
|
protected void |
zapGroup()
Zap the internal group object to indicate that this object needs to
be reinitialized.
|
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, stopServicevlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarningpublic static java.lang.String CLASS_VERSION
protected Repository mRepository
protected java.lang.String mRepositoryViewName
protected java.lang.String mRules
protected StringList mRuleStrings
protected atg.targeting.RuleBasedRepositoryItemGroup mGroup
protected boolean mUseNucleusNameResolver
protected TargetingSourceMap mTargetingSourceMap
protected java.util.Map<java.lang.String,java.lang.String> mOverriddenRules
protected atg.targeting.overrides.MultisiteOverrideContainer<atg.targeting.RuleBasedRepositoryItemGroup> mOverriddenContentGroups
public atg.targeting.RuleBasedRepositoryItemGroup getGroupDefinition()
public atg.targeting.RuleBasedRepositoryItemGroup getSiteGroupDefinition(java.lang.String pSiteId)
public void setRepository(Repository pRepository) throws atg.targeting.TargetingException
atg.targeting.TargetingExceptionpublic Repository getRepository()
getRepository in interface atg.targeting.RepositoryTargeterpublic void setRepositoryViewName(java.lang.String pRepositoryViewName)
throws atg.targeting.TargetingException
atg.targeting.TargetingExceptionpublic java.lang.String getRepositoryViewName()
getRepositoryViewName in interface RepositoryItemGrouppublic RepositoryView getRepositoryView() throws RepositoryException
getRepositoryView in interface atg.targeting.RepositoryTargeterRepositoryExceptionpublic NameResolver getRuleNameResolver()
public void setRules(java.lang.String pRules)
throws atg.targeting.TargetingException
pRules - The rules that define this group, including
the <ruleset> and </ruleset> tags.
This ruleset must not include sorting directives.
atg.targeting.TargetingExceptionpublic java.lang.String getRules()
@Deprecated public java.util.Map<java.lang.String,java.lang.String> getSiteRules()
getOverriddenRules() method instead.@Deprecated
public void setSiteRules(java.util.Map<java.lang.String,java.lang.String> pSiteRules)
throws atg.targeting.TargetingException
setOverriddenRules(java.util.Map<java.lang.String, java.lang.String>) method instead.pSiteRules - the overridden rules to setTargetingExceptionpublic java.util.Map<java.lang.String,java.lang.String> getOverriddenRules()
public void setOverriddenRules(java.util.Map<java.lang.String,java.lang.String> pOverriddenRules)
throws atg.targeting.TargetingException
pOverriddenRules - the overriddenRules to setTargetingExceptionpublic void setRuleStrings(StringList pRuleStrings)
public StringList getRuleStrings()
public void setUseNucleusNameResolver(boolean pUseNucleusNameResolver)
pUseNucleusNameResolver - True to use nucleus if no
TargetingSourceMap is providedpublic boolean getUseNucleusNameResolver()
public void setSourceMap(TargetingSourceMap pTargetingSourceMap)
pTargetingSourceMap - a targeting source map or nullpublic TargetingSourceMap getSourceMap()
public void setLogger(ApplicationLogging pLogger)
public ApplicationLogging getLogger()
public RepositoryItem[] getGroupMembers()
getGroupMembers in interface RepositoryItemGrouppublic int getGroupCount()
throws RepositoryException
getGroupCount in interface RepositoryItemGroupRepositoryExceptionpublic Query getGroupQuery() throws RepositoryException
getGroupQuery in interface RepositoryItemGroupRepositoryExceptionpublic java.lang.String getGroupName()
getGroupName in interface RepositoryItemGrouppublic boolean isGroupMember(RepositoryItem pItem)
isGroupMember in interface RepositoryItemGrouppublic void doStartService()
throws ServiceException
doStartService in class GenericServiceServiceException - if the Service had a problem starting uppublic void doStopService()
doStopService in class GenericServicepublic void start()
throws atg.targeting.TargetingException
TargetingException - if the object had a problem starting uppublic void stop()
protected void updateGroup(boolean pCreate)
throws atg.targeting.TargetingException
atg.targeting.TargetingExceptionprotected void zapGroup()
public atg.targeting.RuleBasedRepositoryItemGroup buildGroup(Repository pRepository, java.lang.String pRepositoryViewName, java.lang.String pRules) throws atg.targeting.TargetingException
pRepository - The repository for which this group is being defined.pRepositoryViewName - The repository view for which this group is being defined.pName - The name of the new group.pRules - A string specifying a single ruleset. This ruleset must not
not include sorting directives.TargetingException - if anything goes wrong when creating the group. In cases
where the error involved unparseable rule specifications or other
ruleset-related problems, the rootCause of the TargetingException
will contain the original exception.public atg.targeting.RuleBasedRepositoryItemGroup[] convertRuleSetsToTargetingObjects(java.lang.String[] pRuleSets)
throws atg.targeting.TargetingException
RuleBasedRepositoryItemGroup)convertRuleSetsToTargetingObjects in interface atg.targeting.overrides.TargetingObjectsFactory<atg.targeting.RuleBasedRepositoryItemGroup>array - of string representations of content groupsRuleBasedRepositoryItemGroupatg.targeting.TargetingExceptionpublic boolean isLoggingInfo()
GenericServiceisLoggingInfo in interface atg.core.logging.LoggingisLoggingInfo in interface ApplicationLoggingisLoggingInfo in class GenericServicepublic void setLoggingInfo(boolean pLogging)
GenericServicesetLoggingInfo in interface atg.core.logging.LoggingsetLoggingInfo in interface ApplicationLoggingsetLoggingInfo in class GenericServicepublic boolean isLoggingWarning()
GenericServiceisLoggingWarning in interface atg.core.logging.LoggingisLoggingWarning in interface ApplicationLoggingisLoggingWarning in class GenericServicepublic void setLoggingWarning(boolean pLogging)
GenericServicesetLoggingWarning in interface atg.core.logging.LoggingsetLoggingWarning in interface ApplicationLoggingsetLoggingWarning in class GenericServicepublic boolean isLoggingError()
GenericServiceisLoggingError in interface atg.core.logging.LoggingisLoggingError in interface ApplicationLoggingisLoggingError in class GenericServicepublic void setLoggingError(boolean pLogging)
GenericServicesetLoggingError in interface atg.core.logging.LoggingsetLoggingError in interface ApplicationLoggingsetLoggingError in class GenericServicepublic boolean isLoggingDebug()
GenericServiceisLoggingDebug in interface atg.core.logging.LoggingisLoggingDebug in interface ApplicationLoggingisLoggingDebug in class GenericServicepublic void setLoggingDebug(boolean pLogging)
GenericServicesetLoggingDebug in interface atg.core.logging.LoggingsetLoggingDebug in interface ApplicationLoggingsetLoggingDebug in class GenericServicepublic void logInfo(java.lang.String pMessage)
GenericServicelogInfo in interface atg.core.logging.LogginglogInfo in interface ApplicationLogginglogInfo in class GenericServicepublic void logInfo(java.lang.Throwable pThrowable)
GenericServicelogInfo in interface atg.core.logging.LogginglogInfo in interface ApplicationLogginglogInfo in class GenericServicepublic void logInfo(java.lang.String pMessage,
java.lang.Throwable pThrowable)
GenericServicelogInfo in interface atg.core.logging.LogginglogInfo in interface ApplicationLogginglogInfo in class GenericServicepublic void logWarning(java.lang.String pMessage)
GenericServicelogWarning in interface atg.core.logging.LogginglogWarning in interface ApplicationLogginglogWarning in class GenericServicepublic void logWarning(java.lang.Throwable pThrowable)
GenericServicelogWarning in interface atg.core.logging.LogginglogWarning in interface ApplicationLogginglogWarning in class GenericServicepublic void logWarning(java.lang.String pMessage,
java.lang.Throwable pThrowable)
GenericServicelogWarning in interface atg.core.logging.LogginglogWarning in interface ApplicationLogginglogWarning in class GenericServicepublic void logError(java.lang.String pMessage)
GenericServicelogError in interface atg.core.logging.LogginglogError in interface ApplicationLogginglogError in class GenericServicepublic void logError(java.lang.Throwable pThrowable)
GenericServicelogError in interface atg.core.logging.LogginglogError in interface ApplicationLogginglogError in class GenericServicepublic void logError(java.lang.String pMessage,
java.lang.Throwable pThrowable)
GenericServicelogError in interface atg.core.logging.LogginglogError in interface ApplicationLogginglogError in class GenericServicepublic void logDebug(java.lang.String pMessage)
GenericServicelogDebug in interface atg.core.logging.LogginglogDebug in interface ApplicationLogginglogDebug in class GenericServicepublic void logDebug(java.lang.Throwable pThrowable)
GenericServicelogDebug in interface atg.core.logging.LogginglogDebug in interface ApplicationLogginglogDebug in class GenericServicepublic void logDebug(java.lang.String pMessage,
java.lang.Throwable pThrowable)
GenericServicelogDebug in interface atg.core.logging.LogginglogDebug in interface ApplicationLogginglogDebug in class GenericServicepublic static atg.nucleus.ConfigurationState createGroupConfiguration()
throws java.beans.IntrospectionException
java.beans.IntrospectionException - If any error occurs while creating the configuration.