[FOray-commit] SF.net SVN: foray: [7251] trunk/foray
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
|
From: <vic...@us...> - 2006-05-25 15:11:01
|
Revision: 7251 Author: victormote Date: 2006-05-25 08:10:46 -0700 (Thu, 25 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7251&view=rev Log Message: ----------- Add package for creating FOray-specific objects. Added Paths: ----------- trunk/foray/foray-specific/ trunk/foray/foray-specific/.checkstyle trunk/foray/foray-specific/.classpath trunk/foray/foray-specific/.project trunk/foray/foray-specific/scripts/ trunk/foray/foray-specific/scripts/build.bat trunk/foray/foray-specific/scripts/build.sh trunk/foray/foray-specific/scripts/build.xml trunk/foray/foray-specific/src/ trunk/foray/foray-specific/src/java/ trunk/foray/foray-specific/src/java/org/ trunk/foray/foray-specific/src/java/org/foray/ trunk/foray/foray-specific/src/java/org/foray/specific/ trunk/foray/foray-specific/src/java/org/foray/specific/FOraySpecific.java Property changes on: trunk/foray/foray-specific ___________________________________________________________________ Name: svn:ignore + build zzlocal Added: trunk/foray/foray-specific/.checkstyle =================================================================== --- trunk/foray/foray-specific/.checkstyle (rev 0) +++ trunk/foray/foray-specific/.checkstyle 2006-05-25 15:10:46 UTC (rev 7251) @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<fileset-config file-format-version="1.2.0" simple-config="true"> + <fileset name="all" enabled="true" check-config-name="FOray Checkstyle" local="false"> + <file-match-pattern match-pattern="." include-pattern="true"/> + </fileset> +</fileset-config> Added: trunk/foray/foray-specific/.classpath =================================================================== --- trunk/foray/foray-specific/.classpath (rev 0) +++ trunk/foray/foray-specific/.classpath 2006-05-25 15:10:46 UTC (rev 7251) @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry excluding=".#*" kind="src" path="src/java"/> + <classpathentry kind="src" path="scripts"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="var" path="FORAY_LIB_ROOT/servlet-2.2.jar"/> + <classpathentry kind="var" path="FORAY_LIB_ROOT/xalan-2.4.1.jar"/> + <classpathentry kind="var" path="ANT_HOME/lib/ant.jar"/> + <classpathentry kind="var" path="FORAY_LIB_ROOT/xercesImpl-2.7.1.jar"/> + <classpathentry kind="var" path="FORAY_LIB_ROOT/resolver.jar"/> + <classpathentry kind="var" path="FORAY_LIB_ROOT/xml-apis-1.3.02.jar"/> + <classpathentry kind="var" path="FORAY_LIB_ROOT/commons-logging.jar"/> + <classpathentry kind="var" path="ANT_HOME/lib/ant-launcher.jar"/> + <classpathentry kind="var" path="ANT_HOME/lib/ant-trax.jar"/> + <classpathentry combineaccessrules="false" kind="src" path="/FOrayApp"/> + <classpathentry combineaccessrules="false" kind="src" path="/axslFont-R"/> + <classpathentry combineaccessrules="false" kind="src" path="/FOrayFont"/> + <classpathentry combineaccessrules="false" kind="src" path="/axslText"/> + <classpathentry combineaccessrules="false" kind="src" path="/FOrayText"/> + <classpathentry combineaccessrules="false" kind="src" path="/axslGraphic-R"/> + <classpathentry combineaccessrules="false" kind="src" path="/FOrayGraphic"/> + <classpathentry combineaccessrules="false" kind="src" path="/FOrayCommon"/> + <classpathentry combineaccessrules="false" kind="src" path="/axslFO-R"/> + <classpathentry combineaccessrules="false" kind="src" path="/axslArea-W"/> + <classpathentry combineaccessrules="false" kind="src" path="/axslLayout"/> + <classpathentry kind="output" path="build/eclipse"/> +</classpath> Added: trunk/foray/foray-specific/.project =================================================================== --- trunk/foray/foray-specific/.project (rev 0) +++ trunk/foray/foray-specific/.project 2006-05-25 15:10:46 UTC (rev 7251) @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>FOrayApp</name> + <comment></comment> + <projects> + <project>FOrayCommon</project> + <project>FOrayFont</project> + <project>FOrayFOTree</project> + <project>FOrayGraphic</project> + <project>FOrayPDF</project> + <project>FOrayPS</project> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>com.atlassw.tools.eclipse.checkstyle.CheckstyleBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + <nature>com.atlassw.tools.eclipse.checkstyle.CheckstyleNature</nature> + </natures> +</projectDescription> Added: trunk/foray/foray-specific/scripts/build.bat =================================================================== --- trunk/foray/foray-specific/scripts/build.bat (rev 0) +++ trunk/foray/foray-specific/scripts/build.bat 2006-05-25 15:10:46 UTC (rev 7251) @@ -0,0 +1,27 @@ +@echo off + +echo "FOray Build System" +echo "------------------" + +IF "%JAVA_HOME%" == "" GOTO JAVA_HOME_ERR +IF "%ANT_HOME%" == "" GOTO ANT_HOME_ERR + +call %ANT_HOME%\bin\ant.bat %* + +GOTO END + +:JAVA_HOME_ERR + echo ERROR: JAVA_HOME not found in your environment. + echo + echo Please set the JAVA_HOME variable in your environment to match the + echo location of the Java Virtual Machine you want to use. +GOTO END + +:ANT_HOME_ERR + echo ERROR: ANT_HOME not found in your environment. + echo + echo Please set the ANT_HOME variable in your environment to match the + echo location of the root of your ANT installation. +GOTO END + +:END Added: trunk/foray/foray-specific/scripts/build.sh =================================================================== --- trunk/foray/foray-specific/scripts/build.sh (rev 0) +++ trunk/foray/foray-specific/scripts/build.sh 2006-05-25 15:10:46 UTC (rev 7251) @@ -0,0 +1,29 @@ +#!/bin/sh + +# This file must be executable. + +echo +echo "FOray Build System" +echo "------------------" + +if [ "$JAVA_HOME" = "" ] +then + echo "ERROR: JAVA_HOME not found in your environment." + echo + echo "Please set the JAVA_HOME variable in your environment to match the" + echo "location of the Java Virtual Machine you want to use." + exit 1 +fi + +if [ "$ANT_HOME" = "" ] +then + echo "ERROR: ANT_HOME not found in your environment." + echo + echo "Please set the ANT_HOME variable in your environment to match the" + echo "location of the root of your ANT installation." + exit 1 +fi + +"$ANT_HOME"/bin/ant "$@" + +##### Last Line of $RCSfile$ ##### Property changes on: trunk/foray/foray-specific/scripts/build.sh ___________________________________________________________________ Name: svn:executable + * Name: svn:keywords + "Author Id Rev Date URL" Name: svn:eol-style + native Added: trunk/foray/foray-specific/scripts/build.xml =================================================================== --- trunk/foray/foray-specific/scripts/build.xml (rev 0) +++ trunk/foray/foray-specific/scripts/build.xml 2006-05-25 15:10:46 UTC (rev 7251) @@ -0,0 +1,199 @@ +<?xml version="1.0"?> +<!-- $Id$ --> + +<project default="package" basedir="."> + + <!-- Set up a prefix to designate environment variables. --> + <property environment="env"/> + + <target name="env"> + <!-- If the environment variable FORAY_CONFIG is set, use it. --> + <condition property="foray.config" value="${env.FORAY_CONFIG}"> + <and> + <isset property="env.FORAY_CONFIG"/> + <available file="${env.FORAY_CONFIG}"/> + </and> + </condition> + <!-- Otherwise, set it to the FOray scripts directory. --> + <property name="foray.config" location="../../scripts"/> + <echo>foray.config: ${foray.config}</echo> + + <!-- Retrieve externally-configured properties. --> + <property file="${foray.config}/foray-build.properties"/> + + <!-- Get a default for {foray.home}. --> + <property name="foray.home" location="../.."/> + <echo>foray.home: ${foray.home}</echo> + + <!-- Set up dependent properties. --> + <property name="lib.dir" location="${foray.home}/lib"/> + <property name="axsl.build" location="${lib.dir}"/> + + <path id="libs-build-classpath"> + <fileset dir="${axsl.build}"> + <include name="**/axsl*.jar"/> + </fileset> + <fileset dir="${lib.dir}"> + <include name="xml-apis*.jar"/> + <include name="servlet*.jar"/> + <include name="axsl*.jar"/> + <include name="xercesImpl*.jar"/> + <include name="commons-logging.jar"/> + </fileset> + <fileset dir="${foray.home}/foray-common/build/ant"> + <include name="*.jar"/> + </fileset> + <fileset dir="${foray.home}/foray-font/build/ant"> + <include name="*.jar"/> + </fileset> + <fileset dir="${foray.home}/foray-graphic/build/ant"> + <include name="*.jar"/> + </fileset> + <fileset dir="${foray.home}/foray-pdf/build/ant"> + <include name="*.jar"/> + </fileset> + <fileset dir="${foray.home}/foray-text/build/ant"> + <include name="*.jar"/> + </fileset> + <fileset dir="${foray.home}/foray-fotree/build/ant"> + <include name="*.jar"/> + </fileset> + <fileset dir="${foray.home}/foray-areatree/build/ant"> + <include name="*.jar"/> + </fileset> + <fileset dir="${foray.home}/foray-layout/build/ant"> + <include name="*.jar"/> + </fileset> + <fileset dir="${foray.home}/foray-pioneer/build/ant"> + <include name="*.jar"/> + </fileset> + <fileset dir="${foray.home}/foray-output/build/ant"> + <include name="*.jar"/> + </fileset> + <fileset dir="${foray.home}/foray-render/build/ant"> + <include name="*.jar"/> + </fileset> + </path> + </target> + + <!-- =================================================================== --> + <!-- Initialization target --> + <!-- =================================================================== --> + <target name="init" depends="env"> + <tstamp/> + <property name="name" value="foray"/> + <property name="contact.info" + value="The FOray project http://www.foray.org"/> + <property name="module" value="app"/> + <property name="module.dir" value="${foray.home}/foray-${module}"/> + <property name="version" value="0.1"/> + <property name="src.dir" value="${module.dir}/src"/> + <property name="build.dir" value="${module.dir}/build/ant"/> + <property name="classes.dir" value="${build.dir}/classes"/> + <property name="debug" value="on"/> + <property name="optimize" value="off"/> + <property name="deprecation" value="off"/> + <property name="source" value="1.4"/> + </target> + + <!-- =================================================================== --> + <!-- Prepares the build directory --> + <!-- =================================================================== --> + <target name="prepare" depends="init"> + <!-- create directories --> + <echo message="Preparing the build directories"/> + <mkdir dir="${build.dir}"/> + <mkdir dir="${classes.dir}"/> + </target> + + <!-- =================================================================== --> + <!-- Compiles the source directory --> + <!-- =================================================================== --> + <target name="compile" depends="prepare"> + <echo message="Compiling the sources "/> + <!-- create directories --> + <mkdir dir="${build.dir}"/> + <javac srcdir="${src.dir}" + destdir="${classes.dir}" + debug="${debug}" + deprecation="${deprecation}" + optimize="${optimize}" + source="${source}" + > + <classpath refid="libs-build-classpath"/> + </javac> + </target> + + <!-- =================================================================== --> + <!-- Creates the class package --> + <!-- =================================================================== --> + <target name="package" depends="compile, style" + description="Generates the jar files (default target)"> + <echo message="Creating the jar file ${build.dir}/${name}.jar"/> + + <tstamp> + <format property="ts" pattern="yyyyMMdd-HHmmss-z"/> + </tstamp> + <jar jarfile="${build.dir}/${name}-${module}.jar" + basedir="${classes.dir}" + > + <manifest> + <attribute name="Implementation-Title" value="${name}-${module}"/> + <attribute name="Implementation-Version" value="${version}"/> + <attribute name="Implementation-Vendor" + value="${contact.info}"/> + </manifest> + </jar> + + </target> + + <target name="javadoc-api" depends="init" description="Creates API + documentation"> + <echo message="Producing the javadoc files "/> + <mkdir dir="${build.dir}/javadoc-api"/> + <javadoc + packagenames="org.foray.app" + sourcepath="${src.dir}/java" + destdir="${build.dir}/javadoc-api" + classpathref="libs-build-classpath" + author="true" + version="true" + windowtitle="FOray Application API" + doctitle="FOray Application API" + bottom="Copyright © 2004 The FOray Project. All Rights Reserved." + overview="${src.dir}/java/org/foray/app/overview.html" + use="true" + access="public" + failonerror="true"> + <classpath refid="libs-build-classpath"/> + </javadoc> + </target> + + <!-- =================================================================== --> + <!-- Clean targets --> + <!-- =================================================================== --> + <target name="clean" depends="init" description="Cleans the build directory"> + <delete dir="${build.dir}"/> + </target> + + <!-- =================================================================== --> + <!-- Checkstyle --> + <!-- =================================================================== --> + <target name="style" depends="init" description="Runs checkstyle" + if="checkstyle.home"> + <taskdef name="checkstyle" + classname="com.puppycrawl.tools.checkstyle.CheckStyleTask"> + <classpath> + <fileset dir="${checkstyle.home}"> + <include name="checkstyle-all-*.jar"/> + </fileset> + </classpath> + </taskdef> + <checkstyle config="../../scripts/checkstyle-config.xml"> + <fileset dir="${src.dir}" includes="**/*.java"/> + </checkstyle> + </target> + +</project> + +<!-- Last Line of $RCSfile$ --> Property changes on: trunk/foray/foray-specific/scripts/build.xml ___________________________________________________________________ Name: svn:keywords + "Author Id Rev Date URL" Name: svn:eol-style + native Added: trunk/foray/foray-specific/src/java/org/foray/specific/FOraySpecific.java =================================================================== --- trunk/foray/foray-specific/src/java/org/foray/specific/FOraySpecific.java (rev 0) +++ trunk/foray/foray-specific/src/java/org/foray/specific/FOraySpecific.java 2006-05-25 15:10:46 UTC (rev 7251) @@ -0,0 +1,107 @@ +/* + * Copyright 2006 The FOray Project. + * http://www.foray.org + * + * Licensed 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 work is in part derived from the following work(s), used with the + * permission of the licensor: + * Apache FOP, licensed by the Apache Software Foundation + * + */ + +/* $Id$ */ + +package org.foray.specific; + +import org.foray.app.FOrayException; +import org.foray.app.SessionConfig; +import org.foray.common.XMLParser; +import org.foray.font.FOrayFontServer; +import org.foray.graphic.FOrayGraphicServer; + +import org.axsl.areaW.AreaTreeFactory; +import org.axsl.foR.FOTreeFactory; +import org.axsl.fontR.FontException; +import org.axsl.fontR.FontServer; +import org.axsl.graphicR.GraphicServer; +import org.axsl.layout.LayoutFactory; +import org.axsl.text.TextServer; + +import org.apache.commons.logging.Log; + +import org.xml.sax.EntityResolver; + +import java.net.URL; + +public class FOraySpecific { + + private Log logger; + + public FOraySpecific(Log logger) throws FOrayException { + this.logger = logger; + } + + public Log getLogger() { + return this.logger; + } + + public FontServer makeFontServer(SessionConfig configuration, + EntityResolver entityResolver) throws FOrayException { + FOrayFontServer forayFontServer = new FOrayFontServer(getLogger()); + forayFontServer.setBaseFontURL( + configuration.optionFontBaseDirectory()); + forayFontServer.setBaseURL(configuration.optionBaseDirectory()); + forayFontServer.setEntityResolver(entityResolver); + try { + forayFontServer.setup(configuration.optionFontConfiguration(), + null); + } catch (FontException e) { + throw new FOrayException(e); + } + return forayFontServer; + } + + public TextServer makeTextServer(SessionConfig configuration) + throws FOrayException { + URL hyphenationDir = configuration.optionHyphenationBaseDirectory(); + return new org.foray.text.TextServer(getLogger(), + hyphenationDir); + + } + + public GraphicServer makeGraphicServer() throws FOrayException { + return new FOrayGraphicServer(getLogger(), + XMLParser.getParserClassName()); + } + + public FOTreeFactory makeFOTreeFactory(GraphicServer graphicServer, + TextServer textServer, URL[] graphicSearchPath) + throws FOrayException { + return null; +// return new FOrayFOTreeServer(this.getLogger(), +// graphicServer, textServer, graphicSearchPath,Wi +// getConfiguration().optionCacheGraphics()); +// + } + + public AreaTreeFactory makeAreaTreeFactory() + throws FOrayException { + return null; + } + + public LayoutFactory makeLayoutFactory() throws FOrayException { + return null; + } + +} Property changes on: trunk/foray/foray-specific/src/java/org/foray/specific/FOraySpecific.java ___________________________________________________________________ Name: svn:keywords + "Author Id Rev Date URL" Name: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |