|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.dbforms.event.DbEventInterceptorSupport org.dbforms.event.BlobInterceptor
public class BlobInterceptor
This Interceptor can be used to automatically store the filenames, content types and file sizes of BLOBS in some table column specified, so that it is not lost. Currently, the interceptor must be configured manually in dbforms-config.xml inside the adequate table definition (see user guide) The interceptor MUST be initialized with the following parameters:
if one BLOB:
<interceptor className="org.dbforms.event.BlobInterceptor">
<param name="blob-column" value="file"/>
<param name="name-column" value="filename"/>
<param name="mime-column" value="mime_type"/>
<param name="size-column" value="file_size"/>
</interceptor>
if mulitple BLOBs:
<interceptor className="org.dbforms.event.BlobInterceptor">
<param name="blob-column1" value="file"/>
<param name="name-column1" value="filename"/>
<param name="mime-column1" value="mime_type"/>
<param name="size-column1" value="file_size"/>
<param name="blob-column2" value="otherfile"/>
<param name="name-column2" value="otherfilename"/>
<param name="mime-column2" value="other_mime_type"/>
<param name="size-column2" value="other_file_size"/>
<param name="blob-column3" value="foofile"/>
<param name="name-column3" value="foofilename"/>
<param name="mime-column3" value="foo_mime_type"/>
<param name="size-column3" value="foo_file_size"/>
</interceptor>
Field Summary |
---|
Fields inherited from interface org.dbforms.interfaces.IDbEventInterceptor |
---|
DENY_OPERATION, GRANT_OPERATION, IGNORE_OPERATION, POST_ADDROW, POST_DELETE, POST_INSERT, POST_SELECT, POST_UPDATE, PRE_ADDROW, PRE_DELETE, PRE_INSERT, PRE_SELECT, PRE_UPDATE |
Constructor Summary | |
---|---|
BlobInterceptor()
|
Method Summary | |
---|---|
int |
preInsert(HttpServletRequest request,
Table table,
FieldValues fieldValues,
DbFormsConfig config,
Connection con)
stores filenames, content types and file sizes of all blobs in the NAME_COLUMNs, MIME_COLUMNs and SIZE_COLUMNs specified |
int |
preUpdate(HttpServletRequest request,
Table table,
FieldValues fieldValues,
DbFormsConfig config,
Connection con)
stores filenames, content types and file sizes of all blobs in the NAME_COLUMNs, MIME_COLUMNs and SIZE_COLUMNs specified |
void |
setParameterMap(Map params)
takes params, sorts/groups and stores for later use |
Methods inherited from class org.dbforms.event.DbEventInterceptorSupport |
---|
getParameter, getParameterMap, postAddRow, postDelete, postDelete, postInsert, postInsert, postSelect, postSelect, postUpdate, postUpdate, preAddRow, preDelete, preDelete, preInsert, preSelect, preSelect, preUpdate, setValue |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BlobInterceptor()
Method Detail |
---|
public void setParameterMap(Map params)
setParameterMap
in interface IDbEventInterceptor
setParameterMap
in class DbEventInterceptorSupport
params
- DOCUMENT ME!public int preInsert(HttpServletRequest request, Table table, FieldValues fieldValues, DbFormsConfig config, Connection con) throws ValidationException
preInsert
in class DbEventInterceptorSupport
request
- DOCUMENT ME!table
- DOCUMENT ME!fieldValues
- DOCUMENT ME!config
- DOCUMENT ME!con
- DOCUMENT ME!
ValidationException
- DOCUMENT ME!public int preUpdate(HttpServletRequest request, Table table, FieldValues fieldValues, DbFormsConfig config, Connection con) throws ValidationException
preUpdate
in class DbEventInterceptorSupport
request
- DOCUMENT ME!table
- DOCUMENT ME!fieldValues
- DOCUMENT ME!config
- DOCUMENT ME!con
- DOCUMENT ME!
ValidationException
- DOCUMENT ME!
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |