<div>Hey Cody,<br><br>Awesome Job! Very mucho awesome job.<br> </div><blockquote style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;" class="gmail_quote">3. From Lincoln on having the EmailAttachment as an interface.<br>
<br>
I'm not really sure how useful this is going to be as you are<br>
going to have to implement quite a few methods.<br></blockquote>
<br>I'm not stuck on this one. It's a simple enough class, but you can never be too safe, and it's difficult to go back :) Forge tells us that there are only 6 methods that need to be in the interface. *wink*<br>
<br><div style="margin-left: 40px;">
[seam-mail-api-base] EmailAttachment.java $ ls<br><br>
[methods]<br>
public::getBytes()::byte[]<br>
public::getContentDisposition()::ContentDisposition<br>
public::getContentId()::String<br>
public::getFileName()::String<br>
public::getHeaders()::Collection<Header><br>
public::getMimeType()::String<br></div>
<br>It would be pretty straight-forward if you did want to break these out into their own interface and move the implentation (still in the api-base package) to BaseEmailAttachment. You could also add a reference to this default implementation in the JavaDocs. Again, just an idea. It really probably isn't a big deal since all you need to do is transform your data into the object you've already provided. I'd love to get Dan's expert opinion ;)<br>
<br>One more thing. It looks like you are doing some UUID work in this class here? <br><br> public EmailAttachment( String fileName, String mimeType, ContentDisposition contentDisposition, byte[] bytes){<br> this.contentId=UUID.randomUUID().toString();<br>
this.fileName=fileName;<br> this.mimeType=mimeType;<br> this.contentDisposition=contentDisposition;<br> this.bytes=bytes;<br> }<br><br>If you were to move Attachments to an interface, this might be something that needs to move to the EmailMessage impl itself. That might be another reason either for or against this, but something to consider :) Anyway. I'm done! Doesn't really matter either way I think.<br>
<br>Cheers! And again, awesome job!<br><br>--LB3<br><br><div class="gmail_quote">On Sun, Feb 27, 2011 at 6:22 PM, Cody Lerum <span dir="ltr"><<a href="mailto:cody.lerum@gmail.com">cody.lerum@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">1. From Lincoln<br>
<br>
Utilizing an Interface for handling the different ways one could<br>
create an email template. -<br>
<a href="https://issues.jboss.org/browse/SEAMMAIL-19" target="_blank">https://issues.jboss.org/browse/SEAMMAIL-19</a><br>
<br>
This is Done.<br>
<br>
VelocityMailMessage vmm = velocityMailMessage.get();<br>
<br>
vmm.from("seam@test.test", "Seam Framework")<br>
.to(person)<br>
.subject("HTML Message from Seam Mail - " +<br>
java.util.UUID.randomUUID().toString())<br>
.bodyHtml(new VelocityClassPathTemplate("template.html.vm"))<br>
.put("version", "Seam 3")<br>
.importance(MessagePriority.HIGH)<br>
vmm.send(session.get());<br>
<br>
the contact fields also support a interface as well so one only<br>
need implement a getName and getAddress method on their User entity<br>
(for example) in order to pass it directly into an email -<br>
<a href="https://github.com/seam/mail/blob/6f70057cca7da712576c21f44bda80082ae1f0a1/examples/sendmail/src/main/java/org/jboss/seam/mail/example/Person.java" target="_blank">https://github.com/seam/mail/blob/6f70057cca7da712576c21f44bda80082ae1f0a1/examples/sendmail/src/main/java/org/jboss/seam/mail/example/Person.java</a><br>
<br>
2. From Emmanuel<br>
<br>
a. the from and all contact fields already support a single argument<br>
being the address<br>
b. the ability to have a var args to("<a href="mailto:emmanuel@nothingtosee.org">emmanuel@nothingtosee.org</a>",<br>
"<a href="mailto:dan@test.com">dan@test.com</a>") is something we could do, but we would have to ditch<br>
the to("Dan", "<a href="mailto:dan@test.com">dan@test.com</a>"). People would have to create personal +<br>
address recipients via something like to(new BaseEmailContact("Dan".<br>
"<a href="mailto:dan@test.com">dan@test.com</a>")...more on that further down<br>
c. all the contact methods (from/to/cc/bcc/replyto) all support<br>
collections being passed into them.<br>
d. I've added an a no arg send() method<br>
e. Typesafe templating is going to have to come later and I'm going<br>
to need to lean on someone for inspiration.<br>
<br>
3. From Lincoln on having the EmailAttachment as an interface.<br>
<br>
I'm not really sure how useful this is going to be as you are<br>
going to have to implement quite a few methods.<br>
<br>
4. From José Rodolfo Carrijo de Freitas reguarding no arg send()<br>
<br>
This has been added.<br>
<br>
5. From Dan via ALR reguarding ordering of the name and address in<br>
contact methods<br>
<br>
I've reordered everything to aways takes Address first and then Name if any.<br>
<br>
to("<a href="mailto:cody@test.com">cody@test.com</a>")<br>
to("<a href="mailto:cody@test.com">cody@test.com</a>", "Cody")<br>
<br>
<br>
Thats what I have for now. The one question I have is do we just drop<br>
the ability to do<br>
<br>
to("<a href="mailto:cody@test.com">cody@test.com</a>", "Cody")<br>
<br>
and require<br>
<br>
to(new BaseEmailContact("<a href="mailto:cody@test.com">cody@test.com</a>", "Cody")<br>
<br>
this would allow a var args address only to/from/cc/bcc/replyTo<br>
<br>
Thus you could do:<br>
<br>
to("<a href="mailto:cody@test.com">cody@test.com</a>")<br>
to("<a href="mailto:cody@test.com">cody@test.com</a>", "<a href="mailto:dan@test.com">dan@test.com</a>")<br>
<br>
but anything with the acutal name would need to be done with<br>
<br>
to(new BaseEmailContact("<a href="mailto:cody@test.com">cody@test.com</a>", "Cody")<br>
<br>
Of course if people are using existing objects it would be easier to<br>
just implement the EmailContact interface<br>
<br>
User user = new User("Cody", "<a href="mailto:cody@test.com">cody@test.com</a>", RoleType.ADMIN);<br>
<br>
to(user);<br>
<br>
Thoughts?<br>
<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>
</blockquote></div><br><br clear="all"><br>-- <br>Lincoln Baxter, III<br><a href="http://ocpsoft.com">http://ocpsoft.com</a><br><a href="http://scrumshark.com">http://scrumshark.com</a><br>"Keep it Simple"<br>