-
1. Re: Displaying existing PDF files
norman.richards Mar 20, 2007 6:09 PM (in response to javajoe220)The document store component is meant for dynamic content. It is conversational, so anything in the document store goes away when the conversation ends. If that works for you, the document store would be a great option.
If your content has a longer lifespan or applies to more than one user, you might take a look at hooking directly into ResourceServlet instead. -
2. Re: Displaying existing PDF files
tony.herstell1 Mar 20, 2007 6:23 PM (in response to javajoe220)I used content servlet used in the seamspace example.
I ship out images through this.
I cant see why you couldn't use it to ship out .pdf.
Can someone point to an example "hooking directly into ResourceServlet instead" as I wouldbe interested in moving over to this method if it preferred. -
3. Re: Displaying existing PDF files
norman.richards Mar 20, 2007 6:40 PM (in response to javajoe220)Look at any of the classes that implement AbstractResource.
-
4. Re: Displaying existing PDF files
javajoe220 Mar 20, 2007 8:04 PM (in response to javajoe220)Thanks for the reply.
Can you elaborate on the document store? I have searched through the examples and only find the DocumentStore being accessed in components.xml and via the various <p: tags - none of which accept a "filename" parameter that I saw.
Should I access the conversationally scoped documentStore reference in my Java code and make an entry by calling documentStore.saveDate() and manually create the DocumentData object?
How would i then access it on the front-end?
Or am I not on the right track here?
Thank you. -
5. Re: Displaying existing PDF files
norman.richards Mar 20, 2007 11:23 PM (in response to javajoe220)Yes, you should be able to just put the bytes directly into the document store using saveData(). DocumentStore was not really designed with other apps in mind, so it's usage is not documented anywhere. You should look at how it is used in the pdf code to get a feel whether or not it is helpful.
Of course, writing a servlet to dump the data out is pretty simple too. Maybe that is the path of least resistance?