Index: C:/Workshop/jluix/displaytag_now/displaytag/displaytag-doc/src/site/apt/tut_decorators.apt =================================================================== --- C:/Workshop/jluix/displaytag_now/displaytag/displaytag-doc/src/site/apt/tut_decorators.apt (revision 1084) +++ C:/Workshop/jluix/displaytag_now/displaytag/displaytag-doc/src/site/apt/tut_decorators.apt (working copy) @@ -109,3 +109,57 @@ performance and it is optimal in a small, non paged, table. During sorting, though, if the column body is used, the result will be always sorted as a String. + + +* {Table decorators and exports} + + When a table decorator should be used both to render an HTML table + and to export to other media, configure the decorator using the table tag's + decorator attribute. For example: + ++-------------------------------------------------------------------+ + + + + + + + ++-------------------------------------------------------------------+ + + Since this decorator will also be called when exporting to non-HTML media, such + as Excel, PDF, or RTF, it should not output HTML. Such a decorator would + normally be useful for adding extra properties to your objects or for media-agnostic + formatting. + + You can also configure a different decorator for each medium in which you want + to render the table. In the following example, a different table decorator is + used to help render the table in HTML, PDF, RTF, and Excel. The + HTML decorator decorates the table using HTML, the PDF and RTF decorators using the iText + API, and the Excel decorator using the HSSF API. + ++-------------------------------------------------------------------+ + + + + + + ++-------------------------------------------------------------------+ + + If you use the same decorator.media. table decorators in every page, + you can configure them in your displaytag properties file. + + Note that if you configure table decorators with both the table tag's decorator attribute + and the decorator.media. config property, the table tag attribute value takes + precedence and the decorator.media. values are ignored. In the example below, + only <<>> will be used. + ++-------------------------------------------------------------------+ + + + + + + ++-------------------------------------------------------------------+ Index: C:/Workshop/jluix/displaytag_now/displaytag/displaytag-doc/src/site/apt/configuration.apt =================================================================== --- C:/Workshop/jluix/displaytag_now/displaytag/displaytag-doc/src/site/apt/configuration.apt (revision 1084) +++ C:/Workshop/jluix/displaytag_now/displaytag/displaytag-doc/src/site/apt/configuration.apt (working copy) @@ -151,6 +151,12 @@ | paging.banner.page.separator | , | any string | separator between pages | yes | yes | | | | | | | | *------------------------------------+--------------------------------+-----------------------------+----------------------------------------------------------------+------+------+ +| decorator.media.html | | Class name of | Decorator used to render table as html. Required when also | yes | yes | +| | | <<>> | decorating the table in other media. Refer to the | | | +| | | subclass | {{{tut_decorators.html#Table decorators and exports}exports decorators tutorial}} | | | +| | | | for detailed explanation. Ignored if a decorator is | | | +| | | | configured in table tag's decorator attribute. | | | +*------------------------------------+--------------------------------+-----------------------------+----------------------------------------------------------------+------+------+ | factory.requestHelper | <<>> | | RequestHelperFactory to be used. | yes | no | | | | Class name for a valid | You can replace the default one if you need to generate links | | | | | | <<>> | with a different format (for example in portal applications) | | | @@ -165,10 +171,10 @@ * Exporting - Displaytag supports exporting to excel, csv, and xml formats. Some + Displaytag supports exporting to excel, csv, pdf, rtf, and xml formats. Some configurable properties are specific for one of these format. - Replace in the property name with "excel", "csv" + Replace in the property name with "excel", "csv", "pdf", "rtf", or "xml". Some of the properties won't work in any export format. @@ -201,9 +207,17 @@ | | | | list. You can instruct the table tag to only send down the | | | | | | | data that is currently being shown on the page | | | *------------------------------------+-----------------------------+-----------------------------+----------------------------------------------------------------+------+------+ -| export.decorated | true | true, false | Should the data be "decorated" as it is exported. | yes | yes | -| | | | | | | +| export.decorated | true | true, false | Should the data be "decorated" as it is exported. Note that | yes | yes | +| | | | <<>>, | | | +| | | | <<>>, and | | | +| | | | <<>> | | | +| | | | do not observe this value. | | | *------------------------------------+-----------------------------+-----------------------------+----------------------------------------------------------------+------+------+ +| decorator.media. | | Class name of | Decorator used to render table in given media. | yes | yes | +| | | <<>> | Refer to the {{{tut_decorators.html#Table decorators and exports}exports and | | | +| | | subclass | decorators tutorial}} for detailed explanation. Ignored if a | | | +| | | | decorator is configured in table tag's decorator attribute. | | | +*------------------------------------+-----------------------------+-----------------------------+----------------------------------------------------------------+------+------+ Index: C:/Workshop/jluix/displaytag_now/displaytag/displaytag-doc/src/site/apt/export_filter.apt =================================================================== --- C:/Workshop/jluix/displaytag_now/displaytag/displaytag-doc/src/site/apt/export_filter.apt (revision 1084) +++ C:/Workshop/jluix/displaytag_now/displaytag/displaytag-doc/src/site/apt/export_filter.apt (working copy) @@ -21,27 +21,27 @@ * Something (tags? java snippets?) before the <<>> tag has explicitely flushed the response (<<>>). - * Your page is dinamically included into another page. This happens for example using Struts tiles. + * Your page is dynamically included into another page. This happens for example using Struts tiles. [] Another problem is related to exporting binary files. The output of binary data is not supported in jsps: it may work on some application server, but it may end up with errors in others. Because of this -restriction an "external help" may be required. Cvs, xml and excel formats don't require a binary -output, but if you want to try a pdf export or other custom binary formats you will have to face some +restriction an "external help" may be required. CSV, XML and text-based Excel formats don't require a binary +output, but if you want to try PDF, POI-based Excel, or some other custom binary format you may encounter problems. * The solution The first attempt can be using a larger page buffer in your jsp pages, for example: - <<<<%@ page buffer = "16kb" %>>>> + <<<\<%@ page buffer = "16kb" %/>>>> However, this can work only if you are in the first situation listed above. - In j2ee 1.3/jsp 1.2 containers you can take advantage of filters to solve the problem. Displaytag ships - with a filter which works together with the table tag during export, disallowing the response to be - flushed when an export has been requested. + In j2ee 1.3/jsp 1.2 containers, you can take advantage of filters to solve the problem. Displaytag ships + with a filter that works together with the table tag during export, disallowing the flushing the response + when export has been requested. @@ -56,7 +56,7 @@ +--------------------------------------------------------+ - And add mappings for the pages that you will intercept, for example: + And add mappings for urls the filter will intercept, for example: +--------------------------------------------------------+