com.ibm.commerce.attachment.commands

Class WriteManagedFileCmdImpl

  • All Implemented Interfaces:
    WriteManagedFileCmd, 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 WriteManagedFileCmdImpl
    extends TaskCommandImpl
    implements WriteManagedFileCmd
    The command implementation of the command WriteManagedFile. The command interface is WriteManagedFileCmd.
    The WriteManagedFile can:
    • Create a new managed file
    • Update the content of an existing managed file
    • Disassociate the managed file with an attachment asset
    The file path and the file content must be set if a new managed file is to be created. Either the file path or file ID must be set, together with the file content if the managed file is to be updated. The association flag must be set if the managed file association flag is to be updated.
    The file path and the content of the managed file can be retrieved by the available getter methods.
    Parameter:
    • The file ID
    • The file path
    • The content of the file
    • The option to set the association to the managed file
    • The Store Entity ID
    Behaviour:
    • The file path of an existing Managed File cannot be changed.
    • File ID cannot be set when creating a new managed file.
    • The content context is obtained in the command context.
    • If the store entity is not specified, it will be obtained from the command context.
    Access Bean:
    • ManagedFileAccessBean
    • AttachmentAssetAccessBean
    • StoreEntityAccessBean
    See Also:
    Serialized Form
    • Field Detail

      • CLASSNAME

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

        public static final java.lang.String FILE_ASSOCIATED
        The constant to indicate that a file is associated.
        See Also:
        Constant Field Values
      • FILE_DISASSOCIATED

        public static final java.lang.String FILE_DISASSOCIATED
        The constant to indicate that the file is not associated.
        See Also:
        Constant Field Values
      • FILE_NOT_PROMOTED_TO_FS

        public static final java.lang.String FILE_NOT_PROMOTED_TO_FS
        The constant to indicate that the file is not yet promoted to the file system.
        See Also:
        Constant Field Values
      • FILE_NOT_PUBLISHED

        public static final java.lang.String FILE_NOT_PUBLISHED
        The constant to indicate that the file is not yet published.
        See Also:
        Constant Field Values
    • Constructor Detail

      • WriteManagedFileCmdImpl

        public WriteManagedFileCmdImpl()
    • Method Detail

      • getFilePath

        public java.lang.String getFilePath()
        Gets the file path.
        Specified by:
        getFilePath in interface WriteManagedFileCmd
        Returns:
        The file path
      • getFile

        public byte[] getFile()
        Gets the content of the file.
        Specified by:
        getFile in interface WriteManagedFileCmd
        Returns:
        The file content
      • reset

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

        public void setFileId(java.lang.Long anFileId)
        Sets the file ID.
        Specified by:
        setFileId in interface WriteManagedFileCmd
        Parameters:
        anFileId - The file ID
      • getFileId

        public java.lang.Long getFileId()
        Gets the file ID.
        Specified by:
        getFileId in interface WriteManagedFileCmd
        Returns:
        The file ID
      • setFilePath

        public void setFilePath(java.lang.String astrFilePath)
        Sets the file path.
        Specified by:
        setFilePath in interface WriteManagedFileCmd
        Parameters:
        astrFilePath - The file path
      • setFile

        public void setFile(byte[] abaFile)
        Sets the content of the file.
        Specified by:
        setFile in interface WriteManagedFileCmd
        Parameters:
        abaFile - The file content
      • setAssociation

        public void setAssociation(java.lang.Boolean aboolAssociation)
        Sets the association option of the managed file.
        • True - the managed file is linked to an attachment asset.
        • False - the managed file is not linked to an attachment asset.
        By default it is set to True. It is possible that multiple assets can be linked to the same managed file. The option here only specified whether the caller of the command is associating or removing the link to the managed file.
        Specified by:
        setAssociation in interface WriteManagedFileCmd
        Parameters:
        aboolAssociation - The option to set an association with the managed file
      • setStoreentId

        public void setStoreentId(java.lang.Integer anStoreentId)
        Sets the store entity ID that owns the managed file.
        Specified by:
        setStoreentId in interface WriteManagedFileCmd
        Parameters:
        anStoreentId - The store entity ID