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 2007/12/27 11:47:33 UTC

svn commit: r607034 [1/2] - in /xmlgraphics/fop/branches/Temp_ImagePackageRedesign: ./ src/documentation/content/xdocs/trunk/ src/java/org/apache/fop/apps/ src/java/org/apache/fop/area/ src/java/org/apache/fop/fo/ src/java/org/apache/fop/fo/extensions/...

Author: jeremias
Date: Thu Dec 27 02:47:12 2007
New Revision: 607034

URL: http://svn.apache.org/viewvc?rev=607034&view=rev
Log:
Merged revisions 604300-607033 via svnmerge from 
https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk

........
  r604475 | vhennebert | 2007-12-15 19:16:01 +0100 (Sa, 15 Dez 2007) | 2 lines
  
  Testcase for the resolution of collapsed and conditional borders in the FO tree
........
  r604678 | adelmelle | 2007-12-16 20:54:00 +0100 (So, 16 Dez 2007) | 8 lines
  
  Streamlining/Correction of the changes made in r603926
  - delegate validation of the fo:wrapper's children to the parent: added static FONode.validateChildNode()
  - narrow the condition for processing text-childnodes: 
    this is not only constrained to fo:flow and fo:static-content, but the same goes 
    for a fo:wrapper that is a direct descendant of a fo:block-container or fo:inline-container, 
    which only allow block-level content (interpretation)
  - minor javadoc fixups/improvements
........
  r604814 | vhennebert | 2007-12-17 11:21:04 +0100 (Mo, 17 Dez 2007) | 2 lines
  
  Organized imports
........
  r604965 | vhennebert | 2007-12-17 19:56:46 +0100 (Mo, 17 Dez 2007) | 2 lines
  
  Renaming GridUnitPart into the more accurate CellPart. Moreover I was always making the confusion between gup and pgu
........
  r604970 | vhennebert | 2007-12-17 20:05:27 +0100 (Mo, 17 Dez 2007) | 2 lines
  
  Simplified addAreasAndFlushRow: there can no longer be null GridUnits, every hole in the grid is now filled with an EmptyGridUnit
........
  r605195 | vhennebert | 2007-12-18 12:56:38 +0100 (Di, 18 Dez 2007) | 2 lines
  
  Reset previousRowsLength before a new row-group is handled
........
  r605246 | vhennebert | 2007-12-18 17:48:03 +0100 (Di, 18 Dez 2007) | 2 lines
  
  Simplification in RowPainter: avoid the use of an array to store rowOffsets and firstRow index for each part of the table (header, footer, body). One at a time is enough.
........
  r605253 | vhennebert | 2007-12-18 18:01:45 +0100 (Di, 18 Dez 2007) | 2 lines
  
  Renamed firstRow into firstRowIndex and moved its initialization into handeTableContentPosition
........
  r605295 | vhennebert | 2007-12-18 19:58:29 +0100 (Di, 18 Dez 2007) | 2 lines
  
  Streamlined the recording of row offsets, by replacing Map with a List. Fixed bug #43633 in the same time.
........
  r605297 | vhennebert | 2007-12-18 20:02:02 +0100 (Di, 18 Dez 2007) | 3 lines
  
  SVG support for AFP is an important addition IMO.
  IIUC it will have to be advertised in the next release as "Support for SVG images using primitive AFP graphics commands instead of bitmap images", or something like that?
........
  r605517 | vhennebert | 2007-12-19 12:47:38 +0100 (Mi, 19 Dez 2007) | 2 lines
  
  I said currentGU can no longer be null
........
  r605978 | jeremias | 2007-12-20 18:00:46 +0100 (Do, 20 Dez 2007) | 1 line
  
  Remove commented code.
........
  r606004 | jeremias | 2007-12-20 20:19:19 +0100 (Do, 20 Dez 2007) | 1 line
  
  Added support for scale-down-to-fit and scale-up-to-fit.
........
  r607032 | jeremias | 2007-12-27 11:34:15 +0100 (Do, 27 Dez 2007) | 4 lines
  
  Added new extension element: fox:external-document. It allows to add whole documents such as multi-page TIFF images to be inserted as peers to a page-sequence. Each image will make up an entire page. See the documentation for details. ATM, only single pages are possible. Multi-page images will be supported with the new image package.
  
  Some preparations for page-position="only" but the implementation is incomplete and "only" has no effect, yet. (Just uploaded some stuff I once started)
  Some javadoc cleanups.
........

Added:
    xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/GraphicsProperties.java
      - copied unchanged from r607032, xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/GraphicsProperties.java
    xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/extensions/ExternalDocument.java
      - copied unchanged from r607032, xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/extensions/ExternalDocument.java
    xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/pagination/AbstractPageSequence.java
      - copied unchanged from r607032, xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/AbstractPageSequence.java
    xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/layoutmgr/AbstractPageSequenceLayoutManager.java
      - copied unchanged from r607032, xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/AbstractPageSequenceLayoutManager.java
    xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/layoutmgr/ExternalDocumentLayoutManager.java
      - copied unchanged from r607032, xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/ExternalDocumentLayoutManager.java
    xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/layoutmgr/TopLevelLayoutManager.java
      - copied unchanged from r607032, xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/TopLevelLayoutManager.java
    xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/layoutmgr/inline/ImageLayout.java
      - copied unchanged from r607032, xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/ImageLayout.java
    xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/layoutmgr/table/CellPart.java
      - copied unchanged from r607032, xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/CellPart.java
    xmlgraphics/fop/branches/Temp_ImagePackageRedesign/test/fotree/unittests/table/collapsed-conditional-borders.fo
      - copied unchanged from r607032, xmlgraphics/fop/trunk/test/fotree/unittests/table/collapsed-conditional-borders.fo
    xmlgraphics/fop/branches/Temp_ImagePackageRedesign/test/fotree/unittests/table/collapsed-conditional-borders_header-footer.fo
      - copied unchanged from r607032, xmlgraphics/fop/trunk/test/fotree/unittests/table/collapsed-conditional-borders_header-footer.fo
    xmlgraphics/fop/branches/Temp_ImagePackageRedesign/test/fotree/unittests/table/collapsed-conditional-borders_test-generator.py
      - copied unchanged from r607032, xmlgraphics/fop/trunk/test/fotree/unittests/table/collapsed-conditional-borders_test-generator.py
    xmlgraphics/fop/branches/Temp_ImagePackageRedesign/test/java/org/apache/fop/fo/flow/table/CollapsedConditionalBorderTestCase.java
      - copied unchanged from r607032, xmlgraphics/fop/trunk/test/java/org/apache/fop/fo/flow/table/CollapsedConditionalBorderTestCase.java
    xmlgraphics/fop/branches/Temp_ImagePackageRedesign/test/layoutengine/standard-testcases/external-graphic_content-height_content-width_2.xml
      - copied unchanged from r607032, xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/external-graphic_content-height_content-width_2.xml
    xmlgraphics/fop/branches/Temp_ImagePackageRedesign/test/layoutengine/standard-testcases/fox_external-document_1.xml
      - copied unchanged from r607032, xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/fox_external-document_1.xml
    xmlgraphics/fop/branches/Temp_ImagePackageRedesign/test/layoutengine/standard-testcases/fox_external-document_2.xml
      - copied unchanged from r607032, xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/fox_external-document_2.xml
    xmlgraphics/fop/branches/Temp_ImagePackageRedesign/test/layoutengine/standard-testcases/table_row-span_missing-cell_bug43633.xml
      - copied unchanged from r607032, xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/table_row-span_missing-cell_bug43633.xml
Removed:
    xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/layoutmgr/table/GridUnitPart.java
Modified:
    xmlgraphics/fop/branches/Temp_ImagePackageRedesign/   (props changed)
    xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/documentation/content/xdocs/trunk/extensions.xml
    xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/apps/FormattingResults.java
    xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/area/AreaTreeHandler.java
    xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/area/RenderPagesModel.java
    xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/Constants.java
    xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/FOEventHandler.java
    xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/FONode.java
    xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/FOPropertyMapping.java
    xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/PropertyList.java
    xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/extensions/ExtensionElementMapping.java
    xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/flow/AbstractGraphics.java
    xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/flow/Wrapper.java
    xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/pagination/ConditionalPageMasterReference.java
    xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/pagination/PageSequence.java
    xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/pagination/PageSequenceMaster.java
    xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java
    xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterReference.java
    xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/pagination/Root.java
    xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/pagination/SinglePageMasterReference.java
    xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/pagination/SubSequenceSpecifier.java
    xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java
    xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/layoutmgr/LayoutManagerMaker.java
    xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/layoutmgr/LayoutManagerMapping.java
    xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/layoutmgr/Page.java
    xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/layoutmgr/PageProvider.java
    xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java
    xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/layoutmgr/inline/AbstractGraphicsLayoutManager.java
    xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/layoutmgr/inline/ExternalGraphicLayoutManager.java
    xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/layoutmgr/inline/InstreamForeignObjectLM.java
    xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/layoutmgr/table/ActiveCell.java
    xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/layoutmgr/table/RowPainter.java
    xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java
    xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/layoutmgr/table/TableContentPosition.java
    xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/layoutmgr/table/TableStepper.java
    xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/rtf/RTFHandler.java
    xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/xml/XMLRenderer.java
    xmlgraphics/fop/branches/Temp_ImagePackageRedesign/status.xml

Propchange: xmlgraphics/fop/branches/Temp_ImagePackageRedesign/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu Dec 27 02:47:12 2007
@@ -1 +1 @@
-/xmlgraphics/fop/trunk:1-604299
+/xmlgraphics/fop/trunk:1-607033

Modified: xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/documentation/content/xdocs/trunk/extensions.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/documentation/content/xdocs/trunk/extensions.xml?rev=607034&r1=607033&r2=607034&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/documentation/content/xdocs/trunk/extensions.xml (original)
+++ xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/documentation/content/xdocs/trunk/extensions.xml Thu Dec 27 02:47:12 2007
@@ -115,6 +115,79 @@
           or list-block.
         </p>
       </section>
+      <section id="external-document">
+        <title>fox:external-document</title>
+        <note>
+          This feature is incomplete. Support for multi-page documents will be added shortly.
+          At the moment, only single-page images will work. And this will not work with RTF output.
+        </note>
+        <p>
+          This is a proprietary extension element which allows to add whole images as pages to
+          an FO document. For example, if you have a scanned document or a fax as multi-page TIFF
+          file, you can append or insert this document using the <code>fox:external-document</code>
+          element. Each page of the external document will create one full page in the target
+          format.
+        </p>
+        <p>
+          The <code>fox:external-document</code> element is structurally a peer to
+          <code>fo:page-sequence</code>, so wherever you can put an <code>fo:page-sequence</code>
+          you could also place a <code>fox:external-document</code>.
+          Therefore, the specified contents for <code>fo:root</code> change to: 
+        </p>
+        <p>
+          <code>
+            (layout-master-set, declarations?, bookmark-tree?, (page-sequence|page-sequence-wrapper|fox:external-document)+)
+          </code>
+        </p>
+        <section>
+          <title>Specification</title>
+          <p>
+            The <code>fox:external-document</code> extension formatting object is used to specify
+            how to create a (sub-)sequence of pages within a document. The content of these pages
+            comes from the individual subimages/pages of an image or paged document (for example:
+            multi-page TIFF in the form of faxes or scanned documents, or PDF files). The
+            formatting object creates the necessary areas to display one image per page.
+          </p>
+          <p>
+            In terms of page numbers, the behaviour is the same as for
+            <code>fo:page-sequence</code>. The placement of the image inside the page is similar
+            to that of <code>fo:external-graphic</code> or <code>fo:instream-foreign-object</code>,
+            i.e. the viewport (and therefore the page size) is defined by either the intrinsic
+            size of the image or by the size properties that apply to this formatting object.
+          </p>
+          <p>Content: EMPTY</p>
+          <p>The following properties apply to this formatting object:</p>
+          <ul>
+            <li>(Common Accessibility Properties) (not implemented, yet)</li>
+            <li>(Common Aural Properties) (not implemented, yet)</li>
+            <li>block-progression-dimension</li>
+            <li>content-height</li>
+            <li>content-type</li>
+            <li>content-width</li>
+            <li>display-align</li>
+            <li>height</li>
+            <li>id</li>
+            <li>inline-progression-dimension</li>
+            <li>overflow</li>
+            <li>pages: &lt;page-set&gt; (see below) (not implemented, yet)</li>
+            <li>reference-orientation</li>
+            <li>scaling</li>
+            <li>scaling-method</li>
+            <li>src</li>
+            <li>text-align</li>
+            <li>width</li>
+          </ul>
+          <p>
+            Datatype "page-set": Value: auto | &lt;integer-range&gt;,
+            Default: "auto" which means all pages/subimages of the document.
+            &lt;integer-range&gt; allows values such as "7" or "1-3"
+          </p>
+          <note>
+            <code>fox:external-document</code> is not suitable for concatenating FO documents.
+            For this, XInclude is recommended.
+          </note>
+        </section>
+      </section>
     </section>
   </body>
 </document>

Modified: xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/apps/FormattingResults.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/apps/FormattingResults.java?rev=607034&r1=607033&r2=607034&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/apps/FormattingResults.java (original)
+++ xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/apps/FormattingResults.java Thu Dec 27 02:47:12 2007
@@ -21,7 +21,7 @@
 
 import java.util.List;
 
-import org.apache.fop.fo.pagination.PageSequence;
+import org.apache.fop.fo.pagination.AbstractPageSequence;
 
 /**
  * Class for reporting back formatting results to the calling application.
@@ -69,10 +69,10 @@
      * Reports the result of one page sequence rendering
      * back into this object.
      *
-     * @param pageSequence  the PageSequence which just completed rendering
+     * @param pageSequence  the page sequence which just completed rendering
      * @param pageCount     the number of pages rendered for that PageSequence
      */
-    public void haveFormattedPageSequence(PageSequence pageSequence, int pageCount) {
+    public void haveFormattedPageSequence(AbstractPageSequence pageSequence, int pageCount) {
         this.pageCount += pageCount;
         if (this.pageSequences == null) {
             this.pageSequences = new java.util.ArrayList();

Modified: xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/area/AreaTreeHandler.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/area/AreaTreeHandler.java?rev=607034&r1=607033&r2=607034&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/area/AreaTreeHandler.java (original)
+++ xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/area/AreaTreeHandler.java Thu Dec 27 02:47:12 2007
@@ -35,13 +35,17 @@
 import org.apache.fop.datatypes.Numeric;
 import org.apache.fop.fo.FOEventHandler;
 import org.apache.fop.fo.extensions.ExtensionAttachment;
+import org.apache.fop.fo.extensions.ExternalDocument;
 import org.apache.fop.fo.extensions.destination.Destination;
+import org.apache.fop.fo.pagination.AbstractPageSequence;
 import org.apache.fop.fo.pagination.PageSequence;
 import org.apache.fop.fo.pagination.Root;
 import org.apache.fop.fo.pagination.bookmarks.BookmarkTree;
+import org.apache.fop.layoutmgr.ExternalDocumentLayoutManager;
 import org.apache.fop.layoutmgr.LayoutManagerMaker;
 import org.apache.fop.layoutmgr.LayoutManagerMapping;
 import org.apache.fop.layoutmgr.PageSequenceLayoutManager;
+import org.apache.fop.layoutmgr.TopLevelLayoutManager;
 
 /**
  * Area tree handler for formatting objects.
@@ -78,7 +82,7 @@
     // The formatting results to be handed back to the caller.
     private FormattingResults results = new FormattingResults();
 
-    private PageSequenceLayoutManager prevPageSeqLM;
+    private TopLevelLayoutManager prevPageSeqLM;
 
     private int idGen = 0;
 
@@ -235,13 +239,39 @@
     }
 
     /**
+     * @see org.apache.fop.fo.FOEventHandler#startExternalDocument(org.apache.fop.fo.extensions.ExternalDocument)
+     */
+    public void startExternalDocument(ExternalDocument document) {
+        rootFObj = document.getRoot();
+        finishPrevPageSequence(document.getInitialPageNumber());
+        document.initPageNumber();
+    }
+
+    /**
+     * @see org.apache.fop.fo.FOEventHandler#endExternalDocument(org.apache.fop.fo.extensions.ExternalDocument)
+     */
+    public void endExternalDocument(ExternalDocument document) {
+        if (statistics != null) {
+            statistics.end();
+        }
+        
+        ExternalDocumentLayoutManager edLM;
+        edLM = getLayoutManagerMaker().makeExternalDocumentLayoutManager(this, document);
+        edLM.activateLayout();
+        // preserve the current PageSequenceLayoutManger for the
+        // force-page-count check at the beginning of the next PageSequence
+        prevPageSeqLM = edLM;
+        
+    }
+
+    /**
      * Called by the PageSequenceLayoutManager when it is finished with a
      * page-sequence.
      * 
      * @param pageSequence the page-sequence just finished
      * @param pageCount The number of pages generated for the page-sequence
      */
-    public void notifyPageSequenceFinished(PageSequence pageSequence,
+    public void notifyPageSequenceFinished(AbstractPageSequence pageSequence,
             int pageCount) {
         this.results.haveFormattedPageSequence(pageSequence, pageCount);
         if (log.isDebugEnabled()) {

Modified: xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/area/RenderPagesModel.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/area/RenderPagesModel.java?rev=607034&r1=607033&r2=607034&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/area/RenderPagesModel.java (original)
+++ xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/area/RenderPagesModel.java Thu Dec 27 02:47:12 2007
@@ -173,7 +173,7 @@
                     }
                 } catch (Exception e) {
                     // use error handler to handle this FOP or IO Exception
-                    log.error(e);
+                    log.error("Error while rendering page " + pageViewport.getPageIndex(), e);
                     if (e instanceof RuntimeException) {
                         throw (RuntimeException)e;
                     }

Modified: xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/Constants.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/Constants.java?rev=607034&r1=607033&r2=607034&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/Constants.java (original)
+++ xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/Constants.java Thu Dec 27 02:47:12 2007
@@ -1087,6 +1087,12 @@
     int EN_SMALL_CAPTION = 184;
     /** Enumeration constant -- font shorthand */
     int EN_STATUS_BAR = 185;
+    /** Enumeration constant -- for page-position, XSL 1.1 */
+    int EN_ONLY = 186; 
+    /** Enumeration constant -- for instream-foreign-object and external-graphic, XSL 1.1 */
+    int EN_SCALE_DOWN_TO_FIT = 187; 
+    /** Enumeration constant -- for instream-foreign-object and external-graphic, XSL 1.1 */
+    int EN_SCALE_UP_TO_FIT = 188; 
     /** Number of enumeration constants defined */
-    int ENUM_COUNT = 185;
+    int ENUM_COUNT = 188;
 }

Modified: xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/FOEventHandler.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/FOEventHandler.java?rev=607034&r1=607033&r2=607034&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/FOEventHandler.java (original)
+++ xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/FOEventHandler.java Thu Dec 27 02:47:12 2007
@@ -25,6 +25,7 @@
 import org.xml.sax.SAXException;
 
 import org.apache.fop.apps.FOUserAgent;
+import org.apache.fop.fo.extensions.ExternalDocument;
 import org.apache.fop.fo.flow.BasicLink;
 import org.apache.fop.fo.flow.Block;
 import org.apache.fop.fo.flow.BlockContainer;
@@ -555,6 +556,20 @@
      * @param length Portion of array to process.
      */
     public void characters(char data[], int start, int length) {
+    }
+
+    /**
+     * Process the start of the external-document extension.
+     * @param document the external-document node
+     */
+    public void startExternalDocument(ExternalDocument document) {
+    }
+
+    /**
+     * Process the end of the external-document extension.
+     * @param document the external-document node
+     */
+    public void endExternalDocument(ExternalDocument document) {
     }
 
 }

Modified: xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/FONode.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/FONode.java?rev=607034&r1=607033&r2=607034&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/FONode.java (original)
+++ xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/FONode.java Thu Dec 27 02:47:12 2007
@@ -45,6 +45,7 @@
 
     /** the XSL-FO namespace URI */
     protected static final String FO_URI = FOElementMapping.URI;
+    /** FOP's proprietary extension namespace URI */
     protected static final String FOX_URI = ExtensionElementMapping.URI;
 
     /** Parent FO node */
@@ -197,11 +198,13 @@
     /**
      * Checks to make sure, during SAX processing of input document, that the
      * incoming node is valid for the this (parent) node (e.g., checking to
-     * see that fo:table is not an immediate child of fo:root)
-     * called within FObj constructor
+     * see that <code>fo:table</code> is not an immediate child of <code>fo:root</code>)
+     * called from {@link FOTreeBuilder#startElement(String, String, String, Attributes)}
+     * before constructing the child {@link FObj}.
+     * 
      * @param loc location in the FO source file
      * @param namespaceURI namespace of incoming node
-     * @param localName (e.g. "table" for "fo:table")
+     * @param localName name of the incoming node (without namespace prefix)
      * @throws ValidationException if incoming node not valid for parent
      */
     protected void validateChildNode(Locator loc, String namespaceURI, String localName) 
@@ -210,6 +213,27 @@
     }
 
     /**
+     * Static version of {@link FONode#validateChildNode(Locator, String, String)} that
+     * can be used by subclasses that need to validate children against a different node
+     * (for example: <code>fo:wrapper</code> needs to check if the incoming node is a 
+     *  valid child to its parent)
+     *  
+     * @param fo    the FONode to validate against
+     * @param loc   location in the source file
+     * @param namespaceURI  namespace of the incoming node
+     * @param localName     name of the incoming node (without namespace prefix) 
+     * @throws ValidationException if the incoming node is not a valid child for the given FO
+     */
+    protected static void validateChildNode(
+                                FONode fo, 
+                                Locator loc, 
+                                String namespaceURI, 
+                                String localName) 
+            throws ValidationException {
+        fo.validateChildNode(loc, namespaceURI, localName);
+    }
+    
+    /**
      * Adds characters (does nothing here)
      * @param data array of characters containing text to be added
      * @param start starting array element to add
@@ -572,8 +596,8 @@
     }
     
     /**
-     * Returns the Constants class integer value of this node
-     * @return the integer enumeration of this FO (e.g., FO_ROOT)
+     * Returns the {@link Constants} class integer value of this node
+     * @return the integer enumeration of this FO (e.g. FO_ROOT)
      *      if a formatting object, FO_UNKNOWN_NODE otherwise
      */
     public int getNameId() {
@@ -632,6 +656,14 @@
         }
     }
     
+    /**
+     * This method is used when adding child nodes to a FO that already
+     * contains at least one child. In this case, the new child becomes a
+     * sibling to the previous one
+     * 
+     * @param precedingSibling  the previous child
+     * @param followingSibling  the new child
+     */
     protected static void attachSiblings(FONode precedingSibling, 
                                          FONode followingSibling) {
         if (precedingSibling.siblings == null) {
@@ -688,7 +720,7 @@
          * @return the last node in the list
          * @throws NoSuchElementException if the list is empty
          */
-        public FONode lastNode();        
+        public FONode lastNode();
 
     }
 }

Modified: xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/FOPropertyMapping.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/FOPropertyMapping.java?rev=607034&r1=607033&r2=607034&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/FOPropertyMapping.java (original)
+++ xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/FOPropertyMapping.java Thu Dec 27 02:47:12 2007
@@ -25,13 +25,13 @@
 import org.apache.fop.apps.FOUserAgent;
 import org.apache.fop.datatypes.LengthBase;
 import org.apache.fop.fo.expr.PropertyException;
+import org.apache.fop.fo.flow.table.TableFObj.ColumnNumberPropertyMaker;
 import org.apache.fop.fo.properties.BackgroundPositionShorthandParser;
 import org.apache.fop.fo.properties.BorderSpacingShorthandParser;
 import org.apache.fop.fo.properties.BorderWidthPropertyMaker;
 import org.apache.fop.fo.properties.BoxPropShorthandParser;
 import org.apache.fop.fo.properties.CharacterProperty;
 import org.apache.fop.fo.properties.ColorProperty;
-import org.apache.fop.fo.flow.table.TableFObj.ColumnNumberPropertyMaker;
 import org.apache.fop.fo.properties.CondLengthProperty;
 import org.apache.fop.fo.properties.CorrespondingPropertyMaker;
 import org.apache.fop.fo.properties.DimensionPropertyMaker;
@@ -1353,6 +1353,8 @@
         l.setInherited(false);
         l.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
         l.addEnum("scale-to-fit", getEnumProperty(EN_SCALE_TO_FIT, "SCALE_TO_FIT"));
+        l.addEnum("scale-down-to-fit", getEnumProperty(EN_SCALE_DOWN_TO_FIT, "SCALE_DOWN_TO_FIT"));
+        l.addEnum("scale-up-to-fit", getEnumProperty(EN_SCALE_UP_TO_FIT, "SCALE_UP_TO_FIT"));
         l.setDefault("auto");
         l.setPercentBase(LengthBase.IMAGE_INTRINSIC_HEIGHT);
         addPropertyMaker("content-height", l);
@@ -1362,6 +1364,8 @@
         l.setInherited(false);
         l.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
         l.addEnum("scale-to-fit", getEnumProperty(EN_SCALE_TO_FIT, "SCALE_TO_FIT"));
+        l.addEnum("scale-down-to-fit", getEnumProperty(EN_SCALE_DOWN_TO_FIT, "SCALE_DOWN_TO_FIT"));
+        l.addEnum("scale-up-to-fit", getEnumProperty(EN_SCALE_UP_TO_FIT, "SCALE_UP_TO_FIT"));
         l.setDefault("auto");
         l.setPercentBase(LengthBase.IMAGE_INTRINSIC_WIDTH);
         addPropertyMaker("content-width", l);
@@ -2223,6 +2227,7 @@
         m.addEnum("last", getEnumProperty(EN_LAST, "LAST"));
         m.addEnum("rest", getEnumProperty(EN_REST, "REST"));
         m.addEnum("any", getEnumProperty(EN_ANY, "ANY"));
+        m.addEnum("only", getEnumProperty(EN_ONLY, "ONLY")); //XSL 1.1
         m.setDefault("any");
         addPropertyMaker("page-position", m);
 

Modified: xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/PropertyList.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/PropertyList.java?rev=607034&r1=607033&r2=607034&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/PropertyList.java (original)
+++ xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/PropertyList.java Thu Dec 27 02:47:12 2007
@@ -20,6 +20,8 @@
 package org.apache.fop.fo;
 
 // Java
+import java.text.MessageFormat;
+
 import org.xml.sax.Attributes;
 
 import org.apache.commons.logging.Log;
@@ -355,9 +357,9 @@
         if (propId == -1 
                 || (subpropId == -1 
                         && findSubPropertyName(propertyName) != null)) {
-            StringBuffer errorMessage = new StringBuffer().append(
-                        "Invalid property name \'").append(propertyName);
-            handleInvalidProperty(errorMessage.toString(), propertyName);
+            String errorMessage = MessageFormat.format(
+                    "Invalid property name ''{0}''.", new Object[] {propertyName});
+            handleInvalidProperty(errorMessage, propertyName);
             return false;
         }
         return true;

Modified: xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/extensions/ExtensionElementMapping.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/extensions/ExtensionElementMapping.java?rev=607034&r1=607033&r2=607034&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/extensions/ExtensionElementMapping.java (original)
+++ xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/extensions/ExtensionElementMapping.java Thu Dec 27 02:47:12 2007
@@ -62,12 +62,19 @@
             foObjs.put("outline", new UnknownXMLObj.Maker(URI));
             foObjs.put("label", new UnknownXMLObj.Maker(URI));
             foObjs.put("destination", new DestinationMaker());
+            foObjs.put("external-document", new ExternalDocumentMaker());
         }
     }
     
     static class DestinationMaker extends ElementMapping.Maker {
         public FONode make(FONode parent) {
             return new Destination(parent);
+        }
+    }
+
+    static class ExternalDocumentMaker extends ElementMapping.Maker {
+        public FONode make(FONode parent) {
+            return new ExternalDocument(parent);
         }
     }
 

