com.ibm.commerce.attachment.commands

Class AttachmentAddCmdImpl

  • All Implemented Interfaces:
    AttachmentAddCmd, 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 AttachmentAddCmdImpl
    extends ControllerCommandImpl
    implements AttachmentAddCmd
    The AttachmentAddCmd is a URL and controller command that:
    • Creates a new Attachment Target.
    • Creates new Attachment Target Descriptions.
    • Creates new Attachment Asset for the Attachment Target.
    • Creates new Attachment Asset Languages for each Attachment Asset in the Attachment Target.
    • Creates new managed file with the attachment asset path as the file path
    When this command is called through URL:
    • Only one attachment target description can be created.
    • Only one attachment asset and one language for the attachment asset will be created.
    • Managed file will not be created.
    When this command is called as a command:
    • the vector of AttachmentTargetDescriptionDataBean will be used to create multiple target descriptions.
    • the vector of AttachmentAssetDataBean will be used to create multiple assets and all the asset languages.
    • when command is called using databeans, if any of the parameters are not specified, it will be set to null. User must specify all the parameters in the databean.
    • If the content of the attachment asset in the AttachmentAssetDataBean is set, then it will be written to the Managed File.
    Behaviour:
    • If the attachment target ID is specified, this means the attachment target is already created. Only the attachment target descriptions and the attachment assets and their asset languages will be created.
    • When creating the attachment target description, the attachment target ID will be obtained from the parameter, not from the databean.
    • When creating the attachment assets, the attachment target ID will be obtained from the parameter, not from the databean.
    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
    • Vector of AttachmentTargetDescriptionDataBean
    • Vector of AttachmentAssetDataBean
    Access Beans and Data Beans:
    • AttachmentTargetAccessBean
    • AttachmentTargetDescriptionAccessBean
    • AttachmentAssetAccessBean
    • AttachmentAssetLanguageAccessBean
    • AttachmentTargetDescriptionDataBean
    • AttachmentAssetDataBean
    Task Commands:
    • AddAttachmentTargetCmd
    • ,
    • AddAttachmentAssetCmd
    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

      • AttachmentAddCmdImpl

        public AttachmentAddCmdImpl()
    • Method Detail

      • getAttachmentTargetId

        public java.lang.Long getAttachmentTargetId()
        Gets the attachment target ID.
        Specified by:
        getAttachmentTargetId in interface AttachmentAddCmd
        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 AttachmentAddCmd
        Returns:
        The store entity ID
      • getMemberId

        public java.lang.Long getMemberId()
        Gets the owner of the attachment target.
        Specified by:
        getMemberId in interface AttachmentAddCmd
        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 AttachmentAddCmd
        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 AttachmentAddCmd
        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 AttachmentAddCmd
        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 AttachmentAddCmd
        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 AttachmentAddCmd
        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 AttachmentAddCmd
        Returns:
        The customizable field 4
      • getAttachmentTargetDescriptions

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

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

        public void performExecute()
                            throws ECException
        Creates the attachment target if the attachment target ID is not specified, creates attachment target descriptions, attachment assets, and attachment asset 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 AttachmentAddCmd
        Parameters:
        anAttachmentTargetId - The attachment target ID
      • setStoreentId

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

        public void setMemberId(java.lang.Long anMemberId)
        Override this method to set the owner of the attachment target. Default implemenation of this method does not set the member ID.
        Specified by:
        setMemberId in interface AttachmentAddCmd
        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 AttachmentAddCmd
        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 AttachmentAddCmd
        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 AttachmentAddCmd
        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 AttachmentAddCmd
        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 AttachmentAddCmd
        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 AttachmentAddCmd
        Parameters:
        astrField4 - The customizable field 4
      • setAttachmentAssets

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

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

        public void setURL(java.lang.String astrURL)
        Sets the redirect URL.
        Specified by:
        setURL in interface AttachmentAddCmd
        Parameters:
        astrURL - The redirect URL
      • 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