com.ibm.commerce.command

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 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.

    <Attachment display="false" maxuploadsize="100000000"> <Command maxuploadsize="1000000" name="MyUploadCmd" supportedFileExtension="gif,jpg" uploadReturnURL_enabled="false" viruscheck="no" /> </Attachment>
    • 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.

    • 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.