| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectatg.nucleus.logging.VariableArgumentApplicationLoggingImpl
atg.nucleus.GenericService
atg.commerce.markers.OrderMarkerManager
public class OrderMarkerManager
Order based repository marker manager implementation.
Throughout the API a Commerce Order object is used as the marked item. To perform the marker operation, the OrderMarkerManager extracts the contained order repository item using the repositoryItemFromOrder method.
The caller is responsible for calling the OrderManger's updateOrder after calling an API that adds or removes marker items from the Order.
Order markers are copied when an order merge occurs in the OrderManager. However, the copy only takes place if the source order is transient.
| Field Summary | |
|---|---|
| static java.lang.String | CLASS_VERSION | 
| protected  OrderManager | mOrderManager | 
| protected  RepositoryMarkerManager | mOrderRepositoryMarkerManager | 
| Fields inherited from class atg.nucleus.GenericService | 
|---|
| SERVICE_INFO_KEY | 
| Fields inherited from interface atg.commerce.markers.OrderMarkerConstants | 
|---|
| ORDER_MARKER_RESOURCE_NAME, ORDER_PROPERTY_NAME, sResourceBundle | 
| 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 | |
|---|---|
| OrderMarkerManager() | |
| Method Summary | |
|---|---|
| protected  boolean | addMarkerItemToOrder(Order pOrder,
                     RepositoryItem pMarkerItem,
                     java.lang.String pMarkerPropertyName,
                     java.lang.String pDuplicationMode)Adds a new marker item to the specified order. | 
|  RepositoryItem | addMarkerToOrder(Order pOrder,
                 java.lang.String pKey,
                 java.lang.String pValue,
                 java.lang.String pData,
                 java.util.Map pExtendedProperties)Creates a new marker item using the provided property values and adds it to the specified order. | 
|  RepositoryItem | addMarkerToOrder(Order pOrder,
                 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 order. | 
|  void | addMarkerValidator(java.lang.String pKey,
                   MarkerValidator pMarkerValidator)Adds a marker validator. | 
|  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)Use this method to delete marker items. | 
|  void | doStartService()This method is called as service startup. | 
|  MarkerValidator | findMarkerValidator(java.lang.String pKey)Locates a marker validator component in the marker validator service map. | 
|  java.util.Collection | findMatchingMarkers(Order pOrder,
                    java.lang.String pKey,
                    java.lang.String pValue,
                    java.lang.String pData)This method returns the markers from the order that match the values provided. | 
|  java.util.Collection | findMatchingMarkers(Order pOrder,
                    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 order that match the values provided. | 
|  java.util.Collection | findValidKeys() | 
|  java.util.List | findValidValuesForKey(java.lang.String pKey) | 
|  java.util.Collection | getAllMarkersFromOrder(Order pOrder)This method returns a copy of the current marker collection from the given Order. | 
|  java.util.Collection | getAllMarkersFromOrder(Order pOrder,
                       java.lang.String pMarkerPropertyName)This method returns a copy of the current marker collection from the given Order. | 
|  java.lang.String[] | getMarkerPropertyNames()Returns the order property names that contain markers | 
|  OrderManager | getOrderManager()Returns the Order Manager | 
|  RepositoryMarkerManager | getOrderRepositoryMarkerManager()Returns the Repository Marker Manager for orders | 
|  java.util.Map | getValidatedKeysAndValues() | 
|  boolean | hasMarker(Order pOrder,
          java.lang.String pKey,
          java.lang.String pValue,
          java.lang.String pData)This method determines if the Order contains a marker with the specified property values. | 
|  boolean | hasMarker(Order pOrder,
          java.lang.String pKey,
          java.lang.String pValue,
          java.lang.String pData,
          java.lang.String pMarkerPropertyName,
          java.util.Map pExtendedProperties)This method determines if the Order contains a marker with the specified property values. | 
|  boolean | isValidKey(java.lang.String pKey) | 
|  boolean | isValidValueForKey(java.lang.String pKey,
                   java.lang.String pValue) | 
|  RepositoryItem | matchLastMarker(Order pOrder,
                java.lang.String pKey,
                java.lang.String pValue,
                java.lang.String pData)This method returns the order's last marker only if it has a matching key, value and data. | 
|  RepositoryItem | matchLastMarker(Order pOrder,
                java.lang.String pKey,
                java.lang.String pValue,
                java.lang.String pData,
                java.lang.String pMarkerPropertyName,
                java.util.Map pExtendedProperties)This method returns the order's last marker only if it has a matching key, value, data and extendedProperties. | 
|  RepositoryItem | matchLastMarkerWithKey(Order pOrder,
                       java.lang.String pKey,
                       java.lang.String pValue,
                       java.lang.String pData)This method returns the last marker with a given key, only if it has a matching value, data and extendedProperties. | 
|  RepositoryItem | matchLastMarkerWithKey(Order pOrder,
                       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. | 
|  void | ordersMerged(OrderMergeEvent pEvent)When orders are merged, this method copies the markers from the source order to the destination order. | 
|  int | removeAllMarkersFromOrder(Order pOrder)Removes all markers from the order. | 
|  int | removeAllMarkersFromOrder(Order pOrder,
                          java.lang.String pMarkerPropertyName)Removes all markers from the Order. | 
|  int | removeMarkersFromOrder(Order pOrder,
                       java.lang.String pKey,
                       java.lang.String pValue,
                       java.lang.String pData)This method removes the markers from the Order that match the values provided. | 
|  int | removeMarkersFromOrder(Order pOrder,
                       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 Order that match the values provided. | 
|  void | removeMarkerValidator(java.lang.String pKey)Remove a marker validator. | 
| protected  MutableRepositoryItem | repositoryItemForOrder(Order pOrder)Gets the mutable repository item from the provided order object. | 
|  void | setMarkerPropertyNames(java.lang.String[] pMarkerPropertyNames) | 
|  void | setOrderManager(OrderManager pOrderManager)Sets the Order Manager | 
|  void | setOrderRepositoryMarkerManager(RepositoryMarkerManager pOrderRepositoryMarkerManager)Sets the Repository Marker Manager for orders | 
| Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl | 
|---|
| vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
public static final java.lang.String CLASS_VERSION
protected RepositoryMarkerManager mOrderRepositoryMarkerManager
protected OrderManager mOrderManager
| Constructor Detail | 
|---|
public OrderMarkerManager()
| Method Detail | 
|---|
public void setOrderRepositoryMarkerManager(RepositoryMarkerManager pOrderRepositoryMarkerManager)
public RepositoryMarkerManager getOrderRepositoryMarkerManager()
public void setOrderManager(OrderManager pOrderManager)
public OrderManager getOrderManager()
public void doStartService()
                    throws ServiceException
doStartService in class GenericServiceServiceException - if the Service had a problem starting up
protected boolean addMarkerItemToOrder(Order pOrder,
                                       RepositoryItem pMarkerItem,
                                       java.lang.String pMarkerPropertyName,
                                       java.lang.String pDuplicationMode)
                                throws MarkerException,
                                       InvalidMarkerException
pOrder - (required)The Order being marked.pMarkerItem - (required)The marker item .pDuplicationMode - Controls processing in cases where the item
                           already contains duplicate markers.
 MarkerException
InvalidMarkerExceptionMarkerConstants.ALLOW_DUPLICATES, 
MarkerConstants.NO_DUPLICATES, 
MarkerConstants.REPLACE_DUPLICATES
public RepositoryItem addMarkerToOrder(Order pOrder,
                                       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
pOrder(required)The - Order 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.pExtendedPropertiesA - 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
InvalidMarkerExceptionMarkerConstants.ALLOW_DUPLICATES, 
MarkerConstants.NO_DUPLICATES, 
MarkerConstants.REPLACE_DUPLICATES
public RepositoryItem addMarkerToOrder(Order pOrder,
                                       java.lang.String pKey,
                                       java.lang.String pValue,
                                       java.lang.String pData,
                                       java.util.Map pExtendedProperties)
                                throws MarkerException,
                                       InvalidMarkerException
MarkerException
InvalidMarkerExceptionaddMarkerToOrder(atg.commerce.order.Order, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map, java.lang.String)
public int removeMarkersFromOrder(Order pOrder,
                                  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.
porder - The order 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 order 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.
MarkerExceptionMarkerConstants.ANY_VALUE
public int removeMarkersFromOrder(Order pOrder,
                                  java.lang.String pKey,
                                  java.lang.String pValue,
                                  java.lang.String pData)
                           throws MarkerException
MarkerException#removeMarkerFromOrder
public int removeAllMarkersFromOrder(Order pOrder,
                                     java.lang.String pMarkerPropertyName)
                              throws MarkerException
pOrder - the order containing markers.pMarkerPropertyName - The property on the order that contains the collection
                              of markers.
MarkerException
public int removeAllMarkersFromOrder(Order pOrder)
                              throws MarkerException
MarkerExceptionremoveAllMarkersFromOrder(atg.commerce.order.Order, java.lang.String)
public java.util.Collection findMatchingMarkers(Order pOrder,
                                                java.lang.String pKey,
                                                java.lang.String pValue,
                                                java.lang.String pData,
                                                java.lang.String pMarkerPropertyName,
                                                java.util.Map pExtendedProperties)
                                         throws MarkerException
pOrder - The order.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.
MarkerExceptionRepositoryMarkerManager.findMatchingMarkers(atg.repository.RepositoryItem, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map)
public java.util.Collection findMatchingMarkers(Order pOrder,
                                                java.lang.String pKey,
                                                java.lang.String pValue,
                                                java.lang.String pData)
                                         throws MarkerException
MarkerExceptionfindMatchingMarkers(atg.commerce.order.Order, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map)
public boolean hasMarker(Order pOrder,
                         java.lang.String pKey,
                         java.lang.String pValue,
                         java.lang.String pData,
                         java.lang.String pMarkerPropertyName,
                         java.util.Map pExtendedProperties)
                  throws MarkerException
pOrder - The order.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.
MarkerExceptionRepositoryMarkerManager.hasMarker(atg.repository.RepositoryItem, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map)
public boolean hasMarker(Order pOrder,
                         java.lang.String pKey,
                         java.lang.String pValue,
                         java.lang.String pData)
                  throws MarkerException
MarkerExceptionhasMarker(atg.commerce.order.Order, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map)
public RepositoryItem matchLastMarker(Order pOrder,
                                      java.lang.String pKey,
                                      java.lang.String pValue,
                                      java.lang.String pData,
                                      java.lang.String pMarkerPropertyName,
                                      java.util.Map pExtendedProperties)
                               throws MarkerException
pOrder - The order 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.
MarkerExceptionRepositoryMarkerManager.matchLastMarker(atg.repository.RepositoryItem, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map)
public RepositoryItem matchLastMarker(Order pOrder,
                                      java.lang.String pKey,
                                      java.lang.String pValue,
                                      java.lang.String pData)
                               throws MarkerException
MarkerExceptionmatchLastMarker(atg.commerce.order.Order, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map)
public RepositoryItem matchLastMarkerWithKey(Order pOrder,
                                             java.lang.String pKey,
                                             java.lang.String pValue,
                                             java.lang.String pData,
                                             java.lang.String pMarkerPropertyName,
                                             java.util.Map pExtendedProperties)
                                      throws MarkerException
pOrder - The order 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.
MarkerExceptionRepositoryMarkerManager.matchLastMarkerWithKey(atg.repository.RepositoryItem, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map)
public RepositoryItem matchLastMarkerWithKey(Order pOrder,
                                             java.lang.String pKey,
                                             java.lang.String pValue,
                                             java.lang.String pData)
                                      throws MarkerException
MarkerExceptionmatchLastMarkerWithKey(atg.commerce.order.Order, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map)
public java.util.Collection getAllMarkersFromOrder(Order pOrder,
                                                   java.lang.String pMarkerPropertyName)
                                            throws MarkerException
pOrder - the order.pMarkerPropertyName - the marker collection property name.
MarkerExceptionRepositoryMarkerManager.getAllMarkersFromItem(atg.repository.RepositoryItem, java.lang.String)
public java.util.Collection getAllMarkersFromOrder(Order pOrder)
                                            throws MarkerException
MarkerExceptiongetAllMarkersFromOrder(atg.commerce.order.Order, java.lang.String)
protected MutableRepositoryItem repositoryItemForOrder(Order pOrder)
                                                throws MarkerException
Override this method if you have a repository-backed order implementation this is NOT derived from OrderImpl.
pOrder - The Order object
MarkerExceptionpublic void setMarkerPropertyNames(java.lang.String[] pMarkerPropertyNames)
public java.lang.String[] getMarkerPropertyNames()
public void ordersMerged(OrderMergeEvent pEvent)
The marker merge only takes place if the source order is transient.
ordersMerged in interface OrderMergeListenerpublic java.util.Collection findValidKeys()
public java.util.List findValidValuesForKey(java.lang.String pKey)
public java.util.Map getValidatedKeysAndValues()
public boolean isValidKey(java.lang.String pKey)
public boolean isValidValueForKey(java.lang.String pKey,
                                  java.lang.String pValue)
public java.lang.Object[] createSortedArrayOfMarkers(java.util.Collection pMarkers,
                                                     java.lang.String pMarkerSortPropertyName)
                                              throws MarkerException
MarkerExceptionRepositoryMarkerManager.createSortedArrayOfMarkers(java.util.Collection, java.lang.String)public MarkerValidator findMarkerValidator(java.lang.String pKey)
findMarkerValidator in interface MarkerValidatorContainerpKey - the key used to lookup the validator.
public void addMarkerValidator(java.lang.String pKey,
                               MarkerValidator pMarkerValidator)
addMarkerValidator in interface MarkerValidatorContainerpKey - the key used to identify the validator.pMarkerValidator - the marker validatorpublic void removeMarkerValidator(java.lang.String pKey)
removeMarkerValidator in interface MarkerValidatorContainerpKey - the key used to identify the validator.
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
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
MarkerExceptionRepositoryMarkerManager.deleteMarkers(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map)| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||