I never did that myself, but one suggestion is to check Seam's source code to find out how the Renderer component actually renders content (Renderer is used to send emails -- see Seam docu ch 17). I just checked it myself, and actually it doesn't look too complicated. Check the file jboss-seam-2.0.1.GA/ui/src/main/java/org/jboss/seam/ui/facelet/FaceletsRenderer.java
You probably could use it as an example on how to render something to a file. Line 104 shows how you could pass a FileWriter.
Or... it seems like you will process those PDFs in batch, so another suggestion is to create a simple script that uses wget to fetch the PDF from a given URL and store it in a given directory. It's definitely not a pretty solution, but it might work for you. Alternatively, you could use some Java-based HTTP client to accomplish the same.
Ben Catherall wrote on Jun 03, 2008 11:56:
See my post here!
In reviewing your code, I can see that the first section stands alone as its own class. I assume that I will need to add the appropriate imports, but the basics are there.
Now, as for the second section of code, I assume that this (or something like it) could be added to my manager bean for the processing of these requests after the user submits their information via the web UI. Using the PDF XHTML file I've created, this code will presumably generate the PDF and store it as a byte array under the variable named data. We cast it as a byte array into the bytes variable, and presumably from there, I can save the file to the server from the bytes variable.
Do I understand that correctly? Or is there more to this picture that I'm missing?
You got it :)
Now, if I could only get conversation to resolve, I'd be happy. I thought it was implicitly called out in Seam as a variable, but for whatever reason, Eclipse doesn't recognize it so it isn't compiling. :(
I'm still digging away at it, though,