-
1. Re: Render Seam PDF template from database
swd847 May 12, 2009 7:59 AM (in response to mdesignz)This is probably not easy. Faclets allows you to implement a ResourceResolver to resolve templates, however this only returns a URL.
I think that if you create your own URL protocol handler you could create a custom databaseTemple:// protocol with a handler that looks them up from a database. Coupled with a ResourceResolver to create these URLs, you should be able to achieve the desired effect. I have never done this so it is just speculation, but it seems feasible.
-
2. Re: Render Seam PDF template from database
nickarls May 12, 2009 8:49 AM (in response to mdesignz)When you are talking about PDF templates, do you mean fill-in-form templates?
-
3. Re: Render Seam PDF template from database
mdesignz May 12, 2009 12:50 PM (in response to mdesignz)Unfortunately not. I have hundreds of those. This is a separate category of documents that are mostly dynamic in nature (i.e., not a form that just needs values plugged in).
-
4. Re: Render Seam PDF template from database
mdesignz May 12, 2009 12:53 PM (in response to mdesignz)I'll look into your suggestion and see what I can do. Thanks.
-
5. Re: Render Seam PDF template from database
nickarls May 12, 2009 1:10 PM (in response to mdesignz)I'm still a bit lost (I don't use PDF support that much); Where does the template come in? You have PDF documents in the database, then you want to do something with them(?) before displaying them?
-
6. Re: Render Seam PDF template from database
mdesignz May 12, 2009 3:45 PM (in response to mdesignz)I have a couple scenarios. Hundreds of existing PDFs that I have turned into fillable PDFs using iText and PDFBox. These fillable forms live in a database and Apache Jackrabbit. They get retrieved, filled and sent on their way. The other situation is a document that has fields, a lot of free form text, and several conditional elements. Using a fillable form in this case doesn't work well because the format is rather fixed. Creating this second type of form using the Seam PDF tags works really well, but having to place this template somewhere in the context path makes it difficult to deploy. Having them as an available dynamic resource in a database or repository fits my case much better, and I basically handle them like the fillable PDFs already in the repository. So the idea would be to retrieve them, render them, and then save or dispatch the resultant file. Based on Stuart's suggestion, I've started to look at the ResourceResolver, and I found this http://seamframework.org/Documentation/HowDoILoadAFaceletsViewTemplateFromASharedJAR
which may be a good starting point. Thanks again for everyone's suggestions.