2. Validity checking on fo:conditional-page-master-reference added. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@197741 13f79535-47bb-0310-9956-ffa450edef68pull/30/head
@@ -78,8 +78,8 @@ public class CommandLineOptions { | |||
/* output mode */ | |||
private int outputmode = NOT_SET; | |||
private java.util.HashMap rendererOptions; | |||
private FOUserAgent foUserAgent; | |||
private Log log; | |||
private Vector xsltParams = null; | |||
@@ -96,7 +96,9 @@ public class CommandLineOptions { | |||
log = LogFactory.getLog("FOP"); | |||
boolean optionsParsed = true; | |||
rendererOptions = new java.util.HashMap(); | |||
foUserAgent = new FOUserAgent(); | |||
try { | |||
optionsParsed = parseOptions(args); | |||
if (optionsParsed) { | |||
@@ -454,7 +456,7 @@ public class CommandLineOptions { | |||
case SVG_OUTPUT: | |||
return Driver.RENDER_SVG; | |||
case AREA_OUTPUT: | |||
rendererOptions.put("fineDetail", isCoarseAreaXml()); | |||
foUserAgent.getRendererOptions().put("fineDetail", isCoarseAreaXml()); | |||
return Driver.RENDER_XML; | |||
case RTF_OUTPUT: | |||
return Driver.RENDER_RTF; | |||
@@ -480,11 +482,11 @@ public class CommandLineOptions { | |||
} | |||
/** | |||
* Get the renderer specific options. | |||
* @return hash map with option/value pairs. | |||
* Get the FOUserAgent for this Command-Line run | |||
* @return FOUserAgent instance | |||
*/ | |||
public java.util.HashMap getRendererOptions() { | |||
return rendererOptions; | |||
protected FOUserAgent getFOUserAgent() { | |||
return foUserAgent; | |||
} | |||
/** |
@@ -19,6 +19,7 @@ | |||
package org.apache.fop.apps; | |||
// Java | |||
import java.util.HashMap; | |||
import java.util.Map; | |||
import java.io.IOException; | |||
import java.io.InputStream; | |||
@@ -55,6 +56,15 @@ public class FOUserAgent { | |||
private String baseURL; | |||
private PDFEncryptionParams pdfEncryptionParams; | |||
private float px2mm = 0.35277777777777777778f; //72dpi (=25.4/dpi) | |||
private HashMap rendererOptions = new java.util.HashMap(); | |||
/** | |||
* Returns the renderer options | |||
* @return renderer options | |||
*/ | |||
public HashMap getRendererOptions() { | |||
return rendererOptions; | |||
} | |||
/** | |||
* Sets the base URL. |
@@ -45,6 +45,7 @@ public class Fop { | |||
Driver driver = new Driver(); | |||
options = new CommandLineOptions(args); | |||
driver.setUserAgent(options.getFOUserAgent()); | |||
inputHandler = options.getInputHandler(); | |||
try { | |||
@@ -60,9 +61,6 @@ public class Fop { | |||
} | |||
} | |||
if (driver.getRenderer() != null) { | |||
driver.getRenderer().setOptions(options.getRendererOptions()); | |||
} | |||
driver.render(inputHandler); | |||
} finally { | |||
if (bos != null) { |
@@ -20,6 +20,7 @@ package org.apache.fop.fo.pagination; | |||
// XML | |||
import org.xml.sax.Attributes; | |||
import org.xml.sax.Locator; | |||
// FOP | |||
import org.apache.fop.fo.FONode; | |||
@@ -52,6 +53,14 @@ public class ConditionalPageMasterReference extends FObj { | |||
super(parent); | |||
} | |||
/** | |||
* @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String) | |||
* XSL/FOP Content Model: empty | |||
*/ | |||
protected void validateChildNode(Locator loc, String nsURI, String localName) { | |||
invalidChildError(loc, nsURI, localName); | |||
} | |||
/** | |||
* @see org.apache.fop.fo.FObj#addProperties | |||
*/ |
@@ -104,11 +104,6 @@ public abstract class AbstractRenderer | |||
*/ | |||
protected Date creationDate = null; | |||
/** | |||
* renderer configuration | |||
*/ | |||
protected Map options; | |||
/** | |||
* block progression position | |||
*/ | |||
@@ -179,11 +174,6 @@ public abstract class AbstractRenderer | |||
creationDate = date; | |||
} | |||
/** @see org.apache.fop.render.Renderer */ | |||
public void setOptions(Map opt) { | |||
options = opt; | |||
} | |||
/** @see org.apache.fop.render.Renderer */ | |||
public void startRenderer(OutputStream outputStream) | |||
throws IOException { } |
@@ -96,13 +96,6 @@ public interface Renderer { | |||
*/ | |||
void setupFontInfo(FontInfo fontInfo); | |||
/** | |||
* Set up renderer options. | |||
* | |||
* @param options The Configuration for the renderer | |||
*/ | |||
void setOptions(Map options); | |||
/** | |||
* Set the producer of the rendering. If this method isn't called the | |||
* renderer uses a default. Note: Not all renderers support this feature. |
@@ -180,7 +180,8 @@ public class XMLRenderer extends AbstractRenderer { | |||
} | |||
private boolean isCoarseXml() { | |||
return ((Boolean) options.get("fineDetail")).booleanValue(); | |||
return ((Boolean) | |||
userAgent.getRendererOptions().get("fineDetail")).booleanValue(); | |||
} | |||
/** |
@@ -315,10 +315,8 @@ public class TestConverter { | |||
driver.setRenderer(Driver.RENDER_XML); | |||
} | |||
Map rendererOptions = new java.util.HashMap(); | |||
rendererOptions.put("fineDetail", new Boolean(false)); | |||
rendererOptions.put("consistentOutput", new Boolean(true)); | |||
driver.getRenderer().setOptions(rendererOptions); | |||
userAgent.getRendererOptions().put("fineDetail", new Boolean(false)); | |||
userAgent.getRendererOptions().put("consistentOutput", new Boolean(true)); | |||
driver.getRenderer().setProducer("Testsuite Converter"); | |||
String outname = res; |