Modified: xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/flow/AbstractGraphics.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/flow/AbstractGraphics.java?rev=607034&r1=607033&r2=607034&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/flow/AbstractGraphics.java (original)
+++ xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/flow/AbstractGraphics.java Thu Dec 27 02:47:12 2007
@@ -23,6 +23,7 @@
 import org.apache.fop.datatypes.Length;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.GraphicsProperties;
 import org.apache.fop.fo.PropertyList;
 import org.apache.fop.fo.properties.CommonBorderPaddingBackground;
 import org.apache.fop.fo.properties.LengthRangeProperty;
@@ -32,7 +33,7 @@
  * Common base class for instream-foreign-object and external-graphics
  * flow formatting objects.
  */
-public abstract class AbstractGraphics extends FObj {
+public abstract class AbstractGraphics extends FObj implements GraphicsProperties {
     
     // The value of properties relevant for fo:instream-foreign-object
     // and external-graphics.
@@ -101,56 +102,6 @@
     }
 
     /**
-     * Given the ipd and the content width calculates the
-     * required x offset based on the text-align property
-     * @param ipd the inline-progression-dimension of the object
-     * @param cwidth the calculated content width of the object
-     * @return the X offset
-     */
-    public int computeXOffset (int ipd, int cwidth) {
-        int xoffset = 0;
-        switch (textAlign) {
-            case EN_CENTER:
-                xoffset = (ipd - cwidth) / 2;
-                break;
-            case EN_END:
-                xoffset = ipd - cwidth;
-                break;
-            case EN_START:
-                break;
-            case EN_JUSTIFY:
-            default:
-                break;
-        }
-        return xoffset;
-    }
-
-    /**
-     * Given the bpd and the content height calculates the
-     * required y offset based on the display-align property
-     * @param bpd the block-progression-dimension of the object
-     * @param cheight the calculated content height of the object
-     * @return the Y offset
-     */
-    public int computeYOffset(int bpd, int cheight) {
-        int yoffset = 0;
-        switch (displayAlign) {
-            case EN_BEFORE:
-                break;
-            case EN_AFTER:
-                yoffset = bpd - cheight;
-                break;
-            case EN_CENTER:
-                yoffset = (bpd - cheight) / 2;
-                break;
-            case EN_AUTO:
-            default:
-                break;
-        }
-        return yoffset;
-    }
-
-    /**
      * @return the "id" property.
      */
     public String getId() {
@@ -171,16 +122,12 @@
         return lineHeight;
     }
 
-    /**
-     * @return the "inline-progression-dimension" property.
-     */
+    /** {@inheritDoc} */
     public LengthRangeProperty getInlineProgressionDimension() {
         return inlineProgressionDimension;
     }
 
-    /**
-     * @return the "block-progression-dimension" property.
-     */
+    /** {@inheritDoc} */
     public LengthRangeProperty getBlockProgressionDimension() {
         return blockProgressionDimension;
     }
@@ -199,32 +146,34 @@
         return width;
     }
 
