public class ContractSaveCmdImpl extends TradingAgreementImportBaseCmdImpl implements ContractSaveCmd
ContractSaveCmd
controller command.
Name | Description |
---|---|
ContractId |
The id of the contract. Mandatory. |
ContractState |
The state of the contract. Optional. |
CurrentContractState |
The current state of the contract.
Sets this parameter before executing isInRightStateToUpdate() |
LanguageId |
The language id. Optional. |
LastUpdatedTime |
The last update time of the contract. Optional. |
request properties |
the request properties. Possible values include redirecturl, XMLFile, xml, XSDValidation, LastUpdatedTime. Optional. |
XML |
the input xml string. Mandatory. |
XSDValidation |
The XSD validation flag. If the flag is set to true, the xml parser will validate the xml instance against the specified XSD file. Mandatory. |
CreateXSDContractCmd
,
UpdateXSDContractCmd
If it updates an existing contract, the UpdateXSDContractCmd
command will be called.
If it adds a new contract, the CreateXSDContractCmd
command will be called.
ContractAccessBean
,
AccountAccessBean
,
ParticipantAccessBean
.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASSNAME
The name of this class
|
static java.lang.String |
COPYRIGHT
The IBM copyright notice field.
|
defaultCommandClassName, NAME
Constructor and Description |
---|
ContractSaveCmdImpl() |
Modifier and Type | Method and Description |
---|---|
java.lang.Integer |
getContractState()
Returns the contract state.
|
com.ibm.commerce.datatype.TypedProperty |
getViewInputProperties()
This method is called by the web controller to retrieve the request properties set
by the setRequestProperties() method.
|
boolean |
isInRightStateToUpdate()
Checks if the contract is in right state for updating action.
|
boolean |
isUpdate()
Returns if the action of this command based on the information inside the xml string.
|
void |
performExecute()
Executes the business logic of this command implementation.
|
void |
setContractId(java.lang.Long contractId)
Sets the contract id parameter.
|
void |
setContractState(java.lang.Integer contractState)
Sets the contract state parameter.
|
void |
setCurrentContractState(java.lang.Integer curContractState)
Sets the current contract state parameter.
|
void |
setLanguageId(java.lang.Integer langId)
Sets the language id parameter.
|
void |
setLastUpdatedTime(java.lang.String lastUpdatedTime)
Sets the last update time of the contract.
|
void |
setRequestProperties(com.ibm.commerce.datatype.TypedProperty aRequestProperties)
Retrieves input parameters from the request properties.
|
void |
setXML(java.lang.String xmlString)
Sets the input xml string.
|
void |
setXSDValidation(boolean bValidation)
Sets the XSD validation flag.
|
void |
validateParameters()
The method checks if the information provided in contract Element object is valid.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setXSDFlag
checkPermission, fulfills, getForUserId, getGeneric, getOwner, getRequestProperties, getResolvedRequestProperties, getResourceOwners, getResponseProperties, getRetriable, isGeneric, isRetriable, mergeProperties, setForUserId, setGeneric, setOwner, setResponseProperties, setRetriable, setViewInputProperties
accessControlCheck, checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getObjectSize, getPostInvokeParameters, getPreInvokeParameters, getResources, getStoreId, getUser, getUserId, isReadyToCallExecute, reset, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
checkPermission, execute, getGeneric, getRequestProperties, getResolvedRequestProperties, getResponseProperties, getRetriable, isGeneric, isRetriable, mergeProperties, setGeneric, setRetriable, setViewInputProperties
accessControlCheck, getAccCheck, getForUserId, getResourceOwners, setAccCheck, setForUserId, setOwner
checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getPostInvokeParameters, getPreInvokeParameters, getResources, getStoreId, getUser, getUserId, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
public static final java.lang.String CLASSNAME
public static final java.lang.String COPYRIGHT
public java.lang.Integer getContractState()
public com.ibm.commerce.datatype.TypedProperty getViewInputProperties()
getViewInputProperties
in interface com.ibm.commerce.command.ControllerCommand
getViewInputProperties
in class com.ibm.commerce.command.ControllerCommandImpl
public boolean isInRightStateToUpdate()
public boolean isUpdate()
public void performExecute() throws com.ibm.commerce.exception.ECException
performExecute
in interface com.ibm.commerce.command.ECCommand
performExecute
in class com.ibm.commerce.command.AbstractECTargetableCommand
com.ibm.commerce.exception.ECException
- Raised with message _ERR_CONTRACT_SAVE when an error occurred.CreateXSDContractCmdImpl.performExecute()
,
UpdateXSDContractCmdImpl.performExecute()
,
AbstractECTargetableCommand.performExecute()
public void setContractId(java.lang.Long contractId)
contractId
- the id of the contractpublic void setContractState(java.lang.Integer contractState)
contractState
- the state of the contractpublic void setCurrentContractState(java.lang.Integer curContractState)
curContractState
- the current state of the contractpublic void setLanguageId(java.lang.Integer langId)
langId
- the language idpublic void setLastUpdatedTime(java.lang.String lastUpdatedTime)
setLastUpdatedTime
in interface ContractSaveCmd
lastUpdatedTime
- the last update time stringpublic void setRequestProperties(com.ibm.commerce.datatype.TypedProperty aRequestProperties) throws com.ibm.commerce.exception.ECApplicationException
setRequestProperties
in interface com.ibm.commerce.command.ControllerCommand
setRequestProperties
in class com.ibm.commerce.command.ControllerCommandImpl
aRequestProperties
- An TypedProperty object contains the input parameters.com.ibm.commerce.exception.ECApplicationException
- Raised with message _ERR_MISSING_CMD_PARAMETER when the input xml string is missed.public void setXML(java.lang.String xmlString)
setXML
in interface ContractSaveCmd
xmlString
- the input xml string.public void setXSDValidation(boolean bValidation)
setXSDValidation
in interface ContractSaveCmd
bValidation
- the validation flag, true: validate, false: do not validate.public void validateParameters() throws com.ibm.commerce.exception.ECException
validateParameters
in interface com.ibm.commerce.command.ECCommand
validateParameters
in class com.ibm.commerce.command.AbstractECTargetableCommand
com.ibm.commerce.exception.ECException
- Raised with message _ERR_WRONG_CONTRACT_STATE if the state of the contract is not in Draft state.
Raised with message _ERR_WRONG_ACCOUNT_OWNER_INFO when the member id cannot be found. It is based on the specified
account owner, if the contract refers to an account.
Raised with message _ERR_ACCOUNT_DOES_NOT_EXIST when the account cannot be found based the provided account
name and owner information. If the contract refers to an account, it occurs.
Raised with message EC_ERR_NO_AUTH_REF_ANOTHER_TRADING if the referred to contract is not a Referral or Hosting contract. And if
the contract owner is not as a Referral/Reseller participant in the referred Referral/Hosting contract, it occurs.
Raised with message _ERR_DUPLICATED_CONTRACT_NAME if there is an existing contract with the same name, origin, and state in
the database and the action is created.
Raised with message _ERR_WRONG_CONTRACT_OWNER_MEMBER_INFO if the contract owner id cannot be retrieved based on the contract
owner information specified in the xml string.AbstractECTargetableCommand.validateParameters()