|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.nucleus.logging.VariableArgumentApplicationLoggingImpl atg.nucleus.GenericService atg.markers.RepositoryMarkerManager
public class RepositoryMarkerManager
This is the base implementation class for a Repository Marker Manager.
A Marker is a repository item that has a standard set of string properties named key, value and data. There is also one standard property of type Date named creationDate. All extensions of the marker item should have the standard properties.
A marker is always referenced in the context of a marked(owning) repository item. The API provides that ability to create or remove a marker from a particular owner and determine if a particular owner has a specific marker by matching any combination of the key, value, and data property values.
A marked item is a repository item that has a multi-valued(Collection) of marker items.
Additional properties can be added to the marker item and provided to the API using the extendedProperties map. The extended properties map can be specified when adding, removing or testing for marker items. The map must contain a property name to value mapping.
The marked and marker items must be defined in the same repository.
Whenever specifying a string property value in the API, an empty string is considered the same as NULL.
This implementation supports marker collections of type List and Set. For Sets, the API methods that rely on ordinal position will sort the Set by marker creationDate.
Adding and removing markers:
Applications that add and remove markers must provide the marked item as
a mutable repository item and perform the final update of the marked item.
For example,
mutItem = repository.getItemForUpdate(item);
repositoryMarkerManager.addMarkerToItem(mutItem,.....)
repository.updateItem(mutItem)
Dealing with duplicate markers:
When adding a new marker to an item, a duplication mode can be specified to optionally
allow duplicates, replace duplicates, or to prevent a new duplicate marker from being
added(no duplicates).
Comparator components are used to determine if there are duplicate markers when adding a new marker. These components are global instances of MarkerDuplicateComparator. A comparator is called once for each marker in the item's current marker collection to determine if the marker is a duplicate of the new marker.
A default comparator component is defined using the property defaultDuplicateMarkerComparator.
There's also a map of comparator components defined by the property markerDuplicateComparators. By default, the new marker's key value is used to lookup the appropriate comparator in the map.
When using the NO_DUPLICATES or REPLACE_DUPLICATES option at least one comparator must be defined to determine the duplicates. If a comparator is not found in the map, the default comparator is used.
Validating markers:
Validator components are used to validate markers before they're added. Each validator is mapped
by a marker key.
The alwaysValidate boolean property can be set to true to force validation of all new markers.
In that case, there must be a validator defined for all new markers.
If alwaysValidate is set to false, only the new markers with a matching validator
are validated.
Testing marked items for specific markers:
Some API methods, such as hasMarker, can be used to test if an item has a specific
marker using any combination of the key, value and data properties.
These methods allow the caller to provide a subset of property values to
use in the comparison. For instance, the caller can determine if an item has a marker
with a key of "test", where only the key value is used in the comparison, regardless
of all other properties on the marker.
If the caller provides a property value that is NULL or an empty string, that value must also be NULL on the marker for a successful match. If the caller doesn't want to include a property in the comparison, they can specify a special string token that tells the RepositoryMarkerManager to ignore the property during the comparison. This special token is defined in the MarkerConstants class.
Example of determining if a marked item has a particular marker:
hasMarker(markedItem, "Campaigns","OctoberSale",MarkerConstants.ANY_VALUE);
Configurable properties:
The following properties can be configured on the RepositoryMarkerManager.
getMarkerDuplicateComparators()
,
getDefaultMarkerDuplicateComparator()
,
MarkerDuplicateComparator
,
CompareByProperties
,
getMarkerValidators()
,
MarkerValidator
,
ConfigurableMarkerValidator
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string |
protected java.lang.String |
mAddMessageJMSType
|
protected boolean |
mAlwaysValidate
|
protected java.lang.String |
mDefaultDuplicationMode
|
protected java.lang.String |
mDefaultMarkedItemType
|
protected MarkerDuplicateComparator |
mDefaultMarkerDuplicateComparator
|
protected java.lang.String |
mDefaultMarkerItemType
|
protected java.lang.String |
mDefaultMarkerPropertyName
|
protected java.lang.String |
mDefaultMarkerSortPropertyName
|
protected boolean |
mGenerateEvents
|
protected ServiceMap |
mMarkerDuplicateComparators
|
protected MarkerMessageSource |
mMarkerMessageSource
|
protected ServiceMap |
mMarkerValidators
|
protected int |
mMaxItemsPerTransaction
|
protected java.lang.String |
mRemoveMessageJMSType
|
protected java.lang.String |
mReplaceMessageJMSType
|
protected MutableRepository |
mRepository
|
protected java.lang.String[] |
mRequiredExtendedProperties
|
protected javax.transaction.TransactionManager |
mTransactionManager
|
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 | |
---|---|
RepositoryMarkerManager()
|
Method Summary | |
---|---|
boolean |
addMarkerItemToItem(MutableRepositoryItem pMarkedItem,
RepositoryItem pMarkerItem,
java.lang.String pMarkerPropertyName,
java.lang.String pDuplicationMode)
Adds a marker item to a marked item. |
RepositoryItem |
addMarkerToItem(MutableRepositoryItem pMarkedItem,
java.lang.String pKey,
java.lang.String pValue,
java.lang.String pData)
Creates a new marker item using the provided property values and adds it to the specified item. |
RepositoryItem |
addMarkerToItem(MutableRepositoryItem pMarkedItem,
java.lang.String pKey,
java.lang.String pValue,
java.lang.String pData,
java.util.Map pExtendedProperties,
java.lang.String pDuplicationMode)
Creates a new marker item using the provided property values and adds it to the specified item. |
RepositoryItem |
addMarkerToItem(MutableRepositoryItem pMarkedItem,
java.lang.String pKey,
java.lang.String pValue,
java.lang.String pData,
java.lang.String pDuplicationMode)
Creates a new marker item using the provided property values and adds it to the specified item. |
RepositoryItem |
addMarkerToItem(MutableRepositoryItem pMarkedItem,
java.lang.String pKey,
java.lang.String pValue,
java.lang.String pData,
java.lang.String pMarkerPropertyName,
java.util.Map pExtendedProperties,
java.lang.String pDuplicationMode)
Creates a new marker item using the provided property values and adds it to the specified item. |
RepositoryItem |
addMarkerToItem(MutableRepositoryItem pMarkedItem,
java.lang.String pKey,
java.lang.String pValue,
java.lang.String pData,
java.lang.String pMarkerItemType,
java.lang.String pMarkerPropertyName,
java.util.Map pExtendedProperties,
java.lang.String pDuplicationMode)
Creates a new marker item using the provided property values and adds it to the specified item. |
RepositoryItem |
addMarkerToItem(java.lang.String pMarkedItemId,
java.lang.String pKey,
java.lang.String pValue,
java.lang.String pData)
Creates a new marker item using the provided property values and adds it to the specified item. |
RepositoryItem |
addMarkerToItem(java.lang.String pMarkedItemId,
java.lang.String pKey,
java.lang.String pValue,
java.lang.String pData,
java.util.Map pExtendedProperties,
java.lang.String pDuplicationMode)
Creates a new marker item using the provided property values and adds it to the specified item. |
RepositoryItem |
addMarkerToItem(java.lang.String pMarkedItemId,
java.lang.String pKey,
java.lang.String pValue,
java.lang.String pData,
java.lang.String pDuplicationMode)
Creates a new marker item using the provided property values and adds it to the specified item. |
RepositoryItem |
addMarkerToItem(java.lang.String pMarkedItemId,
java.lang.String pMarkedItemType,
java.lang.String pKey,
java.lang.String pValue,
java.lang.String pData,
java.lang.String pMarkerItemType,
java.lang.String pMarkerPropertyName,
java.util.Map pExtendedProperties,
java.lang.String pDuplicationMode)
Creates a new marker item using the provided property values and adds it to the specified item. |
protected void |
addMarkerToItemsCollection(MutableRepositoryItem pMarkedItem,
RepositoryItem pMarkerItem,
java.lang.String pMarkerPropertyName)
Adds a marker item to an item's collection of markers. |
void |
addMarkerValidator(java.lang.String pKey,
MarkerValidator pMarkerValidator)
Adds a marker validator. |
protected boolean |
areMarkerPropertiesEqual(RepositoryItem pMarkerItem,
java.lang.String pKey,
java.lang.String pValue,
java.lang.String pData,
java.util.Map pExtendedProperties)
Compares the marker item property values to the parameter values. |
protected boolean |
compareDefaultPropertyValues(RepositoryItem pMarkerItem,
java.lang.String pKey,
java.lang.String pValue,
java.lang.String pData)
Compares key, value and data to the values in the marker. |
protected boolean |
compareExtendedPropertyValues(RepositoryItem pMarkerItem,
java.util.Map pExtendedProperties)
This method compares a marker item's extended property values to those in the extended properties map. |
protected MarkerAddedEventMessage |
createAddedEventMessage(java.lang.String pMarkedItemId,
java.lang.String pMarkedItemType,
java.lang.String pMarkerPropertyName,
RepositoryItem pAddedMarkerItem)
Creates a marker event message for add operations. |
protected MarkerData |
createAddedMarkerData(RepositoryItem pAddedMarkerItem)
Creates a new MarkerData object for the marker item that has been added by calling the generateMarkerData method. |
protected RepositoryItem |
createMarkerItem(java.lang.String pKey,
java.lang.String pValue,
java.lang.String pData,
java.lang.String pMarkerItemType,
java.util.Map pExtendedProperties)
Creates a new transient marker item and sets the default and extended properties. |
protected MarkerRemovedEventMessage |
createRemovedEventMessage(java.lang.String pMarkedItemId,
java.lang.String pMarkedItemType,
java.lang.String pMarkerPropertyName,
RepositoryItem pRemovedMarkerItem)
Creates a marker event message for remove operations. |
protected MarkerData |
createRemovedMarkerData(RepositoryItem pRemovedMarkerItem)
Creates a new MarkerData object for the marker item that has been removed by calling the generateMarkerData method. |
protected MarkerReplacedEventMessage |
createReplacedEventMessage(java.lang.String pMarkedItemId,
java.lang.String pMarkedItemType,
RepositoryItem pAddedMarkerItem,
java.lang.String pMarkerPropertyName,
RepositoryItem pReplacedMarkerItem)
Creates a marker event message for replace operations. |
protected MarkerData |
createReplacedMarkerData(RepositoryItem pReplacedMarkerItem)
Creates a new MarkerData object for the marker item that has been replaced by calling the generateMarkerData method. |
java.lang.Object[] |
createSortedArrayOfMarkers(java.util.Collection pMarkers,
java.lang.String pMarkerSortPropertyName)
Create a sorted array of items in ascending order using the marker sort property name provided. |
int |
deleteMarkers(java.lang.String pMarkedItemType,
java.lang.String pMarkerItemType,
java.lang.String pMarkerPropertyName,
java.lang.String pKey,
java.lang.String pValue,
java.lang.String pData,
java.util.Map pExtendedProperties)
This method will delete marker items with matching values. |
void |
doStartService()
This method is called as service startup. |
protected MarkerDuplicateComparator |
findComparator(java.lang.String pComparatorKey)
Returns the MarkerDuplicateComparator from the MarkerDuplicateComparators map using the pComparatorKey. |
protected java.util.Collection |
findDuplicates(RepositoryItem pMarkedItem,
RepositoryItem pMarkerItem,
java.lang.String pMarkerPropertyName)
Finds duplicate markers on the item. |
protected RepositoryItem |
findLastMarkerOnItem(RepositoryItem pMarkedItem,
java.lang.String pMarkerPropertyName)
This method returns the last marker in the marker collection. |
protected MarkerValidator |
findMarkerValidator(RepositoryItem pMarkedItem,
RepositoryItem pMarkerItem)
Locates a marker validator component in the marker validator service map. |
MarkerValidator |
findMarkerValidator(java.lang.String pKey)
Locates a marker validator component in the marker validator service map. |
java.util.Collection |
findMatchingMarkers(RepositoryItem pMarkedItem,
java.lang.String pKey,
java.lang.String pValue,
java.lang.String pData,
java.lang.String pMarkerPropertyName,
java.util.Map pExtendedProperties)
This method returns the markers from the item that match the values provided. |
java.util.Collection |
findMatchingMarkers(java.lang.String pMarkedItemId,
java.lang.String pKey,
java.lang.String pValue,
java.lang.String pData,
java.util.Map pExtendedProperties)
This method returns the markers from the item that match the values provided. |
java.util.Collection |
findMatchingMarkers(java.lang.String pMarkedItemId,
java.lang.String pMarkedItemType,
java.lang.String pKey,
java.lang.String pValue,
java.lang.String pData,
java.lang.String pMarkerPropertyName,
java.util.Map pExtendedProperties)
This method returns the markers from the item that match the values provided. |
java.util.Collection |
findValidKeys()
The method exposes the keys used to map MarkerValidators. |
java.util.List |
findValidValuesForKey(java.lang.String pMarkerKey)
This returns the valid values for the given markerKey. |
protected MarkerAddedEventMessage |
generateAddMessage()
This method is called by createAddedEventMessage to instantiate an object of type MarkerAddedEventMessage. |
protected MarkerData |
generateMarkerData()
This method instantiates an object of the type MarkerData. |
protected Query |
generateMarkerExtendedPropertyQuery(QueryBuilder pQueryBuilder,
java.lang.String pKey,
java.lang.String pValue,
java.lang.String pData,
java.util.Map pExtendedProperties)
This method is called by getItemsWithMarker and deleteMarkers. |
Query |
generateMarkerQualifyingAndedQuery(java.lang.String pMarkerItemType,
java.lang.String pKey,
java.lang.String pValue,
java.lang.String pData,
java.util.Map pExtendedProperties)
This method will create a query object for the marker item which qualifies markers by the key, value, data and extended properties. |
protected MarkerRemovedEventMessage |
generateRemoveMessage()
This method is called by createRemovedEventMessage to instantiate an object of type MarkerRemovedEventMessage. |
protected MarkerReplacedEventMessage |
generateReplaceMessage()
This method is called by createReplacedEventMessage to instantiate an object of type MarkerReplacedEventMessage. |
java.lang.String |
getAddMessageJMSType()
Returns the JMS Message type used when sending marked added messages. |
java.util.Collection |
getAllMarkersFromItem(RepositoryItem pMarkedItem)
This method returns a copy of the current marker collection from the given item. |
java.util.Collection |
getAllMarkersFromItem(RepositoryItem pMarkedItem,
java.lang.String pMarkerPropertyName)
This method returns a copy of the current marker collection from the given item. |
java.util.Collection |
getAllMarkersFromItem(java.lang.String pMarkedItemId)
This method returns a copy of the current marker collection from the given item. |
java.util.Collection |
getAllMarkersFromItem(java.lang.String pMarkedItemId,
java.lang.String pMarkedItemType,
java.lang.String pMarkerPropertyName)
This method returns a copy of the current marker collection from the given item. |
protected java.lang.String |
getComparatorKey(RepositoryItem pMarkerItem)
This method returns the key used to lookup the MarkerDuplicateComparator in the MarkerDuplicateComparators map. |
java.lang.String |
getDefaultDuplicationMode()
Returns the default duplication mode. |
java.lang.String |
getDefaultMarkedItemType()
Returns the default marked item type used when referencing a marked item by id. |
MarkerDuplicateComparator |
getDefaultMarkerDuplicateComparator()
Returns the default marker duplicate comparator. |
java.lang.String |
getDefaultMarkerItemType()
Returns the default marker item type used when creating new markers. |
java.lang.String |
getDefaultMarkerPropertyName()
Returns the default property name for storing markers on an item. |
java.lang.String |
getDefaultMarkerSortPropertyName()
Returns the default property name for sorting markers. |
Query |
getDefaultPropertyQuery(QueryBuilder pQueryBuilder,
java.lang.String pPropertyNameOnMarker,
java.lang.String pValue)
This method creates the query object for comparing a value of a marker property to the provided value. |
protected java.lang.String |
getDuplicationMode(java.lang.String pDuplicationMode)
This method is called by other internal methods that require a duplicationMode. |
RepositoryItem[] |
getItemsWithMarker(java.lang.String pKey,
java.lang.String pValue,
java.lang.String pData)
This method queries for marked items in the repository that have markers whose key, value and data match the provided parameter values. |
RepositoryItem[] |
getItemsWithMarker(java.lang.String pMarkedItemType,
java.lang.String pMarkerItemType,
java.lang.String pMarkerPropertyName,
java.lang.String pKey,
java.lang.String pValue,
java.lang.String pData,
java.util.Map pExtendedProperties)
This method queries for marked items in the repository that have markers with a matching key, value and data values. |
protected java.lang.String |
getMarkedItemType(java.lang.String pMarkedItemType)
This method is called by other internal methods that require a markedItemType. |
protected java.util.Collection |
getMarkerCollectionFromItem(RepositoryItem pMarkedItem,
java.lang.String pMarkerPropertyName)
Util method for returning the marker collection from an item. |
ServiceMap |
getMarkerDuplicateComparators()
Returns the map of MarkerDuplicateComparator components. |
protected java.lang.String |
getMarkerEventProfileId(java.lang.String pMarkedItemId,
java.lang.String pMarkedItemType,
RepositoryItem pMarkerItem)
This method is called to return the profile id that will be associated with a marker event. |
protected java.lang.String |
getMarkerItemType(java.lang.String pMarkerItemType)
This method is called by other internal methods that require a markerItemType. |
MarkerMessageSource |
getMarkerMessageSource()
Returns the message source that sends marker JMS messages. |
protected java.lang.String |
getMarkerPropertyName(java.lang.String pMarkerPropertyName)
This method is called by other internal methods that require a markerPropertyName. |
protected java.lang.String |
getMarkerSortPropertyName(java.lang.String pMarkerSortPropertyName)
This method is called by other internal methods that require a markerSortPropertyName. |
ServiceMap |
getMarkerValidators()
Returns the map of MarkerValidator Components. |
int |
getMaxItemsPerTransaction()
Returns property maxItemsPerTransaction Default value is 1000. |
java.lang.String |
getRemoveMessageJMSType()
Returns the JMS Message type used when sending marked removed messages. |
java.lang.String |
getReplaceMessageJMSType()
Returns the JMS Message type used when sending marked replaced messages. |
MutableRepository |
getRepository()
Returns the repository used by the marker manager . |
java.lang.String[] |
getRequiredExtendedProperties()
Returns the default array of extended property names that are required when creating a new marker. |
javax.transaction.TransactionManager |
getTransactionManager()
Transaction Manager |
java.util.Map |
getValidatedKeysAndValues()
Generates a map of the validate keys and their possible values. |
protected boolean |
hasDuplicates(RepositoryItem pMarkedItem,
RepositoryItem pMarkerItem,
java.lang.String pMarkerPropertyName)
Checks for a duplicate marker on the item. |
boolean |
hasMarker(RepositoryItem pMarkedItem,
java.lang.String pKey,
java.lang.String pValue,
java.lang.String pData,
java.util.Map pExtendedProperties)
This method determines if a marked item contains a marker with the specified property values. |
boolean |
hasMarker(RepositoryItem pMarkedItem,
java.lang.String pKey,
java.lang.String pValue,
java.lang.String pData,
java.lang.String pMarkerPropertyName,
java.util.Map pExtendedProperties)
This method determines if a marked item contains a marker with the specified property values. |
boolean |
hasMarker(java.lang.String pMarkedItemId,
java.lang.String pKey,
java.lang.String pValue,
java.lang.String pData,
java.util.Map pExtendedProperties)
This method determines if a marked item contains a marker with the specified property values. |
boolean |
hasMarker(java.lang.String pMarkedItemId,
java.lang.String pMarkedItemType,
java.lang.String pKey,
java.lang.String pValue,
java.lang.String pData,
java.lang.String pMarkerPropertyName,
java.util.Map pExtendedProperties)
|
protected java.util.Collection |
identifyMissingExtendedProperties(java.lang.String pKey,
java.lang.String pValue,
java.lang.String pData,
java.lang.String pMarkerItemType,
java.util.Map pExtendedProperties)
This method identifies the properties that are missing from the extendedProperties map using the configured requiredExtendedProperties array. |
boolean |
isAlwaysValidate()
Boolean property that determines if all markers must be validated. |
protected boolean |
isDuplicateMarker(RepositoryItem pMarker1,
RepositoryItem pMarker2,
MarkerDuplicateComparator pComparator)
This method calls the appropriate comparator component to determine if the two markers are duplicates of each other. |
boolean |
isGenerateEvents()
Boolean flag for optionally generating JMS events. |
boolean |
isValidKey(java.lang.String pKey)
|
boolean |
isValidValueForKey(java.lang.String pKey,
java.lang.String pValue)
|
RepositoryItem |
matchLastMarker(RepositoryItem pMarkedItem,
java.lang.String pKey,
java.lang.String pValue,
java.lang.String pData,
java.util.Map pExtendedProperties)
This method returns the item's last marker only if it has a matching key, value, data and extendedProperties. |
RepositoryItem |
matchLastMarker(RepositoryItem pMarkedItem,
java.lang.String pKey,
java.lang.String pValue,
java.lang.String pData,
java.lang.String pMarkerPropertyName,
java.util.Map pExtendedProperties)
This method returns the item's last marker only if it has a matching key, value, data and extendedProperties. |
RepositoryItem |
matchLastMarker(java.lang.String pMarkedItemId,
java.lang.String pKey,
java.lang.String pValue,
java.lang.String pData,
java.util.Map pExtendedProperties)
This method returns the item's last marker only if it has a matching key, value, data and extendedProperties. |
RepositoryItem |
matchLastMarker(java.lang.String pMarkedItemId,
java.lang.String pMarkedItemType,
java.lang.String pKey,
java.lang.String pValue,
java.lang.String pData,
java.lang.String pMarkerPropertyName,
java.util.Map pExtendedProperties)
This method returns the item's last marker only if it has a matching key, value, data and extendedProperties. |
RepositoryItem |
matchLastMarkerWithKey(RepositoryItem pMarkedItem,
java.lang.String pKey,
java.lang.String pValue,
java.lang.String pData,
java.util.Map pExtendedProperties)
This method returns the last marker with a given key only if it has a matching value, data and extendedProperties. |
RepositoryItem |
matchLastMarkerWithKey(RepositoryItem pMarkedItem,
java.lang.String pKey,
java.lang.String pValue,
java.lang.String pData,
java.lang.String pMarkerPropertyName,
java.util.Map pExtendedProperties)
This method returns the last marker with a given key only if it has a matching value, data and extendedProperties. |
RepositoryItem |
matchLastMarkerWithKey(java.lang.String pMarkedItemId,
java.lang.String pKey,
java.lang.String pValue,
java.lang.String pData,
java.util.Map pExtendedProperties)
This method returns the last marker with a given key only if it has a matching value, data and extendedProperties. |
RepositoryItem |
matchLastMarkerWithKey(java.lang.String pMarkedItemId,
java.lang.String pMarkedItemType,
java.lang.String pKey,
java.lang.String pValue,
java.lang.String pData,
java.lang.String pMarkerPropertyName,
java.util.Map pExtendedProperties)
This method returns the last marker with a given key only if it has a matching value, data and extendedProperties. |
int |
removeAllMarkersFromItem(MutableRepositoryItem pMarkedItem)
Removes all markers from the marked item. |
int |
removeAllMarkersFromItem(MutableRepositoryItem pMarkedItem,
java.lang.String pMarkerPropertyName)
Removes all markers from the marked item. |
int |
removeAllMarkersFromItem(java.lang.String pMarkedItemId)
Removes all markers from the marked item. |
int |
removeAllMarkersFromItem(java.lang.String pMarkedItemId,
java.lang.String pMarkedItemType,
java.lang.String pMarkerPropertyName)
Removes all markers from the marked item. |
int |
removeMarkersFromItem(MutableRepositoryItem pMarkedItem,
java.lang.String pKey,
java.lang.String pValue,
java.lang.String pData,
java.util.Map pExtendedProperties)
This method removes the markers from the item that match the values provided. |
int |
removeMarkersFromItem(MutableRepositoryItem pMarkedItem,
java.lang.String pKey,
java.lang.String pValue,
java.lang.String pData,
java.lang.String pMarkerPropertyName,
java.util.Map pExtendedProperties)
This method removes the markers from the item that match the values provided. |
int |
removeMarkersFromItem(java.lang.String pMarkedItemId,
java.lang.String pKey,
java.lang.String pValue,
java.lang.String pData,
java.util.Map pExtendedProperties)
This method removes the markers from the item that match the values provided. |
int |
removeMarkersFromItem(java.lang.String pMarkedItemId,
java.lang.String pMarkedItemType,
java.lang.String pKey,
java.lang.String pValue,
java.lang.String pData,
java.lang.String pMarkerPropertyName,
java.util.Map pExtendedProperties)
This method removes the markers from the item that match the values provided. |
protected void |
removeMarkersFromItemsCollection(MutableRepositoryItem pMarkedItem,
java.util.Collection pMarkerItems,
java.lang.String pMarkerPropertyName)
Removes a collection of markers from a item's collection of markers. |
void |
removeMarkerValidator(java.lang.String pKey)
Remove a marker validator. |
void |
setAddMessageJMSType(java.lang.String pAddMessageJMSType)
property AddMessageJMSType Sets the JMS Message type used when sending marked added messages. |
void |
setAlwaysValidate(boolean pAlwaysValidate)
Sets the boolean property for determining if markers must always be validated. |
protected void |
setBaseMarkerData(RepositoryItem pMarkerItem,
MarkerData pMarkerData)
Sets the base properties of the MarkerData object based on the marker item. |
protected void |
setBaseMarkerEventProperties(java.lang.String pMarkedItemId,
java.lang.String pMarkerItemType,
RepositoryItem pMarkerItem,
java.lang.String pMarkerPropertyName,
MarkerEventMessage pMessage)
Sets the base property values of the marker event message. |
void |
setDefaultDuplicationMode(java.lang.String pDefaultDuplicationMode)
Sets the default duplication mode. |
void |
setDefaultMarkedItemType(java.lang.String pDefaultMarkedItemType)
Sets the default marked item type used when referencing a marked item by id. |
void |
setDefaultMarkerDuplicateComparator(MarkerDuplicateComparator pDefaultMarkerDuplicateComparator)
Sets the default marker duplicate comparator. |
void |
setDefaultMarkerItemType(java.lang.String pDefaultMarkerItemType)
Sets the default marker item type used when creating new markers. |
protected void |
setDefaultMarkerProperties(MutableRepositoryItem pMarkerItem,
java.lang.String pKey,
java.lang.String pValue,
java.lang.String pData)
Set the default property values of a marker. |
void |
setDefaultMarkerPropertyName(java.lang.String pDefaultMarkerPropertyName)
Sets the default property name for storing markers. |
void |
setDefaultMarkerSortPropertyName(java.lang.String pDefaultMarkerSortPropertyName)
Sets the default property name for sorting markers. |
protected void |
setExtendedMarkerData(RepositoryItem pMarkerItem,
MarkerData pMarkerData)
This method is called by the createAddedMarkerData, createReplacedMarkerData and createRemovedMarkerData methods to set the extended properties of the MarkerData object. |
protected void |
setExtendedMarkerProperties(MutableRepositoryItem pMarkerItem,
java.lang.String pKey,
java.lang.String pValue,
java.lang.String pData,
java.util.Map pExtendedProperties)
Sets the extended properties of a marker. |
void |
setGenerateEvents(boolean pGenerateEvents)
Sets the boolean flag for optionally generating JMS events |
void |
setMarkerDuplicateComparators(ServiceMap pMarkerDuplicateComparators)
Sets the map of MarkerDuplicateComparator components. |
void |
setMarkerMessageSource(MarkerMessageSource pMarkerMessageSource)
Sets the message source that sends marker JMS messages. |
void |
setMarkerValidators(ServiceMap pMarkerValidators)
|
void |
setMaxItemsPerTransaction(int pMaxItemsPerTransaction)
Sets property maxItemsPerTransaction |
void |
setRemoveMessageJMSType(java.lang.String pRemoveMessageJMSType)
property RemoveMessageJMSType Sets the JMS Message type used when sending marked removed messages Remove messages are sent whenever a marker is removed from a marked item. |
void |
setReplaceMessageJMSType(java.lang.String pReplaceMessageJMSType)
property ReplaceMessageJMSType Sets the JMS Message type used when sending marked replaced messages Replace messages are sent whenever a marker is replaced by a new marker. |
void |
setRepository(MutableRepository pRepository)
Sets the repository used by the marker manager. |
void |
setRequiredExtendedProperties(java.lang.String[] pRequiredExtendedProperties)
Sets the default array of extended property names that are required when creating a new marker. |
void |
setTransactionManager(javax.transaction.TransactionManager pTransactionManager)
Sets the Transaction Manager. |
protected void |
validateMarker(RepositoryItem pMarkedItem,
RepositoryItem pMarkerItem)
This method is called by addMarkerItemToItem to validate a new marker. |
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, toString, wait, wait, wait |
Field Detail |
---|
public static java.lang.String CLASS_VERSION
protected boolean mAlwaysValidate
protected java.lang.String mAddMessageJMSType
protected java.lang.String mRemoveMessageJMSType
protected java.lang.String mReplaceMessageJMSType
protected MarkerMessageSource mMarkerMessageSource
protected MutableRepository mRepository
protected MarkerDuplicateComparator mDefaultMarkerDuplicateComparator
protected ServiceMap mMarkerDuplicateComparators
protected ServiceMap mMarkerValidators
protected java.lang.String mDefaultMarkerSortPropertyName
protected java.lang.String mDefaultMarkerPropertyName
protected java.lang.String mDefaultMarkerItemType
protected java.lang.String mDefaultMarkedItemType
protected java.lang.String[] mRequiredExtendedProperties
protected java.lang.String mDefaultDuplicationMode
protected boolean mGenerateEvents
protected javax.transaction.TransactionManager mTransactionManager
protected int mMaxItemsPerTransaction
Constructor Detail |
---|
public RepositoryMarkerManager()
Method Detail |
---|
public boolean isAlwaysValidate()
public void setAlwaysValidate(boolean pAlwaysValidate)
public void setAddMessageJMSType(java.lang.String pAddMessageJMSType)
public java.lang.String getAddMessageJMSType()
public void setRemoveMessageJMSType(java.lang.String pRemoveMessageJMSType)
public java.lang.String getRemoveMessageJMSType()
public void setReplaceMessageJMSType(java.lang.String pReplaceMessageJMSType)
public java.lang.String getReplaceMessageJMSType()
public void setMarkerMessageSource(MarkerMessageSource pMarkerMessageSource)
public MarkerMessageSource getMarkerMessageSource()
public void setRepository(MutableRepository pRepository)
public MutableRepository getRepository()
public void setDefaultMarkerDuplicateComparator(MarkerDuplicateComparator pDefaultMarkerDuplicateComparator)
public MarkerDuplicateComparator getDefaultMarkerDuplicateComparator()
public void setMarkerDuplicateComparators(ServiceMap pMarkerDuplicateComparators)
Use this map to define comparator components other than the default comparator. When locating a comparator during a duplicate check, this map is consulted first using the marker's key value. If a comparator is not defined in the map, the defaultComparator is used.
For example, to define a comparator that is used for markers with a key
of "test".
test=/atg/MyTestMarkerComparator
findComparator(java.lang.String)
public ServiceMap getMarkerDuplicateComparators()
public void setMarkerValidators(ServiceMap pMarkerValidators)
public ServiceMap getMarkerValidators()
public void setDefaultMarkerSortPropertyName(java.lang.String pDefaultMarkerSortPropertyName)
public java.lang.String getDefaultMarkerSortPropertyName()
public void setDefaultMarkerPropertyName(java.lang.String pDefaultMarkerPropertyName)
public java.lang.String getDefaultMarkerPropertyName()
public void setDefaultMarkerItemType(java.lang.String pDefaultMarkerItemType)
public java.lang.String getDefaultMarkerItemType()
public void setDefaultMarkedItemType(java.lang.String pDefaultMarkedItemType)
public java.lang.String getDefaultMarkedItemType()
public void setRequiredExtendedProperties(java.lang.String[] pRequiredExtendedProperties)
public java.lang.String[] getRequiredExtendedProperties()
public void setDefaultDuplicationMode(java.lang.String pDefaultDuplicationMode)
public java.lang.String getDefaultDuplicationMode()
public void setGenerateEvents(boolean pGenerateEvents)
public boolean isGenerateEvents()
public void setTransactionManager(javax.transaction.TransactionManager pTransactionManager)
public javax.transaction.TransactionManager getTransactionManager()
public void setMaxItemsPerTransaction(int pMaxItemsPerTransaction)
public int getMaxItemsPerTransaction()
public void doStartService() throws ServiceException
doStartService
in class GenericService
ServiceException
- if the Service had a problem starting uppublic RepositoryItem addMarkerToItem(MutableRepositoryItem pMarkedItem, java.lang.String pKey, java.lang.String pValue, java.lang.String pData, java.lang.String pMarkerItemType, java.lang.String pMarkerPropertyName, java.util.Map pExtendedProperties, java.lang.String pDuplicationMode) throws MarkerException, InvalidMarkerException
pMarkedItem
- (required)The repository item being marked.pKey
- (required)The marker item key.pValue
- The marker item value.pData
- The marker item data.pMarkerItemType
- The repository item type of the marker definition to use when creating
the new marker.pMarkerProperty
- The property name containing the collection of markers on the item.
Defaults to the value configured in the marker manager.pExtendedProperties
- A map containing the extended marker property names/values.
Use this map to specify any non-default marker property values that
have been added to the marker item definition.pDuplicationMode
- Controls processing in cases where the item already contains duplicate markers.
MarkerException
- if errors occur during processing
InvalidMarkerException
- if the marker is rejected as invalid.getDefaultMarkerPropertyName()
public RepositoryItem addMarkerToItem(MutableRepositoryItem pMarkedItem, java.lang.String pKey, java.lang.String pValue, java.lang.String pData) throws MarkerException, InvalidMarkerException
MarkerException
InvalidMarkerException
addMarkerToItem(atg.repository.MutableRepositoryItem, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map, java.lang.String)
public RepositoryItem addMarkerToItem(MutableRepositoryItem pMarkedItem, java.lang.String pKey, java.lang.String pValue, java.lang.String pData, java.lang.String pDuplicationMode) throws MarkerException, InvalidMarkerException
MarkerException
InvalidMarkerException
addMarkerToItem(atg.repository.MutableRepositoryItem, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map, java.lang.String)
public RepositoryItem addMarkerToItem(MutableRepositoryItem pMarkedItem, java.lang.String pKey, java.lang.String pValue, java.lang.String pData, java.util.Map pExtendedProperties, java.lang.String pDuplicationMode) throws MarkerException, InvalidMarkerException
MarkerException
InvalidMarkerException
addMarkerToItem(atg.repository.MutableRepositoryItem, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map, java.lang.String)
public RepositoryItem addMarkerToItem(MutableRepositoryItem pMarkedItem, java.lang.String pKey, java.lang.String pValue, java.lang.String pData, java.lang.String pMarkerPropertyName, java.util.Map pExtendedProperties, java.lang.String pDuplicationMode) throws MarkerException, InvalidMarkerException
MarkerException
InvalidMarkerException
addMarkerToItem(atg.repository.MutableRepositoryItem, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map, java.lang.String)
public boolean addMarkerItemToItem(MutableRepositoryItem pMarkedItem, RepositoryItem pMarkerItem, java.lang.String pMarkerPropertyName, java.lang.String pDuplicationMode) throws MarkerException, InvalidMarkerException
pMarkedItem
- (required)The RepositoryItem being marked.pMarkerItem
- The marker item to be added.pMarkerPropertyName
- The property name containing the collection of markers on the item.
Defaults to the value configured in the marker manager.pDuplicationMode
- Controls processing in cases where the item
already contains duplicate markers.
MarkerException
- if errors occur during processing
InvalidMarkerException
- if the marker is rejected as invalid.getDefaultMarkerPropertyName()
public RepositoryItem addMarkerToItem(java.lang.String pMarkedItemId, java.lang.String pKey, java.lang.String pValue, java.lang.String pData) throws MarkerException, InvalidMarkerException
MarkerException
InvalidMarkerException
addMarkerToItem(atg.repository.MutableRepositoryItem, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map, java.lang.String)
public RepositoryItem addMarkerToItem(java.lang.String pMarkedItemId, java.lang.String pKey, java.lang.String pValue, java.lang.String pData, java.lang.String pDuplicationMode) throws MarkerException, InvalidMarkerException
MarkerException
InvalidMarkerException
addMarkerToItem(atg.repository.MutableRepositoryItem, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map, java.lang.String)
public RepositoryItem addMarkerToItem(java.lang.String pMarkedItemId, java.lang.String pKey, java.lang.String pValue, java.lang.String pData, java.util.Map pExtendedProperties, java.lang.String pDuplicationMode) throws MarkerException, InvalidMarkerException
MarkerException
InvalidMarkerException
addMarkerToItem(atg.repository.MutableRepositoryItem, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map, java.lang.String)
public RepositoryItem addMarkerToItem(java.lang.String pMarkedItemId, java.lang.String pMarkedItemType, java.lang.String pKey, java.lang.String pValue, java.lang.String pData, java.lang.String pMarkerItemType, java.lang.String pMarkerPropertyName, java.util.Map pExtendedProperties, java.lang.String pDuplicationMode) throws MarkerException, InvalidMarkerException
MarkerException
InvalidMarkerException
addMarkerToItem(atg.repository.MutableRepositoryItem, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map, java.lang.String)
protected void setDefaultMarkerProperties(MutableRepositoryItem pMarkerItem, java.lang.String pKey, java.lang.String pValue, java.lang.String pData) throws MarkerException
Default properties are key, value, data and creationDate.
A property is not set if it is null or has a length of 0.
creationDate defaults to the current time.
pMarkerItem
- the marker item.pKey
- the marker key.pValue
- the marker value.pData
- the marker data.
MarkerException
protected void setExtendedMarkerProperties(MutableRepositoryItem pMarkerItem, java.lang.String pKey, java.lang.String pValue, java.lang.String pData, java.util.Map pExtendedProperties) throws MarkerException
Each entry in the extended properties map corresponds to a property on the marker item where the map key = property name.
This method sets each property in the marker to the corresponding value in the map.
Property values of type String must have a length greater than 0 to be set, otherwise they are ignored and left as null.
pMarkerItem
- the marker repository item.pKey
- the marker key.pValue
- the marker value.pData
- the marker data.pExtendedProperties
- the Map containing the property name to value mappings.
MarkerException
protected void addMarkerToItemsCollection(MutableRepositoryItem pMarkedItem, RepositoryItem pMarkerItem, java.lang.String pMarkerPropertyName) throws MarkerException
pMarkedItem
- the mutable item with the collection of markers.pMarkerItem
- the marker item .pMarkerPropertyName
- the name of the item's marker collection property .
MarkerException
protected void removeMarkersFromItemsCollection(MutableRepositoryItem pMarkedItem, java.util.Collection pMarkerItems, java.lang.String pMarkerPropertyName) throws MarkerException
pMarkedItem
- the mutable repository item containing the marker to be removed.pMarkerItems
- the collection of markers to remove.pMarkerPropertyName
- the name of the property containing the Collection of markers.
MarkerException
protected java.util.Collection identifyMissingExtendedProperties(java.lang.String pKey, java.lang.String pValue, java.lang.String pData, java.lang.String pMarkerItemType, java.util.Map pExtendedProperties)
This method uses the same requiredExtendedProperties array for all marker types.
The key, value, data and markerItem types are not used by the base implementation but are provided to enable extensions to define different required extended properties based on these values.
pKey
- the new markers key.pValue
- the new markers value.pData
- the new markers data.pMarkerItemType
- the type of marker being created in addMarkerToItem.pExtendedProperties
- the map of extended properties provided to
addMarkerToItem.protected java.util.Collection findDuplicates(RepositoryItem pMarkedItem, RepositoryItem pMarkerItem, java.lang.String pMarkerPropertyName) throws MarkerException
pMarkedItem
- the item with markerspMarkerItem
- the marker used in the duplicate checkpMarkerPropertyName
- the property containing the markers
MarkerException
protected boolean hasDuplicates(RepositoryItem pMarkedItem, RepositoryItem pMarkerItem, java.lang.String pMarkerPropertyName) throws MarkerException
pMarkedItem
- the item with markerspMarkerItem
- the marker used in the duplicate checkpMarkerPropertyName
- the property containing the markers
MarkerException
protected boolean isDuplicateMarker(RepositoryItem pMarker1, RepositoryItem pMarker2, MarkerDuplicateComparator pComparator) throws MarkerException
pMarker1
- a marker used in the comparison. this marker item is passed to
the method getComparatorKey to determine the comparator
lookup key.pMarker2
- a marker used in the comparison.pComparator
- the MarkerDuplicateComparator to use in the comparison. If null,
findComparator is used to determine the appropriate comparator
component.
MarkerException
getComparatorKey(atg.repository.RepositoryItem)
,
findComparator(java.lang.String)
protected java.lang.String getComparatorKey(RepositoryItem pMarkerItem)
The markerItem's key value is returned by default.
pMarkerItem
- the marker item for which the appropriate
comparator should be returned.
protected MarkerDuplicateComparator findComparator(java.lang.String pComparatorKey)
pComparatorKey
- the key to identify the comparator in the
MarkerDuplicateComparators map.
isDuplicateMarker(atg.repository.RepositoryItem, atg.repository.RepositoryItem, atg.markers.MarkerDuplicateComparator)
protected RepositoryItem createMarkerItem(java.lang.String pKey, java.lang.String pValue, java.lang.String pData, java.lang.String pMarkerItemType, java.util.Map pExtendedProperties) throws MarkerException
pKey
- The marker item key.pValue
- The marker item value.pData
- The marker item data.pMarkerItemType
- The marker item type in the repository.pExtendedProperties
- A Map containing the property name to value pairs used
to set the default and extended property values.
MarkerException
public java.util.Collection findMatchingMarkers(RepositoryItem pMarkedItem, java.lang.String pKey, java.lang.String pValue, java.lang.String pData, java.lang.String pMarkerPropertyName, java.util.Map pExtendedProperties) throws MarkerException
If the parameter values are NULL then the marker property must also be NULL. If you want to exclude/ignore a property, specify MarkerConstants.ANY_VALUE.
pMarkedItem
- The marked repository item.pKey
- The key value used to match markers.pValue
- The value value used to match markers .pData
- The data value used to match markers .pMarkerPropertyName
- The property name where the markers are stored on pMarkedItem.pExtendedProperties
- a map of property values used to match
the marker items. If the map
contains a NULL entry value, the matching
marker property must also be NULL.
If Map is NULL the extended properties
are not included in the test.
MarkerException
areMarkerPropertiesEqual(atg.repository.RepositoryItem, java.lang.String, java.lang.String, java.lang.String, java.util.Map)
,
MarkerConstants.ANY_VALUE
public java.util.Collection findMatchingMarkers(java.lang.String pMarkedItemId, java.lang.String pKey, java.lang.String pValue, java.lang.String pData, java.util.Map pExtendedProperties) throws MarkerException
MarkerException
findMatchingMarkers(atg.repository.RepositoryItem, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map)
public java.util.Collection findMatchingMarkers(java.lang.String pMarkedItemId, java.lang.String pMarkedItemType, java.lang.String pKey, java.lang.String pValue, java.lang.String pData, java.lang.String pMarkerPropertyName, java.util.Map pExtendedProperties) throws MarkerException
MarkerException
findMatchingMarkers(atg.repository.RepositoryItem, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map)
public int removeMarkersFromItem(MutableRepositoryItem pMarkedItem, java.lang.String pKey, java.lang.String pValue, java.lang.String pData, java.lang.String pMarkerPropertyName, java.util.Map pExtendedProperties) throws MarkerException
If a parameter value is NULL, the marker property must be NULL to match. If the marker property value can be any value, use the constant value specified in the MarkerConstants.
pMarkedItem
- The item containing the markers.pKey
- The key value used to match markers.pValue
- The value value used to match markers.pData
- The data value used to match markers.pMarkerPropertyName
- The property on the bean that contains the collection
of markers.pExtendedProperties
- a map of property values used to match
the marker items. If the map
contains a NULL entry value, the matching
marker property must also be NULL.
If Map is NULL the extended properties
are not included in the test.
MarkerException
MarkerConstants.ANY_VALUE
public int removeMarkersFromItem(java.lang.String pMarkedItemId, java.lang.String pKey, java.lang.String pValue, java.lang.String pData, java.util.Map pExtendedProperties) throws MarkerException
MarkerException
removeMarkersFromItem(atg.repository.MutableRepositoryItem, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map)
public int removeMarkersFromItem(java.lang.String pMarkedItemId, java.lang.String pMarkedItemType, java.lang.String pKey, java.lang.String pValue, java.lang.String pData, java.lang.String pMarkerPropertyName, java.util.Map pExtendedProperties) throws MarkerException
MarkerException
removeMarkersFromItem(atg.repository.MutableRepositoryItem, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map)
public int removeMarkersFromItem(MutableRepositoryItem pMarkedItem, java.lang.String pKey, java.lang.String pValue, java.lang.String pData, java.util.Map pExtendedProperties) throws MarkerException
MarkerException
removeMarkersFromItem(atg.repository.MutableRepositoryItem, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map)
protected MarkerRemovedEventMessage createRemovedEventMessage(java.lang.String pMarkedItemId, java.lang.String pMarkedItemType, java.lang.String pMarkerPropertyName, RepositoryItem pRemovedMarkerItem) throws MarkerException
This method first calls generateRemoveMessage to instantiate a MarkerRemovedEventMessage event object, then it fills in all the base properties of the removed event, as well as the MarkerData object that represents the removed marker's property values.
To extend the MarkerRemovedEventMessage, extend the generateRemoveMessage method, and this method. In the extension of this method be sure to call super() first to fill in the base event properties.
pMarkedItemId
- the marked item idpMarkedItemType
- the item type of the marked itempMarkerPropertyName
- the name of the property on the marked item that referenced the marker.pRemovedMarkerItem
- the marker item that was removed
MarkerException
generateRemoveMessage()
,
setBaseMarkerEventProperties(java.lang.String, java.lang.String, atg.repository.RepositoryItem, java.lang.String, atg.markers.MarkerEventMessage)
,
createRemovedMarkerData(atg.repository.RepositoryItem)
protected MarkerReplacedEventMessage createReplacedEventMessage(java.lang.String pMarkedItemId, java.lang.String pMarkedItemType, RepositoryItem pAddedMarkerItem, java.lang.String pMarkerPropertyName, RepositoryItem pReplacedMarkerItem) throws MarkerException
This method first calls generateReplaceMessage to instantiate a MarkerReplacedEventMessage event object, then it fills in all the base properties of the replace event, as well as the MarkerData objects that represent the replaced and added marker's property values.
To extend the MarkerReplacedEventMessage, extend the generateReplaceMessage method, and this method. In the extension of this method be sure to call super() first to fill in the base event properties.
pMarkedItemId
- the marked item idpMarkedItemType
- the item type of the marked itempAddedMarkerItem
- the marker item that was addedpMarkerPropertyName
- the name of the property on the marked item that referenced the marker.pReplacedMarkerItem
- the marker item that was replaced
MarkerException
generateReplaceMessage()
,
setBaseMarkerEventProperties(java.lang.String, java.lang.String, atg.repository.RepositoryItem, java.lang.String, atg.markers.MarkerEventMessage)
,
createReplacedMarkerData(atg.repository.RepositoryItem)
,
createAddedMarkerData(atg.repository.RepositoryItem)
protected MarkerAddedEventMessage createAddedEventMessage(java.lang.String pMarkedItemId, java.lang.String pMarkedItemType, java.lang.String pMarkerPropertyName, RepositoryItem pAddedMarkerItem) throws MarkerException
This method first calls generateAddMessage to instantiate a MarkerAddedEventMessage event object, then it fills in all the base properties of the add event, as well as the MarkerData object that represents the added marker's property values.
To extend the MarkerAddedEventMessage, extend the generateAddMessage method, and this method. In the extension of this method be sure to call super() first to fill in the base event properties.
pMarkedItemId
- the marked item idpMarkedItemType
- the item type of the marked itempMarkerPropertyName
- the name of the property on the marked item that references the marker.pAddedMarkerItem
- the marker item that was added
MarkerException
generateAddMessage()
,
setBaseMarkerEventProperties(java.lang.String, java.lang.String, atg.repository.RepositoryItem, java.lang.String, atg.markers.MarkerEventMessage)
,
createAddedMarkerData(atg.repository.RepositoryItem)
protected void setBaseMarkerEventProperties(java.lang.String pMarkedItemId, java.lang.String pMarkerItemType, RepositoryItem pMarkerItem, java.lang.String pMarkerPropertyName, MarkerEventMessage pMessage) throws MarkerException
pMarkedItemId
- the id of the marked itempMarkerItem
- the marker item that is the subject of the eventpMarkerPropertyName
- the name of the property on the marked item that references the marker.pMessage
- the marker event object when the properties will be set
MarkerException
protected MarkerAddedEventMessage generateAddMessage()
Override this method to return extended versions of the MarkerAddedEventMessage.
createAddedEventMessage(java.lang.String, java.lang.String, java.lang.String, atg.repository.RepositoryItem)
protected MarkerRemovedEventMessage generateRemoveMessage()
Override this method to return extended versions of the MarkerRemovedEventMessage.
createRemovedEventMessage(java.lang.String, java.lang.String, java.lang.String, atg.repository.RepositoryItem)
protected MarkerReplacedEventMessage generateReplaceMessage()
Override this method to return extended versions of the MarkerReplacedEventMessage.
createReplacedEventMessage(java.lang.String, java.lang.String, atg.repository.RepositoryItem, java.lang.String, atg.repository.RepositoryItem)
protected MarkerData generateMarkerData()
This method is called by the createAddedMarkerData, createReplacedMarkerData and createRemovedMarkerData methods to create the MarkerData object.
Extend this method to create extended versions of the MarkerData class.
createAddedMarkerData(atg.repository.RepositoryItem)
,
createRemovedMarkerData(atg.repository.RepositoryItem)
,
createReplacedMarkerData(atg.repository.RepositoryItem)
protected MarkerData createAddedMarkerData(RepositoryItem pAddedMarkerItem) throws MarkerException
Calls setBaseMarkerData to set the base properties of the MarkerData object, followed by setExtendedMarkerData to set the extended properties values.
MarkerException
generateMarkerData()
,
setBaseMarkerData(atg.repository.RepositoryItem, atg.markers.MarkerData)
,
setExtendedMarkerData(atg.repository.RepositoryItem, atg.markers.MarkerData)
protected MarkerData createRemovedMarkerData(RepositoryItem pRemovedMarkerItem) throws MarkerException
Calls setBaseMarkerData to set the base properties of the MarkerData object, followed by setExtendedMarkerData to set the extended properties values.
MarkerException
generateMarkerData()
,
setBaseMarkerData(atg.repository.RepositoryItem, atg.markers.MarkerData)
,
setExtendedMarkerData(atg.repository.RepositoryItem, atg.markers.MarkerData)
protected MarkerData createReplacedMarkerData(RepositoryItem pReplacedMarkerItem) throws MarkerException
Calls setBaseMarkerData to set the base properties of the MarkerData object, followed by setExtendedMarkerData to set the extended properties values.
MarkerException
generateMarkerData()
,
setBaseMarkerData(atg.repository.RepositoryItem, atg.markers.MarkerData)
,
setExtendedMarkerData(atg.repository.RepositoryItem, atg.markers.MarkerData)
protected void setBaseMarkerData(RepositoryItem pMarkerItem, MarkerData pMarkerData) throws MarkerException
MarkerException
createAddedMarkerData(atg.repository.RepositoryItem)
,
createRemovedMarkerData(atg.repository.RepositoryItem)
,
createReplacedMarkerData(atg.repository.RepositoryItem)
protected void setExtendedMarkerData(RepositoryItem pMarkerItem, MarkerData pMarkerData) throws MarkerException
The base implementation doesn't modify the MarkerData object at all.
Extend this method if you have extended the MarkerData object to include extended properties.
MarkerException
protected java.lang.String getMarkerEventProfileId(java.lang.String pMarkedItemId, java.lang.String pMarkedItemType, RepositoryItem pMarkerItem)
The base implementation returns the profile id associated with the current session.
pMarkedItemId
- the marked item's repository idpMarkedItemType
- the marked item's repository typepMarkerItem
- the marker repository itempublic int removeAllMarkersFromItem(MutableRepositoryItem pMarkedItem, java.lang.String pMarkerPropertyName) throws MarkerException
pMarkedItem
- The repository item containing markers.pMarkerPropertyName
- The property on the bean that contains the collection
of markers.
MarkerException
public int removeAllMarkersFromItem(java.lang.String pMarkedItemId) throws MarkerException
MarkerException
removeAllMarkersFromItem(atg.repository.MutableRepositoryItem, java.lang.String)
public int removeAllMarkersFromItem(java.lang.String pMarkedItemId, java.lang.String pMarkedItemType, java.lang.String pMarkerPropertyName) throws MarkerException
MarkerException
removeAllMarkersFromItem(atg.repository.MutableRepositoryItem, java.lang.String)
public int removeAllMarkersFromItem(MutableRepositoryItem pMarkedItem) throws MarkerException
MarkerException
removeAllMarkersFromItem(atg.repository.MutableRepositoryItem, java.lang.String)
protected boolean areMarkerPropertiesEqual(RepositoryItem pMarkerItem, java.lang.String pKey, java.lang.String pValue, java.lang.String pData, java.util.Map pExtendedProperties) throws MarkerException
compareDefaultPropertyValues is called first, followed by compareExtendedPropertyValues.
pMarkerItem
- the marker item.pKey
- the key to compare.pValue
- the value to compare.pData
- the data to compare.pExtendedProperties
- the map of extended properties to compare.
MarkerException
compareDefaultPropertyValues(atg.repository.RepositoryItem, java.lang.String, java.lang.String, java.lang.String)
,
compareDefaultPropertyValues(atg.repository.RepositoryItem, java.lang.String, java.lang.String, java.lang.String)
,
findMatchingMarkers(atg.repository.RepositoryItem, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map)
protected boolean compareDefaultPropertyValues(RepositoryItem pMarkerItem, java.lang.String pKey, java.lang.String pValue, java.lang.String pData)
If a parameter value is NULL, the marker property must be NULL to match. If the marker property value can be any value, use the constant value specified in the MarkerConstants.
pMarkerItem
- the markerItem.pKey
- the key to compare .pValue
- the value to compare.pData
- the data to compare.
MarkerConstants.ANY_VALUE
protected boolean compareExtendedPropertyValues(RepositoryItem pMarkerItem, java.util.Map pExtendedProperties) throws MarkerException
Each value in the map is compared the markers matching property value. False is returned if the the values are NOT the same.
If a entry value is NULL, the marker property must be NULL to match. If the marker property value can be any value, use the constant value specified in the MarkerConstants.
If the extended properties map is null or empty, the comparison is considered successful and true is returned.
pMarkerItem
- the marker repository item.pExtendedProperties
- (required)a map of property name to values used to compare with
the marker item.
MarkerException
MarkerConstants.ANY_VALUE
public boolean hasMarker(RepositoryItem pMarkedItem, java.lang.String pKey, java.lang.String pValue, java.lang.String pData, java.lang.String pMarkerPropertyName, java.util.Map pExtendedProperties) throws MarkerException
If a parameter value is NULL, the marker property must be NULL to match. If the marker property value can be any value, use the constant value specified in the MarkerConstants.
pMarkedItem
- The item containing the markers.pKey
- The key value used to match markers.pValue
- The value value used to match markers.pData
- The data value used to match markers.pMarkerPropertyName
- the property containing the collection of markers.pExtendedProperties
- a map of property values used to match
the marker items. If the map
contains a NULL entry value, the matching
marker property must also be NULL.
If Map is NULL the extended properties
are not included in the test.
MarkerException
MarkerConstants.ANY_VALUE
public boolean hasMarker(java.lang.String pMarkedItemId, java.lang.String pKey, java.lang.String pValue, java.lang.String pData, java.util.Map pExtendedProperties) throws MarkerException
MarkerException
hasMarker(atg.repository.RepositoryItem, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map)
public boolean hasMarker(java.lang.String pMarkedItemId, java.lang.String pMarkedItemType, java.lang.String pKey, java.lang.String pValue, java.lang.String pData, java.lang.String pMarkerPropertyName, java.util.Map pExtendedProperties) throws MarkerException
MarkerException
public boolean hasMarker(RepositoryItem pMarkedItem, java.lang.String pKey, java.lang.String pValue, java.lang.String pData, java.util.Map pExtendedProperties) throws MarkerException
MarkerException
hasMarker(atg.repository.RepositoryItem, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map)
public RepositoryItem matchLastMarkerWithKey(RepositoryItem pMarkedItem, java.lang.String pKey, java.lang.String pValue, java.lang.String pData, java.lang.String pMarkerPropertyName, java.util.Map pExtendedProperties) throws MarkerException
For example, it first retrieves all markers with the given key. Then it tests the last one of those markers against the other provided property values.
If the parameter values are NULL then the marker property must also be NULL. If you want to exclude/ignore a property, specify MarkerConstants.ANY_VALUE.
pMarkedItem
- The item containing the markers.pKey
- (required) The key value used to match markers.pValue
- The value value used to match markers.pData
- The data value used to match markers.pMarkerPropertyName
- the property containing the collection of markers.pExtendedProperties
- a map of property values used to match
the marker items. If the map
contains a NULL entry value, the matching
marker property must also be NULL.
If Map is NULL the extended properties
are not included in the test.
MarkerException
MarkerConstants.ANY_VALUE
public RepositoryItem matchLastMarkerWithKey(java.lang.String pMarkedItemId, java.lang.String pKey, java.lang.String pValue, java.lang.String pData, java.util.Map pExtendedProperties) throws MarkerException
For example, it first retrieves all markers with the given key. Then it tests the last one of those markers against the other provided property values.
MarkerException
matchLastMarkerWithKey(atg.repository.RepositoryItem, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map)
public RepositoryItem matchLastMarkerWithKey(java.lang.String pMarkedItemId, java.lang.String pMarkedItemType, java.lang.String pKey, java.lang.String pValue, java.lang.String pData, java.lang.String pMarkerPropertyName, java.util.Map pExtendedProperties) throws MarkerException
For example, it first retrieves all markers with the given key. Then it tests the last one of those markers against the other provided property values.
MarkerException
matchLastMarkerWithKey(atg.repository.RepositoryItem, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map)
public RepositoryItem matchLastMarkerWithKey(RepositoryItem pMarkedItem, java.lang.String pKey, java.lang.String pValue, java.lang.String pData, java.util.Map pExtendedProperties) throws MarkerException
For example, it first retrieves all markers with the given key. Then it tests the last one of those markers against the other provided property values.
MarkerException
matchLastMarkerWithKey(atg.repository.RepositoryItem, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map)
public RepositoryItem matchLastMarker(RepositoryItem pMarkedItem, java.lang.String pKey, java.lang.String pValue, java.lang.String pData, java.lang.String pMarkerPropertyName, java.util.Map pExtendedProperties) throws MarkerException
If the collection is a list, the last item in the list is checked. If the collection is a set, the collection is sorted by creationDate and the last item is checked.
If a parameter value is NULL, the marker property must be NULL to match. If the marker property value can be any value, use the constant value specified in the MarkerConstants.
pMarkedItem
- The item containing the markers.pKey
- The key value used to match markers.pValue
- The value value used to match markers.pData
- The data value used to match markers.pMarkerPropertyName
- the property containing the collection of markers.pExtendedProperties
- a map of property values used to match
the marker items. If the map
contains a NULL entry value, the matching
marker property must also be NULL.
If Map is NULL the extended properties
are not included in the test.
MarkerException
MarkerConstants.ANY_VALUE
public RepositoryItem matchLastMarker(java.lang.String pMarkedItemId, java.lang.String pKey, java.lang.String pValue, java.lang.String pData, java.util.Map pExtendedProperties) throws MarkerException
MarkerException
matchLastMarker(atg.repository.RepositoryItem, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map)
public RepositoryItem matchLastMarker(java.lang.String pMarkedItemId, java.lang.String pMarkedItemType, java.lang.String pKey, java.lang.String pValue, java.lang.String pData, java.lang.String pMarkerPropertyName, java.util.Map pExtendedProperties) throws MarkerException
MarkerException
matchLastMarker(atg.repository.RepositoryItem, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map)
public RepositoryItem matchLastMarker(RepositoryItem pMarkedItem, java.lang.String pKey, java.lang.String pValue, java.lang.String pData, java.util.Map pExtendedProperties) throws MarkerException
MarkerException
matchLastMarker(atg.repository.RepositoryItem, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map)
public java.util.Collection getAllMarkersFromItem(RepositoryItem pMarkedItem, java.lang.String pMarkerPropertyName) throws MarkerException
pMarkedItem
- the marked item.pMarkerPropertyName
- the marker collection property name.
MarkerException
public java.util.Collection getAllMarkersFromItem(java.lang.String pMarkedItemId) throws MarkerException
MarkerException
getAllMarkersFromItem(atg.repository.RepositoryItem, java.lang.String)
public java.util.Collection getAllMarkersFromItem(java.lang.String pMarkedItemId, java.lang.String pMarkedItemType, java.lang.String pMarkerPropertyName) throws MarkerException
MarkerException
getAllMarkersFromItem(atg.repository.RepositoryItem, java.lang.String)
public java.util.Collection getAllMarkersFromItem(RepositoryItem pMarkedItem) throws MarkerException
MarkerException
getAllMarkersFromItem(atg.repository.RepositoryItem, java.lang.String)
protected java.util.Collection getMarkerCollectionFromItem(RepositoryItem pMarkedItem, java.lang.String pMarkerPropertyName) throws MarkerException
pMarkedItem
- the item containing the marker collectionpMarkerPropertyName
- the collection property name
MarkerException
protected RepositoryItem findLastMarkerOnItem(RepositoryItem pMarkedItem, java.lang.String pMarkerPropertyName) throws MarkerException
If the collection is a list, the last item in the list is returned. If the collection is a set, the collection is sorted by creationDate and the last item is returned.
pMarkedItem
- the marked repository item.pMarkerPropertyName
- the marker collection property name.
MarkerException
public java.lang.Object[] createSortedArrayOfMarkers(java.util.Collection pMarkers, java.lang.String pMarkerSortPropertyName) throws MarkerException
This method is called by other methods that rely on order for their result. Such as, findLastMarkerOnItem and matchLastMarkerWithKey.
pMarkers
- the collection of markers to be sorted in ascending order.pMarkerSortPropertyName
- the marker property name to use in the sort. Defaults to defaulMarkerSortPropertyName
MarkerException
public RepositoryItem[] getItemsWithMarker(java.lang.String pMarkedItemType, java.lang.String pMarkerItemType, java.lang.String pMarkerPropertyName, java.lang.String pKey, java.lang.String pValue, java.lang.String pData, java.util.Map pExtendedProperties) throws MarkerException
generateMarkerExtendedPropertyQuery method is called to provide an additional Query object to further qualify the markers based on the extended properties.
pMarkedItemType
- the type of the item being queriedpMarkerItemType
- the marker item typepMarkerPropertyName
- the property name containing the collection of markerspKey
- marker keypValue
- marker valuepData
- marker datapExtendedProperties
- extended property map. Not used in the base
implementation.
MarkerException
generateMarkerExtendedPropertyQuery(atg.repository.QueryBuilder, java.lang.String, java.lang.String, java.lang.String, java.util.Map)
public Query generateMarkerQualifyingAndedQuery(java.lang.String pMarkerItemType, java.lang.String pKey, java.lang.String pValue, java.lang.String pData, java.util.Map pExtendedProperties) throws MarkerException
MarkerException
public RepositoryItem[] getItemsWithMarker(java.lang.String pKey, java.lang.String pValue, java.lang.String pData) throws MarkerException
MarkerException
getItemsWithMarker(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map)
protected Query generateMarkerExtendedPropertyQuery(QueryBuilder pQueryBuilder, java.lang.String pKey, java.lang.String pValue, java.lang.String pData, java.util.Map pExtendedProperties) throws MarkerException
The query object returned by this method can be anded together to form the final query.
For instance, get all items that have markers with name = x, and value =y, and {this query}......
pQueryBuilder
- the QueryBuilder object to use for creating the new query objectpKey
- marker keypValue
- marker valuepData
- marker datapExtendedProperites
- a map containg the property to value mappings
MarkerException
public int deleteMarkers(java.lang.String pMarkedItemType, java.lang.String pMarkerItemType, java.lang.String pMarkerPropertyName, java.lang.String pKey, java.lang.String pValue, java.lang.String pData, java.util.Map pExtendedProperties) throws MarkerException
generateMarkerExtendedPropertyQuery method is called to provide an additional Query object for further qualify the markers.
pMarkedItemType
- the repository item type of the item that contains the
Set relationship to the marker items.pMarkerItemType
- the repository item type of the marker items.pMarkerPropertyName
- the property on the pMarkedItemType that is the marker setpKey
- marker keypValue
- marker valuepData
- marker datapExtendedProperites
- a map containg the property to value mappings
MarkerException
generateMarkerExtendedPropertyQuery(atg.repository.QueryBuilder, java.lang.String, java.lang.String, java.lang.String, java.util.Map)
public Query getDefaultPropertyQuery(QueryBuilder pQueryBuilder, java.lang.String pPropertyNameOnMarker, java.lang.String pValue) throws RepositoryException
atg.markers.MarkerConstants.ANY_VALUE
RepositoryException
protected java.lang.String getMarkerPropertyName(java.lang.String pMarkerPropertyName) throws MarkerException
MarkerException
protected java.lang.String getMarkerSortPropertyName(java.lang.String pMarkerSortPropertyName) throws MarkerException
MarkerException
protected java.lang.String getMarkerItemType(java.lang.String pMarkerItemType) throws MarkerException
MarkerException
protected java.lang.String getMarkedItemType(java.lang.String pMarkedItemType) throws MarkerException
MarkerException
protected java.lang.String getDuplicationMode(java.lang.String pDuplicationMode) throws MarkerException
MarkerException
protected void validateMarker(RepositoryItem pMarkedItem, RepositoryItem pMarkerItem) throws MarkerException, InvalidMarkerException
pMarkedItem
- the item being markedpMarkerItem
- the new marker item
MarkerException
- if an error occurs in the MarkerValidator.
InvalidMarkerException
- if the marker is rejected as invalid.#addMarkerItemtoItem
,
protected MarkerValidator findMarkerValidator(RepositoryItem pMarkedItem, RepositoryItem pMarkerItem)
pMarkedItem
- the item being markedpMarkerItem
- the new marker item
public MarkerValidator findMarkerValidator(java.lang.String pKey)
findMarkerValidator
in interface MarkerValidatorContainer
pKey
- the key used to lookup the validator.
public void addMarkerValidator(java.lang.String pKey, MarkerValidator pMarkerValidator)
addMarkerValidator
in interface MarkerValidatorContainer
pKey
- the key used to identify the validator.pMarkerValidator
- the marker validatorpublic void removeMarkerValidator(java.lang.String pKey)
removeMarkerValidator
in interface MarkerValidatorContainer
pKey
- the key used to identify the validator.public java.util.Collection findValidKeys()
public java.util.List findValidValuesForKey(java.lang.String pMarkerKey)
A null is returned as the last element in the list if null is a valid value for the key.
pMarkerKey
- the key used to identify possible values.
public java.util.Map getValidatedKeysAndValues()
public boolean isValidKey(java.lang.String pKey)
public boolean isValidValueForKey(java.lang.String pKey, java.lang.String pValue)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |