java.lang.Object | +--CacheableCommandImpl | +--com.ibm.commerce.command.AbstractECTargetableCommand | +--com.ibm.commerce.command.ControllerCommandImpl | +--com.ibm.commerce.command.UploadToStreamCmdImpl
The UploadToStreamCmdImpl
will upload files to return a stream.
Note that this is not registered in URLREG, UploadToStreamCmd is not intended
to be used directly , it should be extended by other commands
Field Summary | |
---|---|
static java.lang.String |
COPYRIGHT IBM 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.command. UploadToStreamCmd |
defaultCommandClassName |
Constructor Summary | |
---|---|
UploadToStreamCmdImpl() |
Method Summary | |
---|---|
long |
getAttachmentOwner() Gets the owner_id of the attachment creator |
java.io.InputStream |
getAttachmentStream() Gets the uploaded attachment Stream |
protected
java.lang.String |
getContentType() Gets the contentType of the uploaded file * |
java.lang.String |
getErrorURL() Gets the Url to be redirected when upload runs into error . |
protected
java.lang.String |
getFileExtension() Gets the file extension of the attachment file |
protected
java.lang.String |
getFileName_NoExt() Gets the filename without extension |
java.lang.String |
getFileName() Gets the filename of the uploaded attachment |
long |
getFileSize() Gets the filesize of uploaded file |
java.lang.String |
getRootPath() Gets the rootPath of where the file should be uploaded . |
protected
java.lang.String |
getStoreName() Gets the storename. |
java.lang.String |
getUrl() Gets the Url to be returned when upload is completed . |
void |
performExecute() This method contains the main business logic of this command. |
void |
setErrorURL(java.lang.String errorURL) Sets the errorURL to be forwarded when an error occurs during upload |
void |
setRefCmd(java.lang.String name) Sets the refcmd of the the command which extends this command. |
void |
setRequestProperties(
TypedProperty reqParms) Sets the request properties. |
void |
setRootPath(java.lang.String path) Sets the rootPath of where the file should be uploaded . |
void |
setUrl(java.lang.String returnURL) Sets the Url to be returned when upload is completed . |
void |
validateParameters() Checks the validity of the parameters. |
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
Constructor Detail |
---|
public UploadToStreamCmdImpl()
Method Detail |
---|
public java.io.InputStream getAttachmentStream()
getAttachmentStream
in interface
UploadToStreamCmd
public void setErrorURL(java.lang.String errorURL)
errorURL
- the url to be forwarded when an error occurs during
uploadpublic void setRefCmd(java.lang.String name)
name
- reference command namepublic void setUrl(java.lang.String returnURL)
returnURL
- the url to be returned when upload is
completeprotected java.lang.String getStoreName()
public java.lang.String getFileName()
getFileName
in interface
UploadToStreamCmd
public java.lang.String getUrl()
getUrl
in interface
UploadToStreamCmd
public java.lang.String getErrorURL()
public long getFileSize()
getFileSize
in interface
UploadToStreamCmd
public long getAttachmentOwner()
getAttachmentOwner
in interface
UploadToStreamCmd
public void setRootPath(java.lang.String path)
path
- the rootpath of where the file is uploaded. The default
value is $wcsstorepublic java.lang.String getRootPath()
protected java.lang.String getContentType()
protected java.lang.String getFileName_NoExt()
protected java.lang.String getFileExtension()
public void setRequestProperties(TypedProperty reqParms) throws ECException
ControllerCommand
setRequestProperties
in interface
ControllerCommand
setRequestProperties
in class
ControllerCommandImpl
reqParms
- request propertiesECException
- Raised with message ECMessage._ERR_CMD_INVALID_PARAM when an unexpected error
occurs when processing the command parameters Raised with message
ECMessage._ERR_REMOTE_EXCEPTION when an remote error occurs Raised with message
ECMessage._ERR_UPLOAD_REFCMD_MISSING_CONFIG_PARAMS when there is no
configuration for the refcmd in the instance fileContollerCommand#setRequestProperties()
public void validateParameters() throws ECException
validateParameters
in interface
ECCommand
validateParameters
in class
AbstractECTargetableCommand
ECException
- Raised with exception ECMessage._ERR_UPLOAD_MISSING_REFCMD when the refcmd is
missing in instance file attachment configuration section Raised with exception
ECMessage._ERR_UPLOAD_FILECONTENTTYPE_NOTALLOWED when the contenttpye of upload
file does not match with file extension Raised with exception
ECMessage._ERR_UPLOAD_FILETYPE_NOTALLOWED when the file type is not one of the
supportedfileextension specified in attachment configuration Raised with
exception ECMessage._ERR_UPLOAD_FILESIZE_TOOBIG when the filesize exceeds the
maximum allowable size in the attachment configuration in instance
filepublic void performExecute() throws ECException
performExecute
in interface
ECCommand
performExecute
in class
AbstractECTargetableCommand
ECException
ControllerComand#performExecute