-    /**
-     * @return the "content-height" property.
-     */
+    /** {@inheritDoc} */
     public Length getContentHeight() {
         return contentHeight;
     }
 
-    /**
-     * @return the "content-width" property.
-     */
+    /** {@inheritDoc} */
     public Length getContentWidth() {
         return contentWidth;
     }
 
-    /**
-     * @return the "scaling" property.
-     */
+    /** {@inheritDoc} */
     public int getScaling() {
         return scaling;
     }
 
-    /**
-     * @return the "overflow" property.
-     */
+    /** {@inheritDoc} */
     public int getOverflow() {
         return overflow;
+    }
+
+    /** {@inheritDoc} */
+    public int getDisplayAlign() {
+        return displayAlign;
+    }
+
+    /** {@inheritDoc} */
+    public int getTextAlign() {
+        return textAlign;
     }
 
     /**

Modified: xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/flow/Wrapper.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/flow/Wrapper.java?rev=607034&r1=607033&r2=607034&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/flow/Wrapper.java (original)
+++ xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/flow/Wrapper.java Thu Dec 27 02:47:12 2007
@@ -24,7 +24,6 @@
 import org.apache.fop.fo.FObjMixed;
 import org.apache.fop.fo.PropertyList;
 import org.apache.fop.fo.ValidationException;
-import org.apache.fop.fo.pagination.Flow;
 import org.xml.sax.Locator;
 
 /**
@@ -38,49 +37,43 @@
     
     // used for FO validation
     private boolean blockOrInlineItemFound = false;
-    private boolean isFlowChild = false;
+    private boolean inlineChildrenAllowed = false;
 
     /**
      * @param parent FONode that is the parent of this object
      */
     public Wrapper(FONode parent) {
         super(parent);
-        /* Check if the fo:wrapper is a child of an fo:flow or fo:static-content
+        /* Check if the fo:wrapper is a child of a FO that allows mixed content
          * (or a descendant in nested fo:wrapper sequence, the first of which
-         *  is a child of an fo:flow or fo:static-content */
+         *  is a child of a FO that allows mixed content) */
         FONode ancestor = this.parent;
-        while (!(ancestor instanceof Flow)
-                && ancestor instanceof Wrapper) {
+        while (ancestor instanceof Wrapper) {
             ancestor = ancestor.getParent();
         }
-        if (ancestor instanceof Flow) {
-            this.isFlowChild = true;
+        if (ancestor instanceof FObjMixed ) {
+            inlineChildrenAllowed = true;
         }
     }
 
     /**
      * {@inheritDoc}
-     * XSL Content Model: marker* (#PCDATA|%inline;|%block;)*
-     * Additionally (unimplemented): "An fo:wrapper that is a child of an 
+     * <br>XSL Content Model: marker* (#PCDATA|%inline;|%block;)*
+     * <br><i>Additionally (unimplemented): "An fo:wrapper that is a child of an 
      * fo:multi-properties is only permitted to have children that would 
-     * be permitted in place of the fo:multi-properties."
+     * be permitted in place of the fo:multi-properties."</i>
      * 
      */
     protected void validateChildNode(Locator loc, String nsURI, String localName) 
         throws ValidationException {
-        if (FO_URI.equals(nsURI) && localName.equals("marker")) {
+        if (FO_URI.equals(nsURI) && "marker".equals(localName)) {
             if (blockOrInlineItemFound) {
                nodesOutOfOrderError(loc, "fo:marker", 
                     "(#PCDATA|%inline;|%block;)");
             }
         } else if (isBlockOrInlineItem(nsURI, localName)) {
-            if (isFlowChild
-                    && isInlineItem(nsURI, localName)
-                    && !isNeutralItem(nsURI, localName)) {
-                invalidChildError(loc, nsURI, localName,
-                        "fo:" + localName + " not allowed as child of an fo:wrapper "
-                        + "that is a child of an fo:flow or fo:static-content");
-            }
+            //delegate validation to parent
+            FONode.validateChildNode(this.parent, loc, nsURI, localName);
             blockOrInlineItemFound = true;
         } else {
             invalidChildError(loc, nsURI, localName);
@@ -94,9 +87,8 @@
                 int end, 
                 PropertyList pList, 
                 Locator locator) throws FOPException {
-        /* Only add text if the fo:wrapper is not a child of an fo:flow 
-         * or fo:static-content */
-        if (!this.isFlowChild) {
+        /* Only add text if the fo:wrapper's parent allows inline children */
+        if (this.inlineChildrenAllowed) {
             super.addCharacters(data, start, end, pList, locator);
         }
     }

Modified: xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/pagination/ConditionalPageMasterReference.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/pagination/ConditionalPageMasterReference.java?rev=607034&r1=607033&r2=607034&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/pagination/ConditionalPageMasterReference.java (original)
+++ xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/pagination/ConditionalPageMasterReference.java Thu Dec 27 02:47:12 2007
@@ -93,14 +93,20 @@
      * @param isFirstPage True if page is first page
      * @param isLastPage True if page is last page
      * @param isBlankPage True if page is blank
+     * @param isOnlyPage True if page is the only page
      * @return True if the conditions for this reference are met
      */
     protected boolean isValid(boolean isOddPage,
                               boolean isFirstPage,
                               boolean isLastPage,
+                              boolean isOnlyPage,
                               boolean isBlankPage) {
         // page-position
-        if (isFirstPage) {
+        if (isOnlyPage) {
+            if (pagePosition != EN_ONLY) {
+                return false;
+            }
+        } else if (isFirstPage) {
             if (pagePosition == EN_REST) {
                 return false;
             } else if (pagePosition == EN_LAST) {

Modified: xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/pagination/PageSequence.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/pagination/PageSequence.java?rev=607034&r1=607033&r2=607034&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/pagination/PageSequence.java (original)
+++ xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/pagination/PageSequence.java Thu Dec 27 02:47:12 2007
@@ -25,32 +25,22 @@
 import org.xml.sax.Locator;
 
 import org.apache.fop.apps.FOPException;
-import org.apache.fop.datatypes.Numeric;
 import org.apache.fop.fo.FONode;
-import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.PropertyList;
 import org.apache.fop.fo.ValidationException;
 
 /**
- * Implementation of the fo:page-sequence formatting object.
+ * Abstract base implementation for page sequences.
  */
-public class PageSequence extends FObj {
+public class PageSequence extends AbstractPageSequence {
     
     // The value of properties relevant for fo:page-sequence.
     private String country;
-    private String format;
     private String language;
-    private int letterValue;
-    private char groupingSeparator;
-    private int groupingSize;
-    private Numeric initialPageNumber;
-    private int forcePageCount;
     private String masterReference;
+    //private int writingMode; //XSL 1.1
     // End of property values
 
-    /** The parent root object */
-    private Root root;
-
     // There doesn't seem to be anything in the spec requiring flows
     // to be in the order given, only that they map to the regions
     // defined in the page sequence, so all we need is this one hashmap
@@ -59,9 +49,6 @@
     /** Map of flows to their flow name (flow-name, Flow) */
     private Map flowMap;
 
-    private int startingPageNumber = 0;
-    private PageNumberGenerator pageNumberGenerator;
-
     /**
      * The currentSimplePageMaster is either the page master for the
      * whole page sequence if master-reference refers to a simple-page-master,
@@ -97,14 +84,9 @@
     public void bind(PropertyList pList) throws FOPException {
         super.bind(pList);
         country = pList.get(PR_COUNTRY).getString();
-        format = pList.get(PR_FORMAT).getString();
         language = pList.get(PR_LANGUAGE).getString();
-        letterValue = pList.get(PR_LETTER_VALUE).getEnum();
-        groupingSeparator = pList.get(PR_GROUPING_SEPARATOR).getCharacter();
-        groupingSize = pList.get(PR_GROUPING_SIZE).getNumber().intValue();
-        initialPageNumber = pList.get(PR_INITIAL_PAGE_NUMBER).getNumeric();
-        forcePageCount = pList.get(PR_FORCE_PAGE_COUNT).getEnum();
         masterReference = pList.get(PR_MASTER_REFERENCE).getString();
+        //writingMode = pList.getWritingMode();
         
         if (masterReference == null || masterReference.equals("")) {
             missingPropertyError("master-reference");
@@ -116,13 +98,12 @@
      */
     protected void startOfNode() throws FOPException {
         super.startOfNode();
-        this.root = (Root) parent;
         flowMap = new java.util.HashMap();
 
-        this.simplePageMaster = root.getLayoutMasterSet().getSimplePageMaster(masterReference);
+        this.simplePageMaster = getRoot().getLayoutMasterSet().getSimplePageMaster(masterReference);
         if (this.simplePageMaster == null) {
             this.pageSequenceMaster
-                    = root.getLayoutMasterSet().getPageSequenceMaster(masterReference);
+                    = getRoot().getLayoutMasterSet().getPageSequenceMaster(masterReference);
             if (this.pageSequenceMaster == null) {
                 throw new ValidationException("master-reference '" + masterReference
                    + "' for fo:page-sequence matches no"
@@ -130,9 +111,6 @@
             }
         }
 
-        this.pageNumberGenerator = new PageNumberGenerator(
-                format, groupingSeparator, groupingSize, letterValue);
-
         getFOEventHandler().startPageSequence(this);
     }
 
@@ -211,7 +189,7 @@
                 + "\" found within fo:page-sequence", flow.getLocator());
         }
 
-        if (!root.getLayoutMasterSet().regionNameExists(flowName) 
+        if (!getRoot().getLayoutMasterSet().regionNameExists(flowName) 
             && !flowName.equals("xsl-before-float-separator") 
             && !flowName.equals("xsl-footnote-separator")) {
                 throw new ValidationException("flow-name \""
@@ -221,31 +199,6 @@
         }
     }
 
-    /**
-     * Initialize the current page number for the start of the page sequence.
-     */
-    public void initPageNumber() {
-        int pageNumberType = 0;
-        
-        if (initialPageNumber.getEnum() != 0) {
-            // auto | auto-odd | auto-even.
-            startingPageNumber = root.getEndingPageNumberOfPreviousSequence() + 1;
-            pageNumberType = initialPageNumber.getEnum();
-            if (pageNumberType == EN_AUTO_ODD) {
-                if (startingPageNumber % 2 == 0) {
-                    startingPageNumber++;
-                }
-            } else if (pageNumberType == EN_AUTO_EVEN) {
-                if (startingPageNumber % 2 == 1) {
-                    startingPageNumber++;
-                }
-            }
-        } else { // <integer> for explicit page number
-            int pageStart = initialPageNumber.getValue();
-            startingPageNumber = (pageStart > 0) ? pageStart : 1; // spec rule
-        }
-    }
-
 //     /**
 //      * Returns true when there is more flow elements left to lay out.
 //      */
@@ -306,15 +259,6 @@
 //          return false;
 //      }
 
-    /**
-     * Get the starting page number for this page sequence.
-     *
-     * @return the starting page number
-     */
-    public int getStartingPageNumber() {
-        return startingPageNumber;
-    }
-
 //     private void forcePage(AreaTree areaTree, int firstAvailPageNumber) {
 //         boolean makePage = false;
 //         if (this.forcePageCount == ForcePageCount.AUTO) {
@@ -433,6 +377,8 @@
      *      page sequence
      * @param isLastPage indicator whether this page is the last page of the
      *      page sequence
+     * @param isOnlyPage indicator whether this page is the only page of the
+     *      page sequence
      * @param isBlank indicator whether the page will be blank
      * @return the SimplePageMaster to use for this page
      * @throws FOPException if there's a problem determining the page master
@@ -440,6 +386,7 @@
     public SimplePageMaster getNextSimplePageMaster(int page, 
             boolean isFirstPage,  
             boolean isLastPage,  
+            boolean isOnlyPage,
             boolean isBlank) throws FOPException {
 
         if (pageSequenceMaster == null) {
@@ -450,11 +397,12 @@
             log.debug("getNextSimplePageMaster(page=" + page
                     + " isOdd=" + isOddPage 
                     + " isFirst=" + isFirstPage 
-                    + " isLast=" + isLastPage 
+                    + " isLast=" + isLastPage
+                    + " isOnly=" + isOnlyPage
                     + " isBlank=" + isBlank + ")");
         }
         return pageSequenceMaster.getNextSimplePageMaster(isOddPage, 
-            isFirstPage, isLastPage, isBlank);
+            isFirstPage, isLastPage, isOnlyPage, isBlank);
     }
 
     /**
@@ -478,24 +426,15 @@
         }
     }
     
-    /**
-     * Retrieves the string representation of a page number applicable
-     * for this page sequence
-     * @param pageNumber the page number
-     * @return string representation of the page number
-     */
-    public String makeFormattedPageNumber(int pageNumber) {
-        return pageNumberGenerator.makeFormattedPageNumber(pageNumber);
-    }
-
-    /**
-     * Public accessor for the ancestor Root.
-     * @return the ancestor Root
-     */
-    public Root getRoot() {
-        return root;
+    /** @return true if the page-sequence has a page-master with page-position="only" */
+    public boolean hasPagePositionOnly() {
+        if (pageSequenceMaster == null) {
+            return false;
+        } else {
+            return pageSequenceMaster.hasPagePositionOnly();
+        }
     }
-
+    
     /** @return the "master-reference" property. */
     public String getMasterReference() {
         return masterReference;
@@ -509,16 +448,6 @@
     /** {@inheritDoc} */
     public int getNameId() {
         return FO_PAGE_SEQUENCE;
-    }
-    
-    /** @return the force-page-count value */
-    public int getForcePageCount() {
-        return forcePageCount;
-    }
-
-    /** @return the initial-page-number property value */
-    public Numeric getInitialPageNumber() {
-        return initialPageNumber;
     }
     
     /** @return the country property value */

Modified: xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/pagination/PageSequenceMaster.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/pagination/PageSequenceMaster.java?rev=607034&r1=607033&r2=607034&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/pagination/PageSequenceMaster.java (original)
+++ xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/pagination/PageSequenceMaster.java Thu Dec 27 02:47:12 2007
@@ -171,11 +171,21 @@
         }
     }
     
+    /** @return true if the page-sequence-master has a page-master with page-position="only" */
+    public boolean hasPagePositionOnly() {
+        if (currentSubSequence != null) {
+            return currentSubSequence.hasPagePositionOnly();
+        } else {
+            return false;
+        }
+    }
+    
     /**
      * Returns the next simple-page-master.
      * @param isOddPage True if the next page number is odd
      * @param isFirstPage True if the next page is the first
      * @param isLastPage True if the next page is the last
+     * @param isOnlyPage True if the next page is the only page
      * @param isBlankPage True if the next page is blank
      * @return the requested page master
      * @throws FOPException if there's a problem determining the next page master
@@ -183,6 +193,7 @@
     public SimplePageMaster getNextSimplePageMaster(boolean isOddPage,
                                                     boolean isFirstPage,
                                                     boolean isLastPage,
+                                                    boolean isOnlyPage,
                                                     boolean isBlankPage)
                                                       throws FOPException {
         if (currentSubSequence == null) {
@@ -193,7 +204,7 @@
             }
         }
         String pageMasterName = currentSubSequence
-            .getNextPageMasterName(isOddPage, isFirstPage, isLastPage, isBlankPage);
+            .getNextPageMasterName(isOddPage, isFirstPage, isLastPage, isOnlyPage, isBlankPage);
         boolean canRecover = true;
         while (pageMasterName == null) {
             SubSequenceSpecifier nextSubSequence = getNextSubSequence();
@@ -212,7 +223,7 @@
                 currentSubSequence = nextSubSequence;
             }
             pageMasterName = currentSubSequence
-                .getNextPageMasterName(isOddPage, isFirstPage, isLastPage, isBlankPage);
+                .getNextPageMasterName(isOddPage, isFirstPage, isLastPage, isOnlyPage, isBlankPage);
         }
         SimplePageMaster pageMaster = this.layoutMasterSet
             .getSimplePageMaster(pageMasterName);

Modified: xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java?rev=607034&r1=607033&r2=607034&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java (original)
+++ xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java Thu Dec 27 02:47:12 2007
@@ -49,6 +49,7 @@
 
     private List conditionalPageMasterRefs;
     private boolean hasPagePositionLast = false;
+    private boolean hasPagePositionOnly = false;
 
     /**
      * @see org.apache.fop.fo.FONode#FONode(FONode)
@@ -124,6 +125,7 @@
     public String getNextPageMasterName(boolean isOddPage,
                                         boolean isFirstPage,
                                         boolean isLastPage,
+                                        boolean isOnlyPage,
                                         boolean isBlankPage) {
         if (getMaximumRepeats() != INFINITE) {
             if (numberConsumed < getMaximumRepeats()) {
@@ -138,7 +140,7 @@
         for (int i = 0; i < conditionalPageMasterRefs.size(); i++) {
             ConditionalPageMasterReference cpmr
                 = (ConditionalPageMasterReference)conditionalPageMasterRefs.get(i);
-            if (cpmr.isValid(isOddPage, isFirstPage, isLastPage, isBlankPage)) {
+            if (cpmr.isValid(isOddPage, isFirstPage, isLastPage, isOnlyPage, isBlankPage)) {
                 return cpmr.getMasterReference();
             }
         }
@@ -155,6 +157,9 @@
         if (cpmr.getPagePosition() == EN_LAST) {
             this.hasPagePositionLast = true;
         }
+        if (cpmr.getPagePosition() == EN_ONLY) {
+            this.hasPagePositionOnly = true;
+        }
     }
 
     /** {@inheritDoc} */
@@ -178,6 +183,12 @@
     }
     
     /** {@inheritDoc} */
+    /** @see org.apache.fop.fo.pagination.SubSequenceSpecifier#hasPagePositionOnly() */
+    public boolean hasPagePositionOnly() {
+        return this.hasPagePositionOnly;
+    }
+    
+    /** @see org.apache.fop.fo.FONode#getLocalName() */
     public String getLocalName() {
         return "repeatable-page-master-alternatives";
     }

Modified: xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterReference.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterReference.java?rev=607034&r1=607033&r2=607034&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterReference.java (original)
+++ xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterReference.java Thu Dec 27 02:47:12 2007
@@ -93,6 +93,7 @@
     public String getNextPageMasterName(boolean isOddPage,
                                         boolean isFirstPage,
                                         boolean isLastPage,
+                                        boolean isOnlyPage,
                                         boolean isEmptyPage) {
         if (getMaximumRepeats() != INFINITE) {
             if (numberConsumed < getMaximumRepeats()) {
@@ -141,6 +142,11 @@
     }
 
     /** {@inheritDoc} */
+    public boolean hasPagePositionOnly() {
+        return false;
+    }
+
+    /** {@inheritDoc} */
     public String getLocalName() {
         return "repeatable-page-master-reference";
     }
@@ -149,5 +155,6 @@
     public int getNameId() {
         return FO_REPEATABLE_PAGE_MASTER_REFERENCE;
     }
+
 
 }

Modified: xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/pagination/Root.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/pagination/Root.java?rev=607034&r1=607033&r2=607034&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/pagination/Root.java (original)
+++ xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/pagination/Root.java Thu Dec 27 02:47:12 2007
@@ -25,6 +25,7 @@
 import org.xml.sax.Locator;
 
 import org.apache.fop.apps.FOPException;
+import org.apache.fop.fo.ElementMapping;
 import org.apache.fop.fo.FOEventHandler;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FObj;
@@ -85,7 +86,7 @@
     protected void endOfNode() throws FOPException {
         if (!pageSequenceFound || layoutMasterSet == null) {
             missingChildElementError("(layout-master-set, declarations?, " + 
-                "bookmark-tree?, page-sequence+)");
+                "bookmark-tree?, (page-sequence+|fox:external-document))");
         }
     }
 
@@ -129,7 +130,21 @@
                 invalidChildError(loc, nsURI, localName);
             }
         } else {
-            invalidChildError(loc, nsURI, localName);
+            if (FOX_URI.equals(nsURI)) {
+                if ("external-document".equals(localName)) {
+                    pageSequenceFound = true;
+                }
+            }
+            //invalidChildError(loc, nsURI, localName);
+            //Ignore non-FO elements under root
+        }
+    }
+    
+
+    /** @inheritDoc */
+    protected void validateChildNode(Locator loc, FONode child) throws ValidationException {
+        if (child instanceof AbstractPageSequence) {
+            pageSequenceFound = true;
         }
     }
 

Modified: xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/pagination/SinglePageMasterReference.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/pagination/SinglePageMasterReference.java?rev=607034&r1=607033&r2=607034&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/pagination/SinglePageMasterReference.java (original)
+++ xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/pagination/SinglePageMasterReference.java Thu Dec 27 02:47:12 2007
@@ -85,6 +85,7 @@
     public String getNextPageMasterName(boolean isOddPage,
                                         boolean isFirstPage,
                                         boolean isLastPage,
+                                        boolean isOnlyPage,
                                         boolean isEmptyPage) {
         if (this.state == FIRST) {
             this.state = DONE;
@@ -117,6 +118,11 @@
     }
 
     /** {@inheritDoc} */
+    public boolean hasPagePositionOnly() {
+        return false;
+    }
+    
+    /** {@inheritDoc} */
     public String getLocalName() {
         return "single-page-master-reference";
     }
@@ -125,5 +131,6 @@
     public int getNameId() {
         return FO_SINGLE_PAGE_MASTER_REFERENCE;
     }
+
 }
 

Modified: xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/pagination/SubSequenceSpecifier.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/pagination/SubSequenceSpecifier.java?rev=607034&r1=607033&r2=607034&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/pagination/SubSequenceSpecifier.java (original)
+++ xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/fo/pagination/SubSequenceSpecifier.java Thu Dec 27 02:47:12 2007
@@ -32,6 +32,7 @@
      * @param isOddPage True if the next page number is odd
      * @param isFirstPage True if the next page is the first
      * @param isLastPage True if the next page is the last
+     * @param isOnlyPage True if the next page is the only page
      * @param isBlankPage True if the next page is blank
      * @return the page master name
      * @throws FOPException if there's a problem determining the next page master
@@ -39,6 +40,7 @@
     String getNextPageMasterName(boolean isOddPage,
                                  boolean isFirstPage,
                                  boolean isLastPage,
+                                 boolean isOnlyPage,
                                  boolean isBlankPage)
                                     throws FOPException;
 
@@ -56,6 +58,9 @@
 
     /** @return true if the subsequence has a page master for page-position "last" */
     boolean hasPagePositionLast();
+    
+    /** @return true if the subsequence has a page master for page-position "only" */
+    boolean hasPagePositionOnly();
     
 }
 

Modified: xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java?rev=607034&r1=607033&r2=607034&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java (original)
+++ xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java Thu Dec 27 02:47:12 2007
@@ -224,9 +224,7 @@
         return newLMs;
     }
 
-    /**
-     * {@inheritDoc}
-     */
+    /** {@inheritDoc} */
     public PageSequenceLayoutManager getPSLM() {
         return parentLM.getPSLM();
     }

Modified: xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/layoutmgr/LayoutManagerMaker.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/layoutmgr/LayoutManagerMaker.java?rev=607034&r1=607033&r2=607034&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/layoutmgr/LayoutManagerMaker.java (original)
+++ xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/layoutmgr/LayoutManagerMaker.java Thu Dec 27 02:47:12 2007
@@ -20,6 +20,7 @@
 
 import java.util.List;
 import org.apache.fop.fo.FONode;
+import org.apache.fop.fo.extensions.ExternalDocument;
 import org.apache.fop.fo.pagination.Flow;
 import org.apache.fop.fo.pagination.PageSequence;
 import org.apache.fop.fo.pagination.SideRegion;
@@ -60,6 +61,15 @@
      */
     public PageSequenceLayoutManager makePageSequenceLayoutManager(
         AreaTreeHandler ath, PageSequence ps);
+
+    /**
+     * Make a ExternalDocumentLayoutManager object for the fox:external-document extension.
+     * @param ath the AreaTreeHandler object the external-document interacts with
+     * @param ed the fox:external-document object to be processed
+     * @return The created ExternalDocumentLayoutManager object
+     */
+    public ExternalDocumentLayoutManager makeExternalDocumentLayoutManager(
+        AreaTreeHandler ath, ExternalDocument ed);
 
     /**
      * Make a FlowLayoutManager object.

Modified: xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/layoutmgr/LayoutManagerMapping.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/layoutmgr/LayoutManagerMapping.java?rev=607034&r1=607033&r2=607034&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/layoutmgr/LayoutManagerMapping.java (original)
+++ xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/layoutmgr/LayoutManagerMapping.java Thu Dec 27 02:47:12 2007
@@ -32,6 +32,7 @@
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FOText;
 import org.apache.fop.fo.FObjMixed;
+import org.apache.fop.fo.extensions.ExternalDocument;
 import org.apache.fop.fo.flow.BasicLink;
 import org.apache.fop.fo.flow.BidiOverride;
 import org.apache.fop.fo.flow.Block;
@@ -403,6 +404,11 @@
                 makeLayoutManagers(child, lms);
             }
         }       
+    }
+
+    public ExternalDocumentLayoutManager makeExternalDocumentLayoutManager(
+        AreaTreeHandler ath, ExternalDocument ed) {
+        return new ExternalDocumentLayoutManager(ath, ed);
     }
 
 }

Modified: xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/layoutmgr/Page.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/layoutmgr/Page.java?rev=607034&r1=607033&r2=607034&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/layoutmgr/Page.java (original)
+++ xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/layoutmgr/Page.java Thu Dec 27 02:47:12 2007
@@ -19,6 +19,8 @@
 
 package org.apache.fop.layoutmgr;
 
+import java.awt.geom.Rectangle2D;
+
 import org.apache.fop.area.PageViewport;
 import org.apache.fop.fo.pagination.SimplePageMaster;
 
@@ -43,6 +45,18 @@
     public Page(SimplePageMaster spm, int pageNumber, String pageNumberStr, boolean blank) {
         this.spm = spm;
         this.pageViewport = new PageViewport(spm, pageNumber, pageNumberStr, blank);
+    }
+    
+    /**
+     * Auxiliary constructor used when there's no SimplePageMaster.
+     * @param viewArea the view area of the page
+     * @param pageNumber the page number (as an int)
+     * @param pageNumberStr the page number (as a String) 
+     * @param blank true if this is a blank page
+     */
+    public Page(Rectangle2D viewArea, int pageNumber, String pageNumberStr, boolean blank) {
+        this.spm = null;
+        this.pageViewport = new PageViewport(viewArea, pageNumber, pageNumberStr, null, blank);
     }
     
     /** @return the simple-page-master that created this page */

Modified: xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/layoutmgr/PageProvider.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/layoutmgr/PageProvider.java?rev=607034&r1=607033&r2=607034&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/layoutmgr/PageProvider.java (original)
+++ xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/layoutmgr/PageProvider.java Thu Dec 27 02:47:12 2007
@@ -252,7 +252,7 @@
         try {
             String pageNumberString = pageSeq.makeFormattedPageNumber(index);
             SimplePageMaster spm = pageSeq.getNextSimplePageMaster(
-                    index, (startPageOfPageSequence == index), isLastPage, isBlank);
+                    index, (startPageOfPageSequence == index), isLastPage, false, isBlank);
                 
             Region body = spm.getRegion(FO_REGION_BODY);
             if (!pageSeq.getMainFlow().getFlowName().equals(body.getRegionName())) {



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org