atg.scenario.targeting
Class RepositoryItemSlot

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.scenario.targeting.Slot
              extended by atg.scenario.targeting.RepositoryItemSlot
All Implemented Interfaces:
NameContextBindingListener, NameContextElement, NameResolver, AdminableService, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, atg.nucleus.logging.VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, atg.scenario.targeting.SlotConstants, atg.targeting.RepositoryTargeter, Targeter, java.io.Serializable, java.util.EventListener

public class RepositoryItemSlot
extends Slot
implements atg.targeting.RepositoryTargeter, atg.scenario.targeting.SlotConstants, java.io.Serializable

A RepositoryItemSlot is a Slot which contains only entries for RepositoryItems, and which declares the repository name and item type of the items that it can contain.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class atg.scenario.targeting.Slot
Slot.SlotEntry
 
Field Summary
static java.lang.String CLASS_VERSION
           
 
Fields inherited from class atg.scenario.targeting.Slot
ACTIVE_GENERATION, DEFAULT_PRIORITY, DESTRUCTIVE_RETRIEVAL, PASSIVE_GENERATION, PRIORITY_RANDOM_ORDERING, PRIORITY_SEQUENTIAL_ORDERING, ROTATING_RETRIEVAL, STATIC_RETRIEVAL
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.scenario.targeting.SlotConstants
MY_RESOURCE_NAME, PROFILE_SLOT_TYPE, PROPERTY_ID, PROPERTY_SLOT_ITEMS, PROPERTY_SLOT_NAME, PROPERTY_SLOT_OFFSET, PROPERTY_SLOT_PRIORITIES, PROPERTY_SLOT_PROFILE
 
Fields inherited from interface atg.targeting.Targeter
NO_MAX_NUMBER, NO_START_INDEX
 
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
RepositoryItemSlot()
           
 
Method Summary
 void add(java.lang.Object pItem)
          Add an item to this slot with a default priority.
 void add(java.lang.Object pItem, int pPriority)
          Add an item to this slot.
 void addAll(java.util.Collection pItems)
          Add multiple items to this slot with a default priority.
 void addAll(java.util.Collection pItems, int pPriority)
          Add an item to this slot.
 void clear()
          Clear all items from the slot.
 void doStartService()
          This is called after a Service has been created, placed into the naming hierarchy, and initialized with its configured property values.
 java.lang.String getItemDescriptorName()
           
 boolean getPersistent()
          Returns flag indicating if this RepositoryItemSlot is persistent or not.
protected  java.lang.Object[] getRange(int pStartIndex, int pMaxNumber)
          Return a list of objects to be rendered.
 Repository getRepository()
           
 java.lang.String getRepositoryName()
           
 java.lang.String getRepositoryPath()
           
 atg.repository.nucleus.RepositoryRegistryService getRepositoryRegistryService()
          Returns property RepositoryRegistryService
 RepositoryView getRepositoryView()
           
 javax.transaction.TransactionManager getTransactionManager()
          Returns the TransactionManager used to persist RepositoryItemSlots.
 java.lang.Class getValueType()
          Returns the type of values contained by the slot - namely, the RepositoryItem class.
 void initSlotFromRepositoryItem(RepositoryItem pItem)
          Initialize this persistent RepositoryItemSlot from the RepositoryItem of type 'profileSlot' contained in the profile Repository.
 void remove(java.lang.Object pItem)
          Remove an item from this slot.
 void removeAll(java.util.Collection pItems)
          Remove a collection of items from this slot.
 void setItemDescriptorName(java.lang.String pItemDescriptorName)
          Set the name of the item descriptor from which to select items
 void setPersistent(boolean pPersistent)
          Set the flag indicating whether or not to store this component in the Repository.
 void setRepositoryName(java.lang.String pRepositoryName)
          Set the repository name from which to select items
 void setRepositoryPath(java.lang.String pRepositoryPath)
          Set the nucleus path of the repository from which to select items
 void setRepositoryRegistryService(atg.repository.nucleus.RepositoryRegistryService pRepositoryRegistryService)
          Sets property RepositoryRegistryService
 void setTransactionManager(javax.transaction.TransactionManager pTM)
          Set the TransactionManager member variable used to persist RepositoryItemSlots.
 void updateSlotProfile()
          Updates the Profile which owns this slot.
 
Methods inherited from class atg.scenario.targeting.Slot
getAllowDuplicates, getCurrentItems, getEntryCount, getGeneration, getMaxRenderSize, getMessageSourcePath, getOrdering, getRetrieval, setAllowDuplicates, setGeneration, setMaxRenderSize, setMessageSourcePath, setOrdering, setRetrieval, setValueType, sortItems, target, target, target, toString, trimConsumedItems
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStopService, getAbsoluteName, getAdminServlet, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, 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, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Constructor Detail

