Message: A new issue has been created in JIRA.
--------------------------------------------------------------------- View the issue: http://jira.codehaus.org/browse/DISPL-13 Here is an overview of the issue: --------------------------------------------------------------------- Key: DISPL-13 Summary: PDF Export Type: Improvement Status: Unassigned Priority: Major Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: DisplayTag Components: Tag Library Versions: 1.0 RC2 Assignee: Reporter: fabrizio giustina Created: Thu, 23 Sep 2004 5:31 PM Updated: Thu, 23 Sep 2004 5:31 PM Description: ==== imported from sf tracker id 1026408 submitted by Ivan Markov - ivan_markov http://sourceforge.net/tracker/index.php?func=detail&group_id=73068&atid=536613&aid=1026408 ==== PDF Export ---------- Our main goal while developing this patch was to do as little changes as possible in the existing display tag code. You know - the smaller the patch, the easier to be accepted. :) We had to change a little the code of BaseExportView, ExportViewFactory & MediaTypeEnum. The changes in these classes revolve around our idea to make the export stuff in display tag *extensible*. The current set of exported formats supported by DT (CSV, Tab-delimited Excel, HTML, XML) all do their stuff relying on core J2SE features only. PDF, however, is complex enough so as we needed to drag a dependency on IText (http://www.lowagie.com/iText/). Since we didn't want to make display tag itself dependent on IText, we instead provided means for the user to register in DT a new exporter. With our patch, user needing custom export has to: a.1) Write the exporter, by extending BaseExportView. That's what we did for PDF: our PDFView extends BaseExportView. a.2) The exporter should have a constructor with the same parameters as the one in BaseExportView, because our patch uses reflection to instantiate the appropriate exporter. b) Somewhere in the webapp, probably in the init() method of the main servlet, the user needs to issue: MediaTypeEnum.registerView("<new-exporter-name>", <new-exporter-class>); For our PDF export, we'll do: MediaTypeEnum.registerView("pdf", PdfView.class); We'll consider providing means for specifying this in the table.properties file too. Note that only the changes to BaseExportView/ExportViewFactory/MediaTypeEnum are important. Our PDFView does not and SHOULD NOT rely on any other DT API. I would imagine, you guys wouldn't like dependency on IText, so PDFView can find its way in an optional package. In future, I suppose XLS export may emerge, based on JExcelAPI (jexcelapi.sf.net), which provides richer formatting means than the regular CSV/Tab-delimited Excel export. Compiling The Code ------------------ You can try to apply the attached paging_and_pdf.diff file (diff to latest CVS as of Sep 11 2004). Note that it will introduce dependency on IText, because of PDFView, which is included for demoing. You can also just unzip the attached archive which contains the latest CVS DT patched. Also, Eclipse project files are provided within. !NOTE: You need to move all 3rd party jar dependencies in WEB-INF/lib (for demoing) INCLUDING itext-1.02b-custom.jar (from http://www.lowagie.com/iText/download.html) so that you can just point the servlet engine to ... /displaytag2/src/webapp . --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira ------------------------------------------------------- This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 Project Admins to receive an Apple iPod Mini FREE for your judgement on who ports your project to Linux PPC the best. Sponsored by IBM. Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php _______________________________________________ displaytag-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/displaytag-devel