com.ibm.commerce.attachment.commands

Class AttachmentUpdateCmdImpl

  • All Implemented Interfaces:
    AttachmentUpdateCmd, AccCommand, ControllerCommand, ECCommand, ECTargetableCommand, Protectable, 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 AttachmentUpdateCmdImpl
    extends ControllerCommandImpl
    implements AttachmentUpdateCmd
    The AttachmentUpdateCmd is a URL and controller command that:
    • Updates an Attachment Target.
    • Updates Attachment Target Descriptions.
    • Delete the lists of unwanted attachment assets.
    • Updates Attachment Assets for the Attachment Target.
    • Updates Attachment Asset Languages for each Attachment Asset in the Attachment Target.
    • Updates the content of the managed file that the attachment asset is pointed to by the attachment asset path.
    When this command is called through URL:
    • Create Missing option is set to true by default and cannot be changed when the command is called through URL.
    • Only one attachment target description can be update, with one attachment asset and one language for the attachment asset.
    • Attachment asset cannot be deleted from attachment target.
    • Only 1 attachment asset can be updated.
    • 1 asset language can be added to the attachment asset.
    • 1 asset language can be removed from the attachment asset.
    • Only data provided by the caller will be updated. If the attachment target name is not specified in the URL, it will not be changed.
    • The content of the managed file that the attachment asset is pointed to by the attachment asset path will not be updated.
    When this command is called as a command,:
    • If the store entity ID of the attachment target is changed, the store entity ID of all its the attachment assets will be updated.
    • the vector of AttachmentTargetDescriptionDataBean will be used to update multiple attachment target descriptions.
    • the vector of AttachmentAssetDataBean for delete will be used to delete the list of attachment assets from the attachment target.
    • the vector of AttachmentAssetDataBean will be used to update multiple assets and all the asset languages.
      • If the list of language IDs in the AttachmentAssetDataBean is not null, then
        • All the attachment asset languages will be deleted from the attachment asset that is being updated.
        • The list of language IDs in the AttachmentAssetDataBean will be used to recreate the attachment asset languages. This means that the list must contain ALL the languages supported by the attachment asset.
      • If the content of the attachment asset in the AttachmentAssetDataBean is set, then it will be written to the Managed File.
    • when updating using databeans, if any of the parameters are not specified, they will be set to null. Caller must specify all the parameters even when these parameters are not being changed.
    Behaviour:
    • By default, the option to create missing attachment target description, asset, and asset language is set to true.
    • When updating the attachment target description, the attachment target ID will be obtained from the parameter, not from the databean.
    • When updating the attachment assets, the attachment target ID will be obtained from the parameter, not from the databean.
    • Only the records that need to be updated or created will be accessed by this command.
    Parameters:
    • Attachment Target ID
    • Store Entity ID
    • Attachment Target Identifier
    • Attachment Target Field 1
    • Attachment Target Field 2
    • Attachment Target Field 3
    • Attachment Target Field 4
    • Attachment Usage ID used for the Attachment Target
    • Target Name
    • Target Description Language ID
    • Target Short Description
    • Target Long Description
    • Attachment Asset Path
    • Attachment Asset MIME Types
    • Attachment Asset MIME Types Encoding
    • Attachment Asset Image 1
    • Attachment Asset Image 2
    • Language ID supported by the Attachment Asset
    • Language ID to be removed from the Attachment Asset.
    • Vector of AttachmentTargetDescriptionDataBean
    • Vector of AttachmentAssetDataBean
    • Vector of AttachmentAssetDataBean for delete
    Access Beans and Data Beans:
    • AttachmentTargetAccessBean
    • AttachmentTargetDescriptionAccessBean
    • AttachmentAssetAccessBean
    • AttachmentAssetLanguageAccessBean
    • AttachmentTargetDescriptionDataBean
    • AttachmentAssetDataBean
    Task Commands:
    • UpdateAttachmentTarget
    • ,
    • UpdateAttachmentAsset
    • ,
    • DeleteAttachmentAsset
    • ,
    Utilities and Helpers:
    • AttachmentHelper
    • AttachmentAssetHelper
    • AttachmentTargetHelper
    See Also:
    Serialized Form
    • Field Detail

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        The internal copyright field.
        See Also:
        Constant Field Values
      • CLASSNAME

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

      • AttachmentUpdateCmdImpl

        public AttachmentUpdateCmdImpl()
    • Method Detail

      • getAttachmentTargetId

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

        public java.lang.Integer getStoreentId()
        Gets the store entity ID that owns the attachment target.
        Specified by:
        getStoreentId in interface AttachmentUpdateCmd
        Returns:
        The store entity ID
      • getMemberId

        public java.lang.Long getMemberId()
        Gets the owner of the attachment target.
        Specified by:
        getMemberId in interface AttachmentUpdateCmd
        Returns:
        The owner ID of the attachment target
      • getIdentifier

        public java.lang.String getIdentifier()
        Gets the identifier of the attachment target.
        Specified by:
        getIdentifier in interface AttachmentUpdateCmd
        Returns:
        The identifier of the attachment target
      • getAttachmentUsageId

        public java.lang.String getAttachmentUsageId()
        Gets the attachment usage ID of the attachment target.
        Specified by:
        getAttachmentUsageId in interface AttachmentUpdateCmd
        Returns:
        The attachment usage ID
      • getField1

        public java.lang.Long getField1()
        Gets the customizable field 1 in the attachment target.
        Specified by:
        getField1 in interface AttachmentUpdateCmd
        Returns:
        The customizable field 1
      • getField2

        public java.lang.Double getField2()
        Gets the customizable field 2 in the attachment target.
        Specified by:
        getField2 in interface AttachmentUpdateCmd
        Returns:
        The customizable field 2
      • getField3

        public java.lang.String getField3()
        Gets the customizable field 3 in the attachment target.
        Specified by:
        getField3 in interface AttachmentUpdateCmd
        Returns:
        The customizable field 3
      • getField4

        public java.lang.String getField4()
        Gets the customizable field 4 in the attachment target.
        Specified by:
        getField4 in interface AttachmentUpdateCmd
        Returns:
        The customizable field 4
      • getAttachmentTargetDescriptions

        public java.util.Vector getAttachmentTargetDescriptions()
        Gets the vector of AttachmentTargetDescriptionDataBean for update.
        Specified by:
        getAttachmentTargetDescriptions in interface AttachmentUpdateCmd
        Returns:
        The vector of AttachmentTargetDescriptionDataBean
      • getAttachmentAssets

        public java.util.Vector getAttachmentAssets()
        Gets the vector of AttachmentAssetDataBean for update.
        Specified by:
        getAttachmentAssets in interface AttachmentUpdateCmd
        Returns:
        The vector of AttachmentAssetDataBean
      • performExecute

        public void performExecute()
                            throws ECException
        • Updates the attachment target.
        • Updates the attachment target descriptions.
        • Delete the set of unwanted attachment assets.
        • Updates all the attachment asset of the attachment target if the store entity ID is changed.
        • Updates the attachment assets and languages.
        • Specified by:
          performExecute in interface ECCommand
          Specified by:
          performExecute in interface com.ibm.websphere.command.TargetableCommand
          Overrides:
          performExecute in class AbstractECTargetableCommand
          Throws:
          ECException
        • reset

          public void reset()
          Resets the variables used.
          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 AttachmentUpdateCmd
          Parameters:
          anAttachmentTargetId - The attachment target ID
        • setStoreentId

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

          public void setMemberId(java.lang.Long anMemberId)
          Sets the owner ID of the attachment target to retrieve an existing attachment. If a new attachment target is being created, the member ID set here will be ignored. To override the default owner of a new attachment target, please use AttachmentAdd.
          Specified by:
          setMemberId in interface AttachmentUpdateCmd
          Parameters:
          anMemberId - The owner of the attachment target
        • setIdentifier

          public void setIdentifier(java.lang.String astrIdentifier)
          Sets the identifier of the attachment target.
          Specified by:
          setIdentifier in interface AttachmentUpdateCmd
          Parameters:
          astrIdentifier - The identifier of the attachment target
        • setAttachmentUsageId

          public void setAttachmentUsageId(java.lang.String astrAttachmentUsageId)
          Sets the attachment usage ID used in the attachment target.
          Specified by:
          setAttachmentUsageId in interface AttachmentUpdateCmd
          Parameters:
          astrAttachmentUsageId - The attachment usage ID
        • setField1

          public void setField1(java.lang.Long anField1)
          Sets the customizable field 1 of the attachment target.
          Specified by:
          setField1 in interface AttachmentUpdateCmd
          Parameters:
          anField1 - The customizable field 1
        • setField2

          public void setField2(java.lang.Double adField2)
          Sets the customizable field 2 of the attachment target.
          Specified by:
          setField2 in interface AttachmentUpdateCmd
          Parameters:
          adField2 - The customizable field 2
        • setField3

          public void setField3(java.lang.String astrField3)
          Sets the customizable field 3 of the attachment target.
          Specified by:
          setField3 in interface AttachmentUpdateCmd
          Parameters:
          astrField3 - The customizable field 3
        • setField4

          public void setField4(java.lang.String astrField4)
          Sets the customizable field 4 of the attachment target.
          Specified by:
          setField4 in interface AttachmentUpdateCmd
          Parameters:
          astrField4 - The customizable field 4
        • setAttachmentAssets

          public void setAttachmentAssets(java.util.Vector avAttachmentAssetDataBeans)
          Sets the vector of AttachmentAssetDataBean as the attachment assets to be updated for the attachment target.
          Specified by:
          setAttachmentAssets in interface AttachmentUpdateCmd
          Parameters:
          avAttachmentAssetDataBeans - The list of AttachmentAssetDataBean
        • setAttachmentAssetsForDelete

          public void setAttachmentAssetsForDelete(java.util.Vector avAttachmentAssetDataBeansForDelete)
          Sets the vector of AttachmentAssetDataBean as the attachment assets to be deleted from the attachment target.
          Specified by:
          setAttachmentAssetsForDelete in interface AttachmentUpdateCmd
          Parameters:
          avAttachmentAssetDataBeansForDelete - The list of AttachmentAssetDataBean as the attachment assets for delete.
        • setAttachmentTargetDescriptions

          public void setAttachmentTargetDescriptions(java.util.Vector avAttachmentTargetDescriptionDataBeans)
          Sets the vector of AttachmentTargetDescriptionDataBean as the description to be updated for the attachment target.
          Specified by:
          setAttachmentTargetDescriptions in interface AttachmentUpdateCmd
          Parameters:
          avAttachmentTargetDescriptionDataBeans - The list of AttachmentTargetDescriptionDataBean
        • setURL

          public void setURL(java.lang.String astrURL)
          Sets the redirect URL.
          Specified by:
          setURL in interface AttachmentUpdateCmd
          Parameters:
          astrURL - The redirect URL
        • setCreateMissing

          public void setCreateMissing(java.lang.Boolean aboolCreateMissing)
          Sets the option to the create missing attachment target, target descriptions, and assets.
          • True - create the missing attachment target, target descriptions, assets, and asset languages.
          • False - throw exception if the attachment target, target descriptions, or assets do not exists
          By default, the option is set to True.
          Specified by:
          setCreateMissing in interface AttachmentUpdateCmd
          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