Update of /var/cvs/contributions/CMSContainer_Portlets/portlets-newsletter/src/java/com/finalist/newsletter/publisher In directory james.mmbase.org:/tmp/cvs-serv472
Modified Files: NewsletterPublisher.java Log Message: CMSC-1084, Newsletter: sending test email contains empty body,add loginfo messages to look for the reason 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-1084 Index: NewsletterPublisher.java =================================================================== RCS file: /var/cvs/contributions/CMSContainer_Portlets/portlets-newsletter/src/java/com/finalist/newsletter/publisher/NewsletterPublisher.java,v retrieving revision 1.36 retrieving revision 1.37 diff -u -b -r1.36 -r1.37 --- NewsletterPublisher.java 3 Nov 2008 05:54:06 -0000 1.36 +++ NewsletterPublisher.java 12 Nov 2008 08:59:40 -0000 1.37 @@ -90,7 +90,10 @@ Multipart multipart = new MimeMultipart(); MimeBodyPart mdp = new MimeBodyPart(); try { - mdp.setContent(getBody(publication, subscription), subscription.getMimeType()); + String type=subscription.getMimeType(); + String o=getBody(publication, subscription); + log.info("the content will be sended:"+o+"\n "+"his type is :"+type); + mdp.setContent(o, type); multipart.addBodyPart(mdp); } catch (MessagingException e) { @@ -142,8 +145,7 @@ private String getBody(Publication publication, Subscription subscription) throws MessagingException { - String url = NewsletterUtil.getTermURL(publication.getUrl(), subscription - .getTerms(), publication.getId()); + String url = NewsletterUtil.getTermURL(publication.getUrl(), subscription.getTerms(), publication.getId()); ICache cache = null; String expiration = PropertiesUtil.getProperty("publication.cache.expiration"); if (StringUtils.isEmpty(expiration)) { @@ -156,16 +158,19 @@ int articleCounts = NewsletterUtil.countArticlesByNewsletter(publication.getNewsletterId()); if (articleCounts == 0 ) { content = publication.getNewsletter().getTxtempty(); + log.info("the newsletter use textEmpty" + content); } else { log.info("url---->" + url); content = NewsletterGenerator.generate(url, subscription.getMimeType()); } if (null != getPersonalise()) { content = getPersonalise().personalise(content, subscription, publication); + log.info("the content sended is Personalised :"+content); } cache.add(url, content); } else { content = (String) cache.get(url); + log.info("the content sended is from the cache"+content); } return content + "\n"; } _______________________________________________ Cvs mailing list Cvs@lists.mmbase.org http://lists.mmbase.org/mailman/listinfo/cvs