svn commit: r661931 - /ofbiz/trunk/applications/content/src/org/ofbiz/content/email/EmailServices.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r661931 - /ofbiz/trunk/applications/content/src/org/ofbiz/content/email/EmailServices.java

lektran
Author: lektran
Date: Fri May 30 19:18:06 2008
New Revision: 661931

URL: http://svn.apache.org/viewvc?rev=661931&view=rev
Log:
Fix for OFBIZ-1813 reported by Jacapo Cappellato,  NPE when rendering PDF attached to the order confirmation email

Modified:
    ofbiz/trunk/applications/content/src/org/ofbiz/content/email/EmailServices.java

Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/email/EmailServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/email/EmailServices.java?rev=661931&r1=661930&r2=661931&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/src/org/ofbiz/content/email/EmailServices.java (original)
+++ ofbiz/trunk/applications/content/src/org/ofbiz/content/email/EmailServices.java Fri May 30 19:18:06 2008
@@ -39,6 +39,7 @@
 import org.ofbiz.service.ServiceUtil;
 import org.ofbiz.service.mail.MimeMessageWrapper;
 import org.ofbiz.webapp.view.ApacheFopWorker;
+import org.ofbiz.widget.fo.FoScreenRenderer;
 import org.ofbiz.widget.html.HtmlScreenRenderer;
 import org.ofbiz.widget.screen.ScreenRenderer;
 import org.xml.sax.SAXException;
@@ -69,6 +70,7 @@
     public final static String module = EmailServices.class.getName();
 
     protected static final HtmlScreenRenderer htmlScreenRenderer = new HtmlScreenRenderer();
+    protected static final FoScreenRenderer foScreenRenderer = new FoScreenRenderer();
 
     /**
      * Basic JavaMail Service
@@ -374,7 +376,7 @@
                 Writer writer = new StringWriter();
                 MapStack screenContextAtt = MapStack.create();
                 // substitute the freemarker variables...
-                ScreenRenderer screensAtt = new ScreenRenderer(writer, screenContext, htmlScreenRenderer);
+                ScreenRenderer screensAtt = new ScreenRenderer(writer, screenContext, foScreenRenderer);
                 screensAtt.populateContextForService(dctx, bodyParameters);
                 screenContextAtt.putAll(bodyParameters);
                 screensAtt.render(xslfoAttachScreenLocation);