diff options
author | Nicola Ken Barozzi <nicolaken@apache.org> | 2002-03-14 11:05:10 +0000 |
---|---|---|
committer | Nicola Ken Barozzi <nicolaken@apache.org> | 2002-03-14 11:05:10 +0000 |
commit | a612b0a28f520ad633efb1ff808e2ed7c9941167 (patch) | |
tree | 0cee9e8c897f90951ade6ecf46014cc12be9347e /src | |
parent | 7271f51bed280dbb9d62f24395111cceb505689a (diff) | |
download | poi-a612b0a28f520ad633efb1ff808e2ed7c9941167.tar.gz poi-a612b0a28f520ad633efb1ff808e2ed7c9941167.zip |
Make POI use commons.logging, make log4j optional and clean structure to comply with, and use, Krysalis Centipede 2.0.1.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@352212 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
37 files changed, 939 insertions, 1719 deletions
diff --git a/src/contrib/builds/poibrowser.xml b/src/contrib/builds/poibrowser.xml deleted file mode 100644 index 68eb0cf974..0000000000 --- a/src/contrib/builds/poibrowser.xml +++ /dev/null @@ -1,28 +0,0 @@ -<!-- try.xml ... these are trial build targets which are currently - undergoing testing. When ready they can be moved into the main build.xml --> - -<project default="poibrowser" basedir="../../" name="POIBrowser build"> - - <!-- =================================================================== --> - <!-- GUI Run Target --> - <!-- =================================================================== --> - <target name="poibrowser"> - <taskdef name="user-input" classname="UserInput" - classpath="./tools/anttasks"/> - - <property name="contrib.input.selection" value=""/> - <user-input name="contrib.input.selection">Please select a file to view </user-input> - - <java classname="org.apache.poi.contrib.poibrowser.POIBrowser" fork="true"> - <arg value="${contrib.input.selection}"/> - <classpath> - <pathelement location="build/jakarta-poi/classes"/> - <pathelement location="build/jakarta-poi/contrib/classes"/> - </classpath> - </java> - </target> - - -</project> - -<!-- End of file --> diff --git a/src/documentation/Release-Checklist.txt b/src/documentation/Release-Checklist.txt new file mode 100644 index 0000000000..61ebae5824 --- /dev/null +++ b/src/documentation/Release-Checklist.txt @@ -0,0 +1,18 @@ +- build distributions +- sign distributions +- Generate announcements and HEADER.html +- upload distributions to correct dir +- tag CVS +- generate www pages and upload +- bump release ID +- send announcements to announcement@apache.org, announcements@xml.apache.org, announcements@jakarta.apache.org +- news to newsgroups: comp.lang.java.softwaretools +- post stories on + *) jakarta news page + *) theserverside.com + *) freshmeat.net + *) www.javaworld.com + *) www.javalobby.com + *) www.jguru.com + *) www.slashdot.org + (and follow them up) diff --git a/src/documentation/cocoon.xconf b/src/documentation/cocoon.xconf deleted file mode 100755 index c5236dc327..0000000000 --- a/src/documentation/cocoon.xconf +++ /dev/null @@ -1,365 +0,0 @@ -<?xml version="1.0"?> -<cocoon version="2.0"> - -<!-- ================ Apache Cocoon configuration file ================== --> -<!-- Please refer to the online documentation for full descriptions. - The notes that accompany the settings below are intended to be concise. ---> - -<!-- ===================== General Components =========================== --> - - <!-- Parser: - The default parser used in the Apache Cocoon 2 system is - org.apache.cocoon.components.parser.JaxpParser - Apache Cocoon 2 system requires a JAXP 1.1 parser. - If you have problems because your servlet environment uses its own - parser not conforming to JAXP 1.1 try using the alternative - XercesParser instead of the JaxpParser. To activate the XercesParser, - change the class attribute to - <parser class="org.apache.cocoon.components.parser.XercesParser"/> - You will also need to add a system property to your JVM - (probably on the startup of your servlet engine like this: - -Dorg.apache.cocoon.components.parser.Parser=org.apache.cocoon.components.parser.XercesParser - - validate: This parameter causes the parser to be a validating parser. - XML validation is only being used for the documentation build. - (If you are going to use it elsewhere, then do so with caution.) - You really should have validated all of your XML documents already, - according to their proper DTD or schema. Do not expect Cocoon to do it. - --> - <parser class="org.apache.cocoon.components.parser.JaxpParser"> - <parameter name="validate" value="false"/> - </parser> - - <!-- Storing: - freememory: Indicates how much memory should be left free in the - JVM for normal operation. - heapsize: Indicates how big the heap size can grow to before the - cleanup thread kicks in. - objectlifetime: Indicates how long (seconds) a cache object will - be hold in memory. The object will be thrown out, - when the time is over. - interval: Indicates the interval of the cleanup thread in seconds. - maxobjects: Indicates how many objects will be hold in the cache. - When the number of maxobjects has been reached. The - last object in the cache will be thrown out. - usethread: Indicates whether we use a cleanup thread or not. - threadpriority: Indicates the priority of the cleanup thread. - (1 is the lowest priority and 10 is the highest). - filesystem: Turns the filesystem storage for objects on or off. - --> - <store class="org.apache.cocoon.components.store.MRUMemoryStore"> - <parameter name="maxobjects" value="100"/> - <parameter name="threadpriority" value="5"/> - <parameter name="filesystem" value="true"/> - </store> - - <!-- Store Janitor: - freememory = How much free memory shall be available in the jvm - heapsize = Indicates the limit of the jvm memory consumption - cleanupthreadinterval = How often shall the cleanup thread check memory - threadpriority = Indicates the thread priority of the cleanup thread - - Be careful with the heapsize and freememory paramters. Wrong values can - cause high cpu usage. - Example configuration: - Jvm settings: - -Xms100000000 -Xmx200000000 - store-janitor settings: - <parameter name="freememory" value="50000000"/> - <parameter name="heapsize" value="150000000"/> - - Heapsize must be higher then the -Xms parameter and freememory - between those both. - --> - <store-janitor class="org.apache.cocoon.components.store.StoreJanitorImpl" logger="root.store"> - <parameter name="freememory" value="1000000"/> - <parameter name="heapsize" value="60000000"/> - <parameter name="cleanupthreadinterval" value="10"/> - <parameter name="threadpriority" value="5"/> - </store-janitor> - - <!-- Entity resolution catalogs: - catalog: - The default catalog is distributed at /resources/entities/catalog - This is the contextual pathname for Cocoon resources. - You can override this path, if necessary, using the "catalog" parameter. - <parameter name="catalog" value="/resources/entities/catalog"/> - However, it is probably desirable to leave this default catalog config - and declare your own local catalogs, which are loaded in addition to - the system catalog. - - There are various ways to do local configuration (see "Entity Catalogs" - documentation). One way is via the CatalogManager.properties file. - As an additional method, you can specify the "local-catalog" parameter here. - - local-catalog: - The full filesystem pathname to a single local catalog file. - <parameter name="local-catalog" value="/usr/local/sgml/mycatalog"/> - - verbosity: - The level of messages for status/debug (messages go to standard output) - The following messages are provided ... - 0 = none - 1 = ? (... not sure yet) - 2 = 1+, Loading catalog, Resolved public, Resolved system - 3 = 2+, Catalog does not exist, resolvePublic, resolveSystem - 10 = 3+, List all catalog entries when loading a catalog - (Cocoon also logs the "Resolved public" messages.) - TODO: determine all messages at each level - <parameter name="verbosity" value="2"/> - - --> - <resolver class="org.apache.cocoon.components.resolver.ResolverImpl"> - <parameter name="catalog" value="/resources/entities/catalog"/> - <parameter name="verbosity" value="0"/> - </resolver> - - <!-- XSLT Processor: - --> - <xslt-processor class="org.apache.cocoon.components.xslt.XSLTProcessorImpl" logger="root.xslt"> - <parameter name="use-store" value="true"/> - </xslt-processor> - - <!-- URL Factory: - The url factory adds special url protocols to the system, they are then - available inside Cocoon, e.g. as a source argument for one of the sitemap - components. - --> - <url-factory> - <protocol name="resource" class="org.apache.cocoon.components.url.ResourceURLFactory"/> - <protocol name="context" class="org.apache.cocoon.components.url.ContextURLFactory"/> - </url-factory> - - <!-- Source Handler: - The source handler adds special url protocols to the system, they are - then available inside Cocoon, e.g. as a source argument for one of the - sitemap components. - --> - <source-handler> - </source-handler> - - <!-- Program Generator: - The ProgamGenerator builds programs from a XML document written in a - MarkupLanguage. - auto-reload: - root-package: persistent code repository. - preload: - --> - <program-generator> - <parameter name="auto-reload" value="false"/> - <parameter name="root-package" value="orgapachecocoonwww"/> - <parameter name="preload" value="true"/> - </program-generator> - - <!-- Programming Languages: - --> - <programming-languages> - <java-language name="java"> - <!-- compiler parameter specifies which class to use to compile Java. - Possible variants are Javac and Jikes compilers. - Javac requires javac.jar (included with Cocoon distribution). - Jikes requires IBM jikes compiler to be present in the PATH --> - <parameter name="compiler" value="org.apache.cocoon.components.language.programming.java.Javac"/> - <!-- A singleton-like implementation of a ClassLoader --> - <parameter name="class-loader" value="org.apache.cocoon.components.classloader.ClassLoaderManagerImpl"/> - </java-language> - </programming-languages> - - <!-- Class loader: - A singleton-like implementation of a ClassLoader. - --> - <classloader class="org.apache.cocoon.components.classloader.ClassLoaderManagerImpl"/> - - <!-- Markup Languages: - This section defines several builtin logicsheets. A logicsheet is an XML - filter used to translate user-defined, dynamic markup into equivalent - code embedding directives for a given markup language. - --> - <markup-languages> - <xsp-language name="xsp"> - <parameter name="prefix" value="xsp"/> - <parameter name="uri" value="http://apache.org/xsp"/> - - <!-- Defines the XSP Core logicsheet for the Java language --> - <target-language name="java"> - <parameter name="core-logicsheet" value="resource://org/apache/cocoon/components/language/markup/xsp/java/xsp.xsl"/> - - <!-- The Request logicsheet (taglib) is an XSP logicsheet that wraps XML tags - around standard request operations --> - <builtin-logicsheet> - <parameter name="prefix" value="xsp-request"/> - <parameter name="uri" value="http://apache.org/xsp/request/2.0"/> - <parameter name="href" value="resource://org/apache/cocoon/components/language/markup/xsp/java/request.xsl"/> - </builtin-logicsheet> - - <!-- The Response logicsheet (taglib) is an XSP logicsheet that wraps XML tags - around standard response operations --> - <builtin-logicsheet> - <parameter name="prefix" value="xsp-response"/> - <parameter name="uri" value="http://apache.org/xsp/response/2.0"/> - <parameter name="href" value="resource://org/apache/cocoon/components/language/markup/xsp/java/response.xsl"/> - </builtin-logicsheet> - - <!-- The Session logicsheet (taglib) is an XSP logicsheet that wraps XML tags around - standard session operations. Specifically, the Session logicsheet provides an - XML interface to most methods of the HttpSession object (see the Java Servlet API - Specification, version 2.2 ) for more information. --> - <builtin-logicsheet> - <parameter name="prefix" value="session"/> - <parameter name="uri" value="http://apache.org/xsp/session/2.0"/> - <parameter name="href" value="resource://org/apache/cocoon/components/language/markup/xsp/java/session.xsl"/> - </builtin-logicsheet> - - <builtin-logicsheet> - <parameter name="prefix" value="xsp-cookie"/> - <parameter name="uri" value="http://apache.org/xsp/cookie/2.0"/> - <parameter name="href" value="resource://org/apache/cocoon/components/language/markup/xsp/java/cookie.xsl"/> - </builtin-logicsheet> - - <!-- The ESQL logicsheet is an XSP logicsheet that performs sql queries and - serializes their results as XML. This allows you to work with data from a - wide variety of different sources when using Apache Cocoon. - <builtin-logicsheet> - <parameter name="prefix" value="esql"/> - <parameter name="uri" value="http://apache.org/cocoon/SQL/v2"/> - <parameter name="href" value="resource://org/apache/cocoon/components/language/markup/xsp/java/esql.xsl"/> - </builtin-logicsheet> ---> - <builtin-logicsheet> - <parameter name="prefix" value="log"/> - <parameter name="uri" value="http://apache.org/xsp/log/2.0"/> - <parameter name="href" value="resource://org/apache/cocoon/components/language/markup/xsp/java/log.xsl"/> - </builtin-logicsheet> - - <builtin-logicsheet> - <parameter name="prefix" value="util"/> - <parameter name="uri" value="http://apache.org/xsp/util/2.0"/> - <parameter name="href" value="resource://org/apache/cocoon/components/language/markup/xsp/java/util.xsl"/> - </builtin-logicsheet> -<!-- - The xsp-formval taglib serves as interface to retrieve validation results - from a request attribute - <builtin-logicsheet> - <parameter name="prefix" value="xsp-formval"/> - <parameter name="uri" value="http://apache.org/xsp/form-validator/2.0"/> - <parameter name="href" value="resource://org/apache/cocoon/components/language/markup/xsp/java/form-validator.xsl"/> - </builtin-logicsheet> - - The capture taglib is for capturing parts of the XSP-generated XML as - XML fragments or DOM nodes - <builtin-logicsheet> - <parameter name="prefix" value="capture"/> - <parameter name="uri" value="http://apache.org/cocoon/capture/1.0"/> - <parameter name="href" value="resource://org/apache/cocoon/components/language/markup/xsp/java/capture.xsl"/> - </builtin-logicsheet> ---> - </target-language> - </xsp-language> - - <!-- Defines Sitemap Core logicsheet for the Java language --> - <sitemap-language name="sitemap"> - <parameter name="prefix" value="map"/> - <parameter name="uri" value="http://apache.org/cocoon/sitemap/1.0"/> - - <target-language name="java"> - <parameter name="core-logicsheet" value="resource://org/apache/cocoon/components/language/markup/sitemap/java/sitemap.xsl"/> - </target-language> - </sitemap-language> - </markup-languages> - - <!-- Stream Pipeline: - Either collects a Reader and lets it produce a character stream - or connects an EventPipeline with a Serializer and lets them produce - the character stream. - --> - <stream-pipeline class="org.apache.cocoon.components.pipeline.CachingStreamPipeline" - pool-max="32" pool-min="4" pool-grow="4"/> - - <!-- Caching of stream pipeline: - freememory: Indicates how much memory should be left free in the - JVM for normal operation. - heapsize: Indicates how big the heap size can grow to before the - cleanup thread kicks in. - objectlifetime: Indicates how long (seconds) a cache object will - be hold in memory. The object will be thrown out, - when the time is over. - interval: Indicates the interval of the cleanup thread in seconds. - maxobjects: Indicates how many objects will be hold in the cache. - When the number of maxobjects has been reached. The - last object in the cache will be thrown out. - usethread: Indicates whether we use a cleanup thread or not. - threadpriority: Indicates the priority of the cleanup thread. - (1 is the lowest priority and 10 is the highest). - filesystem: Turns the filesystem storage for objects on or off. - --> - <stream-cache class="org.apache.cocoon.components.store.MRUMemoryStore" logger="root.store"> - <parameter name="maxobjects" value="100"/> - <parameter name="threadpriority" value="5"/> - <parameter name="filesystem" value="true"/> - </stream-cache> - - <!-- Event Pipeline: - Connects the generator and the various transformers and produces a - character stream. Alternatives to CachingEventPipeline are: - <event-pipeline class="org.apache.cocoon.components.pipeline.NonCachingEventPipeline"/> - --> - <event-pipeline class="org.apache.cocoon.components.pipeline.CachingEventPipeline" - pool-max="32" pool-min="4" pool-grow="4"/> - - <!-- Caching of event pipeline: - freememory: Indicates how much memory should be left free in the - JVM for normal operation. - heapsize: Indicates how big the heap size can grow to before the - cleanup thread kicks in. - objectlifetime: Indicates how long (seconds) a cache object will - be hold in memory. The object will be thrown out, - when the time is over. - interval: Indicates the interval of the cleanup thread in seconds. - maxobjects: Indicates how many objects will be hold in the cache. - When the number of maxobjects has been reached. The - last object in the cache will be thrown out. - usethread: Indicates whether we use a cleanup thread or not. - threadpriority: Indicates the priority of the cleanup thread. - (1 is the lowest priority and 10 is the highest). - filesystem: Turns the filesystem storage for objects on or off. - --> - <event-cache class="org.apache.cocoon.components.store.MRUMemoryStore" logger="root.store"> - <parameter name="maxobjects" value="100"/> - <parameter name="threadpriority" value="5"/> - <parameter name="filesystem" value="true"/> - </event-cache> - - <!-- SAXConnector: - Connects the various pipeline components. - LoggingSAXConnector logs SAX events between pipeline components - into cocoon's log file. - Uncomment one of the following lines for using the SAXConnector. - <sax-connector class="org.apache.cocoon.components.saxconnector.LoggingSAXConnector"/> - --> - -<!-- ======================== The sitemap ============================== --> - - <!-- Reloading of the sitemap: - The check-reload attribute determines if the sitemap is reloaded on change. - Set to "no", the sitemap is generated once at startup. - Set to "yes", the sitemap is regenerated if it changes. - - The reload-method specifies the method for the regeneration: - asynchron: If the sitemap changes, the sitemap is regenerated at the - next request in the background and the incoming request is - served with the old sitemap. All subsequent requests are - served with the old sitemap until the regeneration in the - background has finished. - synchron: If the sitemap changes, the sitemap is regenerated at the - next request. When the regeneration is finished, the request - (and all subsequent ones) is served with the new sitemap. - - For development environment, set the reload-method to synchron and the - check-reload to yes. - For production environment, it is advisable to set the reload-method to - asynchron and for more safety the check-reload to no. - --> - <sitemap file="sitemap.xmap" reload-method="synchron" check-reload="no"/> - -</cocoon> diff --git a/src/documentation/images/.xvpics/header.gif b/src/documentation/images/.xvpics/header.gif Binary files differdeleted file mode 100644 index 62721418b1..0000000000 --- a/src/documentation/images/.xvpics/header.gif +++ /dev/null diff --git a/src/documentation/images/avalon-compatible.png b/src/documentation/images/avalon-compatible.png Binary files differnew file mode 100644 index 0000000000..ecdd455a84 --- /dev/null +++ b/src/documentation/images/avalon-compatible.png diff --git a/src/documentation/images/built-with-cocoon.png b/src/documentation/images/built-with-cocoon.png Binary files differnew file mode 100644 index 0000000000..64e25d3bbf --- /dev/null +++ b/src/documentation/images/built-with-cocoon.png diff --git a/src/documentation/images/cocoon2-small.jpg b/src/documentation/images/cocoon2-small.jpg Binary files differdeleted file mode 100755 index e8f6dd8c8c..0000000000 --- a/src/documentation/images/cocoon2-small.jpg +++ /dev/null diff --git a/src/documentation/images/krysalis-compatible.png b/src/documentation/images/krysalis-compatible.png Binary files differnew file mode 100644 index 0000000000..589305e604 --- /dev/null +++ b/src/documentation/images/krysalis-compatible.png diff --git a/src/documentation/images/made-with-cocoon.png b/src/documentation/images/made-with-cocoon.png Binary files differdeleted file mode 100644 index e409cb413b..0000000000 --- a/src/documentation/images/made-with-cocoon.png +++ /dev/null diff --git a/src/documentation/linkalarm-readme.txt b/src/documentation/linkalarm-readme.txt deleted file mode 100755 index dd5646970e..0000000000 --- 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 49b348ba8b..be3090722b 100755 --- a/src/documentation/sitemap.xmap +++ b/src/documentation/sitemap.xmap @@ -5,35 +5,16 @@ <!-- =========================== Components ================================ --> <map:components> - - <map:generators default="file"> - <map:generator name="file" src="org.apache.cocoon.generation.FileGenerator" label="content"/> - <!-- FIXME: Change this once better view handling is implemented --> - <map:generator name="file-nolabel" src="org.apache.cocoon.generation.FileGenerator"/> - </map:generators> - - <map:transformers default="xslt"> - <map:transformer name="xslt" src="org.apache.cocoon.transformation.TraxTransformer"> - <use-request-parameters>false</use-request-parameters> - <use-browser-capabilities-db>false</use-browser-capabilities-db> - </map:transformer> - </map:transformers> - - <map:readers default="resource"> - <map:reader name="resource" src="org.apache.cocoon.reading.ResourceReader"/> - </map:readers> - - <map:serializers default="html"> - <map:serializer name="html" mime-type="text/html" src="org.apache.cocoon.serialization.HTMLSerializer"> - <encoding>iso8859-1</encoding> - </map:serializer> - <map:serializer name="xml" mime-type="text/xml" src="org.apache.cocoon.serialization.XMLSerializer"/> - <map:serializer name="links" src="org.apache.cocoon.serialization.LinkSerializer"/> - </map:serializers> - - <map:matchers default="wildcard"> + <!-- Components used are declared in the cocoon tool section --> + + <map:generators default="file"/> <!-- available: file, serverpages --> + <map:transformers default="xslt"/> <!-- available: xslt --> + <map:readers default="resource"/> <!-- available: resource --> + <map:serializers default="html"/> <!-- available: html, xml, links --> + <map:matchers default="wildcard"> <map:matcher name="wildcard" src="org.apache.cocoon.matching.WildcardURIMatcher"/> </map:matchers> + </map:components> <!-- =========================== Views =================================== --> @@ -54,7 +35,7 @@ <map:pipelines> - <!-- C2 documentation pipeline --> + <!-- Documentation pipeline --> <map:pipeline> <map:match pattern=""> <map:redirect-to uri="index.html"/> @@ -70,7 +51,7 @@ </map:match> <map:match pattern="body-todo.xml"> - <map:generate type="file-nolabel" src="xdocs/todo.xml"/> + <map:generate type="file" src="xdocs/todo.xml"/> <map:transform src="stylesheets/todo2document.xsl" label="content"/> <map:transform src="stylesheets/document2docbook.xsl"/> <map:transform src="stylesheets/docbook2body.xsl"/> @@ -78,7 +59,7 @@ </map:match> <map:match pattern="body-changes.xml"> - <map:generate type="file-nolabel" src="xdocs/changes.xml"/> + <map:generate type="file" src="xdocs/changes.xml"/> <map:transform src="stylesheets/changes2document.xsl" label="content"/> <map:transform src="stylesheets/document2docbook.xsl"/> <map:transform src="stylesheets/docbook2body.xsl"/> @@ -86,40 +67,13 @@ </map:match> <map:match pattern="body-faq.xml"> - <map:generate type="file-nolabel" src="xdocs/faq.xml"/> + <map:generate type="file" src="xdocs/faq.xml"/> <map:transform src="stylesheets/faq2document.xsl" label="content"/> <map:transform src="stylesheets/document2docbook.xsl"/> <map:transform src="stylesheets/docbook2body.xsl"/> <map:serialize/> </map:match> - <!-- Generate the "doclist" - list of all documentation - The first match generates each book.xml and adds a new attribute "uri". - The second match aggregates each book.xml into a doclist and - then converts it to a document. - --> - <map:match pattern="doclist/xdocs/**book.xml"> - <map:generate src="xdocs/{1}book.xml"/> - <map:transform src="stylesheets/doclist.xsl"> - <map:parameter name="uri" value="{1}"/> - </map:transform> - <map:serialize type="xml"/> - </map:match> - <map:match pattern="body-doclist.xml"> - <map:aggregate element="doclist"> - <map:part src="cocoon:/doclist/xdocs/book.xml"/> - <map:part src="cocoon:/doclist/xdocs/plan/book.xml"/> - <map:part src="cocoon:/doclist/xdocs/poifs/book.xml"/> - <map:part src="cocoon:/doclist/xdocs/hdf/book.xml"/> - <map:part src="cocoon:/doclist/xdocs/hssf/book.xml"/> - <map:part src="cocoon:/doclist/xdocs/hpsf/book.xml"/> - <map:part src="cocoon:/doclist/xdocs/utils/book.xml"/> - </map:aggregate> - <map:transform src="stylesheets/doclist2document.xsl"/> - <map:transform src="stylesheets/document2html.xsl"/> - <map:serialize type="html"/> - </map:match> - <map:match pattern="body-**.xml"> <map:generate src="xdocs/{1}.xml"/> <map:transform src="stylesheets/document2docbook.xsl"/> @@ -165,18 +119,10 @@ <!-- ================ Static =========================== --> - <map:match pattern="**sample/**"> - <map:read src="xdocs/{1}sample/{2}" mime-type="text/plain"/> - </map:match> - <map:match pattern="**.txt"> <map:read src="xdocs/{1}.txt" mime-type="text/plain"/> </map:match> - <map:match pattern="**resources/script.js"> - <map:read src="stylesheets/script-cli.js" mime-type="application/javascript"/> - </map:match> - <map:match pattern="**resources/**.js"> <map:read src="stylesheets/{2}.js" mime-type="application/javascript"/> </map:match> @@ -197,15 +143,6 @@ <map:read src="images/{2}.gif" mime-type="image/gif"/> </map:match> - <map:match pattern="**graphics/**-*.jpg"> - <map:generate src="svg/{3}.xml"/> - <map:transform src="svg/addlabel.xsl"> - <map:parameter name="use-request-parameters" value="true"/> - <map:parameter name="label" value="{2}"/> - </map:transform> - <map:serialize type="svg2jpeg"/> - </map:match> - </map:pipeline> </map:pipelines> diff --git a/src/documentation/stylesheets/announcement.xsl b/src/documentation/stylesheets/announcement.xsl deleted file mode 100755 index 230506202c..0000000000 --- a/src/documentation/stylesheets/announcement.xsl +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0"?> - -<xsl:stylesheet version="1.0" -xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> - - <xsl:template match="changes"> - <xsl:variable name="file" select="concat('../', @file)"/> - <xsl:variable name="version" select="@version"/> - <xsl:apply-templates select="document($file)/changes/release[attribute::version=string($version)]"/> - </xsl:template> -</xsl:stylesheet> diff --git a/src/documentation/stylesheets/book2menu.xsl b/src/documentation/stylesheets/book2menu.xsl index e97057fd1f..ab0fb1fe4e 100755 --- a/src/documentation/stylesheets/book2menu.xsl +++ b/src/documentation/stylesheets/book2menu.xsl @@ -14,20 +14,16 @@ </xsl:template> <xsl:template match="menu"> - <font color="#000000" size="+1"><xsl:value-of select="@label"/></font> - <font size="-1"> - <ul> + <hr/> + <span class="s1"><xsl:value-of select="@label"/></span><br/> <xsl:apply-templates/> - </ul> - </font><br/> </xsl:template> <xsl:template match="menu-item"> <xsl:if test="not(@type) or @type!='hidden'"> - <li><a href="{@href}"><font size="-1"><xsl:value-of select="@label"/></font></a></li> + <a href="{@href}" class="s1"><xsl:value-of select="@label"/></a><br/> </xsl:if> </xsl:template> <xsl:template match="node()|@*" priority="-1"/> -</xsl:stylesheet> - +</xsl:stylesheet>
\ No newline at end of file diff --git a/src/documentation/stylesheets/docbook2body.xsl b/src/documentation/stylesheets/docbook2body.xsl index 88f0d6928a..27621919be 100755 --- a/src/documentation/stylesheets/docbook2body.xsl +++ b/src/documentation/stylesheets/docbook2body.xsl @@ -6,16 +6,31 @@ <xsl:template match="book"> <body> <title><xsl:value-of select="title"/></title> - <center> - <table width="80%"> - <tr> - <td bgcolor="#F3DD61"> - <br/><center><b><xsl:value-of select="title"/><xsl:if test="subtitle"><xsl:text>: </xsl:text><xsl:value-of select="subtitle"/></xsl:if></b></center> - <br/> - </td> - </tr> - </table> - </center><br/> + <table class="centered" align="center" width="100%"> + <tbody> + <tr> + <td align="center"> + <table class="title" cellspacing="0" cellpadding="1" border="0"> + <tbody> + <tr> + <td bgcolor="#525d76"> + <table class="centered" cellspacing="0" cellpadding="2" border="0" width="100%"> + <tbody> + <tr> + <td bgcolor="#f3dd61"> + <span class="title"><xsl:value-of select="title"/><xsl:if test="subtitle"><xsl:text>: </xsl:text><xsl:value-of select="subtitle"/></xsl:if></span> + </td> + </tr> + </tbody> + </table> + </td> + </tr> + </tbody> + </table> + </td> + </tr> + </tbody> + </table> <xsl:apply-templates select="dedication"/> <xsl:apply-templates select="bookinfo"/> </body> @@ -25,15 +40,31 @@ <body> <xsl:if test="normalize-space(title)!=''"> <title><xsl:value-of select="title"/></title> - <center> - <table width="80%"> - <tr> - <td bgcolor="#F3DD61"> - <font size="+1" face="Arial,sans-serif"><center><b><xsl:value-of select="title"/></b></center></font> - </td> - </tr> - </table> - </center> + <table class="centered" align="center" width="100%"> + <tbody> + <tr> + <td align="center"> + <table class="title" cellspacing="0" cellpadding="1" border="0"> + <tbody> + <tr> + <td bgcolor="#525d76"> + <table class="centered" cellspacing="0" cellpadding="2" border="0" width="100%"> + <tbody> + <tr> + <td bgcolor="#f3dd61"> + <span class="title"><xsl:value-of select="title"/></span> + </td> + </tr> + </tbody> + </table> + </td> + </tr> + </tbody> + </table> + </td> + </tr> + </tbody> + </table> </xsl:if> <xsl:if test="subtitle"> @@ -58,7 +89,7 @@ <xsl:apply-templates select="para"/> - <br/> + <xsl:apply-templates select="section"> <xsl:with-param name="level" select="1"/> @@ -424,13 +455,6 @@ <xsl:apply-templates/> </xsl:template> - <xsl:template match="entry[@role='th']"> - <td align="center" bgcolor="#006CB8" valign="top" - style="font-weight: bold"> - <font color="#ffffff" size="-1"><xsl:apply-templates/></font> - </td> - </xsl:template> - <xsl:template match="entry"> <td align="left" bgcolor="#a0ddf0" valign="top"> <font color="#000000" size="-1"><xsl:apply-templates/></font> diff --git a/src/documentation/stylesheets/doclist.xsl b/src/documentation/stylesheets/doclist.xsl deleted file mode 100755 index ecb2465bf2..0000000000 --- a/src/documentation/stylesheets/doclist.xsl +++ /dev/null @@ -1,15 +0,0 @@ -<?xml version="1.0"?> - -<xsl:stylesheet - xmlns:xsl="http://www.w3.org/1999/XSL/Transform" - version="1.0"> - - <xsl:param name="uri"/> - - <xsl:template match="book"> - <book title="{@title}" uri="{$uri}"> - <xsl:copy-of select="node()"/> - </book> - </xsl:template> - -</xsl:stylesheet> diff --git a/src/documentation/stylesheets/doclist2document.xsl b/src/documentation/stylesheets/doclist2document.xsl deleted file mode 100755 index 4219c63519..0000000000 --- a/src/documentation/stylesheets/doclist2document.xsl +++ /dev/null @@ -1,85 +0,0 @@ -<?xml version="1.0"?> - -<xsl:stylesheet - xmlns:xsl="http://www.w3.org/1999/XSL/Transform" - version="1.0"> - - <xsl:template match="doclist"> - <document> - <header> - <title>List of all documentation</title> - </header> - <body> - <s1 title="Documentation List"> - <p> - This complete list shows, at a glance, how all of the documentation - fits together within the hierarchy of sections. -<!-- For an overview of the documentation see the new - "Table of Contents". --> - </p> - <p> - 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. - </p> - </s1> - <xsl:apply-templates/> - </body> - </document> - </xsl:template> - - <xsl:template match="book"> - <s1 title="{@title}"> - <xsl:if test="position()=1"> - <p>This first section is a list of the top-level documentation - (and is a replica of this page's side-panel).</p> - </xsl:if> - <xsl:apply-templates/> - </s1> - </xsl:template> - - <xsl:template match="menu"> - <xsl:if test="@label!='Navigation'"> - <p><strong><xsl:value-of select="@label"/></strong></p> - <ul> - <xsl:apply-templates> - <xsl:with-param name="uri" select="../@uri"/> - </xsl:apply-templates> - </ul> - </xsl:if> - </xsl:template> - - <xsl:template match="menu-item"> - <xsl:param name="uri"/> - <xsl:if test="not(@type) or @type!='hidden'"> - <xsl:if test="@label!='Main' and @label!='User Documentation'"> -<!-- FIXME: ensure href is not full URL scheme:// --> -<!-- - (uri=<xsl:value-of select="$uri"/> href=<xsl:value-of select="@href"/>) ---> - <li><link href="{$uri}{@href}"><xsl:value-of select="@label"/></link> - </li> - </xsl:if> - </xsl:if> - </xsl:template> - - <xsl:template match="external"> - <xsl:param name="uri"/> - <xsl:if test="not(@type) or @type!='hidden'"> - <xsl:choose> - <!-- FIXME: specially handle menu item "API (Javadoc)", it causes a bug. --> - <xsl:when test="starts-with(@label,'API')"> - <li><link href="http://xml.apache.org/cocoon/apidocs/"><xsl:value-of select="@label"/></link></li> -<!-- FIXME: here is the bug: - <li><link href="{@href}"><xsl:value-of select="@label"/></link></li> - <li><xsl:value-of select="@label"/>href=<xsl:value-of select="@href"/></li> ---> - </xsl:when> - <xsl:otherwise> - <li><link href="{@href}"><xsl:value-of select="@label"/></link></li> - </xsl:otherwise> - </xsl:choose> - </xsl:if> - </xsl:template> - -</xsl:stylesheet> diff --git a/src/documentation/stylesheets/document2docbook.xsl b/src/documentation/stylesheets/document2docbook.xsl index 2967f76916..33b48beae2 100755 --- a/src/documentation/stylesheets/document2docbook.xsl +++ b/src/documentation/stylesheets/document2docbook.xsl @@ -144,7 +144,11 @@ <table> <tgroup> <xsl:attribute name="cols"><xsl:value-of select="count(tr/td)"/></xsl:attribute> - <xsl:apply-templates select="th"/> + <xsl:if test="th"> + <thead> + <xsl:apply-templates select="th"/> + </thead> + </xsl:if> <tbody> <xsl:apply-templates select="tr"/> </tbody> @@ -152,13 +156,7 @@ </table> </xsl:template> - <xsl:template match="th"> - <entry role="th"> - <xsl:apply-templates/> - </entry> - </xsl:template> - - <xsl:template match="tr"> + <xsl:template match="th|tr"> <row> <xsl:apply-templates/> </row> @@ -176,3 +174,4 @@ </xsl:copy> </xsl:template> </xsl:stylesheet> + diff --git a/src/documentation/stylesheets/document2html.xsl b/src/documentation/stylesheets/document2html.xsl deleted file mode 100755 index f64b59b51a..0000000000 --- a/src/documentation/stylesheets/document2html.xsl +++ /dev/null @@ -1,389 +0,0 @@ -<?xml version="1.0"?> - -<xsl:stylesheet - xmlns:xsl="http://www.w3.org/1999/XSL/Transform" - version="1.0"> - -<!-- ====================================================================== --> -<!-- document section --> -<!-- ====================================================================== --> - - <xsl:template match="/"> - <!-- checks if this is the included document to avoid neverending loop --> - <xsl:if test="not(book)"> - <document> - <xsl:choose> - <xsl:when test="document/header/title"> - <title><xsl:value-of select="document/header/title"/></title> - </xsl:when> - <xsl:otherwise> - <title>NO TITLE</title> - </xsl:otherwise> - </xsl:choose> - <body text="#000000" link="#039acc" vlink="#0086b2" alink="#cc0000" - topmargin="4" leftmargin="4" marginwidth="4" marginheight="4" - bgcolor="#ffffff"> - - <xsl:apply-templates/> - - </body> - </document> - </xsl:if> - - <xsl:if test="book"> - <xsl:apply-templates/> - </xsl:if> - </xsl:template> - -<!-- ====================================================================== --> -<!-- header section --> -<!-- ====================================================================== --> - - <xsl:template match="header"> - <!-- ignore on general document --> - </xsl:template> - -<!-- ====================================================================== --> -<!-- body section --> -<!-- ====================================================================== --> - - <xsl:template match="s1"> - <div align="right"> - <table border="0" width="98%" cellspacing="0" cellpadding="0"> - <tr> - <td width="9" height="7" valign="bottom" align="right"><img src="images/bar-top-left.gif" width="9" height="7" vspace="0" hspace="0" border="0"/></td> - <td background="images/bar-border-top.gif"><img src="images/void.gif" width="1" height="5" vspace="0" hspace="0" border="0"/></td> - <td width="9" height="7" valign="bottom" align="left"><img src="images/bar-top-right.gif" width="9" height="7" vspace="0" hspace="0" border="0"/></td> - </tr> - <tr> - <td width="9" background="images/bar-border-left.gif"><img src="images/void.gif" width="9" height="1" vspace="0" hspace="0" border="0"/></td> - <td width="100%" bgcolor="#0086b2"> - <font size="+1" face="arial,helvetica,sanserif" color="#ffffff"> - <img src="images/void.gif" width="5" height="5" vspace="0" hspace="0" border="0"/><b><xsl:value-of select="@title"/></b></font> - </td> - <td width="9" background="images/bar-border-right.gif"><img src="images/void.gif" width="9" height="1" vspace="0" hspace="0" border="0"/></td> - </tr> - <tr> - <td width="9" height="12" valign="top" align="right"><img src="images/bar-bottom-left.gif" width="9" height="12" vspace="0" hspace="0" border="0"/></td> - <td background="images/bar-border-bottom.gif"><img src="images/void.gif" height="12" vspace="0" hspace="0" border="0"/></td> - <td width="9" height="12" valign="top" align="left"><img src="images/bar-bottom-right.gif" width="9" height="12" vspace="0" hspace="0" border="0"/></td> - </tr> - </table> - <table border="0" width="98%" cellspacing="0" cellpadding="0"> - <tr> - <td> - <font face="arial,helvetica,sanserif" color="#000000"><xsl:apply-templates/></font> - </td> - </tr> - </table> - </div> - <br/> - </xsl:template> - - <xsl:template match="s2"> - <div align="right"> - <table border="0" width="95%" cellspacing="0" cellpadding="0"> - <tr> - <td width="9" height="7" valign="bottom" align="right"><img src="images/bar-top-left.gif" width="9" height="7" vspace="0" hspace="0" border="0"/></td> - <td background="images/bar-border-top.gif"><img src="images/void.gif" width="1" height="5" vspace="0" hspace="0" border="0"/></td> - <td width="9" height="7" valign="bottom" align="left"><img src="images/bar-top-right.gif" width="9" height="7" vspace="0" hspace="0" border="0"/></td> - </tr> - <tr> - <td width="9" background="images/bar-border-left.gif"><img src="images/void.gif" width="9" height="1" vspace="0" hspace="0" border="0"/></td> - <td width="100%" bgcolor="#0086b2"> - <font face="arial,helvetica,sanserif" color="#ffffff"> - <img src="images/void.gif" width="5" height="5" vspace="0" hspace="0" border="0"/><b><xsl:value-of select="@title"/></b></font> - </td> - <td width="9" background="images/bar-border-right.gif"><img src="images/void.gif" width="9" height="1" vspace="0" hspace="0" border="0"/></td> - </tr> - <tr> - <td width="9" height="12" valign="top" align="right"><img src="images/bar-bottom-left.gif" width="9" height="12" vspace="0" hspace="0" border="0"/></td> - <td background="images/bar-border-bottom.gif"><img src="images/void.gif" width="1" height="12" vspace="0" hspace="0" border="0"/></td> - <td width="9" height="12" valign="top" align="left"><img src="images/bar-bottom-right.gif" width="9" height="12" vspace="0" hspace="0" border="0"/></td> - </tr> - </table> - <table border="0" width="95%" cellspacing="0" cellpadding="0"> - <tr> - <td> - <font face="arial,helvetica,sanserif" color="#000000"><xsl:apply-templates/></font> - </td> - </tr> - </table> - </div> - <br/> - </xsl:template> - - <xsl:template match="s3"> - <div align="right"> - <table border="0" width="90%" cellspacing="0" cellpadding="0"> - <tr> - <td width="9" height="7" valign="bottom" align="right"><img src="images/bar-top-left.gif" width="9" height="7" vspace="0" hspace="0" border="0"/></td> - <td background="images/bar-border-top.gif"><img src="images/void.gif" width="1" height="5" vspace="0" hspace="0" border="0"/></td> - <td width="9" height="7" valign="bottom" align="left"><img src="images/bar-top-right.gif" width="9" height="7" vspace="0" hspace="0" border="0"/></td> - </tr> - <tr> - <td width="9" background="images/bar-border-left.gif"><img src="images/void.gif" width="9" height="1" vspace="0" hspace="0" border="0"/></td> - <td width="100%" bgcolor="#0086b2"> - <font size="-1" face="arial,helvetica,sanserif" color="#ffffff"> - <img src="images/void.gif" width="5" height="5" vspace="0" hspace="0" border="0"/><b><xsl:value-of select="@title"/></b></font> - </td> - <td width="9" background="images/bar-border-right.gif"><img src="images/void.gif" width="9" height="1" vspace="0" hspace="0" border="0"/></td> - </tr> - <tr> - <td width="9" height="12" valign="top" align="right"><img src="images/bar-bottom-left.gif" width="9" height="12" vspace="0" hspace="0" border="0"/></td> - <td background="images/bar-border-bottom.gif"><img src="images/void.gif" width="1" height="12" vspace="0" hspace="0" border="0"/></td> - <td width="9" height="12" valign="top" align="left"><img src="images/bar-bottom-right.gif" width="9" height="12" vspace="0" hspace="0" border="0"/></td> - </tr> - </table> - <table border="0" width="90%" cellspacing="0" cellpadding="0"> - <tr> - <td> - <font face="arial,helvetica,sanserif" color="#000000"><xsl:apply-templates/></font> - </td> - </tr> - </table> - </div> - <br/> - </xsl:template> - - <xsl:template match="s4"> - <div align="right"> - <table border="0" width="85%" cellspacing="0" cellpadding="0"> - <tr> - <td width="9" height="7" valign="bottom" align="right"><img src="images/bar-top-left.gif" width="9" height="7" vspace="0" hspace="0" border="0"/></td> - <td background="images/bar-border-top.gif"><img src="images/void.gif" width="1" height="5" vspace="0" hspace="0" border="0"/></td> - <td width="9" height="7" valign="bottom" align="left"><img src="images/bar-top-right.gif" width="9" height="7" vspace="0" hspace="0" border="0"/></td> - </tr> - <tr> - <td width="9" background="images/bar-border-left.gif"><img src="images/void.gif" width="9" height="1" vspace="0" hspace="0" border="0"/></td> - <td width="100%" bgcolor="#0086b2"> - <font size="-2" face="arial,helvetica,sanserif" color="#ffffff"> - <img src="images/void.gif" width="5" height="5" vspace="0" hspace="0" border="0"/><b><xsl:value-of select="@title"/></b></font> - </td> - <td width="9" background="images/bar-border-right.gif"><img src="images/void.gif" width="9" height="1" vspace="0" hspace="0" border="0"/></td> - </tr> - <tr> - <td width="9" height="12" valign="top" align="right"><img src="images/bar-bottom-left.gif" width="9" height="12" vspace="0" hspace="0" border="0"/></td> - <td background="images/bar-border-bottom.gif"><img src="images/void.gif" width="1" height="12" vspace="0" hspace="0" border="0"/></td> - <td width="9" height="12" valign="top" align="left"><img src="images/bar-bottom-right.gif" width="9" height="12" vspace="0" hspace="0" border="0"/></td> - </tr> - </table> - <table border="0" width="85%" cellspacing="0" cellpadding="0"> - <tr> - <td> - <font face="arial,helvetica,sanserif" color="#000000"><xsl:apply-templates/></font> - </td> - </tr> - </table> - </div> - <br/> - </xsl:template> - -<!-- ====================================================================== --> -<!-- footer section --> -<!-- ====================================================================== --> - - <xsl:template match="footer"> - <!-- ignore on general documents --> - </xsl:template> - -<!-- ====================================================================== --> -<!-- paragraph section --> -<!-- ====================================================================== --> - - <xsl:template match="p"> - <p align="justify"><xsl:apply-templates/></p> - </xsl:template> - - <xsl:template match="note"> - <p> - <table width="100%" cellspacing="3" cellpadding="0" border="0"> - <tr> - <td width="28" valign="top"> - <img src="images/note.gif" width="28" height="29" vspace="0" hspace="0" border="0" alt="Note"/> - </td> - <td valign="top"> - <font size="-1" face="arial,helvetica,sanserif" color="#000000"> - <i> - <xsl:apply-templates/> - </i> - </font> - </td> - </tr> - </table> - </p> - </xsl:template> - - <xsl:template match="source"> - <div align="center"> - <table cellspacing="4" cellpadding="0" border="0"> - <tr> - <td bgcolor="#0086b2" width="1" height="1"><img src="images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> - <td bgcolor="#0086b2" height="1"><img src="images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> - <td bgcolor="#0086b2" width="1" height="1"><img src="images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> - </tr> - <tr> - <td bgcolor="#0086b2" width="1"><img src="images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> - <td bgcolor="#ffffff"><pre><xsl:apply-templates/></pre></td> - <td bgcolor="#0086b2" width="1"><img src="images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> - </tr> - <tr> - <td bgcolor="#0086b2" width="1" height="1"><img src="images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> - <td bgcolor="#0086b2" height="1"><img src="images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> - <td bgcolor="#0086b2" width="1" height="1"><img src="images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> - </tr> - </table> - </div> - </xsl:template> - - <xsl:template match="fixme"> - <!-- ignore on documentation --> - </xsl:template> - -<!-- ====================================================================== --> -<!-- list section --> -<!-- ====================================================================== --> - - <xsl:template match="ul|ol|dl"> - <blockquote> - <xsl:copy> - <xsl:apply-templates/> - </xsl:copy> - </blockquote> - </xsl:template> - - <xsl:template match="li"> - <xsl:copy> - <xsl:apply-templates/> - </xsl:copy> - </xsl:template> - - <xsl:template match="sl"> - <ul> - <xsl:apply-templates/> - </ul> - </xsl:template> - - <xsl:template match="dt"> - <li> - <strong><xsl:value-of select="."/></strong> - <xsl:text> - </xsl:text> - <xsl:apply-templates select="dd"/> - </li> - </xsl:template> - -<!-- ====================================================================== --> -<!-- table section --> -<!-- ====================================================================== --> - - <xsl:template match="table"> - <table width="100%" border="0" cellspacing="2" cellpadding="2"> - <caption><xsl:value-of select="caption"/></caption> - <xsl:apply-templates/> - </table> - </xsl:template> - - <xsl:template match="tr"> - <tr><xsl:apply-templates/></tr> - </xsl:template> - - <xsl:template match="th"> - <td bgcolor="#039acc" colspan="{@colspan}" rowspan="{@rowspan}" valign="center" align="center"> - <font color="#ffffff" size="-1" face="arial,helvetica,sanserif"> - <b><xsl:apply-templates/></b>  - </font> - </td> - </xsl:template> - - <xsl:template match="td"> - <td bgcolor="#a0ddf0" colspan="{@colspan}" rowspan="{@rowspan}" valign="top" align="left"> - <font color="#000000" size="-1" face="arial,helvetica,sanserif"> - <xsl:apply-templates/>  - </font> - </td> - </xsl:template> - - <xsl:template match="tn"> - <td bgcolor="#ffffff" colspan="{@colspan}" rowspan="{@rowspan}"> -   - </td> - </xsl:template> - - <xsl:template match="caption"> - <!-- ignore since already used --> - </xsl:template> - -<!-- ====================================================================== --> -<!-- markup section --> -<!-- ====================================================================== --> - - <xsl:template match="strong"> - <b><xsl:apply-templates/></b> - </xsl:template> - - <xsl:template match="em"> - <i><xsl:apply-templates/></i> - </xsl:template> - - <xsl:template match="code"> - <code><font face="courier, monospaced"><xsl:apply-templates/></font></code> - </xsl:template> - -<!-- ====================================================================== --> -<!-- images section --> -<!-- ====================================================================== --> - - <xsl:template match="figure"> - <p align="center"> - <xsl:choose> - <xsl:when test="string(@width) and string(@height)"> - <img src="{@src}" alt="{@alt}" width="{@width}" height="{@height}" border="0" vspace="4" hspace="4"/> - </xsl:when> - <xsl:otherwise> - <img src="{@src}" alt="{@alt}" border="0" vspace="4" hspace="4"/> - </xsl:otherwise> - </xsl:choose> - </p> - </xsl:template> - - <xsl:template match="img"> - <img src="{@src}" alt="{@alt}" border="0" vspace="4" hspace="4" align="right"/> - </xsl:template> - - <xsl:template match="icon"> - <img src="{@src}" alt="{@alt}" border="0" align="absmiddle"/> - </xsl:template> - -<!-- ====================================================================== --> -<!-- links section --> -<!-- ====================================================================== --> - - <xsl:template match="link"> - <a href="{@href}"><xsl:apply-templates/></a> - </xsl:template> - - <xsl:template match="connect"> - <xsl:apply-templates/> - </xsl:template> - - <xsl:template match="jump"> - <a href="{@href}#{@anchor}"><xsl:apply-templates/></a> - </xsl:template> - - <xsl:template match="fork"> - <a href="{@href}" target="_blank"><xsl:apply-templates/></a> - </xsl:template> - - <xsl:template match="anchor"> - <a name="{@id}"><xsl:comment>anchor</xsl:comment></a> - </xsl:template> - -<!-- ====================================================================== --> -<!-- specials section --> -<!-- ====================================================================== --> - - <xsl:template match="br"> - <br/> - </xsl:template> - -</xsl:stylesheet> diff --git a/src/documentation/stylesheets/announcement2txt.xsl b/src/documentation/stylesheets/projectinfo2announcement.xsl index d5c3ab87a8..dd9e2c0f26 100755..100644 --- a/src/documentation/stylesheets/announcement2txt.xsl +++ b/src/documentation/stylesheets/projectinfo2announcement.xsl @@ -2,7 +2,6 @@ <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> - <xsl:import href="announcement.xsl"/> <xsl:output method="text" indent="no"/> <xsl:template match="announcement"> diff --git a/src/documentation/stylesheets/projectinfo2todo.xsl b/src/documentation/stylesheets/projectinfo2todo.xsl new file mode 100644 index 0000000000..dd9e2c0f26 --- /dev/null +++ b/src/documentation/stylesheets/projectinfo2todo.xsl @@ -0,0 +1,107 @@ +<?xml version="1.0"?> + +<xsl:stylesheet version="1.0" +xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + <xsl:output method="text" indent="no"/> + + <xsl:template match="announcement"> + <xsl:variable name="titlelen" select="string-length(project)+9"/> + <text> + <xsl:value-of select="project"/><xsl:text> Released +</xsl:text> + <xsl:call-template name="line"> + <xsl:with-param name="len" select="$titlelen"/> + </xsl:call-template> + <xsl:text> +</xsl:text> + <xsl:apply-templates select="abstract"/> + <xsl:apply-templates select="body"/> + <xsl:text> +For more information about </xsl:text> + <xsl:value-of select="project"/> + <xsl:text>, please go to +</xsl:text> + <xsl:value-of select="@site"/> + <xsl:text> + +Changes with </xsl:text> + <xsl:value-of select="project"/> + <xsl:text> + +</xsl:text> + <xsl:apply-templates select="changes"/> + </text> + </xsl:template> + + <xsl:template match="project"/> + <xsl:template match="title"/> + + <xsl:template match="subproject"> + <xsl:variable name="titlelen" select="string-length(title)"/> + <xsl:text> +</xsl:text> + <xsl:value-of select="title"/> + <xsl:text> +</xsl:text> + <xsl:call-template name="line"> + <xsl:with-param name="len" select="$titlelen"/> + </xsl:call-template> + <xsl:text> +</xsl:text> + <xsl:apply-templates select="abstract"/> + <xsl:text> +For more information about </xsl:text> + <xsl:value-of select="title"/> + <xsl:text>, please go to +</xsl:text> + <xsl:value-of select="@site"/> + <xsl:text> + +Changes with </xsl:text> + <xsl:value-of select="title"/> + <xsl:text> + +</xsl:text> + <xsl:apply-templates select="changes"/> + </xsl:template> + + <xsl:template match="abstract"> + <xsl:apply-templates/> + </xsl:template> + + <xsl:template match="p"> + <xsl:apply-templates/> + </xsl:template> + + <xsl:template match="link"> + <xsl:value-of select="."/> + <xsl:text> (</xsl:text> + <xsl:value-of select="@href"/> + <xsl:text>)</xsl:text> + </xsl:template> + + <xsl:template match="release"> + <xsl:for-each select="action"> + <xsl:text>*) </xsl:text> + <xsl:value-of select="normalize-space(.)"/><xsl:text> </xsl:text> + <xsl:if test="@dev"> + <xsl:text>[</xsl:text> + <xsl:value-of select="@dev"/> + <xsl:text>]</xsl:text> + </xsl:if> + <xsl:text> + +</xsl:text> + </xsl:for-each> + </xsl:template> + + <xsl:template name="line"> + <xsl:param name="len"/> + <xsl:if test="number($len) > 0"> + <xsl:text>-</xsl:text> + <xsl:call-template name="line"> + <xsl:with-param name="len" select="number($len)-1"/> + </xsl:call-template> + </xsl:if> + </xsl:template> +</xsl:stylesheet> diff --git a/src/documentation/stylesheets/projectinfo2txt.xsl b/src/documentation/stylesheets/projectinfo2txt.xsl new file mode 100644 index 0000000000..dd9e2c0f26 --- /dev/null +++ b/src/documentation/stylesheets/projectinfo2txt.xsl @@ -0,0 +1,107 @@ +<?xml version="1.0"?> + +<xsl:stylesheet version="1.0" +xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + <xsl:output method="text" indent="no"/> + + <xsl:template match="announcement"> + <xsl:variable name="titlelen" select="string-length(project)+9"/> + <text> + <xsl:value-of select="project"/><xsl:text> Released +</xsl:text> + <xsl:call-template name="line"> + <xsl:with-param name="len" select="$titlelen"/> + </xsl:call-template> + <xsl:text> +</xsl:text> + <xsl:apply-templates select="abstract"/> + <xsl:apply-templates select="body"/> + <xsl:text> +For more information about </xsl:text> + <xsl:value-of select="project"/> + <xsl:text>, please go to +</xsl:text> + <xsl:value-of select="@site"/> + <xsl:text> + +Changes with </xsl:text> + <xsl:value-of select="project"/> + <xsl:text> + +</xsl:text> + <xsl:apply-templates select="changes"/> + </text> + </xsl:template> + + <xsl:template match="project"/> + <xsl:template match="title"/> + + <xsl:template match="subproject"> + <xsl:variable name="titlelen" select="string-length(title)"/> + <xsl:text> +</xsl:text> + <xsl:value-of select="title"/> + <xsl:text> +</xsl:text> + <xsl:call-template name="line"> + <xsl:with-param name="len" select="$titlelen"/> + </xsl:call-template> + <xsl:text> +</xsl:text> + <xsl:apply-templates select="abstract"/> + <xsl:text> +For more information about </xsl:text> + <xsl:value-of select="title"/> + <xsl:text>, please go to +</xsl:text> + <xsl:value-of select="@site"/> + <xsl:text> + +Changes with </xsl:text> + <xsl:value-of select="title"/> + <xsl:text> + +</xsl:text> + <xsl:apply-templates select="changes"/> + </xsl:template> + + <xsl:template match="abstract"> + <xsl:apply-templates/> + </xsl:template> + + <xsl:template match="p"> + <xsl:apply-templates/> + </xsl:template> + + <xsl:template match="link"> + <xsl:value-of select="."/> + <xsl:text> (</xsl:text> + <xsl:value-of select="@href"/> + <xsl:text>)</xsl:text> + </xsl:template> + + <xsl:template match="release"> + <xsl:for-each select="action"> + <xsl:text>*) </xsl:text> + <xsl:value-of select="normalize-space(.)"/><xsl:text> </xsl:text> + <xsl:if test="@dev"> + <xsl:text>[</xsl:text> + <xsl:value-of select="@dev"/> + <xsl:text>]</xsl:text> + </xsl:if> + <xsl:text> + +</xsl:text> + </xsl:for-each> + </xsl:template> + + <xsl:template name="line"> + <xsl:param name="len"/> + <xsl:if test="number($len) > 0"> + <xsl:text>-</xsl:text> + <xsl:call-template name="line"> + <xsl:with-param name="len" select="number($len)-1"/> + </xsl:call-template> + </xsl:if> + </xsl:template> +</xsl:stylesheet> diff --git a/src/documentation/stylesheets/script-cli.js b/src/documentation/stylesheets/script-cli.js deleted file mode 100755 index 580dd4a1ba..0000000000 --- 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 77a2762c86..0000000000 --- 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 709963b174..f1de4da669 100755 --- a/src/documentation/stylesheets/site2xhtml.xsl +++ b/src/documentation/stylesheets/site2xhtml.xsl @@ -2,66 +2,85 @@ <html xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xsl:version="1.0"> - <head><title><xsl:value-of select="/site/body/title"/></title></head> - <body text="#000000" link="#525D76" vlink="#023264" alink="#023264" - topmargin="4" leftmargin="4" marginwidth="4" marginheight="4" - bgcolor="#ffffff"> + <head> + <meta content="text/html; charset=ISO-8859-1"/> + <title><xsl:value-of select="/site/body/title"/></title> +<style type="text/css"> +<![CDATA[ body { background-color: white; font-size: normal; color: black ; } + a { color: #525d76; } + a.black { color: #000000;} + table {border-width: 0; width: 100%} + table.centered {text-align: center} + table.title {text-align: center; width: 80%} + img{border-width: 0;} + span.s1 {font-family: Helvetica, Arial, sans-serif; font-weight: bold; color: #000000; } + span.s1_white { font-family: Helvetica, Arial, sans-serif; font-weight: bold; color: #ffffff; } + span.title {font-family: Helvetica, Arial, sans-serif; font-weight: bold; color: #000000; } + span.c1 {color: #000000; font-family: Helvetica, Arial, sans-serif} + tr.left {text-align: left} + hr { width: 100%; size: 2} ]]> +</style> + </head> + <body> + + <!-- header --> +<table border="0" cellpadding="0" cellspacing="0" width="100%"> +<tr> +<td align="left" valign="top"><a href="http://jakarta.apache.org/index.html"><img src="images/jakarta-logo.gif" border="0" vspace="0" hspace="0"/></a></td><td bgcolor="#ffffff" align="left" valign="top" width="100%"><img src="images/header.gif" align="right" border="0" vspace="0" hspace="0"/></td> +</tr> +<tr> +<td bgcolor="#525d76" colspan="2"><span class="c1"><a href="http://www.apache.org/" class="black">www.apache.org ></a><a href="http://jakarta.apache.org/" class="black">jakarta.apache.org ></a><a class="black" href="http://jakarta.apache.org/poi/">jakarta.apache.org/poi</a></span></td> +</tr> +<tr> +<td height="8"></td> +</tr> +</table> + + <!-- main --> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tr> - <td valign="top" align="left"> - <a href="http://jakarta.apache.org/index.html"> - <img hspace="0" vspace="0" border="0" src="images/jakarta-logo.gif"/> - </a> - </td> - <td width="100%" valign="top" align="left" bgcolor="#ffffff"> - <img hspace="0" - vspace="0" - border="0" - align="right" - src="images/header.gif"/> - </td> - </tr> - <tr> - <td width="100%" height="2" colspan="2"><hr noshade="" size="1"/></td> - </tr> - </table> - - <table width="100%" cellspacing="0" cellpadding="0" border="0"> - <tr> - <td width="1%" valign="top"/> + <!-- left menu --> + <td width="1%"><br/></td> <td width="14%" valign="top" nowrap="1"> - <br/> - <font face="arial,helvetica,sanserif"> - <br/> - <xsl:copy-of select="/site/menu/node()|@*"/> - <br/> - </font> + <xsl:copy-of select="/site/menu/node()|@*"/> </td> + <td width="1%"><br/></td> + + <!-- contents --> <td width="*" valign="top" align="left"> <xsl:copy-of select="/site/body/node()|@*"/> </td> </tr> </table> <br/> - <table width="100%" border="0" cellspacing="0" cellpadding="0"> - <tr><td><hr noshade="" size="1"/></td></tr> - <tr> - <td align="center"> - <font face="arial,helvetica,sanserif" size="-1" color="#525D76"> - <i> - Copyright ©2002 Apache Software Foundation - </i> - </font> - </td> - <td align="right" width="5%"> - <img hspace="0" - vspace="0" - border="0" - align="right" - src="images/cocoon2-small.jpg"/> - </td> - </tr> + + <!-- footer --> + <table cellpadding="0" cellspacing="0" border="0" width="100%"> + <tbody> + <tr> + <td> + <hr size="1" noshade=""/> + </td> + </tr> + <tr> + <td align="center"> + <i>Copyright © 2002 Apache Software Foundation</i> + </td> + </tr> + <tr> + <td width="100%" align="right"> + <br/> + </td> + </tr> + <tr> + <td width="100%" align="right"> + <a href="http://krysalis.org/"><img src="images/krysalis-compatible.png" alt="Krysalis Logo"/></a> + <a href="http://xml.apache.org/cocoon/"><img src="images/built-with-cocoon.png" alt="Cocoon Logo"/></a> + </td> + </tr> + </tbody> </table> + </body> </html> diff --git a/src/documentation/xdocs/book.xml b/src/documentation/xdocs/book.xml index 3bfbb58f2c..42ff43d7ea 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"> - <menu label="Main"> - <menu-item label="Jakarta" href="http://jakarta.apache.org"/> - </menu> - <menu label="About"> <menu-item label="Index" href="index.html"/> <menu-item label="History" href="historyandfuture.html"/> @@ -33,7 +29,6 @@ <menu label="References"> <menu-item label="In The News" href="inthenews.html"/> <menu-item label="Live Sites" href="livesites.html"/> - <menu-item label="Building" href="building.xml"/> <menu-item label="XLS spec [PDF]" href="http://sc.openoffice.org/excelfileformat.pdf"/> <menu-item label="Apache Cocoon" href="http://xml.apache.org/cocoon/"/> <menu-item label="Resolutions" href="resolutions/index.html"/> diff --git a/src/java/log4j.properties b/src/java/log4j.properties new file mode 100644 index 0000000000..a912f3a3c4 --- /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/HSSFLog.java b/src/java/org/apache/poi/hssf/HSSFLog.java deleted file mode 100644 index cfef5c31f4..0000000000 --- a/src/java/org/apache/poi/hssf/HSSFLog.java +++ /dev/null @@ -1,96 +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 - * <http://www.apache.org/>. - */ - -/* - * 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/src/java/org/apache/poi/hssf/model/Sheet.java b/src/java/org/apache/poi/hssf/model/Sheet.java index a7b8507524..c274da546f 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 8329a1f00b..d45153f9c9 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 e9c4f18f1e..0000000000 --- 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 55ec266bd4..ddb5dc8a65 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 e41647863a..221f16aed0 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 e52a424dd5..683608b23f 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 1b3186b6c7..a6d066c38d 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/src/resources/devtools/poi.jin b/src/resources/devtools/poi.jin new file mode 100644 index 0000000000..5b612fe38a --- /dev/null +++ b/src/resources/devtools/poi.jin @@ -0,0 +1,319 @@ +### +### Jindent 3.2x property file -- http://www.jindent.de +### +### this encapsulates my preferred style, plus project-specific style ... +### +### author: Marc Johnson +### + +### General -- Convention + +conventionName = "" +conventionString = "" +conventionNotePosition = "none" +blankLinesToSeparateConventionNote = 2 + +### General -- Jindent Note + +jindentNotePosition = "none" +blankLinesToSeparateJindentNote = 2 + +### Header/Footer -- Header Template + +headerSmartMode = infinite +headerIdentifyKey = "Copyright (c) 2002 The Apache Software Foundation" +blankLinesBeforeHeader = 1 +header[00]="/* ====================================================================" +header[01]=" * The Apache Software License, Version 1.1" +header[02]=" *" +header[03]=" * Copyright (c) 2002 The Apache Software Foundation. All rights" +header[04]=" * reserved." +header[05]=" *" +header[06]=" * Redistribution and use in source and binary forms, with or without" +header[07]=" * modification, are permitted provided that the following conditions" +header[08]=" * are met:" +header[09]=" *" +header[10]=" * 1. Redistributions of source code must retain the above copyright" +header[11]=" * notice, this list of conditions and the following disclaimer." +header[12]=" *" +header[13]=" * 2. Redistributions in binary form must reproduce the above copyright" +header[14]=" * notice, this list of conditions and the following disclaimer in" +header[15]=" * the documentation and/or other materials provided with the" +header[16]=" * distribution." +header[17]=" *" +header[18]=" * 3. The end-user documentation included with the redistribution," +header[19]=" * if any, must include the following acknowledgment:" +header[20]=" * "This product includes software developed by the" +header[21]=" * Apache Software Foundation (http://www.apache.org/)."" +header[22]=" * Alternately, this acknowledgment may appear in the software itself," +header[23]=" * if and wherever such third-party acknowledgments normally appear." +header[24]=" *" +header[25]=" * 4. The names "Apache" and "Apache Software Foundation" and" +header[26]=" * "Apache POI" must not be used to endorse or promote products" +header[27]=" * derived from this software without prior written permission. For" +header[28]=" * written permission, please contact apache@apache.org." +header[29]=" *" +header[30]=" * 5. Products derived from this software may not be called "Apache"," +header[31]=" * "Apache POI", nor may "Apache" appear in their name, without" +header[32]=" * prior written permission of the Apache Software Foundation." +header[33]=" *" +header[34]=" * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED" +header[35]=" * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES" +header[36]=" * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE" +header[37]=" * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR" +header[38]=" * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL," +header[39]=" * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT" +header[40]=" * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF" +header[41]=" * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND" +header[42]=" * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY," +header[43]=" * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT" +header[44]=" * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF" +header[45]=" * SUCH DAMAGE." +header[46]=" * ====================================================================" +header[47]=" *" +header[48]=" * This software consists of voluntary contributions made by many" +header[49]=" * individuals on behalf of the Apache Software Foundation. For more" +header[50]=" * information on the Apache Software Foundation, please see" +header[51]=" * <http://www.apache.org/>." +header[52]=" */" +blankLinesAfterHeader = 1 + +### Header/Footer -- Footer Template + +footerSmartMode = infinite +footerIdentifyKey = "" +blankLinesBeforeFooter = 0 +footer[00] = "" +blankLinesAfterFooter = 0 + +### Indentation -- Misc + +tabulatorSize = 8 +indentSize = 4 +firstLevelIndent = 0 +indentCaseFromSwitch = true +labelNewLine = true +indentLabels = true +minimumCommentIndent = 3 +indentLeadingsByTabs = false +indentCommentsByTabs = false +indentDeclarationsByTabs = false +indentAssignmentsByTabs = false + +### Indentation -- Alignment + +alignComments = true +alignDeclarations = true +alignAssignments = true +alignTernaryConditions = false +alignTernaryExpressions = true +alignTooLongComments = true + +### Braces -- Style + +leftBraceNewLineGeneral = true +rightBraceNewLineGeneral = true +indentLeftBraceGeneral = 0 +indentRightBraceGeneral = 0 +indentAfterRightBraceGeneral = 0 +cuddleEmptyBracesGeneral = false +indentCuddledBracesGeneral = 0 + +leftBraceNewLineClassInterface = true +rightBraceNewLineClassInterface = true +indentLeftBraceClassInterface = 0 +indentRightBraceClassInterface = 0 +indentAfterRightBraceClassInterface = 0 +cuddleEmptyBracesClassInterface = false +indentCuddledBracesClassInterface = 0 + +leftBraceNewLineMethod = true +rightBraceNewLineMethod = true +indentLeftBraceMethod = 0 +indentRightBraceMethod = 0 +indentAfterRightBraceMethod = 0 +cuddleEmptyBracesMethod = false +indentCuddledBracesMethod = 0 + +leftBraceNewLineTryCatch = true +rightBraceNewLineTryCatch = true +indentLeftBraceTryCatch = 0 +indentRightBraceTryCatch = 0 +indentAfterRightBraceTryCatch = 0 +cuddleEmptyBracesTryCatch = false +indentCuddledBracesTryCatch = 0 + +### Braces -- Insert At + +insertBracesAtIfElse = true +insertBracesAtFor = true +insertBracesAtWhile = true +insertBracesAtDoWhile = true +insertParenthesisAtConditions = true + +### Braces -- If-Else + +singleIfStatementInOneLine = false +singleElseStatementInOneLine = false +specialElseIfTreatment = true + +### JavaDoc -- Misc + +deleteJavaDocComments = false +formatJavaDocComments = true +insertMissingJavaDocTags = true +deleteObsoleteJavaDocTags = false +createPublicClassInterfaceJavaDocs = true +createFriendlyClassInterfaceJavaDocs = false +createPrivateClassInterfaceJavaDocs = false +createProtectedClassInterfaceJavaDocs = false +createPublicMethodJavaDocs = false +createFriendlyMethodJavaDocs = false +createPrivateMethodJavaDocs = false +createProtectedMethodJavaDocs = false +createPublicFieldJavaDocs = false +createFriendlyFieldJavaDocs = false +createPrivateFieldJavaDocs = false +createProtectedFieldJavaDocs = false + +### JavaDoc -- Templates + +sortExceptionsInTemplates = true +javaDocMethodTop[00] = "/**" +javaDocMethodTop[01] = " * Method $objectName$" +javaDocMethodTop[02] = " *" +javaDocMethodParamSeparator[00] = " *" +javaDocMethodParam[00] = " * @param $paramName$" +javaDocMethodReturn[00] = " *" +javaDocMethodReturn[01] = " * @return" +javaDocMethodExceptionSeparator[00] = " *" +javaDocMethodException[00] = " * @exception $exceptionName$" +javaDocMethodBottom[00] = " *" +javaDocMethodBottom[01] = " */" +javaDocConstructorTop[00] = "/**" +javaDocConstructorTop[01] = " * Constructor $objectName$" +javaDocConstructorTop[02] = " *" +javaDocConstructorParamSeparator[00] = " *" +javaDocConstructorParam[00] = " * @param $paramName$" +javaDocConstructorExceptionSeparator[00] = " *" +javaDocConstructorException[00] = " * @exception $exceptionName$" +javaDocConstructorBottom[00] = " *" +javaDocConstructorBottom[01] = " */" +javaDocClass[00] = "/**" +javaDocClass[01] = " * Class $objectName$" +javaDocClass[02] = " *" +javaDocClass[03] = " *" +javaDocClass[04] = " * @author" +javaDocClass[05] = " * @version %I%, %G%" +javaDocClass[06] = " */" +javaDocInterface[00] = "/**" +javaDocInterface[01] = " * Interface $objectName$" +javaDocInterface[02] = " *" +javaDocInterface[03] = " *" +javaDocInterface[04] = " * @author" +javaDocInterface[05] = " * @version %I%, %G%" +javaDocInterface[06] = " */" +javaDocField[00] = "/** Field $objectName$ */" + +### Comments -- Format/Delete + +deleteBlockComments = false +deleteSingleLineComments = false +deleteTrailingComments = false +deleteEndOfLineComments = false +formatBlockComments = true +formatSingleLineComments = true +formatTrailingComments = true +formatEndOfLineComments = true + +### Comments -- Exceptions + +neverIndentFirstColumnComments = true +neverFormatFirstColumnComments = true +neverFormatHeader = false +neverFormatFooter = false + +### Separation -- Misc + +keepBlankLines = 0 +minLinesToInsertBlankLineInClasses = infinite +minLinesToInsertBlankLineInMethods = infinite + +### Separation -- Separate + +separateChunksByComments = false +allowBreakSeparatedFromCaseBlock = false +blankLinesBetweenCaseBlocks = 1 +blankLinesBetweenChunks = 0 +comparableImportDepth = 2 +blankLinesToSeparateImports = 1 +blankLinesBetweenClassInterface = 2 + +### Separation -- Insert Blank Lines + +blankLinesAfterDeclarations = 1 +blankLinesAfterMethods = 1 +blankLinesAfterClasses = 1 +blankLinesAfterInterfaces = 1 +blankLinesBeforeJavaDocComments = 1 +blankLinesAfterJavaDocComments = 1 +blankLinesBeforeBlockComments = 1 +blankLinesAfterBlockComments = 0 +blankLinesBeforeSingleLineComments = 1 +blankLinesAfterSingleLineComments = 0 +blankLinesBeforeEndOfLineComments = 1 +blankLinesAfterEndOfLineComments = 0 +blankLinesAfterSwitch = 1 +blankLinesAfterPackage = 1 +blankLinesAfterLastImport = 1 + +### Whitespaces -- Padding + +separateAssignmentOperators = true +separateConditionalOperators = true +separateComparisonOperators = true +separateNumericalOperators = true +paddingCastParenthesis = true +paddingParenthesis = false +paddingBrackets = true +paddingBraces = true + +### Whitespaces -- Space Before + +spaceBeforeMethodDeclarationParenthesis = false +spaceBeforeMethodCallParenthesis = false +spaceBeforeBrackets = false +spaceBeforeBracketsInTypes = true +spaceBeforeStatementParenthesis = true +spaceBeforeConditionBang = true +spaceBeforeCaseColon = true + +### Whitespaces -- Space After + +spaceAfterComma = true +spaceAfterSemicolon = true +spaceAfterCasting = true + +### Whitespaces -- No Spaces + +noSpacesInEmptyForExpressions = true + +### Line Wrapping -- Misc + +maxFieldElementsPerLine = 0 +wrapLines = true +wrapBecauseOfComments = true +wrapLongMethodNames = true +maxLineLength = 78 +deepIndent = 45 +forceIndent = 8 +forceIndentTolerance = 4 +allowWrappingAfterAssignments = true +allowWrappingAfterParenthesis = true +preferWrappingAfterThrows = true +alwaysWrapThrows = true +alwaysWrapExtends = true +alwaysWrapImplements = true +indentWrappedThrows = 4 +indentWrappedExtends = 4 +indentWrappedImplements = 4 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 0cb3fa1073..0000000000 --- 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 - * <http://www.apache.org/>. - */ - -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 2fcf0a6361..0000000000 --- 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 - * <http://www.apache.org/>. - */ - -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(); - } -} |