RepositoryItemSlot

public RepositoryItemSlot()
Method Detail

doStartService

public void doStartService()
Description copied from class: GenericService
This is called after a Service has been created, placed into the naming hierarchy, and initialized with its configured property values. The Service should override this method to start any processes it requires.

Overrides:
doStartService in class GenericService

getRepository

public Repository getRepository()
Specified by:
getRepository in interface atg.targeting.RepositoryTargeter

getRepositoryView

public RepositoryView getRepositoryView()
Specified by:
getRepositoryView in interface atg.targeting.RepositoryTargeter

setRepositoryRegistryService

public void setRepositoryRegistryService(atg.repository.nucleus.RepositoryRegistryService pRepositoryRegistryService)
Sets property RepositoryRegistryService


getRepositoryRegistryService

public atg.repository.nucleus.RepositoryRegistryService getRepositoryRegistryService()
Returns property RepositoryRegistryService


setRepositoryName

public void setRepositoryName(java.lang.String pRepositoryName)
Set the repository name from which to select items


getRepositoryName

public java.lang.String getRepositoryName()

setRepositoryPath

public void setRepositoryPath(java.lang.String pRepositoryPath)
Set the nucleus path of the repository from which to select items


getRepositoryPath

public java.lang.String getRepositoryPath()

setItemDescriptorName

public void setItemDescriptorName(java.lang.String pItemDescriptorName)
Set the name of the item descriptor from which to select items


getItemDescriptorName

public java.lang.String getItemDescriptorName()

setPersistent

public void setPersistent(boolean pPersistent)
Set the flag indicating whether or not to store this component in the Repository.


getPersistent

public boolean getPersistent()
Returns flag indicating if this RepositoryItemSlot is persistent or not.


setTransactionManager

public void setTransactionManager(javax.transaction.TransactionManager pTM)
Set the TransactionManager member variable used to persist RepositoryItemSlots.

See Also:
TransactionManager

getTransactionManager

public javax.transaction.TransactionManager getTransactionManager()
Returns the TransactionManager used to persist RepositoryItemSlots.

See Also:
TransactionManager

getValueType

public java.lang.Class getValueType()
Returns the type of values contained by the slot - namely, the RepositoryItem class.

Overrides:
getValueType in class Slot

add

public void add(java.lang.Object pItem)
Add an item to this slot with a default priority. This has been overidden so we will call RepositoryItemSlot.add which will also update the repository if this is a persistent Slot.

Overrides:
add in class Slot
Parameters:
pItem - the item to be added.

add

public void add(java.lang.Object pItem,
                int pPriority)
Add an item to this slot. If persistent, update the repository for the new item and priority just added.

Overrides:
add in class Slot
Parameters:
pItem - the item to be added.
pPriority - a relative priority used to order the items for rendering

addAll

public void addAll(java.util.Collection pItems)
Add multiple items to this slot with a default priority. If persistent, update the repository for the new item and priority just added.

Overrides:
addAll in class Slot
Parameters:
pItems - the collection of items to be added.

addAll

public void addAll(java.util.Collection pItems,
                   int pPriority)
Add an item to this slot. If persistent, update the repository for the new item and priority just added.

Overrides:
addAll in class Slot
Parameters:
pItems - the items to be added.
pPriority - a relative priority used to order the items for rendering

remove

public void remove(java.lang.Object pItem)
Remove an item from this slot. If persistent, update the repository for the item and priority just removed.

Overrides:
remove in class Slot
Parameters:
pItem - the item to be removed.

removeAll

public void removeAll(java.util.Collection pItems)
Remove a collection of items from this slot. If persistent, update the repository for the items and priorities removed.

Overrides:
removeAll in class Slot
Parameters:
pItems - the items to be removed.

clear

public void clear()
Clear all items from the slot. If persistent, update the repository for the items and priorities cleared.

Overrides:
clear in class Slot

getRange

protected java.lang.Object[] getRange(int pStartIndex,
                                      int pMaxNumber)
Return a list of objects to be rendered. If persistent, updates the repository after rendering is complete, since the contents of the slot may have changed in the process.

Overrides:
getRange in class Slot
Parameters:
pStartIndex - the starting index of the rendering
pMaxNumber - the maximum number of objects to render
Returns:
an array of items that should be rendered by the caller.

initSlotFromRepositoryItem

public void initSlotFromRepositoryItem(RepositoryItem pItem)
Initialize this persistent RepositoryItemSlot from the RepositoryItem of type 'profileSlot' contained in the profile Repository. NOTE: This method does not wrap the calls to the repository in a transcation. It is the calling codes repsonsibilty to do this.

Parameters:
pItems - the item used to initialize this RepositoryItemSlot.

updateSlotProfile

public void updateSlotProfile()
Updates the Profile which owns this slot.