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 sp...@apache.org on 2007/01/06 15:18:58 UTC

svn commit: r493473 - in /xmlgraphics/fop/trunk/src: documentation/content/xdocs/trunk/running.xml java/org/apache/fop/cli/Main.java

Author: spepping
Date: Sat Jan  6 06:18:57 2007
New Revision: 493473

URL: http://svn.apache.org/viewvc?view=rev&rev=493473
Log:
Added fop.home to Main.getJARList. Adapted the documentation.

Modified:
    xmlgraphics/fop/trunk/src/documentation/content/xdocs/trunk/running.xml
    xmlgraphics/fop/trunk/src/java/org/apache/fop/cli/Main.java

Modified: xmlgraphics/fop/trunk/src/documentation/content/xdocs/trunk/running.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/documentation/content/xdocs/trunk/running.xml?view=diff&rev=493473&r1=493472&r2=493473
==============================================================================
--- xmlgraphics/fop/trunk/src/documentation/content/xdocs/trunk/running.xml (original)
+++ xmlgraphics/fop/trunk/src/documentation/content/xdocs/trunk/running.xml Sat Jan  6 06:18:57 2007
@@ -184,7 +184,7 @@
         <p>FOP's entry point for your own scripts is the class
 <code>org.apache.fop.cli.Main</code>. The general pattern for the
         command line is: <code>java -classpath &lt;CLASSPATH>
-        org.apache.fop.cli.Main  &lt;arguments></code>. The arguments
+        org.apache.fop.cli.Main &lt;arguments></code>. The arguments
         consist of the options and infile and outfile specifications
         as shown above for the standard scripts. You may wish to review
         the standard scripts to make sure that 
@@ -195,35 +195,48 @@
         <title>Running with java's <code>-jar</code> option</title>
       <p>
         As an alternative to the start scripts you can run <code>java
-        -jar build/fop.jar</code> from the FOP_HOME directory. In this
-        case FOP tries to build the classpath for running FOP
-        dynamically, see <a href="#dynamical-classpath">below</a>. If
-        you use hyphenation, you must put <code>fop-hyph.jar</code> in
-        the <code>lib</code> directory.
+        -jar path/to/build/fop.jar &lt;arguments></code>, relying on
+        FOP to build the classpath for running FOP dynamically, see <a
+        href="#dynamical-classpath">below</a>. If you use hyphenation,
+        you must put <code>fop-hyph.jar</code> in the <code>lib</code>
+        directory.
       </p>
-      <p>You can also run <code>java -jar fop.jar</code> from any
-      other working directory. This only works if you put
+
+      <p>You can also run <code>java -jar path/to/fop.jar
+      &lt;arguments></code>, relying on the <code>Class-Path</code>
+      entry in the manifest file. This works if you put
       <code>fop.jar</code> and all jar files from the <code>lib</code>
-      directory in a single directory. See the <code>Class-Path</code>
-      entry in the manifest file. If you use hyphenation, you
+      directory in a single directory. If you use hyphenation, you
       must also put <code>fop-hyph.jar</code> in that directory.</p>
+
+		<p>In both cases the arguments consist of the options and
+        infile and outfile specifications as shown above for the
+        standard scripts.</p>
       </section>
       <section id="dynamical-classpath">
 		<title>FOP's dynamical classpath construction</title>
 
 		<p>If FOP is started without a proper classpath, it tries to
-		add its dependencies dynamically. FOP expects to find
-		<code>fop.jar</code> in the <code>build</code> directory,
-		which is either the current working directory or one of its
-		subdirectories. Then FOP adds all <code>jar</code> files in
-		the <code>lib</code> directory to the classpath. The
-		<code>lib</code> directory is a sibling directory of the
-		<code>build</code> directory, or, if that does not exist, the
-		parent directory of the <code>build</code> directory. If the
-		system property <code>fop.optional.lib</code> contains the
-		name of a directory, then all <code>jar</code> files in that
-		directory are also added to the classpath. See the methods
-		<code>getJARList</code> and <code>checkDependencies</code> in
+		add its dependencies dynamically. If the system property
+		<code>fop.home</code> contains the name of a directory, then
+		FOP uses that directory as the base directory for its
+		search. Otherwise the current working directory is the base
+		directory. If the base directory is called <code>build</code>,
+		then its parent directory becomes the base directory.</p>
+
+        <p>FOP expects to find <code>fop.jar</code> in the
+		<code>build</code> subdirectory of the base directory, and
+		adds it to the classpath. Subsequently FOP adds all
+		<code>jar</code> files in the lib directory to the
+		classpath. The lib directory is either the <code>lib</code>
+		subdirectory of the base directory, or, if that does not
+		exist, the base directory itself.</p>
+
+        <p>If the system property <code>fop.optional.lib</code>
+		contains the name of a directory, then all <code>jar</code>
+		files in that directory are also added to the classpath. See
+		the methods <code>getJARList</code> and
+		<code>checkDependencies</code> in
 		<code>org.apache.fop.cli.Main</code>.</p>
 
 	  </section>

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/cli/Main.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/cli/Main.java?view=diff&rev=493473&r1=493472&r2=493473
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/cli/Main.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/cli/Main.java Sat Jan  6 06:18:57 2007
@@ -42,7 +42,13 @@
      * instances to URLs.
      */
     public static URL[] getJARList() throws MalformedURLException {
-        File baseDir = new File(".").getAbsoluteFile().getParentFile();
+        String fopHome = System.getProperty("fop.home");
+        File baseDir;
+        if (fopHome != null) {
+            baseDir = new File(fopHome).getAbsoluteFile();
+        } else {
+            baseDir = new File(".").getAbsoluteFile().getParentFile();
+        }
         File buildDir;
         if ("build".equals(baseDir.getName())) {
             buildDir = baseDir;



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