You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by cz...@apache.org on 2004/08/17 10:05:02 UTC
svn commit: rev 36509 - in cocoon/trunk: . src/blocks/mail/java/org/apache/cocoon/mail/transformation src/blocks/repository/java/org/apache/cocoon/components/source/impl
Author: cziegeler
Date: Tue Aug 17 01:04:59 2004
New Revision: 36509
Removed:
cocoon/trunk/src/blocks/repository/java/org/apache/cocoon/components/source/impl/MultiSourceValidity.java
Modified:
cocoon/trunk/src/blocks/mail/java/org/apache/cocoon/mail/transformation/SendMailTransformer.java
cocoon/trunk/status.xml
Log:
Mail block: Add ability to specify mime-type for email body text parameter in the mail transformer.
Modified: cocoon/trunk/src/blocks/mail/java/org/apache/cocoon/mail/transformation/SendMailTransformer.java
==============================================================================
--- cocoon/trunk/src/blocks/mail/java/org/apache/cocoon/mail/transformation/SendMailTransformer.java (original)
+++ cocoon/trunk/src/blocks/mail/java/org/apache/cocoon/mail/transformation/SendMailTransformer.java Tue Aug 17 01:04:59 2004
@@ -170,7 +170,7 @@
* </p>
*
* @author <a href="mailto:pklassen@s-und-n.de">Peter Klassen</a>
- * @version CVS $Id: SendMailTransformer.java,v 1.15 2004/07/22 23:21:56 joerg Exp $
+ * @version CVS $Id$
*
*/
public class SendMailTransformer extends AbstractSAXTransformer {
@@ -191,7 +191,9 @@
public static final String ELEMENT_ERROR = "error";
public static final String ELEMENT_SUCCESS = "success";
public static final String ELEMENT_FAILURE = "failure";
- public static final String ELEMENT_RESULT = "result";
+ public static final String ELEMENT_RESULT = "result";
+
+ public static final String DEFAULT_BODY_MIMETYPE = "text/html";
/*
* mode-constants
@@ -225,6 +227,7 @@
protected String subject;
protected String body;
protected String bodyURI;
+ protected String bodyMimeType;
protected String mailHost;
protected String fromAddress;
protected AttachmentDescriptor attachmentDescriptor;
@@ -306,11 +309,18 @@
this.mode = MODE_SUBJECT;
} else if (name.equals(ELEMENT_MAILBODY)) {
String strBody = attr.getValue("src");
-
+
if (strBody != null) {
this.bodyURI = strBody;
}
-
+
+ String mType = attr.getValue("mime-type");
+ if (mType != null) {
+ this.bodyMimeType = new String(mType);
+ } else {
+ this.bodyMimeType = DEFAULT_BODY_MIMETYPE;
+ }
+
this.startTextRecording();
this.mode = MODE_BODY;
} else if (name.equals(ELEMENT_ATTACHMENT)) {
@@ -527,9 +537,9 @@
inStr.read(byteArr);
String mailBody = new String(byteArr);
- messageBodyPart.setContent(mailBody, "text/html");
+ messageBodyPart.setContent(mailBody, this.bodyMimeType);
} else {
- messageBodyPart.setContent(this.body, "text/html");
+ messageBodyPart.setContent(this.body.toString(), this.bodyMimeType);
}
Multipart multipart = new MimeMultipart();
Modified: cocoon/trunk/status.xml
==============================================================================
--- cocoon/trunk/status.xml (original)
+++ cocoon/trunk/status.xml Tue Aug 17 01:04:59 2004
@@ -204,6 +204,12 @@
<changes>
<release version="@version@" date="@date@">
+ <action dev="CZ" type="add" fixes-bug="30688" due-to="John Lianoglou" due-to-email="john@arachnedesign.net">
+ Mail block: Add ability to specify mime-type for email body text parameter in the mail transformer.
+ </action>
+ <action dev="CZ" type="fix">
+ Fix potential memory leaks in CForms/Woody Template Transformer and JXTemplateGenerator.
+ </action>
<action dev="VG" type="fix" fixes-bug="29765" due-to="Rui Alberto L. Gonçalves" due-to-email="rui-l-goncalves@ptinovacao.pt">
XMLDB Block: Add ability to delete collections with XMLDBTransformer.
</action>