java.lang.Object | +--CacheableCommandImpl | +--com.ibm.commerce.command.AbstractECTargetableCommand | +--com.ibm.commerce.command.ControllerCommandImpl | +--com.ibm.commerce.contract.commands.TradingAgreementImportBaseCmdImpl | +--com.ibm.commerce.contract.commands.ContractImportApprovedVersionCmdImpl
Import a contract from a specified XML file (WebSphere Commerce Business Edition only). The state of the contract in the XML file has to be either Approved or Active. This command called CreateXSDContractCmd, ValidateContractCmd, ContractDeployCmd, ImportDTDContractApprovedVersionCmd,AddContractNLDescriptionCmd, AddStoreNLDescriptionCmd. The following AccessBeans are used in this default implementation: ContractAccessBean, AccountAccessBean, UserAccessBean, OrganizationAccessBean, MemberGroupAccessBean, ParticipantAccessBean, and the AccessBeans are used in the default implementation of the called commands.
CreateXSDCmdImple
,
AddContractNLDescriptionCmdImpl
,
AddStoreNLDescriptionCmdImpl
,
ImportDTDContractApprovedVersionCmd
,
Serialized Form
Field Summary | |
---|---|
static java.lang.String |
CLASSNAME The name of this command. |
static java.lang.String |
COPYRIGHT IBM copyright notice field. |
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.commands. ContractImportApprovedVersionCmd |
defaultCommandClassName |
Constructor Summary | |
---|---|
ContractImportApprovedVersionCmdImpl() |
Method Summary | |
---|---|
java.lang.Integer |
getContractState() Returns the state of the new created contract. |
java.lang.String |
getUrl() Deprecated. |
void |
importContract(org.w3c.dom.Element argContractElement,
java.lang.Integer contractState) Deprecated. |
void |
performExecute() Imports the Approved or Active contract based on the information in contract XML file. |
void |
setContractXML(java.io.InputStream contractXML) Sets the contract XML instance. |
void |
setContractXMLFileName(java.lang.String contractFileName) Sets the contract XML file name. |
void |
setRequestProperties(
TypedProperty aRequestProperties) Sets the request properties. |
void |
setRootElement(org.w3c.dom.Element rootDocElm) Sets the root Element of the contract XML file. |
void |
setStoreId(java.lang.Integer storeId) Sets the ID of the store which the contract will be deployed to. |
void |
setUrl(java.lang.String astrUrl) Sets the redirect url to be called when the command completes successfully. |
void |
setXMLEntityPath(java.lang.String path) Sets the XML entity path. |
void |
setXSDFlag(boolean xsdFlag) Sets the XSD flag to indicate the XML instance file is based on XSD or DTD. |
void |
validateParameters() This is where parameter checking is done. |
Methods inherited from class com.ibm.commerce.contract.commands. TradingAgreementImportBaseCmdImpl |
getAccountId,
getContractId,
getDOMFromFile,
getDOMFromInputStream,
getElementsByTag,
getXMLFlag,
importContractNLDesc,
importFfcNLDesc,
importStoreNLDesc,
saveAccount,
saveContract |
Methods inherited from class com.ibm.commerce.command. ControllerCommandImpl |
checkPermission,
fulfills,
getForUserId,
getGeneric,
getOwner,
getRequestProperties,
getResolvedRequestProperties,
getResourceOwners,
getResponseProperties,
getRetriable,
getViewInputProperties,
isGeneric,
isRetriable,
mergeProperties,
setForUserId,
setGeneric,
setOwner,
setResponseProperties,
setRetriable,
setViewInputProperties |
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,
reset,
setAccCheck,
setCommandContext,
setCommandIfName,
setCommandStoreId,
setDefaultProperties |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait,
wait, wait |
Methods inherited from interface com.ibm.commerce.command. ControllerCommand |
checkPermission,
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,
getResourceOwners,
setAccCheck,
setForUserId,
setOwner |
Methods inherited from interface com.ibm.commerce.command. ECCommand |
checkIsAllowed,
checkResourcePermission,
createCommandExecutionEvent,
getCommandContext,
getCommandIfName,
getCommandName,
getCommandStoreId,
getDefaultProperties,
getResources,
getStoreId,
getUser,
getUserId,
setCommandContext,
setCommandIfName,
setCommandStoreId,
setDefaultProperties |
Field Detail |
---|
public static final java.lang.String COPYRIGHT
public static final java.lang.String CLASSNAME
Constructor Detail |
---|
public ContractImportApprovedVersionCmdImpl()
Method Detail |
---|
public java.lang.Integer getContractState()
public java.lang.String getUrl()
public void importContract(org.w3c.dom.Element argContractElement, java.lang.Integer contractState) throws ECException
contractState
- the state of the contractECException
validateContract()
,
TradingAgreementImportBaseCmdImpl.saveContract(Element contractElement,
boolean actionFlag)
public void performExecute() throws ECException
performExecute
in interface
ECCommand
performExecute
in class
AbstractECTargetableCommand
ECException
- Raised with message _ERR_FINDER_EXCEPTION if the FinderException occurred.
Raised with message _ERR_REMOTE_EXCEPTION if the RemoteException occurred.
Raised with message _ERR_NAMING_EXCEPTION if the NamingException occurred.
Raised with message _ERR_CREATE_EXCEPTION if the CreateException occurred.
Raised with message _ERR_SQL_EXCEPTION if the SQLException occurred.deployContract()
,
AddContractNLDescriptionCmdImpl.performExecute()
,
AddStoreNLDescriptionCmdImpl#performExecute()
,
TradingAgreementImportBaseCmdImpl.saveContract(Element contractElement,
boolean actionFlag)
,
ImportDTDContractApprovedVersionCmdImpl.performExecute()
,
AbstratECTargetableCommand#performExecute()
public void setContractXMLFileName(java.lang.String contractFileName)
setContractXMLFileName
in interface
ContractImportApprovedVersionCmd
contractFileName
- the name of the contract XML
filepublic void setRequestProperties(TypedProperty aRequestProperties) throws ECApplicationException
setRequestProperties
in interface
ControllerCommand
setRequestProperties
in class
ControllerCommandImpl
aRequestProperties
- the request properties The mandatory
name-value pairs are fileName, URL. The optional name-value pairs are XSD,
targetStoreId, validate, path. if the XSD parameter is set to true, it means
the XML file is based on XSD. Otherwise it is DTD based. The default value for
the XSD parameter is false. The validate parameter indicates if the XML parser
will validate the XML file against XSD/DTD. true - validate, false - do not
validate. The default value of the validate parameter is true. If the importing
contract is an Active contract, the targetStoreId is a required parameter. The
path parameter indicates the paths of dtd or XML schema files. The default
value of the path is specified in the WebSphere Commerce instance XML
file.
ECApplicationException
- Raised with message
_ERR_MISSING_CMD_PARAMETER when any one of the required url parameters is
missing.ControllerCommand.setRequestProperties(TypedProperty)
public void setContractXML(java.io.InputStream contractXML)
setContractXML
in interface
ContractImportApprovedVersionCmd
contractXML
- an InputStream object contains the contract XML
instancepublic void setRootElement(org.w3c.dom.Element rootDocElm)
setRootElement
in interface
ContractImportApprovedVersionCmd
rootDocElm
- the document Element object of the contract
XMLpublic void setStoreId(java.lang.Integer storeId)
setStoreId
in interface
ContractImportApprovedVersionCmd
storeId
- the store ID.public void setUrl(java.lang.String astrUrl)
setUrl
in interface
ContractImportApprovedVersionCmd
astrUrl
- the redirect url stringpublic void setXMLEntityPath(java.lang.String path)
setXMLEntityPath
in interface
ContractImportApprovedVersionCmd
path
- the path where can find the DTD or XML Schema
file(s)public void setXSDFlag(boolean xsdFlag)
setXSDFlag
in interface
ContractImportApprovedVersionCmd
setXSDFlag
in class
TradingAgreementImportBaseCmdImpl
xsdFlag
- XSD flag, true for XSD, false for
DTDpublic void validateParameters() throws ECException
validateParameters
in interface
ECCommand
validateParameters
in class
AbstractECTargetableCommand
ECException
- Raised with message _ERR_MISSING_CMD_PARAMETER if the targetStoreId parmeter
was missing from the url for an Active contract. Raised with message
_ERR_FILE_NOT_FOUND if the XML file or XSD file cannot be found. Raised with
message _ERR_PARSE_XML_FILE if an error occurred when the XML parser parses the
XML file. Raised with message _ERR_GENRIC_PARSE_XML_FILE if an IO error
occurred. Raised with message _ERR_WRONG_CONTRACT_STATE if the contract is not
in Approved or Active state. Raised with message _ERR_MISSING_CONTRACT_NAME if
the contract name is empty string in the XML file. Raised with message
_ERR_WRONG_ACCOUNT_OWNER_INFO if an error occurred when retrieving the account
owner id. Raised with message _ERR_ACCOUNT_DOES_NOT_EXIST if an error occurred
when retrieving the account based the account name and account owner id. Raised
with message _ERR_WRONG_CONTRACT_OWNER_MEMBER_INFO if an error occurred when
retrieving the contract owner id. Raised with message
_ERR_DUPLICATED_CONTRACT_NAME if there is a contract existed with the same
name, owner, and origin. Raised with message
_ERR_CONTRACT_REFERENCE_NUMBER_NOT_REQUIRED if the contract referenceNumber
attribute is provided in the XML file for Contract element. Raised with message
_ERR_MISSING_XML_INSTANCE_FOR_CONTRACT_IMPORT if there is not any XML instance
object for this command Raised with message _ERR_XML_DOCUMENT_NULL if there is
not Document object in the XML instance. Raised with message
_ERR_MISSING_CONTRACT_OR_CONTRACT_DESC_ELEMENT if neither of the contract and
contract national lanaguage description element is in XML instance.AbstratECTargetableCommand#validateParameters()