diff --git a/build.bat b/build.bat index 57c087d4b..3a2c9ef8d 100755 --- a/build.bat +++ b/build.bat @@ -1,23 +1,13 @@ @echo off -rem ---------------------------------------------------------------------------- -rem build.bat - Win32 Build Script for Apache Cocoon -rem -rem $Id$ -rem ---------------------------------------------------------------------------- -rem ----- Copy Xalan and Xerces for the build system ------------------------ -copy lib\optional\xerces*.jar tools\lib -copy lib\optional\xalan*.jar tools\lib -copy lib\optional\xml-api*.jar tools\lib -copy lib\optional\jtidy*.jar tools\lib - -rem ----- Verify and Set Required Environment Variables ------------------------ - -REM Commented out so it always uses poi's ant -- gjs -- if not "%ANT_HOME%" == "" goto gotAntHome set OLD_ANT_HOME=%ANT_HOME% -set ANT_HOME=tools -:gotAntHome +set ANT_HOME=tools\ant + +set OLD_CLASSPATH=%CLASSPATH% +set CLASSPATH=tools\centipede\lib\xml-apis.jar;tools\centipede\lib\xerces.jar;tools\centipede\lib\xalan.jar;tools\centipede\lib\junit.jar;tools\centipede\lib\jIzPress.jar;tools\centipede\lib\jtidy.jar + +call %ANT_HOME%\bin\ant -listener org.apache.tools.ant.XmlLogger %1 %2 %3 %4 %5 %6 %7 %8 %9 -call %ANT_HOME%\bin\ant %1 %2 %3 %4 %5 %6 %7 %8 %9 set ANT_HOME=%OLD_ANT_HOME% +set CLASSPATH=%OLD_CLASSPATH% diff --git a/build.sh b/build.sh index dc3c1d4a7..2f51797c2 100755 --- a/build.sh +++ b/build.sh @@ -1,24 +1,24 @@ #!/bin/sh -echo -echo "POI Build System " -echo "----------------------------" +chmod u+x ./tools/ant/bin/antRun +chmod u+x ./tools/ant/bin/ant -cp -f ./lib/optional/xalan*.jar ./tools/lib -cp -f ./lib/optional/xerces*.jar ./tools/lib -cp -f ./lib/optional/xml-api*.jar ./tools/lib -cp -f ./lib/optional/jtidy*.jar ./tools/lib - -chmod u+x ./tools/bin/antRun -chmod u+x ./tools/bin/ant +OLD_ANT_HOME=$ANT_HOME unset ANT_HOME CP=$CLASSPATH export CP unset CLASSPATH -$PWD/tools/bin/ant -logger org.apache.tools.ant.NoBannerLogger -emacs $@ +CLASSPATH="./tools/centipede/lib/xml-apis.jar:./tools/centipede/lib/xerces.jar:./tools/centipede/lib/xalan.jar:./tools/centipede/lib/junit.jar:./tools/centipede/lib/jIzPress.jar:./tools/centipede/lib/jtidy.jar" +export CLASSPATH + +$PWD/./tools/ant/bin/ant -listener org.apache.tools.ant.XmlLogger $@ + +unset CLASSPATH CLASSPATH=$CP export CLASSPATH +ANT_HOME=OLD_ANT_HOME +export ANT_HOME diff --git a/build.xml b/build.xml index 00365f1d2..d3a7d1ed6 100644 --- a/build.xml +++ b/build.xml @@ -1,20 +1,5 @@ - - - - - - - - - - -]> - - - + + + + + + + + + + + + + + + + + + + + + + + +]> + + + - - + + + &preinit-target; + &project-target; + &init-target; &compile-target; diff --git a/src/java/org/apache/poi/hssf/HSSFLog.java b/legal/LICENSE.commons-logging similarity index 53% rename from src/java/org/apache/poi/hssf/HSSFLog.java rename to legal/LICENSE.commons-logging index cfef5c31f..1299c7bf9 100644 --- a/src/java/org/apache/poi/hssf/HSSFLog.java +++ b/legal/LICENSE.commons-logging @@ -1,8 +1,13 @@ - -/* ==================================================================== +/* + * $Header$ + * $Revision$ + * $Date$ + * + * ==================================================================== + * * The Apache Software License, Version 1.1 * - * Copyright (c) 2002 The Apache Software Foundation. All rights + * Copyright (c) 1999-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,28 +15,28 @@ * are met: * * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. + * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the + * 3. The end-user documentation included with the redistribution, if + * any, must include the following acknowlegement: + * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. + * Alternately, this acknowlegement may appear in the software itself, + * if and wherever such third-party acknowlegements normally appear. * - * 4. The names "Apache" and "Apache Software Foundation" and - * "Apache POI" must not be used to endorse or promote products - * derived from this software without prior written permission. For - * written permission, please contact apache@apache.org. + * 4. The names "The Jakarta Project", "Commons", and "Apache Software + * Foundation" must not be used to endorse or promote products derived + * from this software without prior written permission. For written + * permission, please contact apache@apache.org. * - * 5. Products derived from this software may not be called "Apache", - * "Apache POI", nor may "Apache" appear in their name, without - * prior written permission of the Apache Software Foundation. + * 5. Products derived from this software may not be called "Apache" + * nor may "Apache" appear in their names without prior written + * permission of the Apache Group. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES @@ -51,46 +56,10 @@ * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * . - */ - -/* - * HSSFLog.java * - * Created on December 3, 2001, 2:30 PM - */ -package org.apache.poi.hssf; + */ -import org.apache.poi.util.POILogFactory; -import org.apache.poi.util.POILogger; -/** - * Provides logging to HSSF without it having to mess with - * configuration/initialization. - * - * @author Andrew C. Oliver (acoliver at apache dot org) - * @author Marc Johnson (mjohnson at apache dot org) - */ -public class HSSFLog - extends POILogFactory -{ - private static HSSFLog _the_instance = null; - /** - * Create a new instance of HSSFLog - */ - private HSSFLog() - { - super("hssflog.properties", "HSSF.log"); - } - - public static POILogger getPOILogger(final Class theclass) - { - if (_the_instance == null) - { - _the_instance = new HSSFLog(); - } - return _the_instance.getLogger(theclass); - } -} diff --git a/lib/core/commons-logging-1.0.jar b/lib/core/commons-logging-1.0.jar new file mode 100644 index 000000000..b69fffb21 Binary files /dev/null and b/lib/core/commons-logging-1.0.jar differ diff --git a/lib/core/log4j-1.2beta4.jar b/lib/core/log4j-1.2beta4.jar deleted file mode 100644 index e01a9cb67..000000000 Binary files a/lib/core/log4j-1.2beta4.jar and /dev/null differ diff --git a/lib/optional/cocoon-dev-20020129-nooptional.jar b/lib/optional/cocoon-dev-20020129-nooptional.jar deleted file mode 100644 index 563b0c392..000000000 Binary files a/lib/optional/cocoon-dev-20020129-nooptional.jar and /dev/null differ diff --git a/lib/optional/log4j-core.jar b/lib/optional/log4j-core.jar new file mode 100644 index 000000000..da6d8c2e5 Binary files /dev/null and b/lib/optional/log4j-core.jar differ diff --git a/lib/optional/logkit-20011212.jar b/lib/optional/logkit-20011212.jar deleted file mode 100644 index f6b7fa8c2..000000000 Binary files a/lib/optional/logkit-20011212.jar and /dev/null differ diff --git a/lib/optional/resolver.jar b/lib/optional/resolver.jar deleted file mode 100755 index 23d190fa4..000000000 Binary files a/lib/optional/resolver.jar and /dev/null differ diff --git a/lib/optional/xerces-1.4.4.jar b/lib/optional/xerces-1.4.4.jar deleted file mode 100644 index 1e4ea9898..000000000 Binary files a/lib/optional/xerces-1.4.4.jar and /dev/null differ diff --git a/lib/optional/xml-apis.jar b/lib/optional/xml-apis.jar deleted file mode 100644 index dd892c8cc..000000000 Binary files a/lib/optional/xml-apis.jar and /dev/null differ diff --git a/src/contrib/builds/poibrowser.xml b/src/contrib/builds/poibrowser.xml deleted file mode 100644 index 68eb0cf97..000000000 --- a/src/contrib/builds/poibrowser.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - Please select a file to view - - - - - - - - - - - - - - diff --git a/tools/resources/Release-Checklist.txt b/src/documentation/Release-Checklist.txt old mode 100755 new mode 100644 similarity index 100% rename from tools/resources/Release-Checklist.txt rename to src/documentation/Release-Checklist.txt diff --git a/src/documentation/cocoon.xconf b/src/documentation/cocoon.xconf deleted file mode 100755 index c5236dc32..000000000 --- a/src/documentation/cocoon.xconf +++ /dev/null @@ -1,365 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/documentation/images/.xvpics/header.gif b/src/documentation/images/.xvpics/header.gif deleted file mode 100644 index 62721418b..000000000 Binary files a/src/documentation/images/.xvpics/header.gif and /dev/null differ diff --git a/src/documentation/images/avalon-compatible.png b/src/documentation/images/avalon-compatible.png new file mode 100644 index 000000000..ecdd455a8 Binary files /dev/null and b/src/documentation/images/avalon-compatible.png differ diff --git a/src/documentation/images/built-with-cocoon.png b/src/documentation/images/built-with-cocoon.png new file mode 100644 index 000000000..64e25d3bb Binary files /dev/null and b/src/documentation/images/built-with-cocoon.png differ diff --git a/src/documentation/images/cocoon2-small.jpg b/src/documentation/images/cocoon2-small.jpg deleted file mode 100755 index e8f6dd8c8..000000000 Binary files a/src/documentation/images/cocoon2-small.jpg and /dev/null differ diff --git a/src/documentation/images/krysalis-compatible.png b/src/documentation/images/krysalis-compatible.png new file mode 100644 index 000000000..589305e60 Binary files /dev/null and b/src/documentation/images/krysalis-compatible.png differ diff --git a/src/documentation/images/made-with-cocoon.png b/src/documentation/images/made-with-cocoon.png deleted file mode 100644 index e409cb413..000000000 Binary files a/src/documentation/images/made-with-cocoon.png and /dev/null differ diff --git a/src/documentation/linkalarm-readme.txt b/src/documentation/linkalarm-readme.txt deleted file mode 100755 index dd5646970..000000000 --- a/src/documentation/linkalarm-readme.txt +++ /dev/null @@ -1,28 +0,0 @@ -The LinkAlarm report for xml.apache.org/cocoon/ is at -http://reports.linkalarm.com/373104199608/ - -LinkAlarm scans are run after each release to detect any -issues that need to be addressed prior to the next release. - -The LinkAlarm report gives detailed HTML views of the situation -in an easy-to-read style. However, the summary file that is -explained below has concise info about actual broken links. -One other LinkAlarm page that is of special interest is the -"mailto:" validation page (those errors are not included in -the summary listing below). - -To facilitate the management of link mending by the cocoon-dev -team, there is a summary file in the HEAD CVS at - documentation/linkalarm-broken.txt -This tab-delimited file has the following format ... - -status problem_link referring_page response_code meaning comment - -where "status" has these codes ... - - ... not yet addressed - F ... fixed - ? ... has some issue (see the "comment" field) - [1-3] ... external link has been broken for n runs - -To reduce duplication of effort, please update the "status" -tag for each issue that you might address. diff --git a/src/documentation/sitemap.xmap b/src/documentation/sitemap.xmap index 49b348ba8..be3090722 100755 --- a/src/documentation/sitemap.xmap +++ b/src/documentation/sitemap.xmap @@ -5,35 +5,16 @@ - - - - - - - - - - false - false - - - - - - - - - - iso8859-1 - - - - - - + + + + + + + + @@ -54,7 +35,7 @@ - + @@ -70,7 +51,7 @@ - + @@ -78,7 +59,7 @@ - + @@ -86,40 +67,13 @@ - + - - - - - - - - - - - - - - - - - - - - - - - @@ -165,18 +119,10 @@ - - - - - - - - @@ -197,15 +143,6 @@ - - - - - - - - - diff --git a/src/documentation/stylesheets/announcement.xsl b/src/documentation/stylesheets/announcement.xsl deleted file mode 100755 index 230506202..000000000 --- a/src/documentation/stylesheets/announcement.xsl +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - diff --git a/src/documentation/stylesheets/book2menu.xsl b/src/documentation/stylesheets/book2menu.xsl index e97057fd1..ab0fb1fe4 100755 --- a/src/documentation/stylesheets/book2menu.xsl +++ b/src/documentation/stylesheets/book2menu.xsl @@ -14,20 +14,16 @@ - - -
    +
    +
    -
-

