You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by jv...@apache.org on 2001/07/30 16:00:58 UTC
cvs commit: jakarta-turbine/src/adapter/org/apache/turbine/util/mail HtmlEmail.java
jvanzyl 01/07/30 07:00:58
Modified: src/adapter/org/apache/turbine/util/mail HtmlEmail.java
Log:
- getting rid of the use of ecs in this class.
Revision Changes Path
1.3 +10 -25 jakarta-turbine/src/adapter/org/apache/turbine/util/mail/HtmlEmail.java
Index: HtmlEmail.java
===================================================================
RCS file: /home/cvs/jakarta-turbine/src/adapter/org/apache/turbine/util/mail/HtmlEmail.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- HtmlEmail.java 2001/07/25 01:05:29 1.2
+++ HtmlEmail.java 2001/07/30 14:00:58 1.3
@@ -63,14 +63,6 @@
import javax.mail.Multipart;
import javax.mail.internet.MimeBodyPart;
import javax.mail.internet.MimeMultipart;
-
-//!! all these are bad.
-
-import org.apache.ecs.Document;
-import org.apache.ecs.ElementContainer;
-import org.apache.ecs.html.Body;
-import org.apache.ecs.html.Html;
-import org.apache.ecs.html.PRE;
import org.apache.turbine.util.GenerateUniqueId;
/**
@@ -94,7 +86,7 @@
*
* @author <a href="mailto:unknown">Regis Koenig</a>
* @author <a href="mailto:sean@informage.net">Sean Legassick</a>
- * @version $Id: HtmlEmail.java,v 1.2 2001/07/25 01:05:29 jvanzyl Exp $
+ * @version $Id: HtmlEmail.java,v 1.3 2001/07/30 14:00:58 jvanzyl Exp $
*/
public class HtmlEmail
extends MultiPartEmail
@@ -158,18 +150,6 @@
}
/**
- * Set the HTML content based on an ECS document.
- *
- * @param doc A Document.
- * @return An HtmlEmail.
- * @exception MessagingException.
- */
- public HtmlEmail setHtmlMsg(Document doc) throws MessagingException
- {
- return setHtmlMsg(doc.toString());
- }
-
- /**
* Set the message.
*
* <p>This method overrides the MultiPartEmail setMsg() method in
@@ -182,12 +162,16 @@
* @return An Email.
* @exception MessagingException.
*/
- public Email setMsg(String msg) throws MessagingException
+ public Email setMsg(String msg)
+ throws MessagingException
{
setTextMsg(msg);
- setHtmlMsg( new ElementContainer(
- new Html(new Body().addElement(new PRE(msg)))).toString());
+ setHtmlMsg(new StringBuffer()
+ .append("<html><body><pre>")
+ .append(msg)
+ .append("</pre></body></html>")
+ .toString());
return this;
}
@@ -213,7 +197,8 @@
* @return A String with the Content-ID of the file.
* @exception MessagingException.
*/
- public String embed(URL url, String name) throws MessagingException
+ public String embed(URL url, String name)
+ throws MessagingException
{
MimeBodyPart mbp = new MimeBodyPart();
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org