com.bea.campaign.model
Class AddToPlaceholderModel

java.lang.Object
  extended by com.bea.p13n.model.Model
      extended by com.bea.p13n.model.XmlObjectModel
          extended by com.bea.p13n.rules.model.ClauseModel
              extended by com.bea.campaign.model.AddToPlaceholderModel
All Implemented Interfaces
Serializable, Cloneable

public class AddToPlaceholderModel
extends ClauseModel

A rule action that asserts a content query to a set of placeholders from a campaign. This will have a single child of a ContentQueryModel (which cannot be removed).

See Also
Serialized Form

Nested Class Summary
static class AddToPlaceholderModel.ClearingPolicy
          An enum of the possible placeholder clearing policy.
static class AddToPlaceholderModel.Recognizer
          An object which can recognize this structure.
static class AddToPlaceholderModel.TimeToLive
          Utility class to store time to live information.
static class AddToPlaceholderModel.Weight
          An enum of the possible weights.
 
Nested classes/interfaces inherited from class com.bea.p13n.model.Model
Model.ChangeEvent, Model.ChangeListener, Model.ChangeSupport, Model.Debug
 
Field Summary
static String CLAUSE_TYPE
          The default clause type for this model.
static String RULE_TYPE
          The rule type for a rule that has this model as an action.
 
Fields inherited from class com.bea.p13n.rules.model.ClauseModel
clauseType
 
Fields inherited from class com.bea.p13n.model.XmlObjectModel
copyRootXmlObject, instanceUri, isComplete
 
Fields inherited from class com.bea.p13n.model.Model
childrenModels, docModel, parentModel, roChildrenModels
 
Constructor Summary
AddToPlaceholderModel()
           
 
Method Summary
 void clearCachedData()
          Subclasses need to override this to clear out any cached data.
 org.apache.xmlbeans.XmlObject createNewXmlObject(String clauseType)
          Create a new, empty AddPlaceholdersObject).
protected  boolean determineIsComplete()
          This is complete if its ContentQueryModel is set and complete, and it has 1 or more placeholders set.
 com.bea.p13n.rules.schema.extensions.AddPlaceholdersObjectDocument.AddPlaceholdersObject getAddPlaceholdersObject()
          Get our underlying, typed XmlObject.
 AddToPlaceholderModel.ClearingPolicy getClearingPolicy()
          Get the clearing policy for this addition.
 ContentQueryModel getContentQueryModel()
          Get our child content query model.
protected  org.apache.xmlbeans.XmlObject getCopyXmlObject()
          Create a copy XmlObject of our root xml object.
 Calendar getExpireDate()
          Get the expiration date for the query, if set.
 String[] getPlaceholders()
          Get the placeholder uris.
protected  String[] getPlaceholdersNoCache()
           
 AddToPlaceholderModel.TimeToLive getTimeToLive()
          Get the time-to-live for the query, if set.
 AddToPlaceholderModel.Weight getWeight()
          Get the weight of the query in the placeholder(s).
 boolean hasNoEnding()
          True if neither the time-to-live nor the expiration date is set.
 void setClearingPolicy(AddToPlaceholderModel.ClearingPolicy cp)
          Get the clearing policy for this addition.
 void setExpireDate(Calendar cal)
          Set the expiration date on the placeholder query.
 void setNoEnding()
          Set that the query does not end due to a time-to-live or expiration date.
 void setPlaceholders(String... phs)
          Set the placeholders.
 void setTimeToLive(AddToPlaceholderModel.TimeToLive ttl)
          Set the time-to-live on the placeholder query.
 void setWeight(AddToPlaceholderModel.Weight wt)
          Set the weight of the query in the placeholder(s).
 void setXmlObject(String clauseType, org.apache.xmlbeans.XmlObject clause)
          Set the root xml Object (should be AddPlaceholdersObject).
 
Methods inherited from class com.bea.p13n.rules.model.ClauseModel
addBranch, addLiteral, addMethod, addMethodOrOperator, addOperator, addVariable, addVariableBinding, copy, getClauseType, getContainingRuleModel, initializeNew, isInActions, isInConditions, isValidTypeAlias, isValidVariableName, makeSafeCopy, toString
 
