com.ibm.commerce.attachment.commands

Class UpdateAttachmentAssetCmdImpl

  • All Implemented Interfaces:
    UpdateAttachmentAssetCmd, 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 UpdateAttachmentAssetCmdImpl
    extends TaskCommandImpl
    implements UpdateAttachmentAssetCmd
    Updates an attachment asset with the specified parameters.
    Behavior:
    • By default, the create missing attachment asset option is set to true.
    • If the store entity ID is not specified, the store ID in the command context will be used.
    • If the attachment asset ID is not specified, then the attachment target ID and the attachment asset path must be specified. Together with the store entity ID, these parameters will be used to find the attachment asset ID. If both the attachment target ID and the attachment asset path were not specified, an exception will be thrown.
    • If the attachment asset ID is found or specified, then the attachment asset of that attachment asset ID will be updated.
    • If the attachment asset ID is not found, but the create missing option is set to true, an attachment asset will be created. This is performed by calling the AddAttachmnetAsset.
    • If the attachment asset ID is not found, and the create missing option is set to false, an exception will be thrown.
    • If the content of the attachment asset is specified, it will be created or updated to the Managed File
    • If the attachment asset path is being changed, the WriteManagedFile will be called. This will remove the link between the managed file and the old attachment asset path
    Access Bean:
    • AttachmentAssetAccessBean
    • StoreEntityAccessBean
    • ManagedFileAccessBean
    Other Commands:
    • AddAttachmentAsset
    • 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

      • UpdateAttachmentAssetCmdImpl

        public UpdateAttachmentAssetCmdImpl()
    • Method Detail

      • getAttachmentTargetId

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

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

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

        public java.lang.String getMimeType()
        Gets the mime type of the attachment asset.
        Specified by:
        getMimeType in interface UpdateAttachmentAssetCmd
        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 UpdateAttachmentAssetCmd
        Returns:
        The encoding of the attachment asset mime type
      • getContent

        public byte[] getContent()
        Gets the content of the attachment asset if the mime type is not URI. If caller did not set the content. The content will be obtained from the database.
        Specified by:
        getContent in interface UpdateAttachmentAssetCmd
        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
      • setAttachmentAssetId

        public void setAttachmentAssetId(java.lang.Long anAttachmentAssetId)
        Sets the attachment asset ID.
        Specified by:
        setAttachmentAssetId in interface UpdateAttachmentAssetCmd
        Parameters:
        anAttachmentAssetId - The attachment asset ID
      • setAttachmentTargetId

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

        public void setStoreentId(java.lang.Integer anStoreentId)
        Sets the store entity ID.
        Specified by:
        setStoreentId in interface UpdateAttachmentAssetCmd
        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 UpdateAttachmentAssetCmd
        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 UpdateAttachmentAssetCmd
        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 UpdateAttachmentAssetCmd
        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 UpdateAttachmentAssetCmd
        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 UpdateAttachmentAssetCmd
        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 UpdateAttachmentAssetCmd
        Parameters:
        abaAssetContent - The attachment asset content
      • setCreateMissing

        public void setCreateMissing(java.lang.Boolean aboolCreateMissing)
        Sets the option the create missing attachment asset.
        • True - create the missing attachment asset.
        • False - throw exception if the attachment asset.
        By default, the option is set to True.
        Specified by:
        setCreateMissing in interface UpdateAttachmentAssetCmd
        Parameters:
        aboolCreateMissing - The create missing flag
      • getCatalogIdsForCacheInvalidations

        public java.lang.String[] getCatalogIdsForCacheInvalidations()
                                                              throws ECException
        Gets the list 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 list 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 list 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