Update of /var/cvs/applications/email/src/org/mmbase/applications/email
In directory 
james.mmbase.org:/tmp/cvs-serv24155/src/org/mmbase/applications/email

Modified Files:
        EmailBuilder.java EmailHandler.java SendMail.java 
Log Message:
some details, cleanups


See also: 
http://cvs.mmbase.org/viewcvs/applications/email/src/org/mmbase/applications/email


Index: EmailBuilder.java
===================================================================
RCS file: 
/var/cvs/applications/email/src/org/mmbase/applications/email/EmailBuilder.java,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -b -r1.31 -r1.32
--- EmailBuilder.java   1 Aug 2008 12:33:06 -0000       1.31
+++ EmailBuilder.java   14 Oct 2008 11:04:32 -0000      1.32
@@ -28,7 +28,7 @@
  *
  * @author Daniel Ockeloen
  * @author Michiel Meeuwissen
- * @version $Id: EmailBuilder.java,v 1.31 2008/08/01 12:33:06 michiel Exp $
+ * @version $Id: EmailBuilder.java,v 1.32 2008/10/14 11:04:32 michiel Exp $
  */
 public class EmailBuilder extends MMObjectBuilder {
 
@@ -56,8 +56,6 @@
     // public final static int TYPE_REPEATMAIL  = 2; // Email will be sent and 
scheduled after sending for a next time (does not work?)
     public final static int TYPE_ONESHOTKEEP = 3; // Email will be sent and 
will not be removed.
 
-    public final static String EMAILTYPE_RESOURCE = 
"org.mmbase.applications.email.resources.mailtype";
-    public final static String EMAILSTATUS_RESOURCE = 
"org.mmbase.applications.email.resources.mailstatus";
 
     static String usersBuilder;
     static String usersEmailField;
@@ -115,31 +113,6 @@
         return true;
     }
 
-    /**
-     * Get the display string for a given field of this node.
-     * @param locale de locale voor de gui value
-     * @param field name of the field to describe.
-     * @param node Node containing the field data.
-     * @return A <code>String</code> describing the requested field's content
-     */
-    public String getLocaleGUIIndicator(Locale locale, String field, 
MMObjectNode node) {
-        if (field.equals("mailstatus")) {
-            String val = node.getStringValue("mailstatus");
-            log.debug("val: " + val); // 0, 1, 2, 3
-            ResourceBundle bundle;
-            bundle = ResourceBundle.getBundle(EMAILTYPE_RESOURCE, locale, 
getClass().getClassLoader() );
-            try {
-                return bundle.getString(val);
-            } catch (MissingResourceException e) {
-                return val;
-            }
-        } else if (field.equals("mailtype")){  // mailtype
-            String val = node.getStringValue("mailtype");
-            return getMailtypeResource(val,locale);
-        } else {
-            return super.getLocaleGUIIndicator(locale,field,node);
-        }
-    }
 
     {
         addFunction(new NodeFunction/*<Void>*/("mail", MAIL_PARAMETERS, 
ReturnType.VOID) {
@@ -241,22 +214,6 @@
         }
     }
 
-    /**
-     * Mailtype maps to an int in a resource, this method finds it,
-     * if possible and available the localized version of it.
-     *
-     * @param val      The int value that maps to a mailtype (1 = oneshot etc.)
-     * @param locale de locale voor de gui value
-     * @return A String from the resource file being a mailtype
-     */
-    private String getMailtypeResource(String val, Locale locale) {
-        ResourceBundle bundle = ResourceBundle.getBundle(EMAILTYPE_RESOURCE, 
locale, getClass().getClassLoader());
-        try {
-            return bundle.getString(val);
-        } catch (MissingResourceException e) {
-            return val;
-        }
-    }
 
 
     /**


Index: EmailHandler.java
===================================================================
RCS file: 
/var/cvs/applications/email/src/org/mmbase/applications/email/EmailHandler.java,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -b -r1.31 -r1.32
--- EmailHandler.java   8 Aug 2008 08:05:48 -0000       1.31
+++ EmailHandler.java   14 Oct 2008 11:04:32 -0000      1.32
@@ -29,7 +29,7 @@
  * @author Daniel Ockeloen
  * @author Michiel Meeuwissen
  * @author Simon Groenewolt
- * @version $Id: EmailHandler.java,v 1.31 2008/08/08 08:05:48 michiel Exp $
+ * @version $Id: EmailHandler.java,v 1.32 2008/10/14 11:04:32 michiel Exp $
  * @since  MMBase-1.7
  */
 class EmailHandler {
@@ -314,7 +314,7 @@
 
                 }
                 if (! mailResult) {
-                    log.debug("Email -> mail failed");
+                    log.warn("Mail to " + to.email + " failed", exception);
                     node.setValue("mailstatus", EmailBuilder.STATE_FAILED);
                     // add one to the sendmail counter
                     // refix numberofmailsend++;


Index: SendMail.java
===================================================================
RCS file: 
/var/cvs/applications/email/src/org/mmbase/applications/email/SendMail.java,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -b -r1.50 -r1.51
--- SendMail.java       13 Aug 2008 08:19:53 -0000      1.50
+++ SendMail.java       14 Oct 2008 11:04:32 -0000      1.51
@@ -32,7 +32,7 @@
  * @author Daniel Ockeloen
  * @author Johannes Verelst &lt;[EMAIL PROTECTED]&gt;
  * @since  MMBase-1.6
- * @version $Id: SendMail.java,v 1.50 2008/08/13 08:19:53 pierre Exp $
+ * @version $Id: SendMail.java,v 1.51 2008/10/14 11:04:32 michiel Exp $
  */
 public class SendMail extends AbstractSendMail {
     private static final Logger log = 
Logging.getLoggerInstance(SendMail.class);
@@ -433,6 +433,7 @@
             }
         } else {
             log.service("not sending mail to " + to + " because it does not 
match " + onlyToPattern);
+            return true;
         }
         return false;
     }
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to