| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectatg.nucleus.logging.VariableArgumentApplicationLoggingImpl
atg.nucleus.GenericService
atg.targeting.RuleSetEvaluator
public class RuleSetEvaluator
This service can be used to evaluate an arbitrary set of rules
 against different target objects.  The rules are specified via the
 ruleSetService property.  The testTarget
 method can be used to test if a specific target object satisfies
 the rules.  
 
 
For example, suppose that we use a RuleSetService
 configured with the following rule set, which is meant to describe
 a subset of the user population: 
 
 
<ruleset>The
<accepts>
<rule op=eq>
<valueof target="gender">
<valueof constant="male">
</rule>
<rule op=lt>
<valueof target="age">
<valueof constant="30">
</rule>
</accepts>
</ruleset>
testTarget method can then be used to test if
 various users are males under the age of 30.  The target object
 tested against can be any bean which has the properties occuring in
 the target expressions in the rules - in this case,
 "gender" and "age."  Typically, the target object will represent a
 DPS user, and will be either a
 atg.userprofiling.Profile or a
 atg.repository.RepositoryItem.
 The optional sourceMap property, if provided, is
 used to resolve any bean expressions in the rules.  If
 no such expressions occur in the rules, this property can be left
 null.
RuleSetService, 
TargetingSourceMap| Field Summary | |
|---|---|
| static java.lang.String | CLASS_VERSIONClass 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 | |
|---|---|
| RuleSetEvaluator() | |
| Method Summary | |
|---|---|
|  atg.targeting.RuleSetService | getRuleSetService()Returns the RuleSetService containing the rules to be evaluated. | 
|  TargetingSourceMap | getSourceMap()Returns the TargetingSourceMap to use when evaluating rules. | 
|  void | setRuleSetService(atg.targeting.RuleSetService pRuleSetService)Sets the RuleSetService containing the rules to be evaluated. | 
|  void | setSourceMap(TargetingSourceMap pSourceMap)Sets the TargetingSourceMap to use when evaluating rules. | 
|  boolean | testTarget(java.lang.Object pTarget)Evaluates the rules specified via the ruleSetServiceproperty against the target object. | 
|  boolean | testTarget(java.lang.Object pTarget,
           NameResolver pNameResolver)Evaluates the rules specified via the ruleSetServiceproperty against the target object. | 
| 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 | 
|---|
public static java.lang.String CLASS_VERSION
| Constructor Detail | 
|---|
public RuleSetEvaluator()
| Method Detail | 
|---|
public atg.targeting.RuleSetService getRuleSetService()
public void setRuleSetService(atg.targeting.RuleSetService pRuleSetService)
public TargetingSourceMap getSourceMap()
public void setSourceMap(TargetingSourceMap pSourceMap)
public boolean testTarget(java.lang.Object pTarget)
                   throws atg.targeting.rules.RuleSetException
ruleSetService
 property against the target object.  Returns true if the target
 object satisfies the rules, false otherwise.
atg.targeting.rules.RuleSetException - if an error is encountered while
 evaluating the rules
public boolean testTarget(java.lang.Object pTarget,
                          NameResolver pNameResolver)
                   throws atg.targeting.rules.RuleSetException
ruleSetService
 property against the target object.  Returns true if the target
 object satisfies the rules, false otherwise.
pTarget - pNameResolver - name resolver to use if source map does not
 specify one
atg.targeting.rules.RuleSetException - if an error is encountered while
 evaluating the rules| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||