You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by je...@apache.org on 2009/03/02 11:19:02 UTC
svn commit: r749258 - in /xmlgraphics/fop/trunk: ./
src/documentation/content/xdocs/trunk/ src/java/org/apache/fop/events/
src/java/org/apache/fop/render/afp/
src/java/org/apache/fop/render/afp/extensions/
test/layoutengine/standard-testcases/
Author: jeremias
Date: Mon Mar 2 10:19:01 2009
New Revision: 749258
URL: http://svn.apache.org/viewvc?rev=749258&view=rev
Log:
AFP Output: Tag Logical Element (TLE) is now also allowed on fo:page-sequence (page group level).
Modified:
xmlgraphics/fop/trunk/src/documentation/content/xdocs/trunk/output.xml
xmlgraphics/fop/trunk/src/java/org/apache/fop/events/EventFormatter.xml
xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/AFPDocumentHandler.java
xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/AFPRenderer.java
xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/extensions/AFPPageSetupElement.java
xmlgraphics/fop/trunk/status.xml
xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/afp-extension_1.xml
Modified: xmlgraphics/fop/trunk/src/documentation/content/xdocs/trunk/output.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/documentation/content/xdocs/trunk/output.xml?rev=749258&r1=749257&r2=749258&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/documentation/content/xdocs/trunk/output.xml (original)
+++ xmlgraphics/fop/trunk/src/documentation/content/xdocs/trunk/output.xml Mon Mar 2 10:19:01 2009
@@ -759,16 +759,18 @@
<fo:region-body/>
</fo:simple-page-master>
</fo:layout-master-set>
+ [..]
+ <fo:page-sequence master-reference="simple">
+ <afp:tag-logical-element name="foo" value="bar"/>
+ <fo:flow flow-name="xsl-region-body">
+ [..]
]]></source>
- <p>The tag-logical-element extension element can only occur within a simple-page-master.
- Multiple tag-logical-element extension elements within a simple-page-master are allowed.
- The name and value attributes are mandatory.
+ <p>
+ The tag-logical-element extension element can appear within a simple-page-master
+ (page level) or it can appear as child of page-sequence (page group level).
+ Multiple tag-logical-element extension elements within a simple-page-master or
+ page-sequence are allowed. The name and value attributes are mandatory.
</p>
- <note>
- Currently, TLEs are only possible inside simple-page-master (i.e. on page leve).
- At this time, it is not possible to add TLE's at page-group level (i.e. as direct child
- of fo:page-sequence).
- </note>
</section>
<section id="afp-no-operation">
<title>No Operation (NOP) Extension</title>
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/events/EventFormatter.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/events/EventFormatter.xml?rev=749258&r1=749257&r2=749258&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/events/EventFormatter.xml (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/events/EventFormatter.xml Mon Mar 2 10:19:01 2009
@@ -28,6 +28,7 @@
<message key="rule.childOfSPMorDeclarations">The element must be a child of fo:declarations or fo:simple-page-master.</message>
<message key="rule.childOfInstreamForeignObjectorExternalGraphic">The element must be a child of fo:instream-foreign-object or fo:external-graphic.</message>
<message key="rule.childOfPageSequence">The element must be a child of fo:page-sequence.</message>
+ <message key="rule.childOfPageSequenceOrSPM">The element must be a child of fo:page-sequence or fo:simple-page-master.</message>
<message key="rule.wrapperInvalidChildForParent">An fo:wrapper is only permitted to have children that would be permitted for its parent.</message>
<message key="org.apache.fop.fo.FOValidationEventProducer.tooManyNodes">For "{elementName}", only one "{offendingNode}" may be declared.{{locator}}</message>
<message key="org.apache.fop.fo.FOValidationEventProducer.nodeOutOfOrder">For "{elementName}", "{tooLateNode}" must be declared before "{tooEarlyNode}"!{{locator}}</message>
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/AFPDocumentHandler.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/AFPDocumentHandler.java?rev=749258&r1=749257&r2=749258&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/AFPDocumentHandler.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/AFPDocumentHandler.java Mon Mar 2 10:19:01 2009
@@ -245,28 +245,36 @@
public void handleExtensionObject(Object extension) throws IFException {
if (extension instanceof AFPPageSetup) {
AFPPageSetup aps = (AFPPageSetup)extension;
- if (this.location != LOC_IN_PAGE_HEADER) {
- throw new IFException(
- "AFP page setup extension encountered outside the page header: " + aps, null);
- }
String element = aps.getElementName();
- if (AFPElementMapping.INCLUDE_PAGE_OVERLAY.equals(element)) {
- String overlay = aps.getName();
- if (overlay != null) {
- dataStream.createIncludePageOverlay(overlay);
+ if (AFPElementMapping.TAG_LOGICAL_ELEMENT.equals(element)) {
+ if (this.location != LOC_IN_PAGE_HEADER
+ && this.location != LOC_FOLLOWING_PAGE_SEQUENCE) {
+ throw new IFException(
+ "TLE extension must be in the page header or between page-sequence"
+ + " and the first page: " + aps, null);
}
- } else if (AFPElementMapping.INCLUDE_PAGE_SEGMENT.equals(element)) {
- String name = aps.getName();
- String source = aps.getValue();
- pageSegmentMap.put(source, name);
- } else if (AFPElementMapping.TAG_LOGICAL_ELEMENT.equals(element)) {
String name = aps.getName();
String value = aps.getValue();
dataStream.createTagLogicalElement(name, value);
- } else if (AFPElementMapping.NO_OPERATION.equals(element)) {
- String content = aps.getContent();
- if (content != null) {
- dataStream.createNoOperation(content);
+ } else {
+ if (this.location != LOC_IN_PAGE_HEADER) {
+ throw new IFException(
+ "AFP page setup extension encountered outside the page header: " + aps, null);
+ }
+ if (AFPElementMapping.INCLUDE_PAGE_OVERLAY.equals(element)) {
+ String overlay = aps.getName();
+ if (overlay != null) {
+ dataStream.createIncludePageOverlay(overlay);
+ }
+ } else if (AFPElementMapping.INCLUDE_PAGE_SEGMENT.equals(element)) {
+ String name = aps.getName();
+ String source = aps.getValue();
+ pageSegmentMap.put(source, name);
+ } else if (AFPElementMapping.NO_OPERATION.equals(element)) {
+ String content = aps.getContent();
+ if (content != null) {
+ dataStream.createNoOperation(content);
+ }
}
}
} else if (extension instanceof AFPInvokeMediumMap) {
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/AFPRenderer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/AFPRenderer.java?rev=749258&r1=749257&r2=749258&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/AFPRenderer.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/AFPRenderer.java Mon Mar 2 10:19:01 2009
@@ -231,6 +231,11 @@
if (mediumMap != null) {
dataStream.createInvokeMediumMap(mediumMap);
}
+ } else if (attachment instanceof AFPPageSetup) {
+ AFPPageSetup aps = (AFPPageSetup)attachment;
+ String name = aps.getName();
+ String value = aps.getValue();
+ dataStream.createTagLogicalElement(name, value);
}
}
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/extensions/AFPPageSetupElement.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/extensions/AFPPageSetupElement.java?rev=749258&r1=749257&r2=749258&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/extensions/AFPPageSetupElement.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/extensions/AFPPageSetupElement.java Mon Mar 2 10:19:01 2009
@@ -53,9 +53,17 @@
/** {@inheritDoc} */
protected void startOfNode() throws FOPException {
super.startOfNode();
- if (parent.getNameId() != Constants.FO_SIMPLE_PAGE_MASTER) {
- invalidChildError(getLocator(), parent.getName(), getNamespaceURI(), getName(),
- "rule.childOfSPM");
+ if (AFPElementMapping.TAG_LOGICAL_ELEMENT.equals(getLocalName())) {
+ if (parent.getNameId() != Constants.FO_SIMPLE_PAGE_MASTER
+ && parent.getNameId() != Constants.FO_PAGE_SEQUENCE) {
+ invalidChildError(getLocator(), parent.getName(), getNamespaceURI(), getName(),
+ "rule.childOfPageSequenceOrSPM");
+ }
+ } else {
+ if (parent.getNameId() != Constants.FO_SIMPLE_PAGE_MASTER) {
+ invalidChildError(getLocator(), parent.getName(), getNamespaceURI(), getName(),
+ "rule.childOfSPM");
+ }
}
}
Modified: xmlgraphics/fop/trunk/status.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/status.xml?rev=749258&r1=749257&r2=749258&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/status.xml (original)
+++ xmlgraphics/fop/trunk/status.xml Mon Mar 2 10:19:01 2009
@@ -58,6 +58,10 @@
documents. Example: the fix of marks layering will be such a case when it's done.
-->
<release version="FOP Trunk" date="TBD">
+ <action context="Renderers" dev="JM" type="add">
+ AFP Output: Tag Logical Element (TLE) is now also allowed on fo:page-sequence
+ (page group level).
+ </action>
<action context="Layout" dev="JM" type="fix">
Fixed BPD trait and border painting for leaders with leader-pattern="space"
(and similar cases).
Modified: xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/afp-extension_1.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/afp-extension_1.xml?rev=749258&r1=749257&r2=749258&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/afp-extension_1.xml (original)
+++ xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/afp-extension_1.xml Mon Mar 2 10:19:01 2009
@@ -25,7 +25,8 @@
</info>
<fo>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
- xmlns:afp="http://xmlgraphics.apache.org/fop/extensions/afp">
+ xmlns:afp="http://xmlgraphics.apache.org/fop/extensions/afp"
+ xmlns:fox="http://xmlgraphics.apache.org/fop/extensions">
<fo:layout-master-set>
<fo:simple-page-master master-name="normal" page-width="5in" page-height="5in">
<afp:include-page-overlay name="O1SAMP1 "/>
@@ -35,8 +36,9 @@
<fo:region-body/>
</fo:simple-page-master>
</fo:layout-master-set>
- <fo:page-sequence master-reference="normal" afp:test-ignore="this">
+ <fo:page-sequence master-reference="normal" fox:test-ignore="this">
<afp:invoke-medium-map name="MYMAP"/>
+ <afp:tag-logical-element name="foo" value="bar"/>
<fo:flow flow-name="xsl-region-body">
<fo:block>Text on page <fo:page-number/>.</fo:block>
<fo:block break-before="page">Text on page <fo:page-number/>.</fo:block>
@@ -44,7 +46,7 @@
</fo:page-sequence>
</fo:root>
</fo>
- <checks xmlns:afp="http://xmlgraphics.apache.org/fop/extensions/afp">
+ <checks xmlns:afp="apache:fop:extensions:afp">
<eval expected="4" xpath="count(/areaTree/pageSequence/pageViewport[@nr=1]/page/extension-attachments/child::*)"/>
<eval expected="O1SAMP1 " xpath="/areaTree/pageSequence/pageViewport[@nr=1]/page/extension-attachments/child::*[1]/@name"/>
<eval expected="S1ISLOGO" xpath="/areaTree/pageSequence/pageViewport[@nr=1]/page/extension-attachments/child::*[2]/@name"/>
@@ -54,15 +56,28 @@
<eval expected="4" xpath="count(/areaTree/pageSequence/pageViewport[@nr=2]/page/extension-attachments/child::*)"/>
- <eval expected="1" xpath="count(/areaTree/pageSequence/extension-attachments)"/>
+ <eval expected="2" xpath="count(/areaTree/pageSequence/extension-attachments/child::*)"/>
<eval expected="MYMAP" xpath="/areaTree/pageSequence/extension-attachments/child::*[1]/@name"/>
+ <eval expected="bar" xpath="/areaTree/pageSequence/extension-attachments/afp:tag-logical-element[@name = 'foo']/@value"/>
<!-- This just tests if extension attributes make it through to the PageSequence object. -->
- <eval expected="this" xpath="/areaTree/pageSequence/@afp:test-ignore"/>
+ <eval expected="this" xpath="/areaTree/pageSequence/@fox:test-ignore" xmlns:fox="http://xmlgraphics.apache.org/fop/extensions"/>
</checks>
<if-checks xmlns:if="http://xmlgraphics.apache.org/fop/intermediate"
- xmlns:afp="http://xmlgraphics.apache.org/fop/extensions/afp">
- <eval expected="this" xpath="//if:page-sequence/@afp:test-ignore"/>
- <eval expected="MYMAP" xpath="//if:page-sequence/afp:invoke-medium-map/@name" xmlns:afp="apache:fop:extensions:afp"/>
+ xmlns:afp="apache:fop:extensions:afp">
+ <eval expected="4" xpath="count(//if:page[@name = '1']/if:page-header/child::*)"/>
+ <eval expected="O1SAMP1 " xpath="//if:page[@name = '1']/if:page-header/afp:include-page-overlay[1]/@name"/>
+ <eval expected="S1ISLOGO" xpath="//if:page[@name = '1']/if:page-header/afp:include-page-segment[1]/@name"/>
+ <eval expected="The TLE Value" xpath="//if:page[@name = '1']/if:page-header/afp:tag-logical-element[@name = 'The TLE Name']/@value"/>
+ <eval expected="My NOP" xpath="//if:page[@name = '1']/if:page-header/afp:no-operation[1]/@name"/>
+ <eval expected="insert up to 32k of character data here!" xpath="//if:page[@name = '1']/if:page-header/afp:no-operation[1]"/>
+
+ <eval expected="4" xpath="count(//if:page[@name = '2']/if:page-header/child::*)"/>
+
+ <eval expected="MYMAP" xpath="//if:page-sequence/afp:invoke-medium-map/@name"/>
+ <eval expected="bar" xpath="//if:page-sequence/afp:tag-logical-element[@name = 'foo']/@value"/>
+
+ <!-- This just tests if extension attributes make it through to the PageSequence object. -->
+ <eval expected="this" xpath="//if:page-sequence/@fox:test-ignore" xmlns:fox="http://xmlgraphics.apache.org/fop/extensions"/>
</if-checks>
</testcase>
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org