You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by sc...@apache.org on 2008/12/03 22:39:35 UTC

svn commit: r723085 - in /incubator/uima/uimaj/trunk/uima-docbook-tool: build/ properties/ styles/uima-style/top/ tools/fop-versions/fop-0.95/

Author: schor
Date: Wed Dec  3 13:39:34 2008
New Revision: 723085

URL: http://svn.apache.org/viewvc?rev=723085&view=rev
Log:
[UIMA-1244] Add support for FOP 0.95.  Change default FOP level to 0.95.  Change build process to obtain FOP 0.95 from the net if not present - to avoid distributing it with UIMA.

Added:
    incubator/uima/uimaj/trunk/uima-docbook-tool/tools/fop-versions/fop-0.95/
    incubator/uima/uimaj/trunk/uima-docbook-tool/tools/fop-versions/fop-0.95/fop-config.xml
Modified:
    incubator/uima/uimaj/trunk/uima-docbook-tool/build/build-docbook.xml
    incubator/uima/uimaj/trunk/uima-docbook-tool/build/get-components.xml
    incubator/uima/uimaj/trunk/uima-docbook-tool/properties/default.docbook.properties
    incubator/uima/uimaj/trunk/uima-docbook-tool/styles/uima-style/top/pdf.xsl

Modified: incubator/uima/uimaj/trunk/uima-docbook-tool/build/build-docbook.xml
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uima-docbook-tool/build/build-docbook.xml?rev=723085&r1=723084&r2=723085&view=diff
==============================================================================
--- incubator/uima/uimaj/trunk/uima-docbook-tool/build/build-docbook.xml (original)
+++ incubator/uima/uimaj/trunk/uima-docbook-tool/build/build-docbook.xml Wed Dec  3 13:39:34 2008
@@ -60,10 +60,16 @@
 		</condition>
 
 		<condition property="docbook.fop.extensions" value="fop1.extensions">
-			<equals arg1="0.93" arg2="${fop.version}"/>
+			<or>
+        <equals arg1="0.93" arg2="${fop.version}"/>
+        <equals arg1="0.95" arg2="${fop.version}"/>
+      </or>  
 		</condition>
 		<condition property="fop.main.class" value="org.apache.fop.cli.Main">
-			<equals arg1="0.93" arg2="${fop.version}"/>
+			<or>
+        <equals arg1="0.93" arg2="${fop.version}"/>
+        <equals arg1="0.95" arg2="${fop.version}"/>
+      </or>
 		</condition>
 
 		<condition property="saxon.main.class" value="com.icl.saxon.StyleSheet">
@@ -89,6 +95,8 @@
 		<property name="docbook.xml.dir" value="${docbook.ref.dir}/docbook-xml-${docbook.xml.version}"/>
 		<property name="saxon.dir"
       value="${docbook.tool.project}/tools/saxon-versions/saxon-${saxon.version}"/>
+    <property name="fop.dir"
+      value="${docbook.tool.project}/tools/fop-versions/fop-${fop.version}"/>
 		<property name="jai.dir" value="${docbook.tool.project}/tools/jai-versions/jai-${jai.version}"/>
 		<property name="fop.config"
       value="${docbook.tool.project}/tools/fop-versions/fop-${fop.version}/fop-config.xml"/>
@@ -143,7 +151,8 @@
 	<!-- ==                                                                       == -->
 	<!-- =========================================================================== -->
 	<target name="prepare" depends="setup-common-properties-per-build, setup-availables, 
-		make-temp-dir, test-saxon-available, test-docbook-available, test-jai-available">
+		make-temp-dir, test-saxon-available, test-docbook-available, 
+		test-fop-available, test-jai-available">
 	</target>
 	
 	<target name="make-temp-dir">
@@ -154,12 +163,17 @@
 		<available file="${saxon.dir}/saxon.jar" property="saxon.available"/>
 		<available file="${docbook.xml.dir}/catalog.xml" property="docbook.available"/>
 		<available file="${jai.dir}/jai_core.jar" property="jai.available"/>
+		<available file="${fop.dir}/fop.jar" property="fop.available"/>
 	</target>
 	
 	<target name="test-saxon-available" unless="saxon.available">
 	  <ant antfile="${docbook.tool.project}/build/get-components.xml" target="get-saxon"/>
 	</target>
 
