Update of
/var/cvs/contributions/CMSContainer_Portlets/portlets-newsletter/src/java/com/finalist/newsletter/publisher
In directory
james.mmbase.org:/tmp/cvs-serv19540/portlets-newsletter/src/java/com/finalist/newsletter/publisher
Modified Files:
Tag: b1_5
NewsletterPublisher.java
Log Message:
CMSC-1187 - Clean up Newsletter code.
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-1187
Index: NewsletterPublisher.java
===================================================================
RCS file:
/var/cvs/contributions/CMSContainer_Portlets/portlets-newsletter/src/java/com/finalist/newsletter/publisher/NewsletterPublisher.java,v
retrieving revision 1.34.2.14
retrieving revision 1.34.2.15
diff -u -b -r1.34.2.14 -r1.34.2.15
--- NewsletterPublisher.java 3 Mar 2009 11:21:44 -0000 1.34.2.14
+++ NewsletterPublisher.java 4 Mar 2009 17:32:39 -0000 1.34.2.15
@@ -6,7 +6,6 @@
import java.io.InputStream;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
-import java.util.Date;
import java.util.Properties;
import javax.activation.DataHandler;
@@ -199,7 +198,7 @@
}
}
- private String getBody(Publication publication, Subscription subscription)
throws MessagingException {
+ private String getBody(Publication publication, Subscription subscription) {
String url = NewsletterUtil.getTermURL(publication.getUrl(),
subscription.getTerms(), publication.getId());
ICache cache = null;
@@ -213,7 +212,7 @@
if ((subscription.getTerms() == null) || (subscription.getTerms().size()
== 0) || !cache.contains(url)) {
if (null != getPersonalise()) {
content = getPersonalise().personalise(content, subscription,
publication);
- log.info("the content sended is Personalised :" + content);
+ log.debug("the content sent is Personalized:" + content);
}else {
log.info("url---->" + url);
content = NewsletterGenerator.generate(url,
subscription.getMimeType());
@@ -221,7 +220,7 @@
cache.add(url, content);
} else {
content = (String) cache.get(url);
- log.info("the content sended is from the cache" + content);
+ log.debug("the content sent is from cache:" + content);
}
return content + "\n";
}
@@ -246,13 +245,6 @@
message.setFrom(senderAddress);
}
- private void setMIME(Message message, String mime) throws
MessagingException {
- message.setHeader("MIME-Version", "1.0");
- message.setHeader("Content-Type", mime);
- message.setHeader("X-Mailer", "Recommend-It Mailer V2.03c02");
- message.setSentDate(new Date());
- }
-
private void setTitle(Message message, String title)
throws MessagingException {
message.setSubject(title);
@@ -302,18 +294,8 @@
String verpFrom = String.format("%s...@%s", sender[0],
toEmail.replaceAll("@", "="), sender[1]);
properties.put("mail.smtp.from", verpFrom);
-// properties.put("mail.smtp.from",
"[email protected]");
-// properties.put("mail.smtp.from", senderEmail);
properties.putAll(session.getProperties());
-/*
-session = Session.getInstance(properties,
-new javax.mail.Authenticator() {
- protected PasswordAuthentication getPasswordAuthentication() {
- return new PasswordAuthentication("[email protected]", "lgs9000");
- }
-});
-*/
}
catch (NamingException e) {
log.fatal("Configured dataSource '" + datasource + "' of context '" +
context + "' is not a Session ");
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs