Update of
/var/cvs/contributions/CMSContainer_Portlets/portlets-newsletter/src/java/com/finalist/newsletter/publisher
In directory james.mmbase.org:/tmp/cvs-serv25509/newsletter/publisher
Modified Files:
NewsletterPublisher.java
Log Message:
CMSC-743,Newsletter:send email,add term parameter to NewsletterContentPortlet
See also:
http://cvs.mmbase.org/viewcvs/contributions/CMSContainer_Portlets/portlets-newsletter/src/java/com/finalist/newsletter/publisher
See also: http://www.mmbase.org/jira/browse/CMSC-743
Index: NewsletterPublisher.java
===================================================================
RCS file:
/var/cvs/contributions/CMSContainer_Portlets/portlets-newsletter/src/java/com/finalist/newsletter/publisher/NewsletterPublisher.java,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -b -r1.23 -r1.24
--- NewsletterPublisher.java 4 May 2008 12:06:28 -0000 1.23
+++ NewsletterPublisher.java 5 May 2008 10:26:59 -0000 1.24
@@ -10,7 +10,6 @@
import javax.activation.DataHandler;
import javax.activation.DataSource;
-import javax.activation.FileDataSource;
import javax.mail.BodyPart;
import javax.mail.Message;
import javax.mail.MessagingException;
@@ -94,10 +93,11 @@
Multipart multipart = new MimeMultipart();
BodyPart mdp = new MimeBodyPart();
try {
- mdp.setContent(getBody(publication, subscription), "text/html");
+ mdp.setContent(getBody(publication, subscription),
subscription.getMimeType());
multipart.addBodyPart(mdp);
- } catch (MessagingException e1) {
- e1.printStackTrace();
+ }
+ catch (MessagingException e) {
+ log.error(e);
}
setAttachment(multipart, attachmentNodes, MimeType.attachment);
@@ -126,7 +126,8 @@
if (mimeType.compareTo(MimeType.image) == 0) {
bads = new ByteArrayDataSource(bytes, "image/"
+ node.getStringValue("itype"));
- } else if (mimeType.compareTo(MimeType.attachment) == 0) {
+ }
+ else if (mimeType.compareTo(MimeType.attachment) == 0) {
bads = new ByteArrayDataSource(bytes, node
.getStringValue("mimetype"));
}
@@ -153,7 +154,8 @@
if (publication.getNewsletter().getSendempty()) {
content = publication.getNewsletter().getTxtempty();
}
- } else {
+ }
+ else {
content = NewsletterGenerator
.generate(url, subscription.getMimeType());
}
@@ -274,11 +276,14 @@
if (StringUtils.isNotEmpty(personaliser)) {
try {
ps = (Personaliser) Class.forName(personaliser).newInstance();
- } catch (ClassNotFoundException e) {
+ }
+ catch (ClassNotFoundException e) {
log.error("No specified personaliser found:" + personaliser, e);
- } catch (IllegalAccessException e) {
+ }
+ catch (IllegalAccessException e) {
log.error(e);
- } catch (InstantiationException e) {
+ }
+ catch (InstantiationException e) {
log.error(e);
}
}
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs