com.ibm.commerce.attachment.commands

Class AddAttachmentAssetCmdImpl

  • All Implemented Interfaces:
    AddAttachmentAssetCmd, com.ibm.commerce.command.CacheableECCommand, ECCommand, ECTargetableCommand, TaskCommand, com.ibm.websphere.cache.Sizeable, com.ibm.websphere.command.CacheableCommand, com.ibm.websphere.command.Command, com.ibm.websphere.command.CommandCaller, com.ibm.websphere.command.TargetableCommand, java.io.Serializable


    public class AddAttachmentAssetCmdImpl
    extends TaskCommandImpl
    implements AddAttachmentAssetCmd
    Create an attachment asset with the specified parameters.
    Behavior:
    • If the store entity ID is not specified, the store ID in the command context will be used.
    • Creates the attachment asset with the store entity ID, attachment target ID, and attachment asset path.
    • Setting an empty string or null to the mimetype indicates that the attachment asset is a URL.
    • By default, If the mimetype is not specified, it will be set to an empty string to indicated that it is a URI.
    • If the content of the attachment asset is specified but the mimetype is not URI, the WriteManagedFile command will be called. This will create the Managed File.
    • If the attachment asset is a URL, then the directory path will be set to an empty string
    • , otherwise, the directory path will be the path of the directory obtained from the attachment asset path.
    Access Bean:
    • AttachmentAssetAccessBean
    • StoreEntityAccessBean
    • ManagedFileAccessBean
    Other commands:
    • WriteManagedFile
    Helper:
    • AttachmentHelper
    • AttachmentAssetHelper
    See Also:
    Serialized Form
    • Field Detail

      • CLASSNAME

        public static final java.lang.String CLASSNAME
        Define the CLASSNAME.
        See Also:
        Constant Field Values
    • Constructor Detail

      • AddAttachmentAssetCmdImpl

        public AddAttachmentAssetCmdImpl()
    • Method Detail

      • getAttachmentTargetId

        public java.lang.Long getAttachmentTargetId()
        Gets the attachment target ID that owns the attachment asset.
        Specified by:
        getAttachmentTargetId in interface AddAttachmentAssetCmd
        Returns:
        The attachment target ID
      • getStoreentId

        public java.lang.Integer getStoreentId()
        Gets the store entity ID.
        Specified by:
        getStoreentId in interface AddAttachmentAssetCmd
        Returns:
        The store entity ID
      • getAttachmentAssetPath

        public java.lang.String getAttachmentAssetPath()
        Gets the path for the attachment asset.
        Specified by:
        getAttachmentAssetPath in interface AddAttachmentAssetCmd
        Returns:
        The attachment asset path
      • getImage1

        public java.lang.String getImage1()
        Gets the image 1 of the attachment asset.
        Specified by:
        getImage1 in interface AddAttachmentAssetCmd
        Returns:
        The image 1
      • getImage2

        public java.lang.String getImage2()
        Gets the image 2 of the attachment asset.
        Specified by:
        getImage2 in interface AddAttachmentAssetCmd
        Returns:
        The image 2
      • getMimeType

        public java.lang.String getMimeType()
        Gets the mime type of the attachment asset.
        Specified by:
        getMimeType in interface AddAttachmentAssetCmd
        Returns:
        The attachment asset mime type
      • getMimeTypeEncoding

        public java.lang.String getMimeTypeEncoding()
        Gets the encoding of the mime type of the attachment asset.
        Specified by:
        getMimeTypeEncoding in interface AddAttachmentAssetCmd
        Returns:
        The encoding of the attachment asset mime type
      • getContent

        public byte[] getContent()
        Gets the content of the attachment asset. If caller did not set the content. The content will be obtained from the database.
        Specified by:
        getContent in interface AddAttachmentAssetCmd
        Returns:
        The attachment asset content
      • reset

        public void reset()
        Resets all the parameters
        Specified by:
        reset in interface com.ibm.websphere.command.Command
        Overrides:
        reset in class AbstractECTargetableCommand
      • setAttachmentTargetId

        public void setAttachmentTargetId(java.lang.Long anAttachmentTargetId)
        Sets the attachment target ID.
        Specified by:
        setAttachmentTargetId in interface AddAttachmentAssetCmd
        Parameters:
        anAttachmentTargetId - The attachment target ID
      • setStoreentId

        public void setStoreentId(java.lang.Integer anStoreentId)
        Sets the store entity ID.
        Specified by:
        setStoreentId in interface AddAttachmentAssetCmd
        Parameters:
        anStoreentId - The store entity ID
      • setAttachmentAssetPath

        public void setAttachmentAssetPath(java.lang.String astrAttachmentAssetPath)
        Sets the path of the attachment asset.
        Specified by:
        setAttachmentAssetPath in interface AddAttachmentAssetCmd
        Parameters:
        astrAttachmentAssetPath - The attachment asset path
      • setImage1

        public void setImage1(java.lang.String astrImage1)
        Sets the image 1 of the attachment asset.
        Specified by:
        setImage1 in interface AddAttachmentAssetCmd
        Parameters:
        astrImage1 - The image 1
      • setImage2

        public void setImage2(java.lang.String astrImage2)
        Sets the image 2 of the attachment asset.
        Specified by:
        setImage2 in interface AddAttachmentAssetCmd
        Parameters:
        astrImage2 - The image 2
      • setMimeType

        public void setMimeType(java.lang.String astrMimeType)
        Sets the mime type of the attachment asset.
        Specified by:
        setMimeType in interface AddAttachmentAssetCmd
        Parameters:
        astrMimeType - The attachment asset mimetype
      • setMimeTypeEncoding

        public void setMimeTypeEncoding(java.lang.String astrMimeTypeEncoding)
        Sets the encoding of the mime type of the attachment asset.
        Specified by:
        setMimeTypeEncoding in interface AddAttachmentAssetCmd
        Parameters:
        astrMimeTypeEncoding - The encoding of the attachment asset mimetype
      • setContent

        public void setContent(byte[] abaAssetContent)
        Sets the content of the attachment asset.
        Specified by:
        setContent in interface AddAttachmentAssetCmd
        Parameters:
        abaAssetContent - The attachment asset content
      • getCatalogIdsForCacheInvalidations

        public java.lang.String[] getCatalogIdsForCacheInvalidations()
                                                              throws ECException
        Gets the array of catalog IDs for cache invalidations.
        Returns:
        The string array of catalog IDs
        Throws:
        ECException
      • getCatentryIdsForCacheInvalidations

        public java.lang.String[] getCatentryIdsForCacheInvalidations()
                                                               throws ECException
        Gets the array of catalog entry IDs for cache invalidations.
        Returns:
        The string array of catalog entry IDs
        Throws:
        ECException
      • getCatgroupIdsForCacheInvalidations

        public java.lang.String[] getCatgroupIdsForCacheInvalidations()
                                                               throws ECException
        Gets the array of catalog group IDs for cache invalidations.
        Returns:
        The string array of catalog group IDs
        Throws:
        ECException
      • getCollateralIdsForCacheInvalidations

        public java.lang.String[] getCollateralIdsForCacheInvalidations()
                                                                 throws ECException
        Gets the list of collateral IDs for cache invalidations.
        Returns:
        The string array of collateral IDs
        Throws:
        ECException
      • getEMarketingSpotNamesForCacheInvalidations

        public java.util.Collection getEMarketingSpotNamesForCacheInvalidations()
                                                                         throws ECException
        Gets the list of e-Marketing Spot names for cache invalidations.
        Returns:
        The string array of e-Marketing Spot names
        Throws:
        ECException