-
1. Re: Saving SEAM PDF as a file on the server?
felipealbertao Jun 3, 2008 3:51 AM (in response to flynn)Hello Jason,
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.
-
2. Re: Saving SEAM PDF as a file on the server?
bravocharlie.seam.signup.benny.me.uk Jun 3, 2008 11:56 AM (in response to flynn) -
3. Re: Saving SEAM PDF as a file on the server?
flynn Jun 3, 2008 2:45 PM (in response to flynn)
Ben Catherall wrote on Jun 03, 2008 11:56:
Hi Jason,
See my post here!
Cheers- Ben
Ben,
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?
With Regards,
JasonFlynn
Kemp -
4. Re: Saving SEAM PDF as a file on the server?
bravocharlie.seam.signup.benny.me.uk Jun 3, 2008 7:45 PM (in response to flynn)You got it :)
-
5. Re: Saving SEAM PDF as a file on the server?
flynn Jun 3, 2008 8:24 PM (in response to flynn)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,
Jason -
6. Re: Saving SEAM PDF as a file on the server?
norman Jun 3, 2008 10:33 PM (in response to flynn)There's an open JIRA, JBSEAM-2613, for this. If anyone has specific suggestions or usecases, it might be helpful to comment there.