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.
Modifier and Type | Field and Description |
---|---|
static java.lang.String | COPYRIGHT
IBM copyright notice field
|
static java.lang.String | defaultCommandClassName
This is the default implementation of this command.
|
static java.lang.String | NAME
This is the interface name.
|
Modifier and Type | Method and Description |
---|---|
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.
|
java.lang.Long | getOrg_attachmentobj_id()
This method gets the org_attachmentobj_id of the attachment object to be copied from the database table.
|
boolean | performAccessCheck()
This method performs access control checking to control who can view the attachment.
|
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.
|
static final java.lang.String COPYRIGHT
static final java.lang.String defaultCommandClassName
static final java.lang.String NAME
java.lang.Long getAttachmentId()
java.lang.Long getOrg_attachmentobj_id()
void setOrg_attachmentobj_id(java.lang.Long org_attachmentobj_id)
boolean performAccessCheck()