1 2 Previous Next 18 Replies Latest reply on Aug 24, 2006 1:33 PM by adam.stortz

    Seam mailer component

    pmuir

      I created a manager component for Apache Commons email; I've included an example to show how to use it.

      * http://bigbob.splendid.co.uk/mailer.zip - Mailer component

      * http://jroller.com/page/pmuir?entry=mailer_component_for_seam - Blog Entry

        • 1. Re: Seam mailer component
          theute

          Could you add a Wiki page with that ?

          • 2. Re: Seam mailer component
            pmuir

            I added a link on the Wiki to the blog entry under a new heading - Components. Would you prefer a copy of the entry?

            I've also added a JasperReports component that compiles (at the time Seam starts) reports designs defined in components.xml and makes them available for injection.

            • 3. Re: Seam mailer component
              theute

              This is great like this. thanks for sharing your components !

              • 4. Re: Seam mailer component
                gavin.king

                Nice. It might be worth including this in Seam.

                Can commons-email also be used for processing incoming emails? If so, could get something decent be combining this with JCA message inflow mapped to a message-driven bean.

                • 5. Re: Seam mailer component

                  Do we have a component registry? It might be interesting to start collecting some of these to give seam developers more tools to choose from.

                  • 6. Re: Seam mailer component
                    pmuir

                    No it can only send email.

                    When I wrote this I started off with the JavaMail API (which jboss has an impl of) which CAN be used to receive email but changed to commons email (which is build on JavaMail API) as it presented an easier to use interface. And I have no need to receive emails ;)

                    I might have another look at how much worse it would be to use the javamail api rather than commons.

                    • 7. Re: Seam mailer component
                      gavin.king

                      The whole area of processing email is an important one that I wanted to get sorted out, but it just keeps getting pushed and pushed...

                      • 8. Re: Seam mailer component
                        rpiaggio

                        I think it is great to have a component for email manipulation, but IMHO this concern is orthogonal to that of a web framework. Including something like this in the Seam standard would add unnecesary complexity to the framework and its documentation. Again, IM(Very)HO, I see a place for a repository of optional additional components for specific concerns.

                        • 9. Re: Seam mailer component

                          this is an awesome little plug-in. Saved me much time.

                          Thanks!

                          • 10. Re: Seam mailer component
                            pmuir

                            Ok, so I do perhaps need to receive email ;-) and faxes, and SMS, and...


                            • I started looking at MDB and JCA message inflow, looks like a good way to do it. My initial idea would be to have a listener interface

                              public interface EmailListener {
                              public void receive(javax.mail.Message message);
                              }


                              which must be implemeneted by the MDB receiving email. Then write a resource adaptor to receive new messages from the emailbox and deliver them.

                            • The resource adaptor would need to poll the mail box every x seconds to check for new email.

                            • Might want to set user, host, password at runtime. But what I'm suggesting seems to require it at deploy time.

                            • Doesn't seem to be very Seam like. A thought is to tie it to component driven events which could solve other problems (I need to think about this)

                            • Would be a good way to send email as well i.e.

                              @In private Mailer mailer
                              ...
                              javax.mail.Message message = ...;
                              mailer.send(message);
                              ...
                              


                              The Mailer component could then add in any defaults specified if not set on the message.

                              Comments, thoughts, ideas welcome (please!)


                            • 11. Re: Seam mailer component

                               

                              * Might want to set user, host, password at runtime. But what I'm suggesting seems to require it at deploy time.


                              How about including an annotation for injecting your mail component that could either take config information statically or via EL? Is EL runtime configurable enough for everyone? It would be nice if Seam supported JMX remoting of components. I have a feeling it's someone already supports this, maybe JEE 5 provides an annotation or maybe this is a Spring thing (sometimes it's hard to keep these frameworks straight).

                              • 12. Re: Seam mailer component

                                I would be fantastic to have a Seam Cookbook that contained real world examples and solutions using the Seam Framework.

                                I would like to see something more detailed a focued than the current examples.

                                The current documentation is good, but I would like to see some recipes.

                                • 13. Re: Seam mailer component
                                  pmuir

                                  I've updated this to use JavaMail for outbound, and to support inbound email via JCA and message driven beans.

                                  http://jroller.com/page/pmuir?entry=email_transport_layer_revisted

                                  • 14. Re: Seam mailer component
                                    gavin.king

                                    Pete, is all this linked from the Seam wiki?

                                    1 2 Previous Next