+  <target name="test-fop-available" unless="fop.available">
+    <ant antfile="${docbook.tool.project}/build/get-components.xml" target="get-fop"/>
+  </target>
+
 	<target name="test-docbook-available" unless="docbook.available">
 	  <ant antfile="${docbook.tool.project}/build/get-components.xml" target="get-docbook"/>
 	</target>

Modified: incubator/uima/uimaj/trunk/uima-docbook-tool/build/get-components.xml
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uima-docbook-tool/build/get-components.xml?rev=723085&r1=723084&r2=723085&view=diff
==============================================================================
--- incubator/uima/uimaj/trunk/uima-docbook-tool/build/get-components.xml (original)
+++ incubator/uima/uimaj/trunk/uima-docbook-tool/build/get-components.xml Wed Dec  3 13:39:34 2008
@@ -60,6 +60,31 @@
   </target>
   
   <!-- ======================================================================== -->
+  <!-- == Subroutine: Download FOP                                           == -->
+  <!-- ======================================================================== -->
+  
+  <target name="get-fop" unless="fop.available">
+    <input
+      message="Downloading and unzipping (one time) Apache FOP version ${fop.version} for producing PDF output,&#xA;
+licensed under the Apache License Version 2.0;&#xA;
+you may not use this package except in compliance with the License.&#xA;&#xA; 
+You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.txt&#xA;&#xA;Ok to download?"
+      validargs="y,n" addproperty="ok.download.fop"/>
+    <condition property="do.download.fop">
+      <equals arg1="y" arg2="${ok.download.fop}"/>
+    </condition>
+    <fail unless="do.download.fop" message="Download aborted by user."/>
+    
+    <get src="http://archive.apache.org/dist/xmlgraphics/fop/binaries/fop-${fop.version}-bin.zip" dest="${tmp.dir}/fop.zip"/>
+    <unzip src="${tmp.dir}/fop.zip" dest="${tmp.dir}/fop"/>
+    <copy todir="${fop.dir}">
+    	<fileset dir="${tmp.dir}/fop/fop-${fop.version}/build"/>
+    	<fileset dir="${tmp.dir}/fop/fop-${fop.version}/lib"/>
+  	</copy>
+  	
+  </target>
+
+  <!-- ======================================================================== -->
   <!-- == Subroutine: Download jai                                           == -->
   <!-- ======================================================================== -->
   

Modified: incubator/uima/uimaj/trunk/uima-docbook-tool/properties/default.docbook.properties
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uima-docbook-tool/properties/default.docbook.properties?rev=723085&r1=723084&r2=723085&view=diff
==============================================================================
--- incubator/uima/uimaj/trunk/uima-docbook-tool/properties/default.docbook.properties (original)
+++ incubator/uima/uimaj/trunk/uima-docbook-tool/properties/default.docbook.properties Wed Dec  3 13:39:34 2008
@@ -18,7 +18,7 @@
 
 # default version info
 # which version of fop to use
-fop.version = 0.93
+fop.version = 0.95
 
 # which version of docbook to use
 docbook.xml.version = 4.5

Modified: incubator/uima/uimaj/trunk/uima-docbook-tool/styles/uima-style/top/pdf.xsl
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uima-docbook-tool/styles/uima-style/top/pdf.xsl?rev=723085&r1=723084&r2=723085&view=diff
==============================================================================
--- incubator/uima/uimaj/trunk/uima-docbook-tool/styles/uima-style/top/pdf.xsl (original)
+++ incubator/uima/uimaj/trunk/uima-docbook-tool/styles/uima-style/top/pdf.xsl Wed Dec  3 13:39:34 2008
@@ -45,6 +45,7 @@
   <xsl:param name="fop1.extensions">
     <xsl:choose>
       <xsl:when test="$fop.version = '0.93'">1</xsl:when>
+      <xsl:when test="$fop.version = '0.95'">1</xsl:when>
       <xsl:otherwise>0</xsl:otherwise>
     </xsl:choose>
   </xsl:param>

Added: incubator/uima/uimaj/trunk/uima-docbook-tool/tools/fop-versions/fop-0.95/fop-config.xml
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uima-docbook-tool/tools/fop-versions/fop-0.95/fop-config.xml?rev=723085&view=auto
==============================================================================
--- incubator/uima/uimaj/trunk/uima-docbook-tool/tools/fop-versions/fop-0.95/fop-config.xml (added)
+++ incubator/uima/uimaj/trunk/uima-docbook-tool/tools/fop-versions/fop-0.95/fop-config.xml Wed Dec  3 13:39:34 2008
@@ -0,0 +1,130 @@
+<?xml version="1.0"?>
+<!--
+  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.
+-->
+<!--
+
+This is the configuration file for FOP.
+
+Relative config url's will be resolved relative to
+the location of this file.
+
+-->
+
+<!-- NOTE: This is the version of the configuration -->
+<fop version="1.0">
+
+  <!-- Base URL for resolving relative URLs -->
+  <base>.</base>
+  
+  <!-- relative base used for font URL resolution
+       expressed relative to the FOP base dir -->
+  <font-base>../../../uima-docbook-tool/tools/fop-versions/fop-0.93/fonts</font-base>
+  <!-- Source resolution in dpi (dots/pixels per inch) for determining the size of pixels in SVG and bitmap images, default: 72dpi -->
+  <source-resolution>96</source-resolution>
+  <!-- Target resolution in dpi (dots/pixels per inch) for specifying the target resolution for generated bitmaps, default: 72dpi -->
+  <target-resolution>96</target-resolution>
+  
+  <!-- Default page-height and page-width, in case
+       value is specified as auto -->
+  <default-page-settings height="11in" width="8.26in"/>
+  
+  <!-- Information for specific renderers -->
+  <!-- Uses renderer mime type for renderers -->
+  <renderers>
+    <renderer mime="application/pdf">
+      <filterList>
+        <!-- provides compression using zlib flate (default is on) -->
+        <value>flate</value>
+  
+        <!-- encodes binary data into printable ascii characters (default off)
+             This provides about a 4:5 expansion of data size -->
+        <!-- <value>ascii-85</value> -->
+  
+        <!-- encodes binary data with hex representation (default off)
+             This filter is not recommended as it doubles the data size -->
+        <!-- <value>ascii-hex</value> -->
+      </filterList>
+
+      <fonts>
+        <!-- embedded fonts -->
+        <!--
+        This information must exactly match the font specified
+        in the fo file. Otherwise it will use a default font.
+
+        For example,
+        <fo:inline font-family="Arial" font-weight="bold" font-style="normal">
+            Arial-normal-normal font
+        </fo:inline>
+        for the font triplet specified by:
+        <font-triplet name="Arial" style="normal" weight="bold"/>
+
+        If you do not want to embed the font in the pdf document
+        then do not include the "embed-url" attribute.
+        The font will be needed where the document is viewed
+        for it to be displayed properly.
+
+        possible styles: normal | italic | oblique | backslant
+        possible weights: normal | bold | 100 | 200 | 300 | 400
+                          | 500 | 600 | 700 | 800 | 900
+        (normal = 400, bold = 700)
+        -->
+
+        <!--
+        <font metrics-url="arial.xml" kerning="yes" embed-url="arial.ttf">
+          <font-triplet name="Arial" style="normal" weight="normal"/>
+          <font-triplet name="ArialMT" style="normal" weight="normal"/>
+        </font>
+        <font metrics-url="arialb.xml" kerning="yes" embed-url="arialb.ttf">
+          <font-triplet name="Arial" style="normal" weight="bold"/>
+          <font-triplet name="ArialMT" style="normal" weight="bold"/>
+        </font>
+        -->
+        
+        <font metrics-url="palatino.xml"
+          kerning="yes"
+          embed-url="file:///c:/WINDOWS/Fonts/pala.TTF">
+          <font-triplet name="Palatino" style="normal" weight="normal"/>
+        </font>
+        <font metrics-url="palatino-bold.xml" 
+          kerning="yes"
+          embed-url="file:///c:/WINDOWS/Fonts/palab.TTF">
+          <font-triplet name="Palatino" style="normal" weight="bold"/>
+        </font>
+        <font metrics-url="palatino-italic.xml" 
+          kerning="yes"
+          embed-url="file:///c:/WINDOWS/Fonts/palai.TTF">
+          <font-triplet name="Palatino" style="italic" weight="normal"/>
+        </font>
+        <font metrics-url="palatino-bold-italic.xml" 
+          kerning="yes"
+          embed-url="file:///c:/WINDOWS/Fonts/palabi.TTF">
+          <font-triplet name="Palatino" style="italic" weight="bold"/>
+        </font>
+        
+      </fonts>
+
+      <!-- This option lets you specify additional options on an XML handler -->
+      <!--xml-handler namespace="http://www.w3.org/2000/svg">
+        <stroke-text>false</stroke-text>
+      </xml-handler-->
+
+    </renderer>
+
+  </renderers>
+
+</fop>
+