com.ibm.commerce.command

Interface CopyAttachmentCmd

  • All Superinterfaces:
    com.ibm.websphere.command.CacheableCommand, com.ibm.commerce.command.CacheableECCommand, com.ibm.websphere.command.Command, com.ibm.websphere.command.CommandCaller, ECCommand, java.io.Serializable, com.ibm.websphere.command.TargetableCommand, TaskCommand
    All Known Implementing Classes:
    CopyAttachmentCmdImpl


    public interface CopyAttachmentCmd
    extends TaskCommand

    This class makes a copy of the attachment object as specified by org_attachmentobj_id. A new attachment object will be created and the new attachment object_id will be returned. The copy made will be a field by field copy including the timecreated, timeupated and markfordelete fields. The reserved field will be copied from the original attachment object to the new attachment object.

    If the attachmentURL is the same as the org_attachment_id in the attachment table, the content of the attachment is stored in BLOB. It will be copied into the new attachment table as BLOB as well.

    If the attachmentURL is not the same as the attachment_id, the attachment is stored on the file system as specified in the attachmentURL. The file will be opened as specified in the attachmentURL in the original attachment object. A new unique file name will be generated, and the file content will be copied into the new file. The new filename will be the attachmenturl of the new attachment object.

    Note that when the attachment object is deleted during DBClean, a log of the attachmenturl will be generated if the attachment is stored on the file system. It is up to the user to delete the file.

    This class does not provide access control checking. The command writer should implement his/her own access control checking and make sure the caller is authorized to make a copy of the attachment object.

    • Field Detail

      • COPYRIGHT

        static final java.lang.String COPYRIGHT
        IBM copyright notice field
        See Also:
        Constant Field Values
      • defaultCommandClassName

        static final java.lang.String defaultCommandClassName
        This is the default implementation of this command.
        See Also:
        Constant Field Values
    • Method Detail

      • getAttachmentId

        java.lang.Long getAttachmentId()
        This method gets the attachmentobj_id of the attachment object in the database table that is a duplication of the original attachment.
        Returns:
        This method returns a String object that represents the attachmentobj_id.
      • getOrg_attachmentobj_id

        java.lang.Long getOrg_attachmentobj_id()
        This method gets the org_attachmentobj_id of the attachment object to be copied from the database table.
        Returns:
        This method returns a String object that represents the org_attachmentobj_id.
      • setOrg_attachmentobj_id

        void setOrg_attachmentobj_id(java.lang.Long org_attachmentobj_id)
        This method sets the org_attachmentobj_id of the attachment object to be copied from the database table.
        Parameters:
        org_attachmentobj_id - This is a String object that represents the org_attachmentobj_id.
      • performAccessCheck

        boolean performAccessCheck()
        This method performs access control checking to control who can view the attachment. This method should be written by the command writer.