com.ibm.commerce.contract.commands
Class CreateUpdateTradingAgreementBaseCmdImpl

java.lang.Object
  |
  +--CacheableCommandImpl
        |
        +--com.ibm.commerce.command.AbstractECTargetableCommand
              |
              +--com.ibm.commerce.command.TaskCommandImpl
                    |
                    +--com.ibm.commerce.contract.commands.CreateUpdateTradingAgreementBaseCmdImpl
All Implemented Interfaces:
ECCommand, ECTargetableCommand, TaskCommand
Direct Known Subclasses:
CreateXSDContractCmdImpl, SaveAccountCmdImpl, UpdateXSDContractCmdImpl

public abstract class CreateUpdateTradingAgreementBaseCmdImpl
extends TaskCommandImpl
implements TaskCommand

This is the base class of create or update a contract. (WebSphere Commerce Business Edition only). The following AccessBean are used in this default implementation: ContractJDBCHelperAccessBean().findAllTCSubType(), LanguageAccessBean, TradingDescriptionAccessBean, ParticipantAccessBean.

See Also:
Serialized Form

Field Summary
static java.lang.String COPYRIGHT
          IBM copyright notice field.
 
Fields inherited from class com.ibm.commerce.command. AbstractECTargetableCommand
commandContext
 
Fields inherited from interface com.ibm.commerce.command. ECCommand
defaultCommandClassName
 
Constructor Summary
CreateUpdateTradingAgreementBaseCmdImpl()
           
 
Method Summary
protected  java.util.Vector getAttachmentElements()
          Gets all the attachment elements.
protected  java.util.Vector getParticipantElements()
          Gets all the trading agreement level participant elements .
protected  java.util.Vector getTermConditionElements()
          Gets all the terms and conditons elements.
protected  org.w3c.dom.Element getTradingAgreementElement()
          Gets the trading agreement element.
protected  java.util.Vector getTradingAgreementLevelElements(org.w3c.dom.Element trdElement, java.lang.String tagName, java.lang.String tagSuffix)
          Gets an Vector object contains the specified Elements by the provided element tag in the given Element.
protected  org.w3c.dom.Element getTradingDescriptionElement()
          Gets the trading agreement description element.
protected  void parseXMLDocument()
          Parses the trading XML document.
protected  void setAttachments(java.util.Vector attachments, java.lang.Long tradingId, java.lang.String usageId)
          Sets the attachments to the specified trading agreement.
protected  void setTradingAgreementDescAndParticipants(java.lang.Long tradingId)
          Sets the trading agreement description and participants for the specified trading agreement.
protected  void setTradingAgreementElement(org.w3c.dom.Element trdElement)
          Sets the trading agreement element.
 
Methods inherited from class com.ibm.commerce.command. AbstractECTargetableCommand
accessControlCheck, checkIsAllowed, checkParameters, checkResourcePermission, createCommandExecutionEvent, execute, finalize, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getResources, getStoreId, getUser, getUserId, isReadyToCallExecute, performExecute, reset, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties, validateParameters
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail
public static final java.lang.String COPYRIGHT
IBM copyright notice field.
See Also:
Constant Field Values
Constructor Detail

CreateUpdateTradingAgreementBaseCmdImpl

public CreateUpdateTradingAgreementBaseCmdImpl()
Method Detail

getTradingAgreementLevelElements

protected java.util.Vector getTradingAgreementLevelElements(org.w3c.dom.Element trdElement,
                                                            java.lang.String tagName,
                                                            java.lang.String tagSuffix)
Gets an Vector object contains the specified Elements by the provided element tag in the given Element.
Parameters:
trdElement - an Element object represents either contract or account.
tagName - the element tag used to get the elements object.
tagSuffix - the tag of the parent Element.
Returns:
a vector objects contains the elements with specified tag name.

getAttachmentElements

protected java.util.Vector getAttachmentElements()
Gets all the attachment elements.
Returns:
a vector objects contains all the attachment elements.

getParticipantElements

protected java.util.Vector getParticipantElements()
Gets all the trading agreement level participant elements .
Returns:
a vector objects contains all the trading agreement level participant elements.

getTermConditionElements

protected java.util.Vector getTermConditionElements()
Gets all the terms and conditons elements.
Returns:
a vector objects contains all the an Vector object contains elements.

getTradingAgreementElement

protected org.w3c.dom.Element getTradingAgreementElement()
Gets the trading agreement element.
Returns:
The trading agreement element.

getTradingDescriptionElement

protected org.w3c.dom.Element getTradingDescriptionElement()
Gets the trading agreement description element.
Returns:
The trading agreement description element.

parseXMLDocument

protected void parseXMLDocument()
                         throws ECException
Parses the trading XML document.
Throws:
ECException

setAttachments

protected void setAttachments(java.util.Vector attachments,
                              java.lang.Long tradingId,
                              java.lang.String usageId)
                       throws ECException
Sets the attachments to the specified trading agreement.
Parameters:
attachments - An vector object contains all the attachment elements.
tradingId - the trading agreement id
usageId - an attachment usage string
Throws:
ECException - Raised with the message _ERR_REMOVE_EXCEPTION if an error occurred during contract attachment deleting processing.

setTradingAgreementDescAndParticipants

protected void setTradingAgreementDescAndParticipants(java.lang.Long tradingId)
                                               throws CreateException,
                                                      FinderException,
                                                      java.rmi.RemoteException,
                                                      javax.naming.NamingException,
                                                      RemoveException,
ECApplicationException
Sets the trading agreement description and participants for the specified trading agreement.
Parameters:
tradingId - the trading agreement id
Throws:
CreateException
FinderException
java.rmi.RemoteException
javax.naming.NamingException
RemoveException
ECApplicationException - Raised with message _ERR_TRADING_DESC_LOCALE if the provided locale in the Description element is not right. Raised with message _ERR_WRONG_MEMBER_INFO_IN_PARTICIPANT if the member id cannot be retrived by using the information provided in ParticipantMember element. Raised with message _ERR_DUPLICATE_PARTICIPANT if one of the participants in a trading agreement existed during creating.

setTradingAgreementElement

protected void setTradingAgreementElement(org.w3c.dom.Element trdElement)
Sets the trading agreement element.
Parameters:
trdElement - the trading agreement element object