-
  • +
    - - + \ No newline at end of file diff --git a/src/documentation/stylesheets/docbook2body.xsl b/src/documentation/stylesheets/docbook2body.xsl index 88f0d6928..27621919b 100755 --- a/src/documentation/stylesheets/docbook2body.xsl +++ b/src/documentation/stylesheets/docbook2body.xsl @@ -6,16 +6,31 @@ <xsl:value-of select="title"/> -
    - - - - -
    -
    :
    -
    -
    -

    + + + + + + +
    + + + + + + +
    + + + + + + +
    + : +
    +
    +
    @@ -25,15 +40,31 @@ <xsl:value-of select="title"/> -
    - - - - -
    -
    -
    -
    + + + + + + +
    + + + + + + +
    + + + + + + +
    + +
    +
    +
    @@ -58,7 +89,7 @@ -
    + @@ -424,13 +455,6 @@
    - - - - - - diff --git a/src/documentation/stylesheets/doclist.xsl b/src/documentation/stylesheets/doclist.xsl deleted file mode 100755 index ecb2465bf..000000000 --- a/src/documentation/stylesheets/doclist.xsl +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - diff --git a/src/documentation/stylesheets/doclist2document.xsl b/src/documentation/stylesheets/doclist2document.xsl deleted file mode 100755 index 4219c6351..000000000 --- a/src/documentation/stylesheets/doclist2document.xsl +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - -
    - List of all documentation -
    - - -

    - This complete list shows, at a glance, how all of the documentation - fits together within the hierarchy of sections. - -

    -

    - The side-panel of each actual document is used to reach other documents - that are relevant to that section. The side-panel will change, according - to that section's location in the documentation hierarchy. -

    -
    - - -
    -
    - - - - -

    This first section is a list of the top-level documentation - (and is a replica of this page's side-panel).

    -
    - -
    -
    - - - -

    -
      - - - -
    -
    -
    - - - - - - - -
  • -
  • -
    -
    -
    - - - - - - - -
  • - -
    - -
  • -
    -
    -
    -
    - -
    diff --git a/src/documentation/stylesheets/document2docbook.xsl b/src/documentation/stylesheets/document2docbook.xsl index 2967f7691..33b48beae 100755 --- a/src/documentation/stylesheets/document2docbook.xsl +++ b/src/documentation/stylesheets/document2docbook.xsl @@ -144,7 +144,11 @@ - + + + + + @@ -152,13 +156,7 @@
    - - - - - - - + @@ -176,3 +174,4 @@ + diff --git a/src/documentation/stylesheets/document2html.xsl b/src/documentation/stylesheets/document2html.xsl deleted file mode 100755 index f64b59b51..000000000 --- a/src/documentation/stylesheets/document2html.xsl +++ /dev/null @@ -1,389 +0,0 @@ - - - - - - - - - - - - - - - <xsl:value-of select="document/header/title"/> - - - NO TITLE - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - -
    - - -
    - - - - -
    - -
    -
    -
    -
    - - -
    - - - - - - - - - - - - - - - - -
    - - -
    - - - - -
    - -
    -
    -
    -
    - - -
    - - - - - - - - - - - - - - - - -
    - - -
    - - - - -
    - -
    -
    -
    -
    - - -
    - - - - - - - - - - - - - - - - -
    - - -
    - - - - -
    - -
    -
    -
    -
    - - - - - - - - - - - - - - -

    -
    - - -

    - - - - - -
    - Note - - - - - - -
    -

    -
    - - -
    - - - - - - - - - - - - - - - - -
    -
    -
    - - - - - - - - - - -
    - - - -
    -
    - - - - - - - - -
      - -
    -
    - - -
  • - - - - -
  • -
    - - - - - - - - - -
    -
    - - - - - - - - -   - - - - - - - -   - - - - - - -   - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    - - - {@alt} - - - {@alt} - - -

    -
    - - - {@alt} - - - - {@alt} - - - - - - - - - - - - - - - - - - - - - - - - anchor - - - - - - - -
    -
    - -
    diff --git a/src/documentation/stylesheets/announcement2txt.xsl b/src/documentation/stylesheets/projectinfo2announcement.xsl old mode 100755 new mode 100644 similarity index 98% rename from src/documentation/stylesheets/announcement2txt.xsl rename to src/documentation/stylesheets/projectinfo2announcement.xsl index d5c3ab87a..dd9e2c0f2 --- a/src/documentation/stylesheets/announcement2txt.xsl +++ b/src/documentation/stylesheets/projectinfo2announcement.xsl @@ -2,7 +2,6 @@ - diff --git a/src/documentation/stylesheets/projectinfo2todo.xsl b/src/documentation/stylesheets/projectinfo2todo.xsl new file mode 100644 index 000000000..dd9e2c0f2 --- /dev/null +++ b/src/documentation/stylesheets/projectinfo2todo.xsl @@ -0,0 +1,107 @@ + + + + + + + + + Released + + + + + + + + + +For more information about + + , please go to + + + + +Changes with + + + + + + + + + + + + + + + + + + + + + + + + + +For more information about + + , please go to + + + + +Changes with + + + + + + + + + + + + + + + + + + ( + + ) + + + + + *) + + + [ + + ] + + + + + + + + + + + - + + + + + + diff --git a/src/documentation/stylesheets/projectinfo2txt.xsl b/src/documentation/stylesheets/projectinfo2txt.xsl new file mode 100644 index 000000000..dd9e2c0f2 --- /dev/null +++ b/src/documentation/stylesheets/projectinfo2txt.xsl @@ -0,0 +1,107 @@ + + + + + + + + + Released + + + + + + + + + +For more information about + + , please go to + + + + +Changes with + + + + + + + + + + + + + + + + + + + + + + + + + +For more information about + + , please go to + + + + +Changes with + + + + + + + + + + + + + + + + + + ( + + ) + + + + + *) + + + [ + + ] + + + + + + + + + + + - + + + + + + diff --git a/src/documentation/stylesheets/script-cli.js b/src/documentation/stylesheets/script-cli.js deleted file mode 100755 index 580dd4a1b..000000000 --- a/src/documentation/stylesheets/script-cli.js +++ /dev/null @@ -1,27 +0,0 @@ -rolloverImagesOn=new Array(); -rolloverImagesOff=new Array(); - -function rolloverOn(name) { - if(document.images[name] && rolloverImagesOn[name]) document.images[name].src=rolloverImagesOn[name].src; -} - -function rolloverOff(name) { - if(document.images[name] && rolloverImagesOff[name]) document.images[name].src=rolloverImagesOff[name].src; -} - - -function rolloverLoad(name,on,off) { - rolloverImagesOn[name]=new Image(); - rolloverImagesOn[name].src=mangle(on); - rolloverImagesOff[name]=new Image(); - rolloverImagesOff[name].src=mangle(off); -} - -function mangle(name) { - - name = name.replace(/:/g, "_"); - name = name.replace(/\?/g, "_"); - name = name.replace(/\"/g, "\'"); - - return name; -} diff --git a/src/documentation/stylesheets/script.js b/src/documentation/stylesheets/script.js deleted file mode 100755 index 77a2762c8..000000000 --- a/src/documentation/stylesheets/script.js +++ /dev/null @@ -1,17 +0,0 @@ -rolloverImagesOn=new Array(); -rolloverImagesOff=new Array(); - -function rolloverOn(name) { - if(document.images[name] && rolloverImagesOn[name]) document.images[name].src=rolloverImagesOn[name].src; -} - -function rolloverOff(name) { - if(document.images[name] && rolloverImagesOff[name]) document.images[name].src=rolloverImagesOff[name].src; -} - -function rolloverLoad(name,on,off) { - rolloverImagesOn[name]=new Image(); - rolloverImagesOn[name].src=on; - rolloverImagesOff[name]=new Image(); - rolloverImagesOff[name].src=off; -} \ No newline at end of file diff --git a/src/documentation/stylesheets/site2xhtml.xsl b/src/documentation/stylesheets/site2xhtml.xsl index 709963b17..f1de4da66 100755 --- a/src/documentation/stylesheets/site2xhtml.xsl +++ b/src/documentation/stylesheets/site2xhtml.xsl @@ -2,66 +2,85 @@ - <xsl:value-of select="/site/body/title"/> - + + + <xsl:value-of select="/site/body/title"/> + + + + + + + + + + + + + + + +
    www.apache.org >jakarta.apache.org >jakarta.apache.org/poi
    + + - - - - - - -
    - - - - - -

    - - - - + + +
    + +
    -
    - -
    - -
    -
    +


    - - - - - - + + +

    - - - Copyright ©2002 Apache Software Foundation - - - - -
    + + + + + + + + + + + + + +
    +
    +
    + Copyright © 2002 Apache Software Foundation +
    +
    +
    + Krysalis Logo + Cocoon Logo +
    + diff --git a/src/documentation/xdocs/book.xml b/src/documentation/xdocs/book.xml index 3bfbb58f2..42ff43d7e 100644 --- a/src/documentation/xdocs/book.xml +++ b/src/documentation/xdocs/book.xml @@ -6,10 +6,6 @@ copyright="@year@ Poi Project" xmlns:xlink="http://www.w3.org/1999/xlink"> - - - - @@ -33,7 +29,6 @@ - diff --git a/src/java/log4j.properties b/src/java/log4j.properties new file mode 100644 index 000000000..a912f3a3c --- /dev/null +++ b/src/java/log4j.properties @@ -0,0 +1,31 @@ +#log4j.rootCategory=debug, globalLog +log4j.category.org.apache.poi.hssf=debug, hssfLog +log4j.category.org.apache.poi.hdf=debug, hdfLog +log4j.category.org.apache.poi.hpsf=debug, hpsfLog +log4j.category.org.apache.poi.poifs=debug, poifsLog +log4j.category.org.apache.poi.util=debug, utilLog + +log4j.appender.hssfLog=org.apache.log4j.FileAppender +log4j.appender.hssfLog.File=hssf.log +log4j.appender.hssfLog.layout=org.apache.log4j.PatternLayout +log4j.appender.hssfLog.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n + +log4j.appender.hdfLog=org.apache.log4j.FileAppender +log4j.appender.hdfLog.File=hdf.log +log4j.appender.hdfLog.layout=org.apache.log4j.PatternLayout +log4j.appender.hdfLog.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n + +log4j.appender.hpsfLog=org.apache.log4j.FileAppender +log4j.appender.hpsfLog.File=hpsf.log +log4j.appender.hpsfLog.layout=org.apache.log4j.PatternLayout +log4j.appender.hpsfLog.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n + +log4j.appender.poifsLog=org.apache.log4j.FileAppender +log4j.appender.poifsLog.File=poifs.log +log4j.appender.poifsLog.layout=org.apache.log4j.PatternLayout +log4j.appender.poifsLog.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n + +log4j.appender.utilLog=org.apache.log4j.FileAppender +log4j.appender.utilLog.File=util.log +log4j.appender.utilLog.layout=org.apache.log4j.PatternLayout +log4j.appender.utilLog.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n diff --git a/src/java/org/apache/poi/hssf/model/Sheet.java b/src/java/org/apache/poi/hssf/model/Sheet.java index a7b850752..c274da546 100644 --- a/src/java/org/apache/poi/hssf/model/Sheet.java +++ b/src/java/org/apache/poi/hssf/model/Sheet.java @@ -61,7 +61,7 @@ import java.util.List; import java.util.ArrayList; import java.util.Iterator; -import org.apache.poi.hssf.HSSFLog; +import org.apache.poi.util.POILogFactory; import org.apache.poi.hssf .record.*; // normally I don't do this, buy we literally mean ALL import org.apache.poi.hssf.record.formula.FormulaUtil; @@ -106,7 +106,7 @@ public class Sheet protected MergeCellsRecord merged = null; protected int mergedloc = 0; private static POILogger log = - HSSFLog.getPOILogger(Sheet.class); + POILogFactory.getLogger(Sheet.class); private ArrayList columnSizes = null; // holds column info protected ValueRecordsAggregate cells = null; diff --git a/src/java/org/apache/poi/hssf/model/Workbook.java b/src/java/org/apache/poi/hssf/model/Workbook.java index 8329a1f00..d45153f9c 100644 --- a/src/java/org/apache/poi/hssf/model/Workbook.java +++ b/src/java/org/apache/poi/hssf/model/Workbook.java @@ -63,7 +63,7 @@ import java.util.Iterator; import org.apache.poi.hssf.record.*; import org.apache.poi.util.POILogger; -import org.apache.poi.hssf.HSSFLog; +import org.apache.poi.util.POILogFactory; /** * Workbook @@ -130,7 +130,7 @@ public class Workbook private int backuppos = 0; // holds the position of the backup record. private static POILogger log = - HSSFLog.getPOILogger(Workbook.class); + POILogFactory.getLogger(Workbook.class); /** * Creates new Workbook with no intitialization --useless right now diff --git a/src/java/org/apache/poi/hssf/package.uml b/src/java/org/apache/poi/hssf/package.uml deleted file mode 100755 index e9c4f18f1..000000000 --- a/src/java/org/apache/poi/hssf/package.uml +++ /dev/null @@ -1,5 +0,0 @@ -V[1.1:net.sourceforge.poi.hssf] -S[net.sourceforge.poi.hssf:HSSFLog,net.sourceforge.poi.util:POILogFactory]{2:(140,107),(148,329)} -P[net.sourceforge.poi.hssf:HSSFLog]{20,20} -P[net.sourceforge.poi.hssf:HSSFLog]{279,20} -P[net.sourceforge.poi.util:POILogFactory]{11,329} diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java b/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java index 55ec266bd..ddb5dc8a6 100644 --- a/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java +++ b/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java @@ -60,7 +60,7 @@ */ package org.apache.poi.hssf.usermodel; -import org.apache.poi.hssf.HSSFLog; +import org.apache.poi.util.POILogFactory; import org.apache.poi.hssf.model.Sheet; import org.apache.poi.hssf.model.Workbook; import org.apache.poi.hssf.record.*; @@ -98,7 +98,7 @@ public class HSSFSheet private Workbook book; private int firstrow; private int lastrow; - private static POILogger log = HSSFLog.getPOILogger(HSSFSheet.class); + private static POILogger log = POILogFactory.getLogger(HSSFSheet.class); /** * Creates new HSSFSheet - called by HSSFWorkbook to create a sheet from diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java b/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java index e41647863..221f16aed 100644 --- a/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java +++ b/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java @@ -59,7 +59,7 @@ */ package org.apache.poi.hssf.usermodel; -import org.apache.poi.hssf.HSSFLog; +import org.apache.poi.util.POILogFactory; import org.apache.poi.hssf.model.Sheet; import org.apache.poi.hssf.model.Workbook; import org.apache.poi.hssf.record.*; @@ -110,7 +110,7 @@ public class HSSFWorkbook */ private ArrayList sheets; - private static POILogger log = HSSFLog.getPOILogger(HSSFWorkbook.class); + private static POILogger log = POILogFactory.getLogger(HSSFWorkbook.class); /** * Creates new HSSFWorkbook from scratch (start here!) diff --git a/src/java/org/apache/poi/util/POILogFactory.java b/src/java/org/apache/poi/util/POILogFactory.java index e52a424dd..683608b23 100644 --- a/src/java/org/apache/poi/util/POILogFactory.java +++ b/src/java/org/apache/poi/util/POILogFactory.java @@ -60,13 +60,7 @@ import java.io.IOException; import java.util.*; -import org.apache.log4j.ConsoleAppender; -import org.apache.log4j.Hierarchy; -import org.apache.log4j.Level; -import org.apache.log4j.Logger; -import org.apache.log4j.PropertyConfigurator; -import org.apache.log4j.SimpleLayout; -import org.apache.log4j.spi.RootCategory; +import org.apache.commons.logging.*; /** * Provides logging without clients having to mess with @@ -74,52 +68,23 @@ import org.apache.log4j.spi.RootCategory; * * @author Andrew C. Oliver (acoliver at apache dot org) * @author Marc Johnson (mjohnson at apache dot org) + * @author Nicola Ken Barozzi (nicolaken at apache.org) */ public class POILogFactory { - private Hierarchy _creator; + private static LogFactory _creator = LogFactory.getFactory(); // map of POILogger instances, with classes as keys - private Map _loggers; - private static final String _fs = System.getProperty("file.separator"); + private static Map _loggers = new HashMap();; + /** * construct a POILogFactory. - * - * @param logFile the name of the file that contains the - * properties governing the logs; should not be - * null or empty - * @param logPathProperty the name of the system property that - * defines the path of logFile; can not be - * null or empty */ - public POILogFactory(final String logFile, final String logPathProperty) + private POILogFactory() { - String logfile = logFile; - String logpath = System.getProperty(logPathProperty); - - if ((logpath != null) && (logpath.trim().length() != 0)) - { - logfile = logpath + _fs + logfile; - } - _creator = - new Hierarchy(new RootCategory(Logger.getRootLogger() - .getLevel())); - try - { - new FileInputStream(logfile).close(); - new PropertyConfigurator().doConfigure(logfile, _creator); - } - catch (IOException e) - { - _creator.getRootLogger() - .addAppender(new ConsoleAppender(new SimpleLayout(), - ConsoleAppender.SYSTEM_OUT)); - _creator.getRootLogger().setLevel((Level)Level.INFO); - } - _loggers = new HashMap(); } /** @@ -130,16 +95,19 @@ public class POILogFactory * @return a POILogger for the specified class */ - public POILogger getLogger(final Class theclass) + public static POILogger getLogger(final Class theclass) { - POILogger logger = ( POILogger ) _loggers.get(theclass); + POILogger logger = null; - if (logger == null) + if (_loggers.containsKey(theclass)) { - logger = new POILogger(_creator.getLogger(theclass.getName())); + logger = ( POILogger ) _loggers.get(theclass); + } + else + { + logger = new POILogger(_creator.getInstance(theclass)); _loggers.put(theclass, logger); } return logger; } } // end public class POILogFactory - diff --git a/src/java/org/apache/poi/util/POILogger.java b/src/java/org/apache/poi/util/POILogger.java index 1b3186b6c..a6d066c38 100644 --- a/src/java/org/apache/poi/util/POILogger.java +++ b/src/java/org/apache/poi/util/POILogger.java @@ -55,8 +55,7 @@ */ package org.apache.poi.util; -import org.apache.log4j.Level; -import org.apache.log4j.Logger; +import org.apache.commons.logging.Log; import java.util.*; @@ -68,16 +67,17 @@ import java.util.*; * * @author Marc Johnson (mjohnson at apache dot org) * @author Glen Stampoultzis (glens at apache.org) + * @author Nicola Ken Barozzi (nicolaken at apache.org) */ public class POILogger { - private Logger log = null; - public static final int DEBUG = Level.DEBUG_INT; - public static final int INFO = Level.INFO_INT; - public static final int WARN = Level.WARN_INT; - public static final int ERROR = Level.ERROR_INT; - public static final int FATAL = Level.FATAL_INT; + private Log log = null; + public static final int DEBUG = 1; + public static final int INFO = 3; + public static final int WARN = 5; + public static final int ERROR = 7; + public static final int FATAL = 9; /** * package scope so it cannot be instantiated outside of the util @@ -86,7 +86,7 @@ public class POILogger * @param log the object that does the real work of logging */ - POILogger(final Logger log) + POILogger(final Log log) { this.log = log; } @@ -94,50 +94,139 @@ public class POILogger /** * Log a message * - * @param logLevel One of DEBUG, INFO, WARN, ERROR, FATAL - * @param obj1 The object to log. This is converted to a string. + * @param level One of DEBUG, INFO, WARN, ERROR, FATAL + * @param obj1 The object to log. */ - public void log(final int logLevel, final Object obj1) + public void log(final int level, final Object obj1) { - log.log(Level.toLevel(logLevel), obj1); + if(level==FATAL) + { + if(log.isFatalEnabled()) + { + log.fatal(obj1); + } + } + else if(level==ERROR) + { + if(log.isErrorEnabled()) + { + log.error(obj1); + } + } + else if(level==WARN) + { + if(log.isWarnEnabled()) + { + log.warn(obj1); + } + } + else if(level==INFO) + { + if(log.isInfoEnabled()) + { + log.info(obj1); + } + } + else if(level==DEBUG) + { + if(log.isDebugEnabled()) + { + log.debug(obj1); + } + } + else + { + if(log.isTraceEnabled()) + { + log.trace(obj1); + } + } + + } + + /** + * Check if a logger is enabled to log at the specified level + * + * @param level One of DEBUG, INFO, WARN, ERROR, FATAL + * @param obj1 The logger to check. + */ + + public boolean check(final Log log, final int level) + { + if(level==FATAL) + { + if(log.isFatalEnabled()) + { + return true; + } + } + else if(level==ERROR) + { + if(log.isErrorEnabled()) + { + return true; + } + } + else if(level==WARN) + { + if(log.isWarnEnabled()) + { + return true; + } + } + else if(level==INFO) + { + if(log.isInfoEnabled()) + { + return true; + } + } + else if(level==DEBUG) + { + if(log.isDebugEnabled()) + { + return true; + } + } + + return false; + } /** * Log a message. Lazily appends Object parameters together. * - * @param logLevel One of DEBUG, INFO, WARN, ERROR, FATAL + * @param level One of DEBUG, INFO, WARN, ERROR, FATAL * @param obj1 first object to place in the message * @param obj2 second object to place in the message */ - public void log(final int logLevel, final Object obj1, final Object obj2) + public void log(final int level, final Object obj1, final Object obj2) { - Level level = Level.toLevel(logLevel); - - if (log.isEnabledFor(level)) + if (check(log, level)) { - log.log(level, new StringBuffer(32).append(obj1).append(obj2)); + log(level, new StringBuffer(32).append(obj1).append(obj2)); } } /** * Log a message. Lazily appends Object parameters together. * - * @param logLevel One of DEBUG, INFO, WARN, ERROR, FATAL + * @param level One of DEBUG, INFO, WARN, ERROR, FATAL * @param obj1 first Object to place in the message * @param obj2 second Object to place in the message * @param obj3 third Object to place in the message */ - public void log(final int logLevel, final Object obj1, final Object obj2, + public void log(final int level, final Object obj1, final Object obj2, final Object obj3) { - Level level = Level.toLevel(logLevel); + - if (log.isEnabledFor(level)) + if (check(log, level)) { - log.log(level, + log(level, new StringBuffer(48).append(obj1).append(obj2) .append(obj3)); } @@ -146,21 +235,21 @@ public class POILogger /** * Log a message. Lazily appends Object parameters together. * - * @param logLevel One of DEBUG, INFO, WARN, ERROR, FATAL + * @param level One of DEBUG, INFO, WARN, ERROR, FATAL * @param obj1 first Object to place in the message * @param obj2 second Object to place in the message * @param obj3 third Object to place in the message * @param obj4 fourth Object to place in the message */ - public void log(final int logLevel, final Object obj1, final Object obj2, + public void log(final int level, final Object obj1, final Object obj2, final Object obj3, final Object obj4) { - Level level = Level.toLevel(logLevel); + - if (log.isEnabledFor(level)) + if (check(log, level)) { - log.log(level, + log(level, new StringBuffer(64).append(obj1).append(obj2) .append(obj3).append(obj4)); } @@ -169,7 +258,7 @@ public class POILogger /** * Log a message. Lazily appends Object parameters together. * - * @param logLevel One of DEBUG, INFO, WARN, ERROR, FATAL + * @param level One of DEBUG, INFO, WARN, ERROR, FATAL * @param obj1 first Object to place in the message * @param obj2 second Object to place in the message * @param obj3 third Object to place in the message @@ -177,14 +266,14 @@ public class POILogger * @param obj5 fifth Object to place in the message */ - public void log(final int logLevel, final Object obj1, final Object obj2, + public void log(final int level, final Object obj1, final Object obj2, final Object obj3, final Object obj4, final Object obj5) { - Level level = Level.toLevel(logLevel); + - if (log.isEnabledFor(level)) + if (check(log, level)) { - log.log(level, + log(level, new StringBuffer(80).append(obj1).append(obj2) .append(obj3).append(obj4).append(obj5)); } @@ -193,7 +282,7 @@ public class POILogger /** * Log a message. Lazily appends Object parameters together. * - * @param logLevel One of DEBUG, INFO, WARN, ERROR, FATAL + * @param level One of DEBUG, INFO, WARN, ERROR, FATAL * @param obj1 first Object to place in the message * @param obj2 second Object to place in the message * @param obj3 third Object to place in the message @@ -202,15 +291,15 @@ public class POILogger * @param obj6 sixth Object to place in the message */ - public void log(final int logLevel, final Object obj1, final Object obj2, + public void log(final int level, final Object obj1, final Object obj2, final Object obj3, final Object obj4, final Object obj5, final Object obj6) { - Level level = Level.toLevel(logLevel); + - if (log.isEnabledFor(level)) + if (check(log, level)) { - log.log(Level.toLevel(logLevel), + log(level , new StringBuffer(96).append(obj1).append(obj2) .append(obj3).append(obj4).append(obj5).append(obj6)); } @@ -219,7 +308,7 @@ public class POILogger /** * Log a message. Lazily appends Object parameters together. * - * @param logLevel One of DEBUG, INFO, WARN, ERROR, FATAL + * @param level One of DEBUG, INFO, WARN, ERROR, FATAL * @param obj1 first Object to place in the message * @param obj2 second Object to place in the message * @param obj3 third Object to place in the message @@ -229,15 +318,15 @@ public class POILogger * @param obj7 seventh Object to place in the message */ - public void log(final int logLevel, final Object obj1, final Object obj2, + public void log(final int level, final Object obj1, final Object obj2, final Object obj3, final Object obj4, final Object obj5, final Object obj6, final Object obj7) { - Level level = Level.toLevel(logLevel); + - if (log.isEnabledFor(level)) + if (check(log, level)) { - log.log(level, + log(level, new StringBuffer(112).append(obj1).append(obj2) .append(obj3).append(obj4).append(obj5).append(obj6) .append(obj7)); @@ -247,7 +336,7 @@ public class POILogger /** * Log a message. Lazily appends Object parameters together. * - * @param logLevel One of DEBUG, INFO, WARN, ERROR, FATAL + * @param level One of DEBUG, INFO, WARN, ERROR, FATAL * @param obj1 first Object to place in the message * @param obj2 second Object to place in the message * @param obj3 third Object to place in the message @@ -258,15 +347,15 @@ public class POILogger * @param obj8 eighth Object to place in the message */ - public void log(final int logLevel, final Object obj1, final Object obj2, + public void log(final int level, final Object obj1, final Object obj2, final Object obj3, final Object obj4, final Object obj5, final Object obj6, final Object obj7, final Object obj8) { - Level level = Level.toLevel(logLevel); + - if (log.isEnabledFor(level)) + if (check(log, level)) { - log.log(level, + log(level, new StringBuffer(128).append(obj1).append(obj2) .append(obj3).append(obj4).append(obj5).append(obj6) .append(obj7).append(obj8)); @@ -276,34 +365,34 @@ public class POILogger /** * Log a message * - * @param logLevel One of DEBUG, INFO, WARN, ERROR, FATAL + * @param level One of DEBUG, INFO, WARN, ERROR, FATAL * @param obj1 The object to log. This is converted to a string. * @param exception An exception to be logged */ - public void log(final int logLevel, final Object obj1, + public void log(final int level, final Object obj1, final Throwable exception) { - log.log(Level.toLevel(logLevel), obj1, exception); + log(level , obj1, exception); } /** * Log a message. Lazily appends Object parameters together. * - * @param logLevel One of DEBUG, INFO, WARN, ERROR, FATAL + * @param level One of DEBUG, INFO, WARN, ERROR, FATAL * @param obj1 first Object to place in the message * @param obj2 second Object to place in the message * @param exception An exception to be logged */ - public void log(final int logLevel, final Object obj1, final Object obj2, + public void log(final int level, final Object obj1, final Object obj2, final Throwable exception) { - Level level = Level.toLevel(logLevel); + - if (log.isEnabledFor(level)) + if (check(log, level)) { - log.log(level, new StringBuffer(32).append(obj1).append(obj2), + log(level, new StringBuffer(32).append(obj1).append(obj2), exception); } } @@ -311,21 +400,21 @@ public class POILogger /** * Log a message. Lazily appends Object parameters together. * - * @param logLevel One of DEBUG, INFO, WARN, ERROR, FATAL + * @param level One of DEBUG, INFO, WARN, ERROR, FATAL * @param obj1 first Object to place in the message * @param obj2 second Object to place in the message * @param obj3 third object to place in the message * @param exception An error message to be logged */ - public void log(final int logLevel, final Object obj1, final Object obj2, + public void log(final int level, final Object obj1, final Object obj2, final Object obj3, final Throwable exception) { - Level level = Level.toLevel(logLevel); + - if (log.isEnabledFor(level)) + if (check(log, level)) { - log.log(level, new StringBuffer(48).append(obj1).append(obj2) + log(level, new StringBuffer(48).append(obj1).append(obj2) .append(obj3), exception); } } @@ -333,7 +422,7 @@ public class POILogger /** * Log a message. Lazily appends Object parameters together. * - * @param logLevel One of DEBUG, INFO, WARN, ERROR, FATAL + * @param level One of DEBUG, INFO, WARN, ERROR, FATAL * @param obj1 first Object to place in the message * @param obj2 second Object to place in the message * @param obj3 third object to place in the message @@ -341,15 +430,15 @@ public class POILogger * @param exception An exception to be logged */ - public void log(final int logLevel, final Object obj1, final Object obj2, + public void log(final int level, final Object obj1, final Object obj2, final Object obj3, final Object obj4, final Throwable exception) { - Level level = Level.toLevel(logLevel); + - if (log.isEnabledFor(level)) + if (check(log, level)) { - log.log(level, new StringBuffer(64).append(obj1).append(obj2) + log(level, new StringBuffer(64).append(obj1).append(obj2) .append(obj3).append(obj4), exception); } } @@ -357,7 +446,7 @@ public class POILogger /** * Log a message. Lazily appends Object parameters together. * - * @param logLevel One of DEBUG, INFO, WARN, ERROR, FATAL + * @param level One of DEBUG, INFO, WARN, ERROR, FATAL * @param obj1 first Object to place in the message * @param obj2 second Object to place in the message * @param obj3 third object to place in the message @@ -366,15 +455,15 @@ public class POILogger * @param exception An exception to be logged */ - public void log(final int logLevel, final Object obj1, final Object obj2, + public void log(final int level, final Object obj1, final Object obj2, final Object obj3, final Object obj4, final Object obj5, final Throwable exception) { - Level level = Level.toLevel(logLevel); + - if (log.isEnabledFor(level)) + if (check(log, level)) { - log.log(level, new StringBuffer(80).append(obj1).append(obj2) + log(level, new StringBuffer(80).append(obj1).append(obj2) .append(obj3).append(obj4).append(obj5), exception); } } @@ -382,7 +471,7 @@ public class POILogger /** * Log a message. Lazily appends Object parameters together. * - * @param logLevel One of DEBUG, INFO, WARN, ERROR, FATAL + * @param level One of DEBUG, INFO, WARN, ERROR, FATAL * @param obj1 first Object to place in the message * @param obj2 second Object to place in the message * @param obj3 third object to place in the message @@ -392,15 +481,15 @@ public class POILogger * @param exception An exception to be logged */ - public void log(final int logLevel, final Object obj1, final Object obj2, + public void log(final int level, final Object obj1, final Object obj2, final Object obj3, final Object obj4, final Object obj5, final Object obj6, final Throwable exception) { - Level level = Level.toLevel(logLevel); + - if (log.isEnabledFor(level)) + if (check(log, level)) { - log.log(Level.toLevel(logLevel), new StringBuffer(96).append(obj1) + log(level , new StringBuffer(96).append(obj1) .append(obj2).append(obj3).append(obj4).append(obj5) .append(obj6), exception); } @@ -409,7 +498,7 @@ public class POILogger /** * Log a message. Lazily appends Object parameters together. * - * @param logLevel One of DEBUG, INFO, WARN, ERROR, FATAL + * @param level One of DEBUG, INFO, WARN, ERROR, FATAL * @param obj1 first Object to place in the message * @param obj2 second Object to place in the message * @param obj3 third object to place in the message @@ -420,16 +509,16 @@ public class POILogger * @param exception An exception to be logged */ - public void log(final int logLevel, final Object obj1, final Object obj2, + public void log(final int level, final Object obj1, final Object obj2, final Object obj3, final Object obj4, final Object obj5, final Object obj6, final Object obj7, final Throwable exception) { - Level level = Level.toLevel(logLevel); + - if (log.isEnabledFor(level)) + if (check(log, level)) { - log.log(level, new StringBuffer(112).append(obj1).append(obj2) + log(level, new StringBuffer(112).append(obj1).append(obj2) .append(obj3).append(obj4).append(obj5).append(obj6) .append(obj7), exception); } @@ -438,7 +527,7 @@ public class POILogger /** * Log a message. Lazily appends Object parameters together. * - * @param logLevel One of DEBUG, INFO, WARN, ERROR, FATAL + * @param level One of DEBUG, INFO, WARN, ERROR, FATAL * @param obj1 first Object to place in the message * @param obj2 second Object to place in the message * @param obj3 third object to place in the message @@ -450,16 +539,16 @@ public class POILogger * @param exception An exception to be logged */ - public void log(final int logLevel, final Object obj1, final Object obj2, + public void log(final int level, final Object obj1, final Object obj2, final Object obj3, final Object obj4, final Object obj5, final Object obj6, final Object obj7, final Object obj8, final Throwable exception) { - Level level = Level.toLevel(logLevel); + - if (log.isEnabledFor(level)) + if (check(log, level)) { - log.log(level, new StringBuffer(128).append(obj1).append(obj2) + log(level, new StringBuffer(128).append(obj1).append(obj2) .append(obj3).append(obj4).append(obj5).append(obj6) .append(obj7).append(obj8), exception); } @@ -485,15 +574,15 @@ public class POILogger * If the last parameter (after flattening) is a Throwable it is * logged specially. * - * @param logLevel One of DEBUG, INFO, WARN, ERROR, FATAL + * @param level One of DEBUG, INFO, WARN, ERROR, FATAL * @param message The message to log. * @param obj1 The first object to match against. */ - public void logFormatted(final int logLevel, final String message, + public void logFormatted(final int level, final String message, final Object obj1) { - commonLogFormatted(logLevel, message, new Object[] + commonLogFormatted(level, message, new Object[] { obj1 }); @@ -519,16 +608,16 @@ public class POILogger * If the last parameter (after flattening) is a Throwable it is * logged specially. * - * @param logLevel One of DEBUG, INFO, WARN, ERROR, FATAL + * @param level One of DEBUG, INFO, WARN, ERROR, FATAL * @param message The message to log. * @param obj1 The first object to match against. * @param obj2 The second object to match against. */ - public void logFormatted(final int logLevel, final String message, + public void logFormatted(final int level, final String message, final Object obj1, final Object obj2) { - commonLogFormatted(logLevel, message, new Object[] + commonLogFormatted(level, message, new Object[] { obj1, obj2 }); @@ -554,18 +643,18 @@ public class POILogger * If the last parameter (after flattening) is a Throwable it is * logged specially. * - * @param logLevel One of DEBUG, INFO, WARN, ERROR, FATAL + * @param level One of DEBUG, INFO, WARN, ERROR, FATAL * @param message The message to log. * @param obj1 The first object to match against. * @param obj2 The second object to match against. * @param obj3 The third object to match against. */ - public void logFormatted(final int logLevel, final String message, + public void logFormatted(final int level, final String message, final Object obj1, final Object obj2, final Object obj3) { - commonLogFormatted(logLevel, message, new Object[] + commonLogFormatted(level, message, new Object[] { obj1, obj2, obj3 }); @@ -591,7 +680,7 @@ public class POILogger * If the last parameter (after flattening) is a Throwable it is * logged specially. * - * @param logLevel One of DEBUG, INFO, WARN, ERROR, FATAL + * @param level One of DEBUG, INFO, WARN, ERROR, FATAL * @param message The message to log. * @param obj1 The first object to match against. * @param obj2 The second object to match against. @@ -599,33 +688,33 @@ public class POILogger * @param obj4 The forth object to match against. */ - public void logFormatted(final int logLevel, final String message, + public void logFormatted(final int level, final String message, final Object obj1, final Object obj2, final Object obj3, final Object obj4) { - commonLogFormatted(logLevel, message, new Object[] + commonLogFormatted(level, message, new Object[] { obj1, obj2, obj3, obj4 }); } - private void commonLogFormatted(final int logLevel, final String message, + private void commonLogFormatted(final int level, final String message, final Object [] unflatParams) { - Level level = Level.toLevel(logLevel); + - if (log.isEnabledFor(level)) + if (check(log, level)) { Object[] params = flattenArrays(unflatParams); if (params[ params.length - 1 ] instanceof Throwable) { - log(logLevel, StringUtil.format(message, params), + log(level, StringUtil.format(message, params), ( Throwable ) params[ params.length - 1 ]); } else { - log(logLevel, StringUtil.format(message, params)); + log(level, StringUtil.format(message, params)); } } } diff --git a/tools/resources/jindent/poi.jin b/src/resources/devtools/poi.jin old mode 100755 new mode 100644 similarity index 100% rename from tools/resources/jindent/poi.jin rename to src/resources/devtools/poi.jin diff --git a/src/testcases/org/apache/poi/util/TestPOILogFactory.java b/src/testcases/org/apache/poi/util/TestPOILogFactory.java deleted file mode 100644 index 0cb3fa107..000000000 --- a/src/testcases/org/apache/poi/util/TestPOILogFactory.java +++ /dev/null @@ -1,141 +0,0 @@ - -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2002 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" and - * "Apache POI" must not be used to endorse or promote products - * derived from this software without prior written permission. For - * written permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * "Apache POI", nor may "Apache" appear in their name, without - * prior written permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -package org.apache.poi.util; - -import org.apache.log4j.Category; - -import junit.framework.*; - -import java.io.*; - -/** - * @author Marc Johnson (mjohnson at apache dot org) - * @author Glen Stampoultzis (glens at apache.org) - */ - -public class TestPOILogFactory - extends TestCase -{ - private String _test_file_path; - private static final String _test_file_path_property = - "UTIL.testdata.path"; - private static final String _fs = - System.getProperty("file.separator"); - - /** - * Creates new TestPOILogFactory - * - * @param name - */ - - public TestPOILogFactory(String name) - { - super(name); - _test_file_path = System.getProperty(_test_file_path_property) + _fs; - } - - /** - * test log creation - * - * @exception IOException - */ - - public void testLog() - throws IOException - { - - // empty log files - // check the path exists first - assertTrue("Checking for existance of test property directory was " - + _test_file_path, new File(_test_file_path).exists()); - new File("p1.log").delete(); - new File("p2.log").delete(); - POILogFactory f1 = new POILogFactory(_test_file_path - + "test_properties1", "foo"); - POILogFactory f2 = new POILogFactory(_test_file_path - + "test_properties2", "bar"); - POILogger l1 = f1.getLogger(f1.getClass()); - POILogger l2 = f2.getLogger(f2.getClass()); - - l1.log(POILogger.WARN, "test1"); - l2.log(POILogger.WARN, "test2"); - - // It appears necessary that sleep is required for files to be - // written on Win2000. Tried manually closing appenders with - // no luck. - try - { - Thread.sleep(4000); - } - catch (InterruptedException letBuffersFlush) - { - } - assertTrue(new File("p1.log").length() != 0); - assertTrue(new File("p2.log").length() != 0); - } - - /** - * main method to run the unit tests - * - * @param ignored_args - */ - - public static void main(String [] ignored_args) - { - System.out.println("Testing util.POILogFactory functionality"); - junit.textui.TestRunner.run(TestPOILogFactory.class); - } -} diff --git a/src/testcases/org/apache/poi/util/TestPOILogger.java b/src/testcases/org/apache/poi/util/TestPOILogger.java deleted file mode 100644 index 2fcf0a636..000000000 --- a/src/testcases/org/apache/poi/util/TestPOILogger.java +++ /dev/null @@ -1,181 +0,0 @@ - -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2002 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" and - * "Apache POI" must not be used to endorse or promote products - * derived from this software without prior written permission. For - * written permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * "Apache POI", nor may "Apache" appear in their name, without - * prior written permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -package org.apache.poi.util; - -import junit.framework.TestCase; - -import java.io.File; -import java.io.FileInputStream; - -/** - * Tests the log class. - * - * @author Glen Stampoultzis (glens at apache.org) - * @author Marc Johnson (mjohnson at apache dot org) - */ - -public class TestPOILogger - extends TestCase -{ - private String _test_file_path; - private static final String _test_file_path_property = - "UTIL.testdata.path"; - private static final String _fs = - System.getProperty("file.separator"); - private static final String _log_file = "POILogger.log"; - - /** - * Constructor TestPOILogger - * - * - * @param s - * - */ - - public TestPOILogger(String s) - { - super(s); - } - - /** - * Method setUp - * - * - * @exception Exception - * - */ - - protected void setUp() - throws Exception - { - super.setUp(); - _test_file_path = System.getProperty(_test_file_path_property) + _fs; - } - - /** - * Test different types of log output. - * - * @exception Exception - */ - - public void testVariousLogTypes() - throws Exception - { - assertTrue( - "Checking for existance of test property directory, looking for " - + _test_file_path, new File(_test_file_path).exists()); - new File(_log_file).delete(); - POILogFactory f1 = new POILogFactory(_test_file_path - + "test_properties3", "foo"); - POILogger log = f1.getLogger(getClass()); - - log.log(POILogger.WARN, "Test = ", new Integer(1)); - log.logFormatted(POILogger.ERROR, "Test param 1 = %, param 2 = %", - "2", new Integer(3)); - log.logFormatted(POILogger.ERROR, "Test param 1 = %, param 2 = %", - new int[] - { - 4, 5 - }); - log.logFormatted(POILogger.ERROR, - "Test param 1 = %1.1, param 2 = %0.1", new double[] - { - 4, 5.23 - }); - - // It appears necessary that sleep is required for files to be - // written on Win2000. Tried manually closing appenders with - // no luck. - try - { - Thread.sleep(4000); - } - catch (InterruptedException letBuffersFlush) - { - } - String s = fileRead(_log_file); - - assertTrue(s.indexOf("Test = 1") > 0); - assertTrue(s.indexOf("Test param 1 = 2, param 2 = 3") > 0); - assertTrue(s.indexOf("Test param 1 = 4, param 2 = 5") > 0); - assertTrue(s.indexOf("Test param 1 = 4, param 2 = 5.2") > 0); - } - - /** - * Reads the contents of a file. - * - * @param fileName The name of the file to read. - * @return The file contents or null if read failed. - * - * @exception Exception - */ - - public String fileRead(String fileName) - throws Exception - { - StringBuffer buf = new StringBuffer(); - FileInputStream in = new FileInputStream(fileName); - int count; - byte[] b = new byte[ 512 ]; - - while ((count = in.read(b)) > 0) // blocking read - { - buf.append(new String(b, 0, count)); - } - in.close(); - return buf.toString(); - } -} diff --git a/tools/lib/ant-1.4.1-optional.jar b/tools/ant/lib/ant-1.4.1-optional.jar old mode 100755 new mode 100644 similarity index 100% rename from tools/lib/ant-1.4.1-optional.jar rename to tools/ant/lib/ant-1.4.1-optional.jar diff --git a/tools/lib/ant-1.4.1.jar b/tools/ant/lib/ant-1.4.1.jar old mode 100755 new mode 100644 similarity index 100% rename from tools/lib/ant-1.4.1.jar rename to tools/ant/lib/ant-1.4.1.jar diff --git a/tools/bin/ant b/tools/bin/ant deleted file mode 100755 index 4555bf708..000000000 --- a/tools/bin/ant +++ /dev/null @@ -1,107 +0,0 @@ -#! /bin/sh - -if [ -f "$HOME/.antrc" ] ; then - . $HOME/.antrc -fi - -# Cygwin support. $cygwin _must_ be set to either true or false. -case "`uname`" in - CYGWIN*) cygwin=true ;; - *) cygwin=false ;; -esac - -# For Cygwin, ensure paths are in UNIX format before anything is touched -if $cygwin; then - [ -n "$ANT_HOME" ] && - ANT_HOME=`cygpath --unix "$ANT_HOME"` - [ -n "$JAVA_HOME" ] && - JAVA_HOME=`cygpath --unix "$JAVA_HOME"` - [ -n "$CLASSPATH" ] && - CLASSPATH=`cygpath --path --unix "$CLASSPATH"` -fi - -if [ "$ANT_HOME" = "" ] ; then - # try to find ANT - if [ -d /opt/ant ] ; then - ANT_HOME=/opt/ant - fi - - if [ -d ${HOME}/opt/ant ] ; then - ANT_HOME=${HOME}/opt/ant - fi - - ## resolve links - $0 may be a link to ant's home - PRG=$0 - progname=`basename $0` - - while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '.*/.*' > /dev/null; then - PRG="$link" - else - PRG="`dirname $PRG`/$link" - fi - done - - ANT_HOME=`dirname "$PRG"`/.. - -fi - -if [ "$JAVA_HOME" != "" ] ; then - if [ "$JAVACMD" = "" ] ; then - JAVACMD=$JAVA_HOME/bin/java - fi -else - if [ "$JAVACMD" = "" ] ; then - JAVACMD=java - fi -fi - -# add in the dependency .jar files -DIRLIBS=${ANT_HOME}/lib/*.jar -for i in ${DIRLIBS} -do - # if the directory is empty, then it will return the input string - # this is stupid, so case for it - if [ "$i" != "${DIRLIBS}" ] ; then - LOCALCLASSPATH=$LOCALCLASSPATH:"$i" - fi -done - -if [ "$CLASSPATH" != "" ] ; then - LOCALCLASSPATH=$CLASSPATH:$LOCALCLASSPATH -fi - -if [ "$JAVA_HOME" != "" ] ; then - if test -f $JAVA_HOME/lib/tools.jar ; then - LOCALCLASSPATH=$LOCALCLASSPATH:$JAVA_HOME/lib/tools.jar - fi - - if test -f $JAVA_HOME/lib/classes.zip ; then - LOCALCLASSPATH=$LOCALCLASSPATH:$JAVA_HOME/lib/classes.zip - fi -else - echo "Warning: JAVA_HOME environment variable is not set." - echo " If build fails because sun.* classes could not be found" - echo " you will need to set the JAVA_HOME environment variable" - echo " to the installation directory of java." -fi - -# supply JIKESPATH to Ant as jikes.class.path -if [ "$JIKESPATH" != "" ] ; then - if [ "$ANT_OPTS" != "" ] ; then - ANT_OPTS="$ANT_OPTS -Djikes.class.path=$JIKESPATH" - else - ANT_OPTS=-Djikes.class.path=$JIKESPATH - fi -fi - -# For Cygwin, switch paths to Windows format before running java -if $cygwin; then - ANT_HOME=`cygpath --path --windows "$ANT_HOME"` - JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` - LOCALCLASSPATH=`cygpath --path --windows "$LOCALCLASSPATH"` -fi - -$JAVACMD -classpath "$LOCALCLASSPATH" -Dant.home="${ANT_HOME}" $ANT_OPTS org.apache.tools.ant.Main "$@" diff --git a/tools/bin/ant.bat b/tools/bin/ant.bat deleted file mode 100755 index e8f8fd1e8..000000000 --- a/tools/bin/ant.bat +++ /dev/null @@ -1,97 +0,0 @@ -@echo off - -if exist "%HOME%\antrc_pre.bat" call "%HOME%\antrc_pre.bat" - -if not "%OS%"=="Windows_NT" goto win9xStart -:winNTStart -@setlocal - -rem %~dp0 is name of current script under NT -set DEFAULT_ANT_HOME=%~dp0 - -rem : operator works similar to make : operator -set DEFAULT_ANT_HOME=%DEFAULT_ANT_HOME:\bin\=% - -if %ANT_HOME%a==a set ANT_HOME=%DEFAULT_ANT_HOME% -set DEFAULT_ANT_HOME= - -rem On NT/2K grab all arguments at once -set ANT_CMD_LINE_ARGS=%* -goto doneStart - -:win9xStart -rem Slurp the command line arguments. This loop allows for an unlimited number of -rem agruments (up to the command line limit, anyway). - -set ANT_CMD_LINE_ARGS= - -:setupArgs -if %1a==a goto doneStart -set ANT_CMD_LINE_ARGS=%ANT_CMD_LINE_ARGS% %1 -shift -goto setupArgs - -:doneStart -rem This label provides a place for the argument list loop to break out -rem and for NT handling to skip to. - -rem find ANT_HOME -if not "%ANT_HOME%"=="" goto checkJava - -rem check for ant in Program Files on system drive -if not exist "%SystemDrive%\Program Files\ant" goto checkSystemDrive -set ANT_HOME=%SystemDrive%\Program Files\ant -goto checkJava - -:checkSystemDrive -rem check for ant in root directory of system drive -if not exist "%SystemDrive%\ant" goto noAntHome -set ANT_HOME=%SystemDrive%\ant -goto checkJava - -:noAntHome -echo ANT_HOME is not set and ant could not be located. Please set ANT_HOME. -goto end - -:checkJava -set _JAVACMD=%JAVACMD% -set LOCALCLASSPATH="%CLASSPATH%" -for %%i in ("%ANT_HOME%\lib\*.jar") do call "%ANT_HOME%\bin\lcp.bat" "%%i" - -if "%JAVA_HOME%" == "" goto noJavaHome -if "%_JAVACMD%" == "" set _JAVACMD=%JAVA_HOME%\bin\java -if exist "%JAVA_HOME%\lib\tools.jar" call "%ANT_HOME%\bin\lcp.bat" "%JAVA_HOME%\lib\tools.jar" -if exist "%JAVA_HOME%\lib\classes.zip" call "%ANT_HOME%\bin\lcp.bat" "%JAVA_HOME%\lib\classes.zip" -goto checkJikes - -:noJavaHome -if "%_JAVACMD%" == "" set _JAVACMD=java -echo. -echo Warning: JAVA_HOME environment variable is not set. -echo If build fails because sun.* classes could not be found -echo you will need to set the JAVA_HOME environment variable -echo to the installation directory of java. -echo. - -:checkJikes -if not "%JIKESPATH%" == "" goto runAntWithJikes - -:runAnt -%_JAVACMD% -classpath %LOCALCLASSPATH% -Dant.home="%ANT_HOME%" %ANT_OPTS% org.apache.tools.ant.Main %ANT_CMD_LINE_ARGS% -goto end - -:runAntWithJikes -%_JAVACMD% -classpath %LOCALCLASSPATH% -Dant.home="%ANT_HOME%" -Djikes.class.path=%JIKESPATH% %ANT_OPTS% org.apache.tools.ant.Main %ANT_CMD_LINE_ARGS% - -:end -set LOCALCLASSPATH= -set _JAVACMD= -set ANT_CMD_LINE_ARGS= - -if not "%OS%"=="Windows_NT" goto mainEnd -:winNTend -@endlocal - -:mainEnd -if exist "%HOME%\antrc_post.bat" call "%HOME%\antrc_post.bat" - diff --git a/tools/bin/antRun b/tools/bin/antRun deleted file mode 100755 index f0a18f165..000000000 --- a/tools/bin/antRun +++ /dev/null @@ -1,9 +0,0 @@ -#! /bin/sh - -# Args: DIR command -cd "$1" -CMD="$2" -shift -shift - -exec $CMD "$@" diff --git a/tools/bin/antRun.bat b/tools/bin/antRun.bat deleted file mode 100755 index a5484d692..000000000 --- a/tools/bin/antRun.bat +++ /dev/null @@ -1,20 +0,0 @@ -@echo off - -# Change drive and directory to %1 (Win9X only for NT/2K use "cd /d") -cd %1 -%1\ -set ANT_RUN_CMD=%2 -shift -shift - -set PARAMS= -:loop -if ""%1 == "" goto runCommand -set PARAMS=%PARAMS% %1 -shift -goto loop - -:runCommand -rem echo %ANT_RUN_CMD% %PARAMS% -%ANT_RUN_CMD% %PARAMS% - diff --git a/tools/bin/fix-packages.py b/tools/bin/fix-packages.py deleted file mode 100755 index 5858c77a7..000000000 --- a/tools/bin/fix-packages.py +++ /dev/null @@ -1,216 +0,0 @@ -#! /usr/bin/env python -# -# Mass string translation for java/xml files (change Wanted re for other files) -# -# Author: Peter Donald -# -# Adapted from fixid.py in python distribution under Tools -# - -import sys -import re -import string -import os -from stat import * -import getopt - -err = sys.stderr.write -dbg = err -out = sys.stdout.write - -def usage(): - progname = sys.argv[0] - err('Usage: ' + progname + ' [-s file] ... file-or-directory ...\n') - err('\n') - err('-s substfile : add a file of substitutions\n') - err('\n') - err('Each non-empty non-comment line in a substitution file must\n') - err('contain exactly two words separated by a | character.\n') - -def main(): - try: - opts, args = getopt.getopt(sys.argv[1:], 'crs:') - except getopt.error, msg: - err('Options error: ' + str(msg) + '\n') - usage() - sys.exit(2) - bad = 0 - if not args: # No arguments - usage() - sys.exit(2) - for opt, arg in opts: - if opt == '-s': - addsubst(arg) - initre() - for arg in args: - if os.path.isdir(arg): - if recursedown(arg): bad = 1 - elif os.path.islink(arg): - err(arg + ': will not process symbolic links\n') - bad = 1 - else: - if fix(arg): bad = 1 - sys.exit(bad) - -# Change this regular expression to select a different set of files -Wanted = '^[a-zA-Z0-9_\-]+\.(java|xml|xinfo)$' -def wanted(name): - return None <> re.match(Wanted, name) - -def recursedown(dirname): - dbg('recursedown(' + `dirname` + ')\n') - bad = 0 - try: - names = os.listdir(dirname) - except os.error, msg: - err(dirname + ': cannot list directory: ' + str(msg) + '\n') - return 1 - names.sort() - subdirs = [] - for name in names: - if name in (os.curdir, os.pardir): continue - fullname = os.path.join(dirname, name) - if os.path.islink(fullname): pass - elif os.path.isdir(fullname): - subdirs.append(fullname) - elif wanted(name): - if fix(fullname): bad = 1 - for fullname in subdirs: - if recursedown(fullname): bad = 1 - return bad - -def fix(filename): - dbg('fix(' + `filename` + ')\n') - - # File replacement mode - try: - f = open(filename, 'r') - except IOError, msg: - err(filename + ': cannot open: ' + str(msg) + '\n') - return 1 - - head, tail = os.path.split(filename) - tempname = os.path.join(head, '@' + tail) - - # If we find a match, we rewind the file and start over but - # now copy everything to a temp file. - lineno = 0 - g = None - while 1: - line = f.readline() - if not line: break - lineno = lineno + 1 - newline = fixline(line) - if newline != line: - if g is None: - try: - g = open(tempname, 'w') - except IOError, msg: - f.close() - err(tempname+': cannot create: '+ - str(msg)+'\n') - return 1 - f.seek(0) - lineno = 0 - out(filename + ':\n') - continue # restart from the beginning - out(`lineno` + '\n') - out('< ' + line) - out('> ' + newline) - if g is not None: - g.write(newline) - - # End of file - f.close() - if not g: return 0 # No changes - - # Finishing touch -- move files - - # First copy the file's mode to the temp file - try: - statbuf = os.stat(filename) - os.chmod(tempname, statbuf[ST_MODE] & 07777) - except os.error, msg: - err(tempname + ': warning: chmod failed (' + str(msg) + ')\n') - - # Then make a backup of the original file as filename~ - try: - os.rename(filename, filename + '~') - except os.error, msg: - err(filename + ': warning: backup failed (' + str(msg) + ')\n') - - # Now move the temp file to the original file - try: - os.rename(tempname, filename) - except os.error, msg: - err(filename + ': rename failed (' + str(msg) + ')\n') - return 1 - - # Return succes - return 0 - -def initre(): - global SearcherExpr - - keys = Dict.keys() - keyCount = len(keys) - i = 0 - reStr = "" - while i < len(keys): - if i != 0: reStr = reStr + '|' - reStr = reStr + keys[i] - i = i + 1 - SearcherExpr = re.compile( reStr ) - -def fixline(line): - global Program -## print '-->', `line` - i = 0 - - while i < len(line): - match = SearcherExpr.search(line, i) - if match == None: break - found = match.group(0) - i = match.start() - n = len(found) - if Dict.has_key(found): - subst = Dict[found] - - line = line[:i] + subst + line[i+n:] - n = len(subst) - i = i + n - return line - -Dict = {} -NotInComment = {} - -def addsubst(substfile): - try: - fp = open(substfile, 'r') - except IOError, msg: - err(substfile + ': cannot read substfile: ' + str(msg) + '\n') - sys.exit(1) - lineno = 0 - - while 1: - line = fp.readline() - if not line: break - lineno = lineno + 1 - try: - i = string.index(line, '#') - except string.index_error: - i = -1 # Happens to delete trailing \n - words = string.split(line[:i],'|') - if not words: continue - if len(words) <> 2: - err(substfile + ':' + `lineno` + ': warning: bad line: ' + line) - continue - [key, value] = words - -## print 'Will replace ', key, ' with ', value - - Dict[key] = value - - fp.close() - -main() diff --git a/tools/bin/lcp.bat b/tools/bin/lcp.bat deleted file mode 100755 index 8d6b8515a..000000000 --- a/tools/bin/lcp.bat +++ /dev/null @@ -1,2 +0,0 @@ -set LOCALCLASSPATH=%1;%LOCALCLASSPATH% - diff --git a/tools/bin/runant.pl b/tools/bin/runant.pl deleted file mode 100755 index a2cc523e7..000000000 --- a/tools/bin/runant.pl +++ /dev/null @@ -1,131 +0,0 @@ -#!/usr/bin/perl -####################################################################### -# -# runant.pl -# -# wrapper script for invoking ant in a platform with Perl installed -# this may include cgi-bin invocation, which is considered somewhat daft. -# (slo: that should be a separate file which can be derived from this -# and returns the XML formatted output) -# -# the code is not totally portable due to classpath and directory splitting -# issues. oops. (NB, use File::Spec::Functions will help and the code is -# structured for the catfile() call, but because of perl version funnies -# the code is not included. -# -# created: 2000-8-24 -# last modified: 2000-8-24 -# author: Steve Loughran steve_l@sourceforge.net -####################################################################### -# -# Assumptions: -# -# - the "java" executable/script is on the command path -# - ANT_HOME has been set -# - target platform uses ":" as classpath separator or perl indicates it is dos/win32 -# - target platform uses "/" as directory separator. - -#be fussy about variables -use strict; - -#platform specifics (disabled) -#use File::Spec::Functions; - -#turn warnings on during dev; generates a few spurious uninitialised var access warnings -#use warnings; - -#and set $debug to 1 to turn on trace info -my $debug=0; - -####################################################################### -# -# check to make sure environment is setup -# - -my $HOME = $ENV{ANT_HOME}; -if ($HOME eq "") - { - die "\n\nANT_HOME *MUST* be set!\n\n"; - } - -my $JAVACMD = $ENV{JAVACMD}; -$JAVACMD = "java" if $JAVACMD eq ""; - -#ISSUE: what java wants to split up classpath varies from platform to platform -#and perl is not too hot at hinting which box it is on. -#here I assume ":" 'cept on win32 and dos. Add extra tests here as needed. -my $s=":"; -if(($^O eq "MSWin32") || ($^O eq "dos")) - { - $s=";"; - } - -#build up standard classpath -my $localpath=$ENV{CLASSPATH}; -if ($localpath eq "") - { - print "warning: no initial classpath\n" if ($debug); - $localpath=""; - } - -#add jar files. I am sure there is a perl one liner to do this. -my $jarpattern="$HOME/lib/*.jar"; -my @jarfiles =glob($jarpattern); -print "jarfiles=@jarfiles\n" if ($debug); -my $jar; -foreach $jar (@jarfiles ) - { - $localpath.="$s$jar"; - } - -#if Java home is defined, look for tools.jar & classes.zip and add to classpath -my $JAVA_HOME = $ENV{JAVA_HOME}; -if ($JAVA_HOME ne "") - { - my $tools="$JAVA_HOME/lib/tools.jar"; - if (-e "$tools") - { - $localpath .= "$s$tools"; - } - my $classes="$JAVA_HOME/lib/classes.zip"; - if (-e $classes) - { - $localpath .= "$s$classes"; - } - } -else - { - print "\n\nWarning: JAVA_HOME environment variable is not set.\n". - "If the build fails because sun.* classes could not be found\n". - "you will need to set the JAVA_HOME environment variable\n". - "to the installation directory of java\n"; - } - -#jikes -my @ANT_OPTS=split $ENV{ANT_OPTS}; -if($ENV{JIKESPATH} ne "") - { - push @ANT_OPTS, "-Djikes.class.path=$ENV{JIKESPATH}"; - } - -#construct arguments to java - -my @ARGS; -push @ARGS, "-classpath", "$localpath", "-Dant.home=$HOME"; -push @ARGS, @ANT_OPTS; -push @ARGS, "org.apache.tools.ant.Main"; -push @ARGS, @ARGV; - -print "\n $JAVACMD @ARGS\n\n" if ($debug); - -my $returnValue = system $JAVACMD, @ARGS; -if ($returnValue eq 0) - { - exit 0; - } -else - { - # only 0 and 1 are widely recognized as exit values - # so change the exit value to 1 - exit 1; - } diff --git a/tools/centipede/lib/IzPress.jar b/tools/centipede/lib/IzPress.jar new file mode 100644 index 000000000..4665c12c4 Binary files /dev/null and b/tools/centipede/lib/IzPress.jar differ diff --git a/lib/optional/jtidy-04aug2000r7-dev.jar b/tools/centipede/lib/jtidy.jar similarity index 100% rename from lib/optional/jtidy-04aug2000r7-dev.jar rename to tools/centipede/lib/jtidy.jar diff --git a/tools/lib/junit.jar b/tools/centipede/lib/junit.jar old mode 100755 new mode 100644 similarity index 100% rename from tools/lib/junit.jar rename to tools/centipede/lib/junit.jar diff --git a/lib/optional/xalan-2.2.0.jar b/tools/centipede/lib/xalan.jar similarity index 100% rename from lib/optional/xalan-2.2.0.jar rename to tools/centipede/lib/xalan.jar diff --git a/tools/centipede/lib/xerces.jar b/tools/centipede/lib/xerces.jar new file mode 100644 index 000000000..28d3642ee Binary files /dev/null and b/tools/centipede/lib/xerces.jar differ diff --git a/tools/centipede/lib/xml-apis.jar b/tools/centipede/lib/xml-apis.jar new file mode 100644 index 000000000..2c4275729 Binary files /dev/null and b/tools/centipede/lib/xml-apis.jar differ diff --git a/tools/centipede/targets/compile.xtarget b/tools/centipede/targets/compile.xtarget index 416c9f538..28e537dce 100644 --- a/tools/centipede/targets/compile.xtarget +++ b/tools/centipede/targets/compile.xtarget @@ -21,6 +21,12 @@ + + + + + + @@ -66,6 +72,27 @@ + + + + + + + + + + @@ -102,6 +129,12 @@ + + + + + + diff --git a/tools/centipede/targets/init.xtarget b/tools/centipede/targets/init.xtarget index 4deedae3e..7d51f5763 100644 --- a/tools/centipede/targets/init.xtarget +++ b/tools/centipede/targets/init.xtarget @@ -83,6 +83,11 @@ + + + + + @@ -101,6 +106,9 @@ + + + diff --git a/tools/centipede/targets/preinit.xtarget b/tools/centipede/targets/preinit.xtarget index d93708c8a..4bee00355 100644 --- a/tools/centipede/targets/preinit.xtarget +++ b/tools/centipede/targets/preinit.xtarget @@ -33,6 +33,11 @@ + + + + + @@ -61,3 +66,4 @@ + diff --git a/tools/centipede/targets/test.xtarget b/tools/centipede/targets/test.xtarget index 6ff67dd0f..1cf2e8219 100644 --- a/tools/centipede/targets/test.xtarget +++ b/tools/centipede/targets/test.xtarget @@ -20,6 +20,10 @@ + + diff --git a/lib/optional/avalon-excalibur-20020114.jar b/tools/cocoon/lib/avalon-excalibur-4.1.jar similarity index 67% rename from lib/optional/avalon-excalibur-20020114.jar rename to tools/cocoon/lib/avalon-excalibur-4.1.jar index bf2134f75..7dcb1a73b 100644 Binary files a/lib/optional/avalon-excalibur-20020114.jar and b/tools/cocoon/lib/avalon-excalibur-4.1.jar differ diff --git a/lib/optional/avalon-framework-20020114.jar b/tools/cocoon/lib/avalon-framework-4.1.2.jar similarity index 78% rename from lib/optional/avalon-framework-20020114.jar rename to tools/cocoon/lib/avalon-framework-4.1.2.jar index 4c52bc3f9..6a38f1d59 100644 Binary files a/lib/optional/avalon-framework-20020114.jar and b/tools/cocoon/lib/avalon-framework-4.1.2.jar differ diff --git a/tools/cocoon/lib/avalon-scratchpad-20020212.jar b/tools/cocoon/lib/avalon-scratchpad-20020212.jar new file mode 100644 index 000000000..f5439a382 Binary files /dev/null and b/tools/cocoon/lib/avalon-scratchpad-20020212.jar differ diff --git a/tools/cocoon/lib/batik-libs-1.1.1.jar b/tools/cocoon/lib/batik-libs-1.1.1.jar new file mode 100644 index 000000000..3558d15a3 Binary files /dev/null and b/tools/cocoon/lib/batik-libs-1.1.1.jar differ diff --git a/tools/cocoon/lib/cocoon-scratchpad-part.jar b/tools/cocoon/lib/cocoon-scratchpad-part.jar new file mode 100644 index 000000000..8614814b1 Binary files /dev/null and b/tools/cocoon/lib/cocoon-scratchpad-part.jar differ diff --git a/tools/cocoon/lib/cocoon.jar b/tools/cocoon/lib/cocoon.jar new file mode 100644 index 000000000..2c8780383 Binary files /dev/null and b/tools/cocoon/lib/cocoon.jar differ diff --git a/lib/optional/commons-collections-1.0.jar b/tools/cocoon/lib/commons-collections-1.0.jar similarity index 100% rename from lib/optional/commons-collections-1.0.jar rename to tools/cocoon/lib/commons-collections-1.0.jar diff --git a/lib/optional/commons-httpclient-20011012.jar b/tools/cocoon/lib/commons-httpclient-20011012.jar similarity index 100% rename from lib/optional/commons-httpclient-20011012.jar rename to tools/cocoon/lib/commons-httpclient-20011012.jar diff --git a/lib/optional/jakarta-regexp-1.2.jar b/tools/cocoon/lib/jakarta-regexp-1.2.jar similarity index 100% rename from lib/optional/jakarta-regexp-1.2.jar rename to tools/cocoon/lib/jakarta-regexp-1.2.jar diff --git a/tools/cocoon/lib/jisp_1_0_2.jar b/tools/cocoon/lib/jisp_1_0_2.jar new file mode 100644 index 000000000..2f4102f91 Binary files /dev/null and b/tools/cocoon/lib/jisp_1_0_2.jar differ diff --git a/tools/cocoon/lib/logkit-1.0.1.jar b/tools/cocoon/lib/logkit-1.0.1.jar new file mode 100644 index 000000000..d3250ee64 Binary files /dev/null and b/tools/cocoon/lib/logkit-1.0.1.jar differ diff --git a/tools/cocoon/lib/resolver-20020130.jar b/tools/cocoon/lib/resolver-20020130.jar new file mode 100644 index 000000000..12e30a318 Binary files /dev/null and b/tools/cocoon/lib/resolver-20020130.jar differ diff --git a/tools/lib/.cvsignore b/tools/lib/.cvsignore deleted file mode 100755 index eb1aa6768..000000000 --- a/tools/lib/.cvsignore +++ /dev/null @@ -1,3 +0,0 @@ -xalan-2.2.0-D14.jar -xerces-1.4.4.jar -xml-apis.jar diff --git a/tools/lib/jtidy-04aug2000r7-dev.jar b/tools/lib/jtidy-04aug2000r7-dev.jar deleted file mode 100644 index a11dfe58a..000000000 Binary files a/tools/lib/jtidy-04aug2000r7-dev.jar and /dev/null differ diff --git a/tools/lib/xalan-2.2.0.jar b/tools/lib/xalan-2.2.0.jar deleted file mode 100644 index 8dd6dca25..000000000 Binary files a/tools/lib/xalan-2.2.0.jar and /dev/null differ diff --git a/tools/resources/stylesheets/announcement2readme.xsl b/tools/resources/stylesheets/announcement2readme.xsl deleted file mode 100644 index 63cbdefd0..000000000 --- a/tools/resources/stylesheets/announcement2readme.xsl +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - - - - - - - - - -

    PGP Signatures

    - -

    Many of the distribution kits have been digitally signed (using - PGP). If so, there will be an accompanying - distribution.asc file in the same directory as - the distribution. The PGP keys can be found in the distribution - directory at < - http://jakarta.apache.org/builds/jakarta-avalon/release/KEYS>.

    - - --bin.tar.gz - -
    Always test available signatures, e.g.,
    -> pgpk -a KEYS
    -> pgpv .asc
    -or,
    -> pgp -ka KEYS
    -> pgp .asc
    -or,
    -> gpg --import KEYS
    -> gpg --verify .asc
    -
    - - - -

    About

    - -
    -
    - -
    - - - -

    For more information about , please go to - - .

    - - - -

    ChangeLog for

    - -
    -
    - - - - - - -
      - -
    • - - - [] - -
    • -
      -
    -
    - -
    diff --git a/tools/resources/stylesheets/announcement2txt.xsl b/tools/resources/stylesheets/announcement2txt.xsl deleted file mode 100644 index 9b03cc12b..000000000 --- a/tools/resources/stylesheets/announcement2txt.xsl +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - Released - - - - - - - - - - - About - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -For more information about - - , please go to - - - - - - - -ChangeLog for - - - - - - - - - - -Downloads for available at - -/latest - - - - - - - - - - - - - ( - - ) - - - - - *) - - - - - - [] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tools/resources/stylesheets/bugzilla2patchqueue.xsl b/tools/resources/stylesheets/bugzilla2patchqueue.xsl deleted file mode 100644 index 5ebb1a913..000000000 --- a/tools/resources/stylesheets/bugzilla2patchqueue.xsl +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - - - http://nagoya.apache.org/bugzilla/ - - - - - - - - - - - - - - - - - diff --git a/tools/resources/stylesheets/changelog.xsl b/tools/resources/stylesheets/changelog.xsl deleted file mode 100644 index 20f7cf9fb..000000000 --- a/tools/resources/stylesheets/changelog.xsl +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - module - cvsweb - - - - - - - - -

    Change Log

    - - - - - - - - -
    - - - -

    - - - -

    -

    - - - by - -

    -

    - -

    -
    - -
    - - - - - - - - - - - - - - -
    - - - /?rev=&content-type=text/x-cvsweb-markup - - - /?r1=&r2=&diff_format=h - - - - -
    - - - - - - - - - -
    - - - - - -
    - - - -
    -
    - -
    - diff --git a/tools/resources/stylesheets/html2xml.xsl b/tools/resources/stylesheets/html2xml.xsl deleted file mode 100755 index a40bdd248..000000000 --- a/tools/resources/stylesheets/html2xml.xsl +++ /dev/null @@ -1,153 +0,0 @@ - - - - bodyroot - - - - ]]> - - - - - - - - -
    - <xsl:value-of select="title" /><xsl:value-of select="TITLE" /> - - - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    - -

    -
    -
    -
    - - - - - - - - - - - - - - - - - -
      - -
    -
    - - -
  • - -
  • -
    - - -
      - -
    -
    - - - - - - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    diff --git a/tools/resources/stylesheets/patchqueue2text4dev.xsl b/tools/resources/stylesheets/patchqueue2text4dev.xsl deleted file mode 100644 index 0ed5685e9..000000000 --- a/tools/resources/stylesheets/patchqueue2text4dev.xsl +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - - - ----------------------------------------------------------- - This mail is generated automatically using - Jakarta Ant. Contents are automatically - downloaded from Apache's Bugzilla. ------------------------------------------------------------ - Please do not reply to this mail. ------------------------------------------------------------ - -*********************************************************** - COCOON PATCH QUEUE UPDATE - - patches in queue: -*********************************************************** - - ------------------------------------------------------------ -: ------------------------------------------------------------ - - -REVIEWER: -RESOLUTION: -STATUS: - - - -*************************that's it!************************ - -------------------------patch HOWTO------------------------ - -Send patches to http://nagoya.apache.org/bugzilla/ -specifying [PATCH] in the summary. -Bugzilla sends a mail automatically to this list. -Reviewers will mark it FIXED there when applied. -Patches not sent to Bugzilla will not be reviewed. ------------------------------------------------------------ -This file is generated and updated automatically at least -once a week, and the data is taken from Bugzilla. -If you don't find the patch you submitted to bugzilla -after one week, please notify cocoon-dev@xml.apache.org -for assistance. ------------------------------------------------------------ -There is usually a HEAD branch and a previous-version -branch that are maintained. Where will the patch go? -1. If it is a bug fix it should go to both branches -2. If something is totally new it goes into HEAD scratchpad. -3. Something in between, but does not break backward - compatibility _may_ go into both (and may not) -4. For everything else, a vote is required so - first it may go into HEAD, and then be VOTEd in order - to sync this into branch. -Please note that structural changes have to be VOTEd first. - - - - - - - diff --git a/tools/resources/stylesheets/patchqueue2xdocs.xsl b/tools/resources/stylesheets/patchqueue2xdocs.xsl deleted file mode 100644 index 52d21f609..000000000 --- a/tools/resources/stylesheets/patchqueue2xdocs.xsl +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - - - - - - ]]> - - - - -
    - Patch Queue - - - - -
    - - - - - -

    - This is an informal list - in chronological order - - of some of the noteworthy patches that have been posted - to the cocoon-dev mailing list. - These patches are not (yet) part of the Apache Cocoon project, but need reviewing for possible - inclusion. This system was instituted because, due to the large volume of mail and - the lack of time of the committers, some patches tended to get forgotten about. This - queue does not guarantee that any patch will be reviewed within a reasonable time frame, - but it does at least make them easier to find! -

    - -

    Reviewers wanted! - If you have time to review and/or test these patches, - we would be grateful for your time. Please post comments to the cocoon-dev mailing lists. -

    - -

    - Before submitting a patch, please read the page on Third-Party - Contributions. The preferred submission method for patches is: -

    - -
      -
    • Post to cocoon-dev@xml.apache.org
    • -
    • Describe the patch, the reason for it and (if necessary) why this is important.
    • -
    • Generate the patch in diff -u format from CVS
    • -
    • Also generate a documentation patch or new file, if this is something that should be documented. -
    • -
    • Post as an attachment rather than inline (unless it is trivially small).
    • -
    - -

    Following the above guidelines will facilitate your patch being reviewed - and applied efficiently.

    - -
    - - - -

    [Under Construction] Archive links will be added later. - Please do not bother the patch submitters/authors without first reading the - relevant post(s) in the mailing list archives. -

    - -

    Vapourware will not be listed.

    - - - - - - - - - - - - - - - - - - -
    idSummaryReviewerResolutionStatus
    - - - - -
    - -

    See also additional list of patches to be added in To Do. -

    - -
    - -
    - -
    - - - - - -
    diff --git a/tools/src/ClassAvailable.java b/tools/src/ClassAvailable.java deleted file mode 100644 index bec059aeb..000000000 --- a/tools/src/ClassAvailable.java +++ /dev/null @@ -1,246 +0,0 @@ - -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2002 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" and - * "Apache POI" must not be used to endorse or promote products - * derived from this software without prior written permission. For - * written permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * "Apache POI", nor may "Apache" appear in their name, without - * prior written permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -import java.io.*; - -import java.util.*; -import java.util.zip.*; - -import org.apache.tools.ant.*; -import org.apache.tools.ant.taskdefs.*; -import org.apache.tools.ant.types.*; - -/** - * Will set the given property if the requested class is available in the - * specified classpath. The found class is not loaded! - * This class is heavily based on the available task in the ant package: - * @author Stefano Mazzocchi stefano@apache.org - * - * This task searches only in the defined path but not in the parents path - * unless explicitly overridden by the value of ${build.sysclasspath} - * like the original available task does. - * @author Carsten Ziegeler - * @version CVS $Revision$ $Date$ - */ - -public class ClassAvailable - extends Task -{ - - /** - * A hashtable of zip files opened by the classloader - */ - - private Hashtable zipFiles = new Hashtable(); - private String property; - private String classname; - private Path classpath; - private String value = "true"; - - public void setClasspath(Path classpath) - { - createClasspath().append(classpath); - } - - public Path createClasspath() - { - if (this.classpath == null) - { - this.classpath = new Path(this.project); - } - return this.classpath.createPath(); - } - - public void setClasspathRef(Reference r) - { - createClasspath().setRefid(r); - } - - public void setProperty(String property) - { - this.property = property; - } - - public void setValue(String value) - { - this.value = value; - } - - public void setClassname(String classname) - { - if (!"".equals(classname)) - { - this.classname = classname; - } - } - - public void execute() - throws BuildException - { - if (property == null) - { - throw new BuildException("property attribute is required", - location); - } - if (eval()) - { - this.project.setProperty(property, value); - } - } - - public boolean eval() - throws BuildException - { - if (classname == null) - { - throw new BuildException( - "At least one of (classname|file|resource) is required", - location); - } - if (classpath != null) - { - classpath.setProject(project); - classpath = classpath.concatSystemClasspath("ignore"); - } - if (!findClassInComponents(classname)) - { - log("Unable to load class " + classname + " to set property " - + property, Project.MSG_VERBOSE); - return false; - } - return true; - } - - /** - * Get an inputstream to a given resource in the given file which may - * either be a directory or a zip file. - * - * @param file the file (directory or jar) in which to search for the resource. - * @param resourceName the name of the resource for which a stream is required. - * - * @return a stream to the required resource or null if the resource cannot be - * found in the given file object - */ - - private boolean contains(File file, String resourceName) - { - try - { - if (!file.exists()) - { - return false; - } - if (file.isDirectory()) - { - File resource = new File(file, resourceName); - - if (resource.exists()) - { - return true; - } - } - else - { - - // is the zip file in the cache - ZipFile zipFile = ( ZipFile ) zipFiles.get(file); - - if (zipFile == null) - { - zipFile = new ZipFile(file); - zipFiles.put(file, zipFile); - } - ZipEntry entry = zipFile.getEntry(resourceName); - - if (entry != null) - { - return true; - } - } - } - catch (Exception e) - { - log("Ignoring Exception " + e.getClass().getName() + ": " - + e.getMessage() + " reading resource " + resourceName - + " from " + file, Project.MSG_VERBOSE); - } - return false; - } - - /** - * Find a class on the given classpath. - */ - - private boolean findClassInComponents(String name) - { - - // we need to search the components of the path to see if we can find the - // class we want. - final String classname = name.replace('.', '/') + ".class"; - final String[] list = classpath.list(); - boolean found = false; - int i = 0; - - while ((i < list.length) && (found == false)) - { - final File pathComponent = - ( File ) project.resolveFile(list[ i ]); - - found = this.contains(pathComponent, classname); - i++; - } - return found; - } -} diff --git a/tools/src/JTidyTask.java b/tools/src/JTidyTask.java deleted file mode 100644 index ce8f5b3af..000000000 --- a/tools/src/JTidyTask.java +++ /dev/null @@ -1,272 +0,0 @@ - -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2002 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" and - * "Apache POI" must not be used to endorse or promote products - * derived from this software without prior written permission. For - * written permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * "Apache POI", nor may "Apache" appear in their name, without - * prior written permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -import java.io.InputStream; -import java.io.FileInputStream; -import java.io.BufferedInputStream; -import java.io.OutputStream; -import java.io.FileOutputStream; -import java.io.Writer; -import java.io.PrintWriter; -import java.io.FileWriter; -import java.io.BufferedWriter; -import java.io.FileWriter; -import java.io.IOException; - -import java.util.ArrayList; - -import org.w3c.dom.NodeList; -import org.w3c.dom.Node; -import org.w3c.dom.Element; -import org.w3c.dom.Attr; -import org.w3c.dom.Document; -import org.w3c.dom.NamedNodeMap; -import org.w3c.tidy.Tidy; - -import org.apache.tools.ant.BuildException; -import org.apache.tools.ant.taskdefs.Property; - -/** - * Task to ask property values to the user. Uses current value as default. - * - * @author Nicola Ken Barozzi - * @created 14 January 2002 - */ - -public class JTidyTask - extends org.apache.tools.ant.Task -{ - private String src; - private String dest; - private String log; - private Tidy tidy; - private String warn = "false"; - private String summary = "false"; - PrintWriter pw; - - /** - * Constructor. - */ - - public JTidyTask() - { - super(); - } - - /** - * Initializes the task. - */ - - public void init() - { - super.init(); - - // Setup an instance of Tidy. - tidy = new Tidy(); - tidy.setXmlOut(true); - tidy.setXHTML(true); - tidy.setDropFontTags(true); - tidy.setLiteralAttribs(true); - tidy.setMakeClean(true); - tidy.setShowWarnings(Boolean.getBoolean(warn)); - tidy.setQuiet(!Boolean.getBoolean(summary)); - } - - /** - * Run the task. - * @exception org.apache.tools.ant.BuildException The exception raised during task execution. - */ - - public void execute() - throws org.apache.tools.ant.BuildException - { - try - { - PrintWriter pw = new PrintWriter(new FileWriter(log)); - - tidy.setErrout(pw); - - // Extract the document using JTidy and stream it. - BufferedInputStream in = - new BufferedInputStream(new FileInputStream(src)); - - // FileOutputStream out = new FileOutputStream(dest); - PrintWriter out = - new PrintWriter(new FileWriter(dest)); - - // using null as output to get dom so to remove duplicate attributes - org.w3c.dom.Document domDoc = tidy.parseDOM(in, null); - - domDoc.normalize(); - stripDuplicateAttributes(domDoc, null); - org.apache.xml.serialize.OutputFormat format = - new org.apache.xml.serialize.OutputFormat(); - - format.setIndenting(true); - format.setEncoding("ISO-8859-1"); - format.setPreserveSpace(true); - format.setLineSeparator("\n"); - org.apache.xml.serialize.XMLSerializer serializer = - new org.apache.xml.serialize.XMLSerializer(out, format); - - serializer.serialize(domDoc); - out.flush(); - out.close(); - in.close(); - pw.flush(); - pw.close(); - } - catch (IOException ioe) - { - throw new BuildException(ioe); - } - } - - public void setSrc(String src) - { - this.src = src; - } - - public void setDest(String dest) - { - this.dest = dest; - } - - public void setLog(String log) - { - this.log = log; - } - - public void setWarn(String warn) - { - this.warn = warn; - } - - public void setSummary(String summary) - { - this.summary = summary; - } - - // using parent because jtidy dom is bugged, cannot get parent or delete child - public static void stripDuplicateAttributes(Node node, Node parent) - { - - // The output depends on the type of the node - switch (node.getNodeType()) - { - - case Node.DOCUMENT_NODE : - { - Document doc = ( Document ) node; - Node child = doc.getFirstChild(); - - while (child != null) - { - stripDuplicateAttributes(child, node); - child = child.getNextSibling(); - } - break; - } - case Node.ELEMENT_NODE : - { - Element elt = ( Element ) node; - NamedNodeMap attrs = elt.getAttributes(); - ArrayList nodesToRemove = new ArrayList(); - int nodesToRemoveNum = 0; - - for (int i = 0; i < attrs.getLength(); i++) - { - Node a = attrs.item(i); - - for (int j = 0; j < attrs.getLength(); j++) - { - Node b = attrs.item(j); - - // if there are two attributes with same name - if ((i != j) - && (a.getNodeName().equals(b.getNodeName()))) - { - nodesToRemove.add(b); - nodesToRemoveNum++; - } - } - } - for (int i = 0; i < nodesToRemoveNum; i++) - { - org.w3c.dom.Attr nodeToDelete = - ( org.w3c.dom.Attr ) nodesToRemove.get(i); - org.w3c.dom.Element nodeToDeleteParent = - ( org.w3c.dom - .Element ) node; // nodeToDelete.getParentNode(); - - nodeToDeleteParent.removeAttributeNode(nodeToDelete); - } - nodesToRemove.clear(); - Node child = elt.getFirstChild(); - - while (child != null) - { - stripDuplicateAttributes(child, node); - child = child.getNextSibling(); - } - break; - } - default : - - // do nothing - break; - } - } -} diff --git a/tools/src/SitemapTool.java b/tools/src/SitemapTool.java deleted file mode 100644 index 23a5f7cac..000000000 --- a/tools/src/SitemapTool.java +++ /dev/null @@ -1,363 +0,0 @@ - -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2002 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" and - * "Apache POI" must not be used to endorse or promote products - * derived from this software without prior written permission. For - * written permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * "Apache POI", nor may "Apache" appear in their name, without - * prior written permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -import java.io.*; - -import java.util.*; - -import org.apache.tools.ant.*; -import org.apache.tools.ant.taskdefs.*; -import org.apache.tools.ant.types.*; - -/** - * Add components to the sitemap - * - * @author Carsten Ziegeler - * @version CVS $Revision$ $Date$ - */ - -public final class SitemapTool - extends Task -{ - private String sitemap; - private String directory; - private String extension; - - public void setSitemap(String sitemap) - { - this.sitemap = sitemap; - } - - public void setDirectory(String directory) - { - this.directory = directory; - } - - public void setExtension(String extension) - { - this.extension = extension; - } - - public void execute() - throws BuildException - { - if (this.sitemap == null) - { - throw new BuildException("sitemap attribute is required", - location); - } - if (this.extension == null) - { - throw new BuildException("extension attribute is required", - location); - } - if (this.directory == null) - { - throw new BuildException("directory attribute is required", - location); - } - try - { - - // process recursive - this.process(new File(this.directory), this.extension, - this.sitemap); - } - catch (IOException ioe) - { - throw new BuildException("IOException: " + ioe); - } - } - - /** - * Scan recursive - */ - - private void process(final File directoryFile, final String ext, - final String sitemapLocation) - throws IOException, BuildException - { - final File[] files = directoryFile.listFiles(); - - for (int i = 0; i < files.length; i++) - { - if (files[ i ].isDirectory() == true) - { - this.process(files[ i ], ext, sitemapLocation); - } - else - { - if (files[ i ].getName().endsWith("." + ext) == true) - { - System.out.println("Reading: " - + files[ i ].getAbsolutePath()); - final String data = - this.load(files[ i ].getAbsolutePath()); - - // separate the data by lines - final StringTokenizer st = new StringTokenizer(data); - - while (st.hasMoreElements() == true) - { - - // now get the properties of a line. These are separated by a "|" - final String line = - ( String ) st.nextElement(); - final StringTokenizer prop = - new StringTokenizer(line, "|"); - String category = null; - String componentName = null; - String className = null; - String configuration = null; - String label = null; - String mimeType = null; - - while (prop.hasMoreElements() == true) - { - final String property = - ( String ) prop.nextElement(); - final int pos = property.indexOf(":"); - final String propName = - property.substring(0, pos); - final String propVal = property.substring(pos - + 1); - - if (propName.equals("category")) - { - category = propVal; - } - else if (propName.equals("componentName")) - { - componentName = propVal; - } - else if (propName.equals("componentClass")) - { - className = propVal; - } - else if (propName.equals("configuration")) - { - configuration = propVal; - } - else if (propName.equals("label")) - { - label = propVal; - } - else if (propName.equals("mimeType")) - { - mimeType = propVal; - } - else - { - throw new BuildException( - "Unknown property " + propName - + " in file " - + files[ i ].getAbsolutePath()); - } - } - - // Test for required values - if (category == null) - { - throw new BuildException( - "category property is required in file " - + files[ i ].getAbsolutePath(), location); - } - if (componentName == null) - { - throw new BuildException( - "componentName property is required in file " - + files[ i ].getAbsolutePath(), location); - } - if (className == null) - { - throw new BuildException( - "componentClass property is required in file " - + files[ i ].getAbsolutePath(), location); - } - this.add(sitemapLocation, category, componentName, - className, configuration, label, mimeType); - } - } - } - } - } - - /** - * Add entry to sitemap - */ - - private void add(final String sitemapLocation, final String category, - final String componentName, final String className, - final String configuration, final String label, - final String mimeType) - throws IOException - { - final String data = load(sitemapLocation); - final String searchString = - new StringBuffer("") - .toString(); - final int pos = data.indexOf(searchString); - int categoryStartPos = - data - .indexOf(new StringBuffer("") - .toString()); - - if (categoryStartPos == -1) - { - categoryStartPos = - data - .indexOf(new StringBuffer(" 0)) - { - buffer.append(" mime-type=\"").append(mimeType) - .append("\""); - } - if ((null != label) && (label.length() > 0)) - { - buffer.append(" label=\"").append(label).append("\""); - } - if (null != configuration) - { - buffer.append(">\n").append(configuration).append("\n") - .append("\n"); - } - else - { - buffer.append("/>\n"); - } - buffer.append(data.substring(pos)).toString(); - this.save(sitemapLocation, buffer.toString()); - } - } - } - - /** - * Load a file and return the content as a string. - */ - - public String load(String filename) - throws IOException - { - FileInputStream fis; - - fis = new FileInputStream(filename); - int available; - byte[] data = null; - byte[] tempData; - byte[] copyData; - - do - { - available = 1024; - tempData = new byte[ available ]; - available = fis.read(tempData, 0, available); - if (available > 0) - { - copyData = new byte[ ((data == null) ? 0 - : data.length) + available ]; - if (data != null) - { - System.arraycopy(data, 0, copyData, 0, data.length); - } - System.arraycopy(tempData, 0, copyData, ((data == null) ? 0 - : data.length), available); - data = copyData; - } - } - while (available > 0); - fis.close(); - return ((data != null) ? new String(data) - : ""); - } - - /** - * Save the string to a file - */ - - public void save(String filename, String data) - throws IOException - { - FileWriter fw = new FileWriter(filename); - - fw.write(data); - fw.close(); - } -} diff --git a/tools/src/UserInput.java b/tools/src/UserInput.java deleted file mode 100644 index 6a3c6a419..000000000 --- a/tools/src/UserInput.java +++ /dev/null @@ -1,149 +0,0 @@ - -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2002 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" and - * "Apache POI" must not be used to endorse or promote products - * derived from this software without prior written permission. For - * written permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * "Apache POI", nor may "Apache" appear in their name, without - * prior written permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -import java.io.InputStreamReader; -import java.io.BufferedReader; -import java.io.IOException; - -/** - * Task to ask property values to the user. Uses current value as default. - * - * @author Nicola Ken Barozzi - * @created 14 January 2002 - */ - -public class UserInput - extends org.apache.tools.ant.Task -{ - private String question; - private String name; - private String value; - - /** - * Constructor. - */ - - public UserInput() - { - super(); - } - - /** - * Initializes the task. - */ - - public void init() - { - super.init(); - question = "?"; - } - - /** - * Run the task. - * @exception org.apache.tools.ant.BuildException The exception raised during task execution. - */ - - public void execute() - throws org.apache.tools.ant.BuildException - { - value = project.getProperty(name); - String defaultvalue = value; - - // if the property exists - if (value != null) - { - System.out.println("\n" + question + " [" + value + "] "); - BufferedReader reader = - new BufferedReader(new InputStreamReader(System.in)); - - try - { - value = reader.readLine(); - } - catch (IOException e) - { - value = defaultvalue; - } - if (!value.equals("")) - { - project.setProperty(name, value); - } - else - { - project.setProperty(name, defaultvalue); - } - } - } - - /** - * Sets the prompt text that will be presented to the user. - * @param question prompt string - */ - - public void addText(String question) - { - this.question = question; - } - - public void setQuestion(String question) - { - this.question = question; - } - - public void setName(String name) - { - this.name = name; - } -} diff --git a/tools/src/XConfTool.java b/tools/src/XConfTool.java deleted file mode 100644 index becdba921..000000000 --- a/tools/src/XConfTool.java +++ /dev/null @@ -1,238 +0,0 @@ - -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2002 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" and - * "Apache POI" must not be used to endorse or promote products - * derived from this software without prior written permission. For - * written permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * "Apache POI", nor may "Apache" appear in their name, without - * prior written permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -import java.io.*; - -import java.util.*; - -import org.apache.tools.ant.*; -import org.apache.tools.ant.taskdefs.*; -import org.apache.tools.ant.types.*; - -/** - * Add components to the cocoon.xconf - * This is only a ugly first shot - * - * @author Carsten Ziegeler - * @version CVS $Revision$ $Date$ - */ - -public final class XConfTool - extends Task -{ - private String configuration; - private String directory; - private String extension; - - public void setConfiguration(String configuration) - { - this.configuration = configuration; - } - - public void setDirectory(String directory) - { - this.directory = directory; - } - - public void setExtension(String extension) - { - this.extension = extension; - } - - public void execute() - throws BuildException - { - if (this.configuration == null) - { - throw new BuildException("configuration attribute is required", - location); - } - if (this.extension == null) - { - throw new BuildException("extension attribute is required", - location); - } - if (this.directory == null) - { - throw new BuildException("directory attribute is required", - location); - } - try - { - - // process recursive - this.process(new File(this.directory), this.extension, - this.configuration); - } - catch (IOException ioe) - { - throw new BuildException("IOException: " + ioe); - } - } - - /** - * Scan recursive - */ - - private void process(final File directoryFile, final String ext, - final String configurationLocation) - throws IOException, BuildException - { - final File[] files = directoryFile.listFiles(); - - for (int i = 0; i < files.length; i++) - { - if (files[ i ].isDirectory() == true) - { - this.process(files[ i ], ext, configurationLocation); - } - else - { - if (files[ i ].getName().endsWith("." + ext) == true) - { - System.out.println("Reading: " - + files[ i ].getAbsolutePath()); - final String newComponent = - this.load(files[ i ].getAbsolutePath()); - - this.add(configurationLocation, newComponent); - } - } - } - } - - /** - * Add entry to sitemap - */ - - private void add(final String configurationLocation, - final String newComponent) - throws IOException - { - final String data = load(configurationLocation); - - // first search if component already present: - if (data.indexOf(newComponent) == -1) - { - int pos = data.indexOf("", pos); - if (pos != -1) - { - StringBuffer buffer = - new StringBuffer(data.substring(0, pos + 1)) - .append("\n\n").append(newComponent) - .append(data.substring(pos + 1)); - - this.save(configurationLocation, buffer.toString()); - } - } - } - } - - /** - * Load a file and return the content as a string. - */ - - public String load(String filename) - throws IOException - { - FileInputStream fis; - - fis = new FileInputStream(filename); - int available; - byte[] data = null; - byte[] tempData; - byte[] copyData; - - do - { - available = 1024; - tempData = new byte[ available ]; - available = fis.read(tempData, 0, available); - if (available > 0) - { - copyData = new byte[ ((data == null) ? 0 - : data.length) + available ]; - if (data != null) - { - System.arraycopy(data, 0, copyData, 0, data.length); - } - System.arraycopy(tempData, 0, copyData, ((data == null) ? 0 - : data.length), available); - data = copyData; - } - } - while (available > 0); - fis.close(); - return ((data != null) ? new String(data) - : ""); - } - - /** - * Save the string to a file - */ - - public void save(String filename, String data) - throws IOException - { - FileWriter fw = new FileWriter(filename); - - fw.write(data); - fw.close(); - } -} diff --git a/tools/src/announcement2header.xsl b/tools/src/announcement2header.xsl deleted file mode 100755 index c326fa56a..000000000 --- a/tools/src/announcement2header.xsl +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - - - -

    Released

    - - - -

    About

    - -
    - -
    - - -

    - -

    For more information about , please go to - - .

    - - - -
    - - -
    - -
    -
    - - -

    -
    - - - - - - -
      - -
    • - - - [] - -
    • -
      -
    -
    - -
    diff --git a/tools/src/announcement2readme.xsl b/tools/src/announcement2readme.xsl deleted file mode 100755 index 63cbdefd0..000000000 --- a/tools/src/announcement2readme.xsl +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - - - - - - - - - -

    PGP Signatures

    - -

    Many of the distribution kits have been digitally signed (using - PGP). If so, there will be an accompanying - distribution.asc file in the same directory as - the distribution. The PGP keys can be found in the distribution - directory at < - http://jakarta.apache.org/builds/jakarta-avalon/release/KEYS>.

    - - --bin.tar.gz - -
    Always test available signatures, e.g.,
    -> pgpk -a KEYS
    -> pgpv .asc
    -or,
    -> pgp -ka KEYS
    -> pgp .asc
    -or,
    -> gpg --import KEYS
    -> gpg --verify .asc
    -
    - - - -

    About

    - -
    -
    - -
    - - - -

    For more information about , please go to - - .

    - - - -

    ChangeLog for

    - -
    -
    - - - - - - -
      - -
    • - - - [] - -
    • -
      -
    -
    - -
    diff --git a/tools/src/announcement2site.xsl b/tools/src/announcement2site.xsl deleted file mode 100755 index 52a41cd9c..000000000 --- a/tools/src/announcement2site.xsl +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - var month = new Array ( - "January", - "February", - "March", - "April", - "May", - "June", - "July", - "August", - "September", - "October", - "November", - "December" - ); - - function getdate() - { - var d = new Date(); - var mo = month[d.getMonth()]; - var dy = d.getDate(); - var yr = d.getFullYear(); - var dateString = dy + " " + mo + " " + yr; - return dateString; - } - - - - - - - - - -

    - Released

    - - - -

    About : - -

    -
    - -
    -
    - - - - -

    For more information about , please go to - - .

    - - -
    - - -

    -
    - - - - - - - - - - - - - - -

    -
    - - - - -
    diff --git a/tools/src/announcement2txt.xsl b/tools/src/announcement2txt.xsl deleted file mode 100755 index 9b03cc12b..000000000 --- a/tools/src/announcement2txt.xsl +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - Released - - - - - - - - - - - About - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -For more information about - - , please go to - - - - - - - -ChangeLog for - - - - - - - - - - -Downloads for available at - -/latest - - - - - - - - - - - - - ( - - ) - - - - - *) - - - - - - [] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tools/src/bugzilla2patchqueue.xsl b/tools/src/bugzilla2patchqueue.xsl deleted file mode 100755 index 96e91245a..000000000 --- a/tools/src/bugzilla2patchqueue.xsl +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - http://nagoya.apache.org/bugzilla/ - - - - - - - - - - - - - - - - - - - diff --git a/tools/src/changelog.xsl b/tools/src/changelog.xsl deleted file mode 100755 index 20f7cf9fb..000000000 --- a/tools/src/changelog.xsl +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - module - cvsweb - - - - - - - - -

    Change Log

    - - - - - - - - -
    - - - -

    - - - -

    -

    - - - by - -

    -

    - -

    -
    - -
    - - - - - - - - - - - - - - -
    - - - /?rev=&content-type=text/x-cvsweb-markup - - - /?r1=&r2=&diff_format=h - - - - -
    - - - - - - - - - -
    - - - - - -
    - - - -
    -
    - -
    - diff --git a/tools/src/patchqueue2text4dev.xsl b/tools/src/patchqueue2text4dev.xsl deleted file mode 100755 index 57986547c..000000000 --- a/tools/src/patchqueue2text4dev.xsl +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - ----------------------------------------------------------- - This mail is generated automatically using - Jakarta Ant. Contents are automatically - downloaded from Apache's Bugzilla. ------------------------------------------------------------ - Please do not reply to this mail. ------------------------------------------------------------ - -*********************************************************** - __ __ __ __ __ __ - (___ (__) (___ (__) (__) | ) - - __ __ _|_ __ |__ ___ __ - |__) (__( |_, (___ | ) (__/_ __) - | -*********************************************************** -***************** patches in queue: ******************** -*********************************************************** - ------------------------------------------------------------ -: ------------------------------------------------------------ - - -REVIEWER: -RESOLUTION: -STATUS: - - - -*************************that's it!************************ - -------------------------patch HOWTO------------------------ - -Send patches to http://nagoya.apache.org/bugzilla/ -specifying [PATCH] in the summary. -Bugzilla sends a mail automatically to this list. -Reviewers will mark it FIXED there when applied. -Patches not sent to Bugzilla will not be reviewed. ------------------------------------------------------------ -This file is generated and updated automatically at least -once a week, and the data is taken from Bugzilla. -If you don't find the patch you submitted to bugzilla -after one week, please notify cocoon-dev@xml.apache.org -for assistance. ------------------------------------------------------------ -There is usually a HEAD branch and a previous-version -branch that are maintained. Where will the patch go? -1. If it is a bug fix it should go to both branches -2. If something is totally new it goes into HEAD scratchpad. -3. Something in between, but does not break backward - compatibility _may_ go into both (and may not) -4. For everything else, a vote is required so - first it may go into HEAD, and then be VOTEd in order - to sync this into branch. -Please note that structural changes have to be VOTEd first. - - - - - - - diff --git a/tools/src/patchqueue2xdocs.xsl b/tools/src/patchqueue2xdocs.xsl deleted file mode 100755 index 37194957b..000000000 --- a/tools/src/patchqueue2xdocs.xsl +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - - - - ]]> - - - -
    - Patch Queue - - - - -
    - - - - - -

    - This is an informal list - in chronological order - - of some of the noteworthy patches that have been posted - to the cocoon-dev mailing list. - These patches are not (yet) part of the Apache Cocoon project, but need reviewing for possible - inclusion. This system was instituted because, due to the large volume of mail and - the lack of time of the committers, some patches tended to get forgotten about. This - queue does not guarantee that any patch will be reviewed within a reasonable time frame, - but it does at least make them easier to find! -

    - -

    Reviewers wanted! - If you have time to review and/or test these patches, - we would be grateful for your time. Please post comments to the cocoon-dev mailing lists. -

    - -

    - Before submitting a patch, please read the page on Third-Party - Contributions. The preferred submission method for patches is: -

    - -
      -
    • Post to cocoon-dev@xml.apache.org
    • -
    • Describe the patch, the reason for it and (if necessary) why this is important.
    • -
    • Generate the patch in diff -u format from CVS
    • -
    • Also generate a documentation patch or new file, if this is something that should be documented. -
    • -
    • Post as an attachment rather than inline (unless it is trivially small).
    • -
    - -

    Following the above guidelines will facilitate your patch being reviewed - and applied efficiently.

    - -
    - - - -

    [Under Construction] Archive links will be added later. - Please do not bother the patch submitters/authors without first reading the - relevant post(s) in the mailing list archives. -

    - -

    Vapourware will not be listed.

    - - - - - - - - - - - - - - - - - - -
    idSummaryReviewerResolutionStatus
    - - - - -
    - -

    See also additional list of patches to be added in To Do. -

    - -
    - -
    - -
    - - - - - -
    diff --git a/tools/targets/compile.xtarget b/tools/targets/deprecated/compile.xtarget similarity index 100% rename from tools/targets/compile.xtarget rename to tools/targets/deprecated/compile.xtarget diff --git a/tools/targets/contrib.xtarget b/tools/targets/deprecated/contrib.xtarget similarity index 100% rename from tools/targets/contrib.xtarget rename to tools/targets/deprecated/contrib.xtarget diff --git a/tools/targets/dev.xtarget b/tools/targets/deprecated/dev.xtarget similarity index 100% rename from tools/targets/dev.xtarget rename to tools/targets/deprecated/dev.xtarget diff --git a/tools/targets/docs.xtarget b/tools/targets/deprecated/docs.xtarget similarity index 100% rename from tools/targets/docs.xtarget rename to tools/targets/deprecated/docs.xtarget diff --git a/tools/targets/init.xtarget b/tools/targets/deprecated/init.xtarget similarity index 100% rename from tools/targets/init.xtarget rename to tools/targets/deprecated/init.xtarget diff --git a/tools/targets/interactive.xtarget b/tools/targets/deprecated/interactive.xtarget similarity index 100% rename from tools/targets/interactive.xtarget rename to tools/targets/deprecated/interactive.xtarget diff --git a/tools/targets/preinit.xtarget b/tools/targets/deprecated/preinit.xtarget similarity index 100% rename from tools/targets/preinit.xtarget rename to tools/targets/deprecated/preinit.xtarget diff --git a/tools/targets/robot.xtarget b/tools/targets/deprecated/robot.xtarget similarity index 100% rename from tools/targets/robot.xtarget rename to tools/targets/deprecated/robot.xtarget diff --git a/tools/targets/scratchpad.xtarget b/tools/targets/deprecated/scratchpad.xtarget similarity index 100% rename from tools/targets/scratchpad.xtarget rename to tools/targets/deprecated/scratchpad.xtarget diff --git a/tools/targets/test.xtarget b/tools/targets/deprecated/test.xtarget similarity index 100% rename from tools/targets/test.xtarget rename to tools/targets/deprecated/test.xtarget diff --git a/tools/targets/try.xml b/tools/targets/deprecated/try.xml similarity index 100% rename from tools/targets/try.xml rename to tools/targets/deprecated/try.xml diff --git a/tools/targets/util.xtarget b/tools/targets/deprecated/util.xtarget similarity index 100% rename from tools/targets/util.xtarget rename to tools/targets/deprecated/util.xtarget