public class ContractExportCmdImpl extends TradingAgreementExportBaseCmdImpl implements ContractExportCmd
ContractExportCmd
controller command.
Name | Description |
---|---|
contractId |
The contract ID. It is mandatory. |
fileName |
The file name of the importing xml file. It is mandatory. |
langId |
The language ID. It is mandatory. |
xsdName |
The xsd file name when exporting a contract. It is mandatory. |
URL |
The url parameter. It is mandatory. |
xmlFileEncoding |
The xml file encoding. It is optional. |
tagName |
The tag name of the contract element.It is optional. |
all |
It indicates if everything including the system generated field for a contract will be exported.It is optional. |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASSNAME
The full name of this class.
|
static java.lang.String |
COPYRIGHT
The IBM copyright notice field.
|
defaultCommandClassName, NAME
Constructor and Description |
---|
ContractExportCmdImpl() |
Modifier and Type | Method and Description |
---|---|
com.ibm.commerce.accesscontrol.AccessVector |
getResources()
Gets the access vector accessed by this command.
|
java.lang.String |
getUrl()
Gets the redirection url to be called when the command completes successfully.
|
void |
performExecute()
Executes the business logic of this command implementation.
|
void |
setContractId(java.lang.Long contractId)
Sets the ID of the contract to be exported.
|
void |
setExportAllData(boolean wantsAll)
Sets the exporting all data flag.
|
void |
setFileName(java.lang.String astrFileName)
Sets the xml file to which the contract will be exported.
|
void |
setLangId(java.lang.Integer anLangId)
Sets the language ID.
|
void |
setRequestProperties(com.ibm.commerce.datatype.TypedProperty aRequestProperties)
Sets the request properties of this command implementation.
|
void |
setUrl(java.lang.String astrUrl)
Sets the redirection URL to be called when the command completes successfully.
|
void |
setXMLFileEncoding(java.lang.String encoding)
Sets the encoding.
|
void |
setXSDFileName(java.lang.String xsdName)
Sets the XSD file name.
|
void |
validateParameters()
Validates the contract to check if it is in right state for the exporting process.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checkPermission, fulfills, getForUserId, getGeneric, getOwner, getRequestProperties, getResolvedRequestProperties, getResourceOwners, getResponseProperties, getRetriable, getViewInputProperties, isGeneric, isRetriable, mergeProperties, setForUserId, setGeneric, setOwner, setResponseProperties, setRetriable, setViewInputProperties
accessControlCheck, checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getObjectSize, getPostInvokeParameters, getPreInvokeParameters, getStoreId, getUser, getUserId, isReadyToCallExecute, reset, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
checkPermission, execute, getGeneric, getRequestProperties, getResolvedRequestProperties, getResponseProperties, getRetriable, getViewInputProperties, isGeneric, isRetriable, mergeProperties, setGeneric, setRetriable, setViewInputProperties
accessControlCheck, getAccCheck, getForUserId, getResourceOwners, setAccCheck, setForUserId, setOwner
checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getPostInvokeParameters, getPreInvokeParameters, getStoreId, getUser, getUserId, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
public static final java.lang.String CLASSNAME
public static final java.lang.String COPYRIGHT
public com.ibm.commerce.accesscontrol.AccessVector getResources() throws com.ibm.commerce.exception.ECException
getResources
in interface com.ibm.commerce.command.ECCommand
getResources
in class com.ibm.commerce.command.AbstractECTargetableCommand
com.ibm.commerce.exception.ECException
AbstractECTargetableCommand.getResources()
public java.lang.String getUrl()
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_UNSUPPORTED_ENCODING whenever an unsupported encode is found.
Raised with message _ERR_IO_EXCEPTION whenever an IO problem occurred.
Raised with message _ERR_EXPORT_CONTRACT if a problem occurred, but this command cannot determine the reason.
Raised with message _ERR_CONTRACT_CMD_EXEC whenever one of the following exceptions
occurs: javax.ejb.FinderException, javax.ejb.CreateException, java.rmi.RemoteException,
and javax.naming.NamingException.AbstractECTargetableCommand.performExecute()
public void setContractId(java.lang.Long contractId)
setContractId
in interface ContractExportCmd
contractId
- the ID of the contract.public void setExportAllData(boolean wantsAll)
setExportAllData
in interface ContractExportCmd
wantsAll
- the flag to indicate if all the data will be exported. If the flag is set to true,
the contract ID, term and condition IDs, time created, and the last updated time will be exported. otherwise, the information will not be exported.public void setFileName(java.lang.String astrFileName)
setFileName
in interface ContractExportCmd
astrFileName
- the name of the xml filepublic void setLangId(java.lang.Integer anLangId)
setLangId
in interface ContractExportCmd
anLangId
- the language IDpublic 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
- the request properties
The mandatory name-value pairs are contractId, fileName, langId, xsdName, URL.
The optional name-value parameters are xmlFileEncoding, all, tagName. If the
xmlFileEncoding is not provided, the default value will be UTF-8. The default
value for name "all" is set to true. It means the ids, create time, update time will be exported
to the specified xml file.
If the tagName is not provided, when a contract is exported, the tag name of the contract will based on
the default implementation. For example, a referral contract, the tag will be ReferralContract.com.ibm.commerce.exception.ECApplicationException
- Raised with message _ERR_MISSING_CMD_PARAMETER when any one of the required url parameters is missing.
The required parameters are contractId, langId, fileName, URL, and xsdName. Raised with message InvalidParameterValueException
whenever either the contradId or langId parameter has the bad format.ControllerCommand.setRequestProperties(TypedProperty)
public void setUrl(java.lang.String astrUrl)
setUrl
in interface ContractExportCmd
astrUrl
- the redirection URL stringpublic void setXMLFileEncoding(java.lang.String encoding)
setXMLFileEncoding
in interface ContractExportCmd
encoding
- the encoding stringpublic void setXSDFileName(java.lang.String xsdName)
setXSDFileName
in interface ContractExportCmd
xsdName
- The name of the XSD file which the contract xml should against for.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_CONTRACT_OBJECT_NOT_FOUND if the specified contract cannot be found.
Raised with message _ERR_WRONG_CONTRACT_STATE if the contract is in one of the following state:
EC_STATE_DEPLOY_FAILED, EC_STATE_DEPLOY_IN_PROGRESS.