You can find the full source code for this website in the Seam package in the directory /examples/wiki. It is licensed under the LGPL.
| Online: | 21 Members of 4546 |
| Forum: Seam Users |
04. Jun 2008, 20:07 CET | Link |
Good Afternoon, All:
How do I access the DocumentStore from within a class?
What notations and imports need to be made?
What code should I use to do this?
Please be as specific and detailed as you can. I hate to ask, but the answer is not as intuitive as I'd hoped, and the only examples of code that I've found haven't worked. I'm hoping that a direct appeal will help me move forward past this roadblock.
With Regards,
Jason Flynn
Kemp
Try DocumentStore.instance(), what are you trying to do?
If a man speaks in the forest and there is no woman around to hear him, is he still wrong?
Man, that was easy. I'm trying to get the contents of the DocumentStore after it generates a PDF, so that I can write it out to a file instead of to the browser.
I was trying to use Ben Catherall's approach as described in this thread: http://www.seamframework.org/Community/PDFdocumentStore
However, conversation doesn't work like he has in his code (there is no get(String) method for Conversation), so I'm now trying to access the DocumentStore directly.
Now I have to figure out how to get the document's id String so that I can get the DocumentData, since the DocumentStore's getDocumentData method requires an id String.
Any clues or suggestions?
With Regards,
Jason Kemp
I'm just brainstorming here but looking at the source code in the UIDocument encodeEnd I see something like
if (sendRedirect) { // The stuff that puts data in DocumentStore and redirects } else { UIComponent parent = getParent(); if (parent instanceof ValueHolder) { ValueHolder holder = (ValueHolder) parent; holder.setValue(documentData); }which could indicate that if you set sendRedirect= in the UIDocument, the data should end up in the parent, as long as it is a ValueHolder.
I've never used it so just guessing: If you set sendRedirect to false and nest the UIDocument in something with a value-binding, the byte[] data ends up there?
If a man speaks in the forest and there is no woman around to hear him, is he still wrong?
My bad in the code before its a Context object, not Conversation object