Update of
/var/cvs/contributions/CMSContainer_Portlets/portlets-newsletter/src/java/com/finalist/newsletter/publisher
In directory
james.mmbase.org:/tmp/cvs-serv24485/CMSContainer_Portlets/portlets-newsletter/src/java/com/finalist/newsletter/publisher
Modified Files:
NewsletterPublisher.java NewsletterGenerator.java
MIMEType.java
Log Message:
CMSC-1091 improve code style.
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-1091
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
retrieving revision 1.35
diff -u -b -r1.34 -r1.35
--- NewsletterPublisher.java 23 Sep 2008 10:53:48 -0000 1.34
+++ NewsletterPublisher.java 14 Oct 2008 11:22:44 -0000 1.35
@@ -123,8 +123,7 @@
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"));
}
@@ -147,29 +146,26 @@
.getTerms(), publication.getId());
ICache cache = null;
String expiration =
PropertiesUtil.getProperty("publication.cache.expiration");
- if(StringUtils.isEmpty(expiration)) {
+ if (StringUtils.isEmpty(expiration)) {
cache = CacheFactory.getDefaultCache();
- }
- else {
+ } else {
cache = CacheFactory.getDefaultCache(Long.parseLong(expiration));
}
String content = " ";
if ((subscription.getTerms() == null) || (subscription.getTerms().size()
== 0) || !cache.contains(url)) {
int articleCounts =
NewsletterUtil.countArticlesByNewsletter(publication.getNewsletterId());
- if (articleCounts == 0&&publication.getNewsletter().getSendempty()) {
+ if (articleCounts == 0 && publication.getNewsletter().getSendempty())
{
content = publication.getNewsletter().getTxtempty();
- }
- else {
- log.info("url---->"+url);
+ } else {
+ log.info("url---->" + url);
content = NewsletterGenerator.generate(url,
subscription.getMimeType());
}
if (null != getPersonalise()) {
- content = getPersonalise().personalise(content,
subscription,publication);
+ content = getPersonalise().personalise(content, subscription,
publication);
}
cache.add(url, content);
- }
- else{
- content=(String) cache.get(url);
+ } else {
+ content = (String) cache.get(url);
}
return content + "\n";
}
@@ -243,7 +239,7 @@
session = (javax.mail.Session) envCtx.lookup(datasource);
Properties properties = new Properties();
- if(senderEmail == null || senderEmail.indexOf("@") < 1){
+ if (senderEmail == null || senderEmail.indexOf("@") < 1) {
senderEmail = "[EMAIL PROTECTED]";
}
String[] sender = StringUtils.split(senderEmail, "@");
@@ -254,15 +250,14 @@
// properties.put("mail.smtp.from", senderEmail);
properties.putAll(session.getProperties());
-
/*
- session = Session.getInstance(properties,
- new javax.mail.Authenticator() {
+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 ");
Index: NewsletterGenerator.java
===================================================================
RCS file:
/var/cvs/contributions/CMSContainer_Portlets/portlets-newsletter/src/java/com/finalist/newsletter/publisher/NewsletterGenerator.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
Index: MIMEType.java
===================================================================
RCS file:
/var/cvs/contributions/CMSContainer_Portlets/portlets-newsletter/src/java/com/finalist/newsletter/publisher/MIMEType.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- MIMEType.java 15 Apr 2008 06:18:33 -0000 1.1
+++ MIMEType.java 14 Oct 2008 11:22:44 -0000 1.2
@@ -1,8 +1,8 @@
package com.finalist.newsletter.publisher;
public enum MIMEType {
- HTML ("text/html"),
- PLANTEXT ("text/plain");
+ HTML("text/html"),
+ PLANTEXT("text/plain");
private String type;
@@ -10,7 +10,7 @@
this.type = type;
}
- public String type(){
+ public String type() {
return type;
}
}
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs