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_KEY
DEFAULT_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, stopService
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
public 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.TargetingException
public Repository getRepository()
getRepository
in interface atg.targeting.RepositoryTargeter
public void setRepositoryViewName(java.lang.String pRepositoryViewName) throws atg.targeting.TargetingException
atg.targeting.TargetingException
public java.lang.String getRepositoryViewName()
getRepositoryViewName
in interface RepositoryItemGroup
public RepositoryView getRepositoryView() throws RepositoryException
getRepositoryView
in interface atg.targeting.RepositoryTargeter
RepositoryException
public 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.TargetingException
public 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 setTargetingException
public 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 setTargetingException
public 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 RepositoryItemGroup
public int getGroupCount() throws RepositoryException
getGroupCount
in interface RepositoryItemGroup
RepositoryException
public Query getGroupQuery() throws RepositoryException
getGroupQuery
in interface RepositoryItemGroup
RepositoryException
public java.lang.String getGroupName()
getGroupName
in interface RepositoryItemGroup
public boolean isGroupMember(RepositoryItem pItem)
isGroupMember
in interface RepositoryItemGroup
public void doStartService() throws ServiceException
doStartService
in class GenericService
ServiceException
- if the Service had a problem starting uppublic void doStopService()
doStopService
in class GenericService
public 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.TargetingException
protected 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 groupsRuleBasedRepositoryItemGroup
atg.targeting.TargetingException
public boolean isLoggingInfo()
GenericService
isLoggingInfo
in interface atg.core.logging.Logging
isLoggingInfo
in interface ApplicationLogging
isLoggingInfo
in class GenericService
public void setLoggingInfo(boolean pLogging)
GenericService
setLoggingInfo
in interface atg.core.logging.Logging
setLoggingInfo
in interface ApplicationLogging
setLoggingInfo
in class GenericService
public boolean isLoggingWarning()
GenericService
isLoggingWarning
in interface atg.core.logging.Logging
isLoggingWarning
in interface ApplicationLogging
isLoggingWarning
in class GenericService
public void setLoggingWarning(boolean pLogging)
GenericService
setLoggingWarning
in interface atg.core.logging.Logging
setLoggingWarning
in interface ApplicationLogging
setLoggingWarning
in class GenericService
public boolean isLoggingError()
GenericService
isLoggingError
in interface atg.core.logging.Logging
isLoggingError
in interface ApplicationLogging
isLoggingError
in class GenericService
public void setLoggingError(boolean pLogging)
GenericService
setLoggingError
in interface atg.core.logging.Logging
setLoggingError
in interface ApplicationLogging
setLoggingError
in class GenericService
public boolean isLoggingDebug()
GenericService
isLoggingDebug
in interface atg.core.logging.Logging
isLoggingDebug
in interface ApplicationLogging
isLoggingDebug
in class GenericService
public void setLoggingDebug(boolean pLogging)
GenericService
setLoggingDebug
in interface atg.core.logging.Logging
setLoggingDebug
in interface ApplicationLogging
setLoggingDebug
in class GenericService
public void logInfo(java.lang.String pMessage)
GenericService
logInfo
in interface atg.core.logging.Logging
logInfo
in interface ApplicationLogging
logInfo
in class GenericService
public void logInfo(java.lang.Throwable pThrowable)
GenericService
logInfo
in interface atg.core.logging.Logging
logInfo
in interface ApplicationLogging
logInfo
in class GenericService
public void logInfo(java.lang.String pMessage, java.lang.Throwable pThrowable)
GenericService
logInfo
in interface atg.core.logging.Logging
logInfo
in interface ApplicationLogging
logInfo
in class GenericService
public void logWarning(java.lang.String pMessage)
GenericService
logWarning
in interface atg.core.logging.Logging
logWarning
in interface ApplicationLogging
logWarning
in class GenericService
public void logWarning(java.lang.Throwable pThrowable)
GenericService
logWarning
in interface atg.core.logging.Logging
logWarning
in interface ApplicationLogging
logWarning
in class GenericService
public void logWarning(java.lang.String pMessage, java.lang.Throwable pThrowable)
GenericService
logWarning
in interface atg.core.logging.Logging
logWarning
in interface ApplicationLogging
logWarning
in class GenericService
public void logError(java.lang.String pMessage)
GenericService
logError
in interface atg.core.logging.Logging
logError
in interface ApplicationLogging
logError
in class GenericService
public void logError(java.lang.Throwable pThrowable)
GenericService
logError
in interface atg.core.logging.Logging
logError
in interface ApplicationLogging
logError
in class GenericService
public void logError(java.lang.String pMessage, java.lang.Throwable pThrowable)
GenericService
logError
in interface atg.core.logging.Logging
logError
in interface ApplicationLogging
logError
in class GenericService
public void logDebug(java.lang.String pMessage)
GenericService
logDebug
in interface atg.core.logging.Logging
logDebug
in interface ApplicationLogging
logDebug
in class GenericService
public void logDebug(java.lang.Throwable pThrowable)
GenericService
logDebug
in interface atg.core.logging.Logging
logDebug
in interface ApplicationLogging
logDebug
in class GenericService
public void logDebug(java.lang.String pMessage, java.lang.Throwable pThrowable)
GenericService
logDebug
in interface atg.core.logging.Logging
logDebug
in interface ApplicationLogging
logDebug
in class GenericService
public static atg.nucleus.ConfigurationState createGroupConfiguration() throws java.beans.IntrospectionException
java.beans.IntrospectionException
- If any error occurs while creating the configuration.