| java.lang.Object dinamica.AbstractModule dinamica.GenericTransaction dinamica.GetBlob
GetBlob | public class GetBlob extends GenericTransaction (Code) | | Generic Blob reader.
This Transaction publishes a Recordset with the
information required by the BlobOutput module
to print a blob column's content, whether it is an image or
a document. It is meant to be a generic mechanism to send
blobs as response to requests without requiring special coding.
The whole mechanism depends on a certain table structure, that at least
must contain these fields: content_type, image_data and filename (required only if blob will be sent as attachment).
A primary key to retrieve the blob is also required, usually an ID (integer).
The Action that uses this Transaction must include two query files: query-info.sql and query-blob.sql.
They must have those names. Also include a custom element in config.xml: >attach<true>/attach< Set it to "true" if you want
the browser to open a "Save as" dialog box, otherwise it should be "false".
You may include your own validation rules before this Transaction's execute() method
is invoked. The BlobOutput module will read the blob column by itself, which means that it will
open its own database connection using the default application datasource (context parameter in web.xml).
The Recodset must be published with the name "blobinfo". The fields of this recordset are:
format, filename (null if attach=false), size and sql.
NOTE: A validator.xml file with the field that represents the blob ID is required. Set validator=true in config.xml.
Creation date: 6/jan/2004
Last Update: 20/may/2004
(c) 2003 Martin Cordova
This code is released under the LGPL license
author: Martin Cordova |
|
|