[seam-dev] Let me know what you need for a first stab at the PDF/Mail port from Seam 2

denis.forveille at gmail.com denis.forveille at gmail.com
Mon May 24 09:35:12 EDT 2010


Calling an URL to get a PDF is a bad idea IMHO

In our real world with firewalls,  clustering,  load balancers and 
strict network zoning etc, this implies to open the firewall to get ou 
from the application servers and send a request that goes through load 
balancers, web serveurs, firewall and finally to an application server 
that will process the request. Very inefficient with regard to a simple 
local call...
And it does not solve the use case where you want to store in the 
database the resulting PDF..

For us the current most annoying thing with seam 2 is the dependency on 
JSF/facelets and so on a web container (But this is also its 
strenght..). I think the best thing would be to remove the dependence to 
facelets and JSF or make it work outside a web container but I have no 
idea how without redropping the facelets templating thing...

Our apps are structured in layers, with a war module, an ejb module and 
a jpa module. Our ejb module has no dependency on facelets as the latter 
depends on the web container. This is currently not easy to produce a 
PDF as the process has to be split between the war (to handle the http 
request, it uses DocumentStore etc...) and the ejb module (business 
logic and database/jpa access..)

In fact those PDF and mail modules are currently not really into the 
seam 2 philosophy, as Seam is way better when SFSB/SLSF are used as 
backing beans but we can't do that with PDF and mail as a web container 
is necessary for the templating. I think JEE 6 solve the problem with 
the "merge" of web and ejb containers but JEE 6 is very very young...

We have the same problem for seam "batch" process that run outside a JEE 
container and produce PDF and send mails at night...

For us, having this  working outside a web container is a must (outside 
any container in fact).  If encapsulating a "fake" http request and that 
"encapsulating" object can run anywhere by just adding some jars in the 
classpath, then go for it

On 05/24/2010 06:29 AM, Pete Muir wrote:
> This is an idea that we had.
>
> Would be interested in feedback from people working with production systems, is this something they would allow?
>
> It's certainly very clean to implement.
>
> On 22 May 2010, at 08:08, Jason Porter wrote:
>
>    
>> Maybe I'm missing something here, but wouldn't it be just as easy to
>> create a URL or URLConnection for the doc view and simply call
>> getContent (or other method)?  That way we actually do have a real
>> request and we don't have to go to all the trouble of trying to fake
>> it or mock a request.  That may be another outside call though, which
>> probably wouldn't be the best, now that I think about it.  I'll think
>> some more, see if I come up with anything.
>>
>> On Fri, May 21, 2010 at 14:13, Pete Muir<pmuir at redhat.com>  wrote:
>>      
>>> On 21 May 2010, at 16:24, Lincoln Baxter, III wrote:
>>>
>>>        
>>>> I think for now these should be the same module. "Seam Docs"
>>>>          
>>> Yes, no reason not to bundle Mail - it's easy to ignore those tags you don't want. Just make sure to keep the code split up...
>>>
>>>        
>>>> -- There's also been speculation on whether a Mock Framework could be used to boot-up JSF and render documents.
>>>>
>>>> http://community.jboss.org/wiki/MockObjectsforTestDrivenJSFDevelopmentorgjbosstest-jsfjsf-mockproject
>>>>
>>>> Another alternative is to build a UIViewRoot, and replace it during the PreRenderViewEvent (which specifically states that it can be used to replace the UIViewRoot.)
>>>>
>>>> Or.. there's the possibility of simply creating a "fake" Request and Response object, and doing an internal forward in order to capture output and capture the output (via the faked response object) to be used in generating the PDF or Mail document.
>>>>
>>>> This last option is probably where I would start. I'd start by simply trying to create a new request and capture the output -- just try on a normal page, we can worry about generating pages that look like email documents after this basic functionality is working.
>>>>
>>>> --Lincoln
>>>>
>>>>
>>>> 2010/5/21 Cody Lerum<cody.lerum at gmail.com>
>>>> So a seam-mail and a seam-reporting?
>>>>
>>>> -C
>>>>
>>>> 2010/5/21 Tomaž Cerar<cerar at parsek.com>:
>>>>          
>>>>> Hi guys,
>>>>>
>>>>>
>>>>>
>>>>> Will pdf and mail be separate modules?
>>>>>
>>>>>
>>>>>
>>>>> I would also like to contribute to both modules.
>>>>>
>>>>> I have done some extensive research of existing mail module code while
>>>>> tracking down JBSEAM-3555 and have found out that current approach to using
>>>>> JSF in seam mail error-prone J
>>>>>
>>>>> Currently seam just uses jsf that was initalized in web application and that
>>>>> is why there are some ugly hacks to make it work when you invoke seam mail
>>>>> from from non-web request (ejb,mdb,...)
>>>>>
>>>>>
>>>>>
>>>>> Pete has sugessted that new seam-mail modul should start its own instance of
>>>>> JSF.
>>>>>
>>>>> Main problem with jsf is that there is no standard api to programaticly
>>>>> set-up jsf enviroment. Idea is that seam implements RI (Mojarra 2.0) with
>>>>> implementation specific api and possible others if they provide any machins
>>>>> for starting up.
>>>>>
>>>>>
>>>>>
>>>>> I would also like to contribute do pdf module as we have some in-house
>>>>> improvments and also some friends are willing to contibute huge upgrade to
>>>>> seam-pdf(forms,etc,..) but it is currently seam 2.0.x based.
>>>>>
>>>>>
>>>>>
>>>>> As I have not yet had much time to dive deeply into CDI and Seam 3(but I
>>>>> folow development closly) a kick start as setting up seam3 module would be
>>>>> much apreciated. Altough I can help to »rip out« any seam 2 module...
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Cheers,
>>>>>
>>>>> Tomaž
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> From: seam-dev-bounces at lists.jboss.org
>>>>> [mailto:seam-dev-bounces at lists.jboss.org] On Behalf Of Lincoln Baxter, III
>>>>> Sent: Thursday, May 20, 2010 4:57 PM
>>>>> To: cody.lerum at gmail.com; Dan Allen; Seam Dev List
>>>>> Subject: [seam-dev] Let me know what you need for a first stab at the
>>>>> PDF/Mail port from Seam 2
>>>>>
>>>>>
>>>>>
>>>>> Hi Cody, you have my email address now.
>>>>>
>>>>> I'm actually not very familiar with Seam 2, which is one of the reasons this
>>>>> has been lower priority, but if you can "rip" that part out of Seam 2 and
>>>>> make it a standalone maven project, I can help you get it set up as a Seam 3
>>>>> module and all that goodness :)
>>>>>
>>>>> seam-dev at lists.jboss.org (if you don't already know) is where we discuss
>>>>> development, so you can also ask questions there --
>>>>> https://lists.jboss.org/mailman/listinfo/seam-dev is where you can sign up.
>>>>>
>>>>> Thanks for reaching out!
>>>>> --
>>>>> Lincoln Baxter, III
>>>>> http://ocpsoft.com
>>>>> http://scrumshark.com
>>>>> "Keep it Simple"
>>>>> !DSPAM:6,4bf54e13248112142088973!
>>>>>            
>>>>
>>>>
>>>> --
>>>> Lincoln Baxter, III
>>>> http://ocpsoft.com
>>>> http://scrumshark.com
>>>> "Keep it Simple"
>>>> _______________________________________________
>>>> seam-dev mailing list
>>>> seam-dev at lists.jboss.org
>>>> https://lists.jboss.org/mailman/listinfo/seam-dev
>>>>          
>>>
>>> _______________________________________________
>>> seam-dev mailing list
>>> seam-dev at lists.jboss.org
>>> https://lists.jboss.org/mailman/listinfo/seam-dev
>>>
>>>        
>>
>>
>> -- 
>> Jason Porter
>>
>> Software Engineer
>> Open Source Advocate
>>
>> PGP key id: 926CCFF5
>> PGP key available at: keyserver.net, pgp.mit.edu
>>      
>
> _______________________________________________
> seam-dev mailing list
> seam-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/seam-dev
>
>    


More information about the seam-dev mailing list