Update of 
/var/cvs/contributions/CMSContainer_Portlets/portlets-newsletter/src/java/com/finalist/newsletter/publisher
In directory 
james.mmbase.org:/tmp/cvs-serv29487/portlets-newsletter/src/java/com/finalist/newsletter/publisher

Modified Files:
        NewsletterPublisher.java 
Log Message:
CMSC-725 service classes.


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-725


Index: NewsletterPublisher.java
===================================================================
RCS file: 
/var/cvs/contributions/CMSContainer_Portlets/portlets-newsletter/src/java/com/finalist/newsletter/publisher/NewsletterPublisher.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- NewsletterPublisher.java    8 Mar 2008 15:57:55 -0000       1.7
+++ NewsletterPublisher.java    10 Apr 2008 10:07:47 -0000      1.8
@@ -23,13 +23,12 @@
 import org.mmbase.util.logging.Logger;
 import org.mmbase.util.logging.Logging;
 
-import com.finalist.cmsc.mmbase.PropertiesUtil;
-import com.finalist.cmsc.services.community.NewsletterCommunication;
 import com.finalist.newsletter.generator.NewsletterGenerator;
 import com.finalist.newsletter.generator.NewsletterGeneratorFactory;
 import com.finalist.newsletter.util.NewsletterPublicationUtil;
 import com.finalist.newsletter.util.NewsletterSubscriptionUtil;
 import com.finalist.newsletter.util.NewsletterUtil;
+import com.finalist.cmsc.services.community.person.Person;
 
 public class NewsletterPublisher extends Thread {
 
@@ -49,8 +48,7 @@
    private void createConfirmationList(List<String> subscribers) {
       for (int s = 0; s < subscribers.size(); s++) {
          String userName = subscribers.get(s);
-         NewsletterCommunication.setUserPreference(userName, UNSENT_NEWSLETTER,
-               String.valueOf(publicationNumber));
+//         NewsletterCommunication.setUserPreference(userName, 
UNSENT_NEWSLETTER,                  String.valueOf(publicationNumber));
       }
    }
 
@@ -68,8 +66,8 @@
    }
 
    private void removeFromConfirmationList(String userName) {
-      NewsletterCommunication.removeUserPreference(userName, UNSENT_NEWSLETTER,
-            String.valueOf(publicationNumber));
+//      NewsletterCommunication.removeUserPreference(userName, 
UNSENT_NEWSLETTER,
+//            String.valueOf(publicationNumber));
    }
 
    @Override
@@ -115,24 +113,24 @@
          nameReplyTo = newsletterNode.getStringValue("replyto_name");
       }
 
-      if (emailFrom == null || emailFrom.length() == 0) {
-         emailFrom = PropertiesUtil.getProperty("newsletter.from.mail");
-         if (emailFrom == null || emailFrom.length() == 0) {
-            emailFrom = PropertiesUtil.getProperty("mail.system.email");
-         }
-      }
-
-      if (nameFrom == null || nameFrom.length() == 0) {
-         nameFrom = PropertiesUtil.getProperty("newsletter.from.name");
-      }
-
-      if (emailReplyTo == null || emailReplyTo.length() == 0) {
-         emailReplyTo = PropertiesUtil.getProperty("newsletter.replyto.mail");
-      }
-
-      if (nameReplyTo == null || nameReplyTo.length() == 0) {
-         nameReplyTo = PropertiesUtil.getProperty("newsletter.replyto.name");
-      }
+//      if (emailFrom == null || emailFrom.length() == 0) {
+//         emailFrom = PropertiesUtil.getProperty("newsletter.from.mail");
+//         if (emailFrom == null || emailFrom.length() == 0) {
+//            emailFrom = PropertiesUtil.getProperty("mail.system.email");
+//         }
+//      }
+//
+//      if (nameFrom == null || nameFrom.length() == 0) {
+//         nameFrom = PropertiesUtil.getProperty("newsletter.from.name");
+//      }
+//
+//      if (emailReplyTo == null || emailReplyTo.length() == 0) {
+//         emailReplyTo = 
PropertiesUtil.getProperty("newsletter.replyto.mail");
+//      }
+//
+//      if (nameReplyTo == null || nameReplyTo.length() == 0) {
+//         nameReplyTo = PropertiesUtil.getProperty("newsletter.replyto.name");
+//      }
 
       if (emailFrom != null && emailFrom.length() > 0) {
          InternetAddress fromAddress = new InternetAddress(emailFrom);
@@ -156,14 +154,14 @@
          return (null);
       }
 
-      String userEmail = NewsletterCommunication.getUserPreference(userName,
-            "email");
-      if (userEmail != null && userEmail.length() > 0) {
-         InternetAddress toAddress = new InternetAddress(userEmail);
-         message.setRecipient(RecipientType.TO, toAddress);
-      } else {
-         return (null);
-      }
+//      String userEmail = NewsletterCommunication.getUserPreference(userName,
+//            "email");
+//      if (userEmail != null && userEmail.length() > 0) {
+//         InternetAddress toAddress = new InternetAddress(userEmail);
+//         message.setRecipient(RecipientType.TO, toAddress);
+//      } else {
+//         return (null);
+//      }
 
       String subject = "" + publicationNode.getStringValue("subject");
       message.setSubject(subject);
@@ -212,4 +210,8 @@
       publicationNode.setStringValue("title", newTitle);
       publicationNode.commit();
    }
+
+   public void deliver(int id,List<Person> persons){
+      
+   }
 }
\ No newline at end of file
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to