atg.commerce.order.processor
Class ProcUpdateGiftRepository

java.lang.Object
  extended by atg.nucleus.logging.ApplicationLoggingImpl
      extended by atg.commerce.order.processor.ProcUpdateGiftRepository
All Implemented Interfaces:
ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, PipelineProcessor

public class ProcUpdateGiftRepository
extends ApplicationLoggingImpl
implements PipelineProcessor

Check the shipping groups of an order for Handlers. Update the gift repository where appropriate.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
Fields inherited from interface atg.service.pipeline.PipelineProcessor
STOP_CHAIN_EXECUTION, STOP_CHAIN_EXECUTION_AND_COMMIT, STOP_CHAIN_EXECUTION_AND_ROLLBACK
 
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
ProcUpdateGiftRepository()
           
 
Method Summary
 java.lang.String getCatalogRefDisplayNameProperty()
          The property of a catalog ref item that is the display name
 GiftlistManager getGiftlistManager()
          All Giftlist manipulations are done with this.
 java.lang.String getLoggingIdentifier()
          Returns property LoggingIdentifier
 OrderManager getOrderManager()
          The class responsible for managing changes to orders
 int[] getRetCodes()
          Returns the valid return codes 1 - The processor completed
 javax.transaction.TransactionManager getTransactionManager()
          Component that controls management of the transactions
protected  void prepareToRemoveHandlingInstruction(Order pOrder, java.lang.String pShippingGroupId, java.lang.String pHandlingInstructionId, PipelineResult pResult)
          Register with the transaction.
protected  void removeHandlingInstruction(Order pOrder, java.lang.String pShippingGroupId, java.lang.String pHandlingInstructionId)
          Remove the given handling instruction from the order.
 int runProcess(java.lang.Object pParam, PipelineResult pResult)
          This method runs the actual processor and does the work.
 void setCatalogRefDisplayNameProperty(java.lang.String pCatalogRefDisplayNameProperty)
           
 void setGiftlistManager(GiftlistManager pGiftlistManager)
           
 void setLoggingIdentifier(java.lang.String pLoggingIdentifier)
          Sets property LoggingIdentifier
 void setOrderManager(OrderManager pOrderManager)
           
 void setTransactionManager(javax.transaction.TransactionManager pTransactionManager)
           
protected  void updateGiftlistItem(Order pOrder, java.lang.String pGiftlistId, java.lang.String pGiftlistItemId, CommerceItem pCommerceItem, long pQuantity, PipelineResult pResult)
          Deprecated.  
protected  int updateGiftlistItem(Order pOrder, java.lang.String pHandlingInstructionId, java.lang.String pShippingGroupId, java.lang.String pGiftlistId, java.lang.String pGiftlistItemId, CommerceItem pCommerceItem, long pQuantity, java.util.ResourceBundle pBundle, PipelineResult pResult)
          This method increments the quantityPurchased property for the given item in the given Giftlist by some quantity.
 
Methods inherited from class atg.nucleus.logging.ApplicationLoggingImpl
addGlobalLogListeners, addLogListener, getLoggingIdentifer, getLogListenerCount, getLogListeners, initializeFromServiceEvent, isAutoInitListeners, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, removeLogListener, sendLogEvent, setAutoInitListeners, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string

Constructor Detail

ProcUpdateGiftRepository

public ProcUpdateGiftRepository()
Method Detail

getRetCodes

public int[] getRetCodes()
Returns the valid return codes 1 - The processor completed

Specified by:
getRetCodes in interface PipelineProcessor
Returns:
an integer array of the valid return codes.

setGiftlistManager

public void setGiftlistManager(GiftlistManager pGiftlistManager)

getGiftlistManager

public GiftlistManager getGiftlistManager()
All Giftlist manipulations are done with this.


setOrderManager

public void setOrderManager(OrderManager pOrderManager)

getOrderManager

public OrderManager getOrderManager()
The class responsible for managing changes to orders


setTransactionManager

public void setTransactionManager(javax.transaction.TransactionManager pTransactionManager)

getTransactionManager

public javax.transaction.TransactionManager getTransactionManager()
Component that controls management of the transactions


setCatalogRefDisplayNameProperty

public void setCatalogRefDisplayNameProperty(java.lang.String pCatalogRefDisplayNameProperty)

getCatalogRefDisplayNameProperty

public java.lang.String getCatalogRefDisplayNameProperty()
The property of a catalog ref item that is the display name


setLoggingIdentifier

public void setLoggingIdentifier(java.lang.String pLoggingIdentifier)
Sets property LoggingIdentifier

Overrides:
setLoggingIdentifier in class ApplicationLoggingImpl

getLoggingIdentifier

public java.lang.String getLoggingIdentifier()
Returns property LoggingIdentifier

Overrides:
getLoggingIdentifier in class ApplicationLoggingImpl

runProcess

public int runProcess(java.lang.Object pParam,
                      PipelineResult pResult)
               throws java.lang.Exception
This method runs the actual processor and does the work. pParam is user data and pResult is an object which contains result data. The return value of the method is what determines what the next link to be executed is. This method requires that an Order and optionally a Locale object be supplied in pParam in a HashMap. Use the PipelineConstants class' static members to key the objects in the HashMap. If the giftlist has been removed, this method adds an exception to the result and removes the offending HandlingInstruction.

Specified by:
runProcess in interface PipelineProcessor
Parameters:
pParam - a HashMap which must contain an Order and optionally a Locale object
pResult - a PipelineResult object which stores any information which must be returned from this method invokation
Returns:
an integer specifying the processor's return code
Throws:
java.lang.Exception - throws any exception back to the caller
See Also:
PipelineProcessor.runProcess(Object, PipelineResult)

updateGiftlistItem

protected void updateGiftlistItem(Order pOrder,
                                  java.lang.String pGiftlistId,
                                  java.lang.String pGiftlistItemId,
                                  CommerceItem pCommerceItem,
                                  long pQuantity,
                                  PipelineResult pResult)
Deprecated. 

This method increments the quantityPurchased property for the given item in the given Giftlist by some quantity. This method is deprecated, you should use the other updateGiftlistItem method instead.

Parameters:
pOrder - The order containing the gift.
pGiftlistId - The id of the giftlist to be updated.
pGiftlistItemId - The id of the giftlist item to be updated.
pCommerceItem - The commerce item in the giftlist to be updated.
pQuantity - The quantity purchased
pResult - a PipelineResult object which stores any information which must be returned from this method invokation

updateGiftlistItem

protected int updateGiftlistItem(Order pOrder,
                                 java.lang.String pHandlingInstructionId,
                                 java.lang.String pShippingGroupId,
                                 java.lang.String pGiftlistId,
                                 java.lang.String pGiftlistItemId,
                                 CommerceItem pCommerceItem,
                                 long pQuantity,
                                 java.util.ResourceBundle pBundle,
                                 PipelineResult pResult)
This method increments the quantityPurchased property for the given item in the given Giftlist by some quantity. This method will also remove the handling instruction, if the giftlist or giftlist item has been removed. If the handling instruction is removed, the method returns STOP_CHAIN_EXECUTION_AND_ROLLBACK

Parameters:
pOrder - The order containing the gift.
pGiftlistId - The id of the giftlist to be updated.
pGiftlistItemId - The id of the giftlist item to be updated.
pCommerceItem - The commerce item in the giftlist to be updated.
pQuantity - The quantity purchased
pBundle - resource bundle specific to users locale
pResult - a PipelineResult object which stores any information which must be returned from this method invokation
Returns:
an integer specifying the processor's return code

prepareToRemoveHandlingInstruction

protected void prepareToRemoveHandlingInstruction(Order pOrder,
                                                  java.lang.String pShippingGroupId,
                                                  java.lang.String pHandlingInstructionId,
                                                  PipelineResult pResult)
                                           throws CommerceException
Register with the transaction. We know it will be rolling back. When it is finished, remove the offending handling instruction so we don't have any errors.

Parameters:
pOrder - The order containing the handling instruction
pShippingGroupId - The shipping group containing the handling instruction
pHandlingInstructionId - The handling instruction that should be removed
pResult - The pipeline result object
Throws:
CommerceException

removeHandlingInstruction

protected void removeHandlingInstruction(Order pOrder,
                                         java.lang.String pShippingGroupId,
                                         java.lang.String pHandlingInstructionId)
                                  throws CommerceException
Remove the given handling instruction from the order. The removal is done within the context of a new transaction.

Throws:
CommerceException