Methods inherited from class com.bea.p13n.model.XmlObjectModel
checkElement, childAdded, childRemoved, fixQName, getApplicationInstanceUri, getChild, getDocument, getLocalName, getParent, getQName, getRootXmlObject, isComplete, isNil, preRemove, propertyChanged, removeAllChildren, removeChild, setApplicationInstanceUri, setIsComplete, setIsComplete, setParent, setRootXmlObject
 
Methods inherited from class com.bea.p13n.model.Model
addChangeListener, addChild, addChild, clone, doubleEquals, equals, getChildren, getDebug, getDebug, getDocument, getParent, longEquals, removeChangeListener, removeChild, removeChild, removeEmpties, setDocument
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CLAUSE_TYPE

public static final String CLAUSE_TYPE
The default clause type for this model.

See Also
Constants Summary

RULE_TYPE

public static final String RULE_TYPE
The rule type for a rule that has this model as an action.

See Also
Constants Summary
Constructor Detail

AddToPlaceholderModel

public AddToPlaceholderModel()
Method Detail

setXmlObject

public void setXmlObject(String clauseType,
                         org.apache.xmlbeans.XmlObject clause)
                  throws IllegalArgumentException
Set the root xml Object (should be AddPlaceholdersObject).

Overrides:
setXmlObject in class ClauseModel
Parameters
clauseType - the clause type of the clause.
clause - the root xml object of the clause.
Throws
IllegalArgument - on wrong clause.
IllegalArgumentException - thrown if the clause is not valid for the ClauseModel or clauseType.

createNewXmlObject

public org.apache.xmlbeans.XmlObject createNewXmlObject(String clauseType)
Create a new, empty AddPlaceholdersObject).

Specified by:
createNewXmlObject in class ClauseModel
Parameters
clauseType - the clause type of the clause.
Returns
a new, empty initialize root object.

getCopyXmlObject

protected org.apache.xmlbeans.XmlObject getCopyXmlObject()
Create a copy XmlObject of our root xml object.

Overrides:
getCopyXmlObject in class ClauseModel
See Also
ClauseModel.makeSafeCopy(XmlObject)

clearCachedData

public void clearCachedData()
Description copied from class: XmlObjectModel
Subclasses need to override this to clear out any cached data. This will be automatically called when the root XmlObject or clauseType changes.

Specified by:
clearCachedData in class XmlObjectModel

getAddPlaceholdersObject

public com.bea.p13n.rules.schema.extensions.AddPlaceholdersObjectDocument.AddPlaceholdersObject getAddPlaceholdersObject()
Get our underlying, typed XmlObject.


getContentQueryModel

public ContentQueryModel getContentQueryModel()
Get our child content query model.


getPlaceholders

public String[] getPlaceholders()
Get the placeholder uris.


getPlaceholdersNoCache

protected String[] getPlaceholdersNoCache()

setPlaceholders

public void setPlaceholders(String... phs)
Set the placeholders.


getWeight

public AddToPlaceholderModel.Weight getWeight()
Get the weight of the query in the placeholder(s).


setWeight

public void setWeight(AddToPlaceholderModel.Weight wt)
Set the weight of the query in the placeholder(s).


getTimeToLive

public AddToPlaceholderModel.TimeToLive getTimeToLive()
Get the time-to-live for the query, if set. This instance should not be modified; you should make a copy.

Returns
the time-to-live, or null if not set.

getExpireDate

public Calendar getExpireDate()
Get the expiration date for the query, if set. This instance should not be modified; you should make a copy.

Returns
the expiration date, or null if not set.

hasNoEnding

public boolean hasNoEnding()
True if neither the time-to-live nor the expiration date is set.


setExpireDate

public void setExpireDate(Calendar cal)
Set the expiration date on the placeholder query.


setTimeToLive

public void setTimeToLive(AddToPlaceholderModel.TimeToLive ttl)
Set the time-to-live on the placeholder query.


setNoEnding

public void setNoEnding()
Set that the query does not end due to a time-to-live or expiration date.


getClearingPolicy

public AddToPlaceholderModel.ClearingPolicy getClearingPolicy()
Get the clearing policy for this addition.


setClearingPolicy

public void setClearingPolicy(AddToPlaceholderModel.ClearingPolicy cp)
Get the clearing policy for this addition.


determineIsComplete

protected boolean determineIsComplete()
This is complete if its ContentQueryModel is set and complete, and it has 1 or more placeholders set.

Overrides:
determineIsComplete in class XmlObjectModel


Copyright © 2011, Oracle. All rights reserved.