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 me...@apache.org on 2012/08/24 16:50:54 UTC

svn commit: r1376950 - in /xmlgraphics/fop/trunk: ./ src/documentation/content/xdocs/trunk/ src/java/org/apache/fop/afp/ src/java/org/apache/fop/afp/modca/ src/java/org/apache/fop/afp/modca/triplets/ src/java/org/apache/fop/fo/ src/java/org/apache/fop/...

Author: mehdi
Date: Fri Aug 24 14:50:54 2012
New Revision: 1376950

URL: http://svn.apache.org/viewvc?rev=1376950&view=rev
Log:
Bugzilla#48954: Support for character encoding of TLEs in AFP output. Submitted by PH.

Added:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/triplets/EncodingTriplet.java   (with props)
Removed:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/TagLogicalElementBean.java
Modified:
    xmlgraphics/fop/trunk/src/documentation/content/xdocs/trunk/output.xml
    xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/DataStream.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/Factory.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/AbstractPageObject.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/PageGroup.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/TagLogicalElement.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FONode.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/AFPDocumentHandler.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/extensions/AFPExtensionHandler.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/extensions/AFPPageSetup.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/extensions/AFPPageSetupElement.java
    xmlgraphics/fop/trunk/status.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=1376950&r1=1376949&r2=1376950&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/documentation/content/xdocs/trunk/output.xml (original)
+++ xmlgraphics/fop/trunk/src/documentation/content/xdocs/trunk/output.xml Fri Aug 24 14:50:54 2012
@@ -971,7 +971,8 @@ Note that the value of the encoding attr
      xmlns:afp="http://xmlgraphics.apache.org/fop/extensions/afp">
       <fo:layout-master-set>
         <fo:simple-page-master master-name="simple">
-          <afp:tag-logical-element name="The TLE Name" value="The TLE Value" />
+          <afp:tag-logical-element name="The TLE Name" value="The TLE Value"
+            encoding="500" />
           <fo:region-body/>
         </fo:simple-page-master>
       </fo:layout-master-set>
@@ -985,7 +986,7 @@ Note that the value of the encoding attr
           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.
+          page-sequence are allowed. The name and value attributes are mandatory.  The encoding attribute specifying a CCSID encoding is optional.  
         </p>
       </section>
       <section id="afp-no-operation">

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/DataStream.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/DataStream.java?rev=1376950&r1=1376949&r2=1376950&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/DataStream.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/DataStream.java Fri Aug 24 14:50:54 2012
@@ -40,7 +40,7 @@ import org.apache.fop.afp.modca.Overlay;
 import org.apache.fop.afp.modca.PageGroup;
 import org.apache.fop.afp.modca.PageObject;
 import org.apache.fop.afp.modca.ResourceGroup;
-import org.apache.fop.afp.modca.TagLogicalElementBean;
+import org.apache.fop.afp.modca.TagLogicalElement;
 import org.apache.fop.afp.modca.triplets.FullyQualifiedNameTriplet;
 import org.apache.fop.afp.ptoca.PtocaBuilder;
 import org.apache.fop.afp.ptoca.PtocaProducer;
@@ -90,7 +90,7 @@ public class DataStream {
 
     /** The MO:DCA interchange set in use (default to MO:DCA-P IS/2 set) */
     private InterchangeSet interchangeSet
-        = InterchangeSet.valueOf(InterchangeSet.MODCA_PRESENTATION_INTERCHANGE_SET_2);
+    = InterchangeSet.valueOf(InterchangeSet.MODCA_PRESENTATION_INTERCHANGE_SET_2);
 
     private final Factory factory;
 
@@ -544,17 +544,19 @@ public class DataStream {
         currentPage.createIncludePageSegment(name, xOrigin, yOrigin, createHardPageSegments);
     }
 
+
+
     /**
      * Creates a TagLogicalElement on the current page.
      *
      * @param attributes
      *            the array of key value pairs.
      */
-    public void createPageTagLogicalElement(TagLogicalElementBean[] attributes) {
+
+    public void createPageTagLogicalElement(TagLogicalElement.State[] attributes) {
         for (int i = 0; i < attributes.length; i++) {
-            String name = attributes[i].getKey();
-            String value = attributes[i].getValue();
-            currentPage.createTagLogicalElement(name, value, tleSequence++);
+
+            currentPage.createTagLogicalElement(attributes[i], tleSequence++);
         }
     }
 
@@ -564,11 +566,9 @@ public class DataStream {
      * @param attributes
      *            the array of key value pairs.
      */
-    public void createPageGroupTagLogicalElement(TagLogicalElementBean[] attributes) {
+    public void createPageGroupTagLogicalElement(TagLogicalElement.State[] attributes) {
         for (int i = 0; i < attributes.length; i++) {
-            String name = attributes[i].getKey();
-            String value = attributes[i].getValue();
-            currentPageGroup.createTagLogicalElement(name, value);
+            currentPageGroup.createTagLogicalElement(attributes[i]);
         }
     }
 
@@ -579,12 +579,17 @@ public class DataStream {
      *            The tag name
      * @param value
      *            The tag value
+     * @param encoding The CCSID character set encoding
      */
-    public void createTagLogicalElement(String name, String value) {
+    public void createTagLogicalElement(String name, String value, int encoding) {
+
+        TagLogicalElement.State tleState = new  TagLogicalElement.State(name, value, encoding);
         if (currentPage != null) {
-            currentPage.createTagLogicalElement(name, value, tleSequence++);
+
+            currentPage.createTagLogicalElement(tleState, tleSequence++);
+
         } else {
-            currentPageGroup.createTagLogicalElement(name, value);
+            currentPageGroup.createTagLogicalElement(tleState);
         }
     }
 

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/Factory.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/Factory.java?rev=1376950&r1=1376949&r2=1376950&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/Factory.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/Factory.java Fri Aug 24 14:50:54 2012
@@ -374,13 +374,13 @@ public class Factory {
     /**
      * Creates a MO:DCA {@link TagLogicalElement}
      *
-     * @param name name of the element
-     * @param value value of the element
+     * @param state the attribute state for the TLE
      * @param tleSequence current start tle sequence number within stream*
      * @return a new {@link TagLogicalElement}
      */
-    public TagLogicalElement createTagLogicalElement(String name, String value, int tleSequence) {
-        TagLogicalElement tle = new TagLogicalElement(name, value, tleSequence);
+    public TagLogicalElement createTagLogicalElement(TagLogicalElement.State state,
+            int tleSequence) {
+        TagLogicalElement tle = new TagLogicalElement(state, tleSequence);
         return tle;
     }
 

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/AbstractPageObject.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/AbstractPageObject.java?rev=1376950&r1=1376949&r2=1376950&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/AbstractPageObject.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/AbstractPageObject.java Fri Aug 24 14:50:54 2012
@@ -223,19 +223,16 @@ public abstract class AbstractPageObject
     /**
      * Creates a TagLogicalElement on the page.
      *
-     * @param name
-     *            the name of the tag
-     * @param value
-     *            the value of the tag
-     * @param tleID
-     *            unique ID within AFP stream
+     * @param state the state of the TLE
+     * @param tleID the id of the TLE
      */
-    public void createTagLogicalElement(String name, String value, int tleID) {
-        TagLogicalElement tle = new TagLogicalElement(name, value, tleID);
+    public void createTagLogicalElement(TagLogicalElement.State state, int tleID) {
+        TagLogicalElement tle = new TagLogicalElement(state, tleID);
         List list = getTagLogicalElements();
         list.add(tle);
     }
 
+
     /**
      * Creates a NoOperation on the page.
      *

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/PageGroup.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/PageGroup.java?rev=1376950&r1=1376949&r2=1376950&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/PageGroup.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/PageGroup.java Fri Aug 24 14:50:54 2012
@@ -55,13 +55,11 @@ public class PageGroup extends AbstractR
     /**
      * Creates a TagLogicalElement on the page.
      *
-     * @param name
-     *            the name of the tag
-     * @param value
-     *            the value of the tag
+     * @param state
+     *              the state of the TLE
      */
-    public void createTagLogicalElement(String name, String value) {
-        TagLogicalElement tle = factory.createTagLogicalElement(name, value, tleSequence);
+    public void createTagLogicalElement(TagLogicalElement.State state) {
+        TagLogicalElement tle = factory.createTagLogicalElement(state, tleSequence);
         if (!getTagLogicalElements().contains(tle)) {
             getTagLogicalElements().add(tle);
             tleSequence++;

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/TagLogicalElement.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/TagLogicalElement.java?rev=1376950&r1=1376949&r2=1376950&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/TagLogicalElement.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/TagLogicalElement.java Fri Aug 24 14:50:54 2012
@@ -24,6 +24,7 @@ import java.io.OutputStream;
 
 import org.apache.fop.afp.modca.triplets.AttributeQualifierTriplet;
 import org.apache.fop.afp.modca.triplets.AttributeValueTriplet;
+import org.apache.fop.afp.modca.triplets.EncodingTriplet;
 import org.apache.fop.afp.modca.triplets.FullyQualifiedNameTriplet;
 import org.apache.fop.afp.util.BinaryUtils;
 
@@ -49,15 +50,9 @@ import org.apache.fop.afp.util.BinaryUti
 public class TagLogicalElement extends AbstractTripletStructuredObject {
 
     /**
-     * Name of the key, used within the TLE
+     * the params of the TLE
      */
-    private String name = null;
-
-    /**
-     * Value returned by the key
-     */
-    private String value = null;
-
+    private State state;
     /**
      * Sequence of TLE within document
      */
@@ -66,25 +61,26 @@ public class TagLogicalElement extends A
     /**
      * Construct a tag logical element with the name and value specified.
      *
-     * @param name the name of the tag logical element
-     * @param value the value of the tag logical element
+     * @param state the state of the tag logical element
      * @param tleID unique identifier for TLE within AFP stream
      */
-    public TagLogicalElement(String name, String value, int tleID) {
-        this.name = name;
-        this.value = value;
+
+    public TagLogicalElement(State state, int tleID) {
+        this.state = state;
+
         this.tleID = tleID;
     }
 
-    /**
-     * Sets the attribute value of this structured field
-     *
-     * @param value the attribute value
-     */
-    public void setAttributeValue(String value) {
+    private void setAttributeValue(String value) {
         addTriplet(new AttributeValueTriplet(value));
     }
 
+    private void setEncoding(int encoding) {
+        if (encoding != State.ENCODING_NONE) {
+            addTriplet(new EncodingTriplet(encoding));
+        }
+    }
+
     /**
      * Sets the attribute qualifier of this structured field
      *
@@ -100,8 +96,9 @@ public class TagLogicalElement extends A
         setFullyQualifiedName(
                 FullyQualifiedNameTriplet.TYPE_ATTRIBUTE_GID,
                 FullyQualifiedNameTriplet.FORMAT_CHARSTR,
-                name);
-        setAttributeValue(value);
+                state.key);
+        setAttributeValue(state.value);
+        setEncoding(state.encoding);
         setAttributeQualifier(tleID, 1);
 
         byte[] data = new byte[SF_HEADER_LENGTH];
@@ -115,4 +112,51 @@ public class TagLogicalElement extends A
 
         writeTriplets(os);
     }
+
+    /**
+     *
+     * Holds the attribute state of a TLE
+     *
+     */
+    public static class State {
+
+        /**
+         *  value  interpreted as no encoding
+         */
+        public static final int ENCODING_NONE = -1;
+        /** The key attribute */
+        private String key;
+
+        /** The value attribute */
+        private String value;
+
+        /** The CCSID character et encoding attribute */
+        private int encoding =  ENCODING_NONE;
+
+
+        /**
+         * Constructor
+         *
+         * @param key the key attribute
+         * @param value the value attribute
+         */
+        public State(String key, String value) {
+            this.key = key;
+            this.value = value;
+        }
+
+        /**
+         *
+         * @param key the key attribute
+         * @param value the value attribute
+         * @param encoding the CCSID character set encoding attribute
+         */
+        public State(String key, String value, int encoding) {
+            this.key = key;
+            this.value = value;
+            this.encoding = encoding;
+        }
+
+
+    }
 }

Added: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/triplets/EncodingTriplet.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/triplets/EncodingTriplet.java?rev=1376950&view=auto
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/triplets/EncodingTriplet.java (added)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/triplets/EncodingTriplet.java Fri Aug 24 14:50:54 2012
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id$ */
+
+package org.apache.fop.afp.modca.triplets;
+
+import java.io.IOException;
+import java.io.OutputStream;
+
+import org.apache.fop.afp.util.BinaryUtils;
+/**
+ *
+ * Represents a CCSID encoding triplet.
+ *
+ */
+public class EncodingTriplet extends AbstractTriplet {
+
+
+    private int encoding;
+    /**
+     * @param encoding the CCSID character set encoding
+     */
+    public EncodingTriplet( int encoding) {
+        super(CODED_GRAPHIC_CHARACTER_SET_GLOBAL_IDENTIFIER);
+        this.encoding = encoding;
+    }
+    /** {@inheritDoc} */
+    public void writeToStream(OutputStream os) throws IOException {
+
+        // [len,id,0,0,0,0]
+        byte[] data = getData();
+
+        byte[] encodingBytes = BinaryUtils.convert(encoding, 2);
+
+        // [len,id,0,0,0,0] -> [len.id,0,0,encodingBytes[0],encodingBytes[1]]
+        System.arraycopy(encodingBytes, 0, data, 4, encodingBytes.length);
+
+        os.write(data);
+
+    }
+
+    /** {@inheritDoc} */
+    public int getDataLength() {
+        //len(1b) + id(1b) + 0x0000 (2b) + encoding (2b) = 6b
+        return 6;
+    }
+
+}

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/modca/triplets/EncodingTriplet.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FONode.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FONode.java?rev=1376950&r1=1376949&r2=1376950&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FONode.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FONode.java Fri Aug 24 14:50:54 2012
@@ -38,6 +38,7 @@ import org.apache.fop.accessibility.Stru
 import org.apache.fop.apps.FOPException;
 import org.apache.fop.apps.FOUserAgent;
 import org.apache.fop.complexscripts.bidi.DelimitedTextRange;
+import org.apache.fop.fo.expr.PropertyException;
 import org.apache.fop.fo.extensions.ExtensionAttachment;
 import org.apache.fop.fo.extensions.ExtensionElementMapping;
 import org.apache.fop.fo.extensions.InternalElementMapping;
@@ -601,6 +602,22 @@ public abstract class FONode implements 
         getFOValidationEventProducer().missingProperty(this, getName(), propertyName, locator);
     }
 
+
+
+    /**
+     * Helper function to throw an error caused by an invalid property
+     *
+     * @param propertyName the name of the property.
+     * @param propertyValue the value of the property.
+     * * @param e optional property parsing exception.
+     * @throws ValidationException the validation error provoked by the method call
+     */
+    protected void invalidPropertyValueError(String propertyName, String propertyValue, Exception e)
+                throws ValidationException {
+        getFOValidationEventProducer().invalidPropertyValue(this, getName(), propertyName,
+                propertyValue,  new PropertyException(e), locator);
+    }
+
     /**
      * Helper function to return "Error(line#/column#)" string for
      * above exception messages

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=1376950&r1=1376949&r2=1376950&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 Fri Aug 24 14:50:54 2012
@@ -318,7 +318,8 @@ public class AFPDocumentHandler extends 
                 case IN_PAGE_HEADER:
                     String name = aps.getName();
                     String value = aps.getValue();
-                    dataStream.createTagLogicalElement(name, value);
+                    int encoding = aps.getEncoding();
+                    dataStream.createTagLogicalElement(name, value, encoding);
                     break;
                 default:
                     throw new IFException(

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/extensions/AFPExtensionHandler.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/extensions/AFPExtensionHandler.java?rev=1376950&r1=1376949&r2=1376950&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/extensions/AFPExtensionHandler.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/extensions/AFPExtensionHandler.java Fri Aug 24 14:50:54 2012
@@ -144,6 +144,12 @@ public class AFPExtensionHandler extends
                 if (placement != null && placement.length() > 0) {
                     pageSetupExtn.setPlacement(ExtensionPlacement.fromXMLValue(placement));
                 }
+
+                String encoding =  lastAttributes.getValue("encoding");
+                if (encoding != null && pageSetupExtn != null) {
+                    pageSetupExtn.setEncoding(Integer.parseInt(encoding));
+                }
+
                 if (content.length() > 0 && pageSetupExtn != null) {
                     pageSetupExtn.setContent(content.toString());
                     content.setLength(0); //Reset text buffer (see characters())

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/extensions/AFPPageSetup.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/extensions/AFPPageSetup.java?rev=1376950&r1=1376949&r2=1376950&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/extensions/AFPPageSetup.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/extensions/AFPPageSetup.java Fri Aug 24 14:50:54 2012
@@ -23,6 +23,8 @@ import org.xml.sax.ContentHandler;
 import org.xml.sax.SAXException;
 import org.xml.sax.helpers.AttributesImpl;
 
+import org.apache.fop.afp.modca.TagLogicalElement;
+
 /**
  * This is the pass-through value object for the AFP extension.
  */
@@ -48,6 +50,27 @@ public class AFPPageSetup extends AFPExt
     protected ExtensionPlacement placement = ExtensionPlacement.DEFAULT;
 
     /**
+     * the CCSID character set encoding
+     */
+    protected int encoding = TagLogicalElement.State.ENCODING_NONE;
+
+    /**
+     *
+     * @return CCSID character set encoding
+     */
+    public int getEncoding() {
+        return encoding;
+    }
+
+    /**
+     *
+     * @param encoding CCSID character set encoding
+     */
+    public void setEncoding(int encoding) {
+        this.encoding = encoding;
+    }
+
+    /**
      * Default constructor.
      *
      * @param elementName the name of the setup code object, may be null

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=1376950&r1=1376949&r2=1376950&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 Fri Aug 24 14:50:54 2012
@@ -35,6 +35,7 @@ import org.apache.fop.fo.extensions.Exte
  */
 public class AFPPageSetupElement extends AbstractAFPExtensionObject {
 
+    private static final String ATT_ENCODING = "encoding";
     private static final String ATT_SRC = "src";
 
     /**
@@ -105,6 +106,16 @@ public class AFPPageSetupElement extends
             } else {
                 missingPropertyError(AFPPageSetup.ATT_VALUE);
             }
+            attr = attlist.getValue(ATT_ENCODING);
+            if (attr != null) {
+                try {
+                    pageSetup.setEncoding(Integer.parseInt(attr));
+                } catch (NumberFormatException nfe) {
+                    invalidPropertyValueError(ATT_ENCODING, attr, nfe);
+                }
+
+            }
+
         }
         String placement = attlist.getValue(AFPPageSetup.ATT_PLACEMENT);
         if (placement != null && placement.length() > 0) {

Modified: xmlgraphics/fop/trunk/status.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/status.xml?rev=1376950&r1=1376949&r2=1376950&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/status.xml (original)
+++ xmlgraphics/fop/trunk/status.xml Fri Aug 24 14:50:54 2012
@@ -62,6 +62,9 @@
       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="MH" type="fix" fixes-bug="48954" due-to="PH">
+         Support for character encoding of TLEs in AFP output
+      </action>
       <action context="Renderers" dev="VH" type="fix" fixes-bug="53778">
         When PDF accessibility is enabled, the contents for the different regions must appear in the 
         proper order in the structure tree.



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