On Jun 26, 2008, at 1:58 AM, sdumitriu (SVN) wrote:
Author: sdumitriu
Date: 2008-06-26 01:58:47 +0200 (Thu, 26 Jun 2008)
New Revision: 10823
Modified:
xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/
pdf/impl/PdfExportImpl.java
Log:
XWIKI-2498: Exporting a page with an image to PDF fails on Jetty
Fixed.
Modified: xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/
xwiki/pdf/impl/PdfExportImpl.java
===================================================================
--- xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/
pdf/impl/PdfExportImpl.java 2008-06-25 23:35:34 UTC (rev 10822)
+++ xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/
pdf/impl/PdfExportImpl.java 2008-06-25 23:58:47 UTC (rev 10823)
@@ -26,6 +26,7 @@
import com.xpn.xwiki.objects.BaseObject;
import com.xpn.xwiki.pdf.api.PdfExport;
import com.xpn.xwiki.util.Util;
+import com.xpn.xwiki.web.Utils;
import com.xpn.xwiki.web.XWikiRequest;
import info.informatica.doc.dom4j.CSSStylableElement;
import info.informatica.doc.dom4j.XHTMLDocument;
@@ -221,7 +222,15 @@
try {
tempdir.mkdirs();
context.put("pdfexportdir", tempdir);
+ boolean useLocalPlaceholders = !
Utils.arePlaceholdersEnabled(context);
+ if (useLocalPlaceholders) {
+ Utils.enablePlaceholders(context);
+ }
String content =
context.getWiki().parseTemplate("pdf.vm", context);
+ if (useLocalPlaceholders) {
+ content = Utils.replacePlaceholders(content,
context);
+ Utils.disablePlaceholders(context);
+ }
Shouldn't this be done in the rendering engine code?
For example in the new rendering we don't need this so it would be
easier to integrate the new rendering if this code was only found in
the old rendering code.
WDYT?
Thanks
-Vincent