svn commit: r962996 - /ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ScreenFopViewHandler.java

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

svn commit: r962996 - /ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ScreenFopViewHandler.java

jonesde
Author: jonesde
Date: Sun Jul 11 06:35:09 2010
New Revision: 962996

URL: http://svn.apache.org/viewvc?rev=962996&view=rev
Log:
When a screen fop render fails, puts the screen XSL:FO output text in the log so you can see what caused the problem

Modified:
    ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ScreenFopViewHandler.java

Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ScreenFopViewHandler.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ScreenFopViewHandler.java?rev=962996&r1=962995&r2=962996&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ScreenFopViewHandler.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ScreenFopViewHandler.java Sun Jul 11 06:35:09 2010
@@ -80,7 +80,7 @@ public class ScreenFopViewHandler extend
             screens.getContext().put("simpleEncoder", StringUtil.getEncoder(UtilProperties.getPropertyValue("widget", getName() + ".encoder")));
             screens.render(page);
         } catch (Exception e) {
-            renderError("Problems with the response writer/output stream", e, request, response);
+            renderError("Problems with the response writer/output stream", e, "[Not Yet Rendered]", request, response);
             return;
         }
 
@@ -101,7 +101,7 @@ public class ScreenFopViewHandler extend
             Fop fop = ApacheFopWorker.createFopInstance(out, contentType);
             ApacheFopWorker.transform(src, null, fop);
         } catch (Exception e) {
-            renderError("Unable to transform FO file", e, request, response);
+            renderError("Unable to transform FO file", e, screenOutString, request, response);
             return;
         }
         // set the content type and length
@@ -113,12 +113,12 @@ public class ScreenFopViewHandler extend
             out.writeTo(response.getOutputStream());
             response.getOutputStream().flush();
         } catch (IOException e) {
-            renderError("Unable to write to OutputStream", e, request, response);
+            renderError("Unable to write to OutputStream", e, screenOutString, request, response);
         }
     }
 
-    protected void renderError(String msg, Exception e, HttpServletRequest request, HttpServletResponse response) throws ViewHandlerException {
-        Debug.logError(msg + ": " + e, module);
+    protected void renderError(String msg, Exception e, String screenOutString, HttpServletRequest request, HttpServletResponse response) throws ViewHandlerException {
+        Debug.logError(msg + ": " + e + "; Screen XSL:FO text was:\n" + screenOutString, module);
         try {
             Writer writer = new StringWriter();
             ScreenRenderer screens = new ScreenRenderer(writer, null, new HtmlScreenRenderer());