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 the store_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 to myicon.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 <instance_name>.xml
file needs to be set up.
name="MyUploadCmd"
: This defines the command name that extends TempUploadCmd. This must be
the command name that is retrieved from the command context.
maxuploadsize
: This defines the maximum allowable upload size for MyUploadCmd
. This must be
less than the site maxuploadsize
.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 whether virusCheck
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.
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.
|
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. |
getAttachmentOwner, getFileName, getFileSize
checkPermission, execute, getGeneric, getRequestProperties, getResolvedRequestProperties, getResponseProperties, getRetriable, getViewInputProperties, isGeneric, isRetriable, mergeProperties, setGeneric, setRequestProperties, setRetriable, setViewInputProperties
executeFromCache, getCaller, getEntryInfo, getId, getSharingPolicy, postExecute, preExecute, setCaller, updateCache
getCommandTarget, getCommandTargetName, hasOutputProperties, performExecute, setCommandTarget, setCommandTargetName, setOutputProperties
accessControlCheck, getAccCheck, getForUserId, getResourceOwners, setAccCheck, setForUserId, setOwner
checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getPostInvokeParameters, getPreInvokeParameters, getResources, getStoreId, getUser, getUserId, performExecute, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties, validateParameters
fulfills, getOwner
static final java.lang.String COPYRIGHT
static final java.lang.String defaultCommandClassName
java.lang.String getUrl()
URL
returned when the upload is completed.getUrl
in interface TempUploadCmd
String
representation of the URL
returned when the upload is completed.java.lang.String getAttachmentURL()
URL
of the uploaded file.getAttachmentURL
in interface TempUploadCmd
String
representation of the URL
of the uploaded attachment file.