com.ibm.commerce.command
Interface TempUploadCmd

All Superinterfaces:
AccCommand, ControllerCommand, ECCommand
All Known Subinterfaces:
WebAssetsUploadCmd
All Known Implementing Classes:
TempUploadCmdImpl, WebAssetsUploadCmdImpl

public interface TempUploadCmd
extends ControllerCommand

TempUploadCmd will upload file to a file system with a unique generated filename. Note that this is not registered in URLREG or CMREG. TempUPloadCmd is not intended to be used directly, it should be extended by other commands. There is no access control management. If your command extends the TempUploadCmd, you should implement your own access control checking.

The filepath to be uploaded is $wcsstore\storename\filepath $wcsstore is defined in instance configuration file storename is based on store_id retrieved from command context i.e. the store that you logon to filepath is user input.

To write your command which extend TempUploadCmd, requires setting up attachment configuration section in the instance file.

 <Attachment display="false"
       maxuploadsize="100000000">
      <Command maxuploadsize="1000000"
      name="MyUploadCmd"
      supportedFileExtension="gif,jpg"
      uploadReturnURL_enabled="false"
      viruscheck="no" />
 </Attachment>

The result of the command is an URL which can be called to retrieve the attachment (attachmenturl).


Field Summary
static java.lang.String COPYRIGHT
          IBM copyright notice field
static java.lang.String defaultCommandClassName
          default class name
 
Method Summary
 long getAttachmentOwner()
          Gets the owner_id of the uploaded attachment .
 java.lang.String getAttachmentURL()
          Gets the attachment URL where the attachment is uploaded .
 java.lang.String getFileName()
          Gets the File name of the uplaoded attachment.
 long getFileSize()
          Gets the file size of the uploaded attachment
 java.lang.String getUrl()
          Gets the return URL of the command.
 
Methods inherited from interface com.ibm.commerce.command. ControllerCommand
checkPermission, execute, getGeneric, getRequestProperties, getResolvedRequestProperties, getResponseProperties, getRetriable, getViewInputProperties, isGeneric, isRetriable, mergeProperties, setGeneric, setRequestProperties, 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, performExecute, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties, validateParameters
 

Field Detail
public static final java.lang.String COPYRIGHT
IBM copyright notice field
See Also:
Constant Field Values

defaultCommandClassName

public static final java.lang.String defaultCommandClassName
default class name
See Also:
Constant Field Values
Method Detail

getUrl

public java.lang.String getUrl()
Gets the return URL of the command. when the command is completed, it will do a redirect to this URL
Returns:
Url

getAttachmentURL

public java.lang.String getAttachmentURL()
Gets the attachment URL where the attachment is uploaded .
Returns:
attachmenturl The unique URL of the uploaded attachment

getAttachmentOwner

public long getAttachmentOwner()
Gets the owner_id of the uploaded attachment .
Returns:
owner_id the owner identifier of the uploaded attachment

getFileSize

public long getFileSize()
Gets the file size of the uploaded attachment
Returns:
filesize the file size of the uploaded attachment

getFileName

public java.lang.String getFileName()
Gets the File name of the uplaoded attachment.
Returns:
filename the file name of the uploaded attachment