public class AttachmentUploadCmdImpl extends UploadToStreamCmdImpl implements AttachmentUploadCmd
This class will upload a file to an input stream and then store it in the database as BLOBs in the attachment table. Note that this command is not registered in the URL configuration. AttachmentUploadCmd is not intended to be used directly. It should be extended by other commands. If the uploaded file is a JAR or ZIP file, the system will not verify whether the JAR or ZIP file contains unsupported file types or file name extensions.
No access control policies or checking is set up for the this class. Access control checking will need to be implemented by the command writer. In the JSP, the POST method should be used to invoke an upload command which extends this command.
Note that the usage will be set to "DEFAULT". It should be set to the desired usage as long as the usage is defined in the ATTACHUSG table. The persistDB flag is used to indicate whether the upload file should be stored only in the database. If persistDB is true and the file size is bigger than the BLOB size in the database then an exception will be thrown. If persistDB is false, the upload file storage is not limited to the database. If the file size is smaller than the BLOB size in database, the file will be stored in the database. If the file size is bigger than the BLOB size in the database the file will be stored in the file system. The location of the file will be stored in the attachmenturl field in the attachment table. The default location will be $wcsstores\web-inf\storename\
Constructor and Description |
---|
AttachmentUploadCmdImpl() |
Modifier and Type | Method and Description |
---|---|
java.lang.Long | getAttachmentId()
This method gets the attachmentobj_id of the attachment object from the database table.
|
java.lang.String | getAttachusg_id()
This method gets attachusg_id.
|
void | performExecute()
This method defines the business logic for this command.
|
void | setAttachusg_id(java.lang.String attachusg_id)
This method sets attachusg_id.
|
void | setPersistDB(boolean flag)
This method sets the flag that indicates whether the attachment stream should be persisted the attachment stream in the database table as BLOB.
|
void | setRequestProperties(TypedProperty reqParms)
This method sets the request properties.
|
public java.lang.Long getAttachmentId()
public void setPersistDB(boolean flag)
public void setRequestProperties(TypedProperty reqParms) throws ECException
public void performExecute() throws ECException
public java.lang.String getAttachusg_id()
public void setAttachusg_id(java.lang.String attachusg_id)