-
1. Re: How Do I Access The DocumentStore From Within A Class?
nickarls Jun 4, 2008 9:51 PM (in response to flynn)Try DocumentStore.instance(), what are you trying to do?
-
2. Re: How Do I Access The DocumentStore From Within A Class?
flynn Jun 4, 2008 10:37 PM (in response to flynn)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/PDFdocumentStoreHowever, 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
Flynn
Kemp -
3. Re: How Do I Access The DocumentStore From Within A Class?
nickarls Jun 4, 2008 11:05 PM (in response to flynn)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=
false
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?
-
4. Re: How Do I Access The DocumentStore From Within A Class?
bravocharlie.seam.signup.benny.me.uk Jun 5, 2008 1:12 PM (in response to flynn)My bad in the code before its a Context object, not Conversation object
conversation = Contexts.getConversationContext()