Interface WebAssetsUploadCmd
-
- All Superinterfaces:
- AccCommand, com.ibm.websphere.command.CacheableCommand, com.ibm.websphere.command.Command, com.ibm.websphere.command.CommandCaller, ControllerCommand, ECCommand, Protectable, java.io.Serializable, com.ibm.websphere.command.TargetableCommand, TempUploadCmd
- All Known Implementing Classes:
- WebAssetsUploadCmdImpl
public interface WebAssetsUploadCmd extends TempUploadCmd
This interface defines how web assets are uploaded to the file system. The location will be
$wcsstore\storename\filepath\filename
.$wcsstore
is from the instance's configuration file.storename
is based on thestore_id
from the command context.filepath
is user-specified.filename
is the file to be uploaded. For example:storelogo.gif
. The user can specify a rename, which includes the file extension. For example:myicon.gif
. In this case, uploaded file will be renamed tomyicon.gif
.A unique filename will not be generated. If the uploaded file already exists, it will be overwritten.
This is not registered in the
URL
configuration or the command configuration. This interface is not intended to be used directly. It should be extended by other commands. There is no access control management. If a command extends this interface, access control checking will need to be implemented.In order to write a command which extends this interface, the attachment configuration section in the
<Attachment display="false" maxuploadsize="100000000"> <Command maxuploadsize="1000000" name="MyUploadCmd" supportedFileExtension="gif,jpg" uploadReturnURL_enabled="false" viruscheck="no" /> </Attachment><instance_name>.xml
file needs to be set up.name="MyUploadCmd"
: This defines the command name that extendsTempUploadCmd
. This must be the command name that is retrieved from the command context.
maxuploadsize
: This defines the maximum allowable upload size forMyUploadCmd
. This must be less than the sitemaxuploadsize
.supportedFileExtension
: This indicates the file extension that is allowed to be uploaded.uploadReturnURL_enabled
: This determines whether to return to the URL when command is completed.virusCheck
: This indicates whethervirusCheck
should be enabled or not. Virus checking is not provided by default.
The result of the command is a
URL
which can be called to retrieve the attachment.
-
-
Field Summary
Fields
Modifier and Type
Field and Description
static java.lang.String
COPYRIGHT
IBM copyright notice field
static java.lang.String
defaultCommandClassName
This is the default implementation class of this command.
-
Method Summary
All Methods Instance Methods Abstract Methods
Modifier and Type
Method and Description
java.lang.String
getAttachmentURL()
This method gets the URL
of the uploaded file.
java.lang.String
getUrl()
This method gets the URL
returned when the upload is completed.
-
Methods inherited from interface com.ibm.commerce.command.TempUploadCmd
getAttachmentOwner, getFileName, getFileSize
-
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.websphere.command.CacheableCommand
executeFromCache, getCaller, getEntryInfo, getId, getSharingPolicy, postExecute, preExecute, setCaller, updateCache
-
Methods inherited from interface com.ibm.websphere.command.TargetableCommand
getCommandTarget, getCommandTargetName, hasOutputProperties, performExecute, setCommandTarget, setCommandTargetName, setOutputProperties
-
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, getExceptionInvokeParameters, getPostInvokeParameters, getPreInvokeParameters, getResources, getStoreId, getUser, getUserId, performExecute, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties, validateParameters
-
Methods inherited from interface com.ibm.commerce.security.Protectable
fulfills, getOwner
-
-
Field Detail
-
COPYRIGHT
static final java.lang.String COPYRIGHT
IBM copyright notice field
- See Also:
- Constant Field Values
-
defaultCommandClassName
static final java.lang.String defaultCommandClassName
This is the default implementation class of this command.
- See Also:
- Constant Field Values
-
Method Detail
-
getUrl
java.lang.String getUrl()
This method gets the URL
returned when the upload is completed.
- Specified by:
getUrl
in interface TempUploadCmd
- Returns:
- This method returns a
String
representation of the URL
returned when the upload is completed.
-
getAttachmentURL
java.lang.String getAttachmentURL()
This method gets the URL
of the uploaded file.
- Specified by:
getAttachmentURL
in interface TempUploadCmd
- Returns:
- This method returns a
String
representation of the URL
of the uploaded attachment file.