In Seam 2 there was the DocumentServlet that Excel and PDF output used for content delivery (conversation scoped, generate data and redirect). Is there any need for this step? And if so, should we use JSF 2 resource handling for it?<div>
<br></div><div>I played around with mojarra 2 examined it for possibilities of loosening the servlet dependencies but it turned out the ServletContext was used about everywhere internally.<br><br><div class="gmail_quote">
On Fri, May 21, 2010 at 6:42 PM, Lincoln Baxter, III <span dir="ltr"><<a href="mailto:lincolnbaxter@gmail.com">lincolnbaxter@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Well let's see if we can get you started, then :)<br><br>Have no fear!<br><br>Let me know if this helps:<br><ul><li>Create a JSF2 project. Here's a starting tutorial that takes about 5 minutes to get the project running.<br>
<a href="http://www.javaserverfaces.org/get-started#TOC-Creating-a-JSF-2-and-CDI-project" target="_blank">http://www.javaserverfaces.org/get-started#TOC-Creating-a-JSF-2-and-CDI-project</a><br><br></li><li>Create a page that, when requested, calls a JSF Managed Bean action (You can start by doing this with <f:event type="PreRenderViewEvent" listener="#{myBean.mailListener}"> -- <a href="https://javaserverfaces.dev.java.net/nonav/docs/2.0/pdldocs/facelets/index.html" target="_blank">https://javaserverfaces.dev.java.net/nonav/docs/2.0/pdldocs/facelets/index.html</a><br>
<br></li><li>In that listener method, try to use something like this:<br><br>(HttpServletRequest) request.getRequestDispatcher("/path/to/mail/view.xhtml").forward(MockHttpRequestObject, MockHttpResponseObject);<br>
<br></li><li>Try to capture the output of that new MockHttpResponseObject when JSF has finished processing it .. the forward(...) method will actually start another JSF request in the background.<br></li></ul>This may or may not work, but it's what I would try first. If capturing the output from a "background" request works, then getting the mail rendering set up will be pretty easy. This, of course, requires that JSF be running, but -- that's not such a bad requirement to start with. We can worry about starting it up later.<br>
<font color="#888888">
<br><br>--Lincoln</font><div><div></div><div class="h5"><br><br>
<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex"><font color="#888888"></font><div><div></div><div><br>
On Fri, May 21, 2010 at 9:24 AM, Lincoln Baxter, III<br>
<<a href="mailto:lincolnbaxter@gmail.com" target="_blank">lincolnbaxter@gmail.com</a>> wrote:<br>
> I think for now these should be the same module. "Seam Docs" -- There's also<br>
> been speculation on whether a Mock Framework could be used to boot-up JSF<br>
> and render documents.<br>
><br>
> <a href="http://community.jboss.org/wiki/MockObjectsforTestDrivenJSFDevelopmentorgjbosstest-jsfjsf-mockproject" target="_blank">http://community.jboss.org/wiki/MockObjectsforTestDrivenJSFDevelopmentorgjbosstest-jsfjsf-mockproject</a><br>
><br>
> Another alternative is to build a UIViewRoot, and replace it during the<br>
> PreRenderViewEvent (which specifically states that it can be used to replace<br>
> the UIViewRoot.)<br>
><br>
> Or.. there's the possibility of simply creating a "fake" Request and<br>
> Response object, and doing an internal forward in order to capture output<br>
> and capture the output (via the faked response object) to be used in<br>
> generating the PDF or Mail document.<br>
><br>
> This last option is probably where I would start. I'd start by simply trying<br>
> to create a new request and capture the output -- just try on a normal page,<br>
> we can worry about generating pages that look like email documents after<br>
> this basic functionality is working.<br>
><br>
> --Lincoln<br>
><br>
><br>
> 2010/5/21 Cody Lerum <<a href="mailto:cody.lerum@gmail.com" target="_blank">cody.lerum@gmail.com</a>><br>
>><br>
>> So a seam-mail and a seam-reporting?<br>
>><br>
>> -C<br>
>><br>
>> 2010/5/21 Tomaž Cerar <<a href="mailto:cerar@parsek.com" target="_blank">cerar@parsek.com</a>>:<br>
>> > Hi guys,<br>
>> ><br>
>> ><br>
>> ><br>
>> > Will pdf and mail be separate modules?<br>
>> ><br>
>> ><br>
>> ><br>
>> > I would also like to contribute to both modules.<br>
>> ><br>
>> > I have done some extensive research of existing mail module code while<br>
>> > tracking down JBSEAM-3555 and have found out that current approach to<br>
>> > using<br>
>> > JSF in seam mail error-prone J<br>
>> ><br>
>> > Currently seam just uses jsf that was initalized in web application and<br>
>> > that<br>
>> > is why there are some ugly hacks to make it work when you invoke seam<br>
>> > mail<br>
>> > from from non-web request (ejb,mdb,...)<br>
>> ><br>
>> ><br>
>> ><br>
>> > Pete has sugessted that new seam-mail modul should start its own<br>
>> > instance of<br>
>> > JSF.<br>
>> ><br>
>> > Main problem with jsf is that there is no standard api to programaticly<br>
>> > set-up jsf enviroment. Idea is that seam implements RI (Mojarra 2.0)<br>
>> > with<br>
>> > implementation specific api and possible others if they provide any<br>
>> > machins<br>
>> > for starting up.<br>
>> ><br>
>> ><br>
>> ><br>
>> > I would also like to contribute do pdf module as we have some in-house<br>
>> > improvments and also some friends are willing to contibute huge upgrade<br>
>> > to<br>
>> > seam-pdf(forms,etc,..) but it is currently seam 2.0.x based.<br>
>> ><br>
>> ><br>
>> ><br>
>> > As I have not yet had much time to dive deeply into CDI and Seam 3(but I<br>
>> > folow development closly) a kick start as setting up seam3 module would<br>
>> > be<br>
>> > much apreciated. Altough I can help to »rip out« any seam 2 module...<br>
>> ><br>
>> ><br>
>> ><br>
>> ><br>
>> ><br>
>> > Cheers,<br>
>> ><br>
>> > Tomaž<br>
>> ><br>
>> ><br>
>> ><br>
>> ><br>
>> ><br>
>> ><br>
>> ><br>
>> ><br>
>> ><br>
>> ><br>
>> ><br>
>> > From: <a href="mailto:seam-dev-bounces@lists.jboss.org" target="_blank">seam-dev-bounces@lists.jboss.org</a><br>
>> > [mailto:<a href="mailto:seam-dev-bounces@lists.jboss.org" target="_blank">seam-dev-bounces@lists.jboss.org</a>] On Behalf Of Lincoln Baxter,<br>
>> > III<br>
>> > Sent: Thursday, May 20, 2010 4:57 PM<br>
>> > To: <a href="mailto:cody.lerum@gmail.com" target="_blank">cody.lerum@gmail.com</a>; Dan Allen; Seam Dev List<br>
>> > Subject: [seam-dev] Let me know what you need for a first stab at the<br>
>> > PDF/Mail port from Seam 2<br>
>> ><br>
>> ><br>
>> ><br>
>> > Hi Cody, you have my email address now.<br>
>> ><br>
>> > I'm actually not very familiar with Seam 2, which is one of the reasons<br>
>> > this<br>
>> > has been lower priority, but if you can "rip" that part out of Seam 2<br>
>> > and<br>
>> > make it a standalone maven project, I can help you get it set up as a<br>
>> > Seam 3<br>
>> > module and all that goodness :)<br>
>> ><br>
>> > <a href="mailto:seam-dev@lists.jboss.org" target="_blank">seam-dev@lists.jboss.org</a> (if you don't already know) is where we discuss<br>
>> > development, so you can also ask questions there --<br>
>> > <a href="https://lists.jboss.org/mailman/listinfo/seam-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/seam-dev</a> is where you can sign<br>
>> > up.<br>
>> ><br>
>> > Thanks for reaching out!<br>
>> > --<br>
>> > Lincoln Baxter, III<br>
>> > <a href="http://ocpsoft.com" target="_blank">http://ocpsoft.com</a><br>
>> > <a href="http://scrumshark.com" target="_blank">http://scrumshark.com</a><br>
>> > "Keep it Simple"<br>
>> > !DSPAM:6,4bf54e13248112142088973!<br>
><br>
><br>
><br>
> --<br>
> Lincoln Baxter, III<br>
> <a href="http://ocpsoft.com" target="_blank">http://ocpsoft.com</a><br>
> <a href="http://scrumshark.com" target="_blank">http://scrumshark.com</a><br>
> "Keep it Simple"<br>
><br>
</div></div></blockquote></div><br><br clear="all"><br></div></div>-- <br><div><div></div><div class="h5">Lincoln Baxter, III<br><a href="http://ocpsoft.com" target="_blank">http://ocpsoft.com</a><br><a href="http://scrumshark.com" target="_blank">http://scrumshark.com</a><br>
"Keep it Simple"<br>
</div></div><br>_______________________________________________<br>
seam-dev mailing list<br>
<a href="mailto:seam-dev@lists.jboss.org">seam-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/seam-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/seam-dev</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>---<br>Nik<br>
</div>