com.ibm.commerce.contract.tc.commands
Class ContractTCCreateCmdImpl

com.ibm.commerce.command.AbstractECTargetableCommand
  |
  +--com.ibm.commerce.command.ControllerCommandImpl
        |
        +--com.ibm.commerce.contract.tc.commands.ContractTCCreateCmdImpl
All Implemented Interfaces:
AccCommand, ContractTCCreateCmd, ControllerCommand, ECCommand, ECTargetableCommand, Protectable

public class ContractTCCreateCmdImpl
extends ControllerCommandImpl
implements ContractTCCreateCmd

This is the default implementation of ContractTCCreateCmd (WebSphere Commerce Business Edition only). Create a terms and conditions based on the TermCondition element XML string to the specified contract. The contract has to be in Draft state.


Field Summary
static java.lang.String CLASSNAME
           
static java.lang.String COPYRIGHT
           
 
Fields inherited from class com.ibm.commerce.command.ControllerCommandImpl
requestProperties, responseProperties, retriable, viewReqProperties
 
Fields inherited from class com.ibm.commerce.command.AbstractECTargetableCommand
commandContext
 
Fields inherited from interface com.ibm.commerce.contract.tc.commands.ContractTCCreateCmd
defaultCommandClassName, NAME
 
Constructor Summary
ContractTCCreateCmdImpl()
           
 
Method Summary
 org.w3c.dom.Element getElement()
          Returns the term condition element
 AccessVector getResources()
          Gets the access vector accessed by this command.
 void parseXMLElement(org.w3c.dom.Element element)
          Parses the term and condition element.
 void performExecute()
          Contains the actual business logic of the command It should be implemented by all the command writer.
 void setContractId(java.lang.Long newContractId)
          Sets the id of the contract.
 void setElement(org.w3c.dom.Element newElement)
          Sets term and condition element
 void setLanguageId(java.lang.Integer newLangId)
          Set the language id parameter
 void setRequestProperties(TypedProperty aRequestProperties)
          The WebController calls this method before invoking the execute method in this command to set the request properties for this command.
 void setTcLongDescription(java.lang.String newTcLongDescription)
          Sets the long description of the term and condition
 void setTcReferenceNumber(java.lang.Long newTcRefNumber)
          Sets the id of the term and condition
 void setTcReferenceNumber(java.lang.String newTcRefNumberStr)
          Sets the id of the term and condition
 void setTcShortDescription(java.lang.String newTcShortDescription)
          Sets the short description of the term and condition
 void validateParameters()
          Performs server side parameter checking.
 
Methods inherited from class com.ibm.commerce.command.ControllerCommandImpl
fulfills, getForUserId, getGeneric, getOwner, getRequestProperties, getResolvedRequestProperties, getResponseProperties, getRetriable, getViewInputProperties, isGeneric, isRetriable, mergeProperties, setForUserId, setGeneric, setOwner, setResponseProperties, setRetriable, setViewInputProperties
 
Methods inherited from class com.ibm.commerce.command.AbstractECTargetableCommand
accessControlCheck, checkIsAllowed, checkResourcePermission, execute, finalize, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getStoreId, getUser, getUserId, isReadyToCallExecute, reset, setAccCheck, setCommandContext, setCommandIfName, setDefaultProperties
 
Methods inherited from interface com.ibm.commerce.command.ControllerCommand
execute, getGeneric, getRequestProperties, getResolvedRequestProperties, getResponseProperties, getRetriable, getViewInputProperties, isGeneric, isRetriable, mergeProperties, setGeneric, setRetriable, setViewInputProperties
 
Methods inherited from interface com.ibm.commerce.command.AccCommand
accessControlCheck, getAccCheck, getForUserId, setAccCheck, setForUserId, setOwner
 
Methods inherited from interface com.ibm.commerce.command.ECCommand
checkIsAllowed, checkResourcePermission, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getStoreId, getUser, getUserId, setCommandContext, setCommandIfName, setDefaultProperties
 
Methods inherited from interface com.ibm.commerce.security.Protectable
fulfills, getOwner
 

Field Detail

CLASSNAME

public static final java.lang.String CLASSNAME

COPYRIGHT

public static final java.lang.String COPYRIGHT
Constructor Detail

ContractTCCreateCmdImpl

public ContractTCCreateCmdImpl()
Method Detail

getElement

public org.w3c.dom.Element getElement()
Returns the term condition element

getResources

public AccessVector getResources()
                          throws ECException
Gets the access vector accessed by this command. The default implementation returns null indicating that no protectable resource is accessed by this command. It is the responsibilities of the command writer to return the protectable primary resource(s) and the corresponding actions accessed by this command.

Specified by:
getResources in interface ECCommand
Overrides:
getResources in class AbstractECTargetableCommand
Returns:
AccessVector - a vector of resource action pairs

parseXMLElement

public void parseXMLElement(org.w3c.dom.Element element)
Parses the term and condition element.

performExecute

public void performExecute()
                    throws ECException
Description copied from interface: ECCommand
Contains the actual business logic of the command It should be implemented by all the command writer.
Specified by:
performExecute in interface ECCommand
Overrides:
performExecute in class AbstractECTargetableCommand
Following copied from interface: com.ibm.commerce.command.ECCommand
Throws:
com.ibm.commerce.command.CommandException - The superclass for all ECExceptions.

setContractId

public void setContractId(java.lang.Long newContractId)
Sets the id of the contract.
Parameters:
newContractId - java.lang.Long

setElement

public void setElement(org.w3c.dom.Element newElement)
Sets term and condition element
Parameters:
newElement - org.w3c.dom.Element

setLanguageId

public void setLanguageId(java.lang.Integer newLangId)
Set the language id parameter
Parameters:
newLangId - java.lang.Integer

setRequestProperties

public void setRequestProperties(TypedProperty aRequestProperties)
                          throws ECApplicationException
Description copied from interface: ControllerCommand
The WebController calls this method before invoking the execute method in this command to set the request properties for this command. It is the responsibility of the implementer of the ControllerCommand to extract the required input parameters from the request properties and perform parameter checking.
Specified by:
setRequestProperties in interface ControllerCommand
Overrides:
setRequestProperties in class ControllerCommandImpl
Following copied from interface: com.ibm.commerce.command.ControllerCommand
Parameters:
requestProperties - com.ibm.commerce.datatype.TypedProperty
Throws:
com.ibm.commerce.exception.ECException. -  

setTcLongDescription

public void setTcLongDescription(java.lang.String newTcLongDescription)
Sets the long description of the term and condition
Parameters:
newTcLongDescription - java.lang.String

setTcReferenceNumber

public void setTcReferenceNumber(java.lang.Long newTcRefNumber)
Sets the id of the term and condition
Parameters:
newTcRefNumber - java.lang.Long

setTcReferenceNumber

public void setTcReferenceNumber(java.lang.String newTcRefNumberStr)
Sets the id of the term and condition
Parameters:
newTcRefNumberStr - java.lang.String

setTcShortDescription

public void setTcShortDescription(java.lang.String newTcShortDescription)
Sets the short description of the term and condition
Parameters:
newTcShortDescription - java.lang.String

validateParameters

public void validateParameters()
                        throws ECException
Description copied from interface: ECCommand
Performs server side parameter checking. This method replaces the checkParameters() method in a previous version of the code.

Specified by:
validateParameters in interface ECCommand
Overrides:
validateParameters in class AbstractECTargetableCommand
Following copied from interface: com.ibm.commerce.command.ECCommand
Throws:
ECException. -