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

Tomaž Cerar cerar at parsek.com
Mon May 24 10:12:40 EDT 2010


Hi,

I think this is really terrible idea!
We used to send email like that before going to seam...

Email "template" was jsp page which we called with new URL(host-name+"path/to/template");.
This usually worked for simple websites that ware running on single host without any load balancers etc..

Problems begun when we had more complex and "enterprisy" environment where you have load balancer/caching/reverse proxy server and behind there is one more application servers where the code is executing.
You can get problems like this:
- dns doesn't resolve the host (www.example.com) properly as the server must connect to load balancer and load balancer back to backend server
- if network uses NAT-ing you have to connect to internal ip instead to external for that you need a) internal dns server, b) enter all dns records to "hosts" file
- usually you have LB/RP in different network segments where there is one-way firewall connection permitted where one way is LB/RP --> app server.
- we have an example where client doesn't even allow servers to use dns.

These are just on top of my head as we had so many problems with "connect to myself mailing" that I just don't want to think about it anymore...

Also in many cases you have scenario where you have LB/RP and 2 servers that proxy server balances between and then another "app server" that just does some backend processing. 
That server should never ever use any external resources that are out of that "processing" job but it has to send emails. That server can also be consumer of jms messages and process them and send emails. 

Ideally for seam 3 it would be that that last server that has just processing logic could use seam-mail without web part of application installed...


Cheers,
Tomaz




-----Original Message-----
From: Pete Muir [mailto:pmuir at redhat.com] 
Sent: Monday, May 24, 2010 12:29 PM
To: Jason Porter
Cc: Lincoln Baxter, III; Tomaž Cerar; Seam Dev List
Subject: Re: [seam-dev] Let me know what you need for a first stab at the PDF/Mail port from Seam 2

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/MockObjectsforTestDrivenJSFDevelopme
>>> ntorgjbosstest-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"
>>>> 
>>> 
>>> 
>>> 
>>> --
>>> 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


!DSPAM:6,4bfa54f5316528466120797!




More information about the seam-dev mailing list