bloritsch 00/12/08 12:41:05
Modified: src/org/apache/cocoon/components/classloader Tag:
xml-cocoon2 RepositoryClassLoader.java
src/org/apache/cocoon/components/language/generator Tag:
xml-cocoon2 ProgramGeneratorImpl.java
src/org/apache/cocoon/components/language/markup Tag:
xml-cocoon2 AbstractMarkupLanguage.java
src/org/apache/cocoon/components/language/markup/sitemap
Tag: xml-cocoon2 SitemapMarkupLanguage.java
src/org/apache/cocoon/components/language/markup/sitemap/java
Tag: xml-cocoon2 sitemap.xsl
src/org/apache/cocoon/components/language/markup/xsp Tag:
xml-cocoon2 XSPMarkupLanguage.java
XSPObjectHelper.java XSPResponseHelper.java
src/org/apache/cocoon/components/language/markup/xsp/java
Tag: xml-cocoon2 esql.xsl
src/org/apache/cocoon/components/language/programming/java
Tag: xml-cocoon2 AbstractJavaCompiler.java
JavaLanguage.java Javac.java Jikes.java
JstyleFormatter.java
src/org/apache/cocoon/components/language/programming/javascript
Tag: xml-cocoon2 JavascriptLanguage.java
src/org/apache/cocoon/components/store Tag: xml-cocoon2
FilesystemStore.java
src/org/apache/cocoon/generation Tag: xml-cocoon2
FileGenerator.java HTMLGenerator.java
ImageDirectoryGenerator.java PhpGenerator.java
ServerPagesGenerator.java StatusGenerator.java
src/org/apache/cocoon/matching Tag: xml-cocoon2
RegexpTargetHostMatcherFactory.java
RegexpURIMatcherFactory.java
WildcardURIMatcherFactory.java
src/org/apache/cocoon/reading Tag: xml-cocoon2
AbstractReader.java ResourceReader.java
src/org/apache/cocoon/serialization Tag: xml-cocoon2
AbstractTextSerializer.java FOPSerializer.java
HTMLSerializer.java SVGSerializer.java
TextSerializer.java XMLSerializer.java
src/org/apache/cocoon/servlet Tag: xml-cocoon2
CocoonServlet.java
src/org/apache/cocoon/sitemap Tag: xml-cocoon2
AbstractSitemap.java DefaultComponentHolder.java
Handler.java PoolableComponentHolder.java
XSLTFactoryLoader.java
src/org/apache/cocoon/transformation Tag: xml-cocoon2
LogTransformer.java SQLTransformer.java
XIncludeTransformer.java XTTransformer.java
XalanTransformer.java
src/org/apache/cocoon/util Tag: xml-cocoon2 IOUtils.java
src/org/apache/cocoon/xml Tag: xml-cocoon2
DocumentHandlerWrapper.java
src/org/apache/cocoon/xml/dom Tag: xml-cocoon2
DOMStreamer.java
Log:
Every Exception is logged now. This is very important for debugging Cocoon.
There
are a number of ignored exceptions, but they are logged now.
Revision Changes Path
No revision
No revision
1.1.2.7 +11 -2
xml-cocoon/src/org/apache/cocoon/components/classloader/Attic/RepositoryClassLoader.java
Index: RepositoryClassLoader.java
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/components/classloader/Attic/RepositoryClassLoader.java,v
retrieving revision 1.1.2.6
retrieving revision 1.1.2.7
diff -u -r1.1.2.6 -r1.1.2.7
--- RepositoryClassLoader.java 2000/12/07 17:10:36 1.1.2.6
+++ RepositoryClassLoader.java 2000/12/08 20:38:41 1.1.2.7
@@ -17,14 +17,21 @@
import org.apache.cocoon.util.IOUtils;
import org.apache.cocoon.util.ClassUtils;
+import org.apache.log.Logger;
+import org.apache.log.LogKit;
+
/**
* A class loader with a growable list of path search directories
*
* @author <a href="mailto:[EMAIL PROTECTED]">Ricardo Rocha</a>
- * @version CVS $Revision: 1.1.2.6 $ $Date: 2000/12/07 17:10:36 $
+ * @version CVS $Revision: 1.1.2.7 $ $Date: 2000/12/08 20:38:41 $
*/
class RepositoryClassLoader extends ClassLoader {
/**
+ * The logger
+ */
+ protected Logger log = LogKit.getLoggerFor("cocoon");
+ /**
* The list of searchable directories
*/
protected Vector repositories;
@@ -101,6 +108,7 @@
try {
c = findSystemClass(name);
} catch (ClassNotFoundException e) {
+ log.warn("Could not load class", e);
byte[] bits = this.loadClassData (name);
if (bits == null) {
@@ -159,10 +167,11 @@
return buffer;
} catch (IOException e) {
+ log.warn("RepositoryClassLoader.IOException", e);
} finally {
if (in != null) {
try { in.close(); }
- catch (IOException e) { }
+ catch (IOException e) { log.warn("Could not close stream", e); }
}
}
}
No revision
No revision
1.1.2.18 +3 -3
xml-cocoon/src/org/apache/cocoon/components/language/generator/Attic/ProgramGeneratorImpl.java
Index: ProgramGeneratorImpl.java
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/components/language/generator/Attic/ProgramGeneratorImpl.java,v
retrieving revision 1.1.2.17
retrieving revision 1.1.2.18
diff -u -r1.1.2.17 -r1.1.2.18
--- ProgramGeneratorImpl.java 2000/12/07 17:10:42 1.1.2.17
+++ ProgramGeneratorImpl.java 2000/12/08 20:38:46 1.1.2.18
@@ -53,7 +53,7 @@
* The default implementation of <code>ProgramGenerator</code>
*
* @author <a href="mailto:[EMAIL PROTECTED]">Ricardo Rocha</a>
- * @version CVS $Revision: 1.1.2.17 $ $Date: 2000/12/07 17:10:42 $
+ * @version CVS $Revision: 1.1.2.18 $ $Date: 2000/12/08 20:38:46 $
*/
public class ProgramGeneratorImpl
implements ProgramGenerator, Composer, Configurable, ThreadSafe
@@ -96,7 +96,7 @@
log.debug("Lookup " + Roles.COCOON);
this.workDir = ((Cocoon)
this.manager.lookup(Roles.COCOON)).getWorkDir();
} catch (Exception e) {
- log.error("Could not lookup Component", e);
+ log.warn("Could not lookup Component", e);
}
}
@@ -179,7 +179,7 @@
// Instantiate program
programInstance = programmingLanguage.instantiate(program);
- } catch (LanguageException e) { }
+ } catch (LanguageException e) { log.warn("Language Exception", e); }
/*
FIXME: It's the program (not the instance) that must
No revision
No revision
1.1.2.13 +3 -2
xml-cocoon/src/org/apache/cocoon/components/language/markup/Attic/AbstractMarkupLanguage.java
Index: AbstractMarkupLanguage.java
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/components/language/markup/Attic/AbstractMarkupLanguage.java,v
retrieving revision 1.1.2.12
retrieving revision 1.1.2.13
diff -u -r1.1.2.12 -r1.1.2.13
--- AbstractMarkupLanguage.java 2000/11/30 21:40:54 1.1.2.12
+++ AbstractMarkupLanguage.java 2000/12/08 20:38:51 1.1.2.13
@@ -50,7 +50,7 @@
* be decoupled from this context!!!
*
* @author <a href="mailto:[EMAIL PROTECTED]">Ricardo Rocha</a>
- * @version CVS $Revision: 1.1.2.12 $ $Date: 2000/11/30 21:40:54 $
+ * @version CVS $Revision: 1.1.2.13 $ $Date: 2000/12/08 20:38:51 $
*/
public abstract class AbstractMarkupLanguage
implements MarkupLanguage, Composer, Configurable
@@ -174,7 +174,7 @@
this.languages.put(language.getName(), language);
}
} catch (Exception e) {
- log.error("Configuration Error: " + e.getMessage(), e);
+ log.warn("Configuration Error: " + e.getMessage(), e);
throw new ConfigurationException("AbstractMarkupLanguage: " +
e.getMessage(), e);
}
}
@@ -629,6 +629,7 @@
this.logicsheetMarkupGenerator,
this.language.getLogicsheet(), resolver
);
} catch (IOException ioe) {
+ log.warn("AbstractMarkupLanguage.startElement", ioe);
throw new SAXException (ioe);
}
// All stylesheet have been configured and correctly setup.
No revision
No revision
1.1.2.8 +17 -11
xml-cocoon/src/org/apache/cocoon/components/language/markup/sitemap/Attic/SitemapMarkupLanguage.java
Index: SitemapMarkupLanguage.java
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/components/language/markup/sitemap/Attic/SitemapMarkupLanguage.java,v
retrieving revision 1.1.2.7
retrieving revision 1.1.2.8
diff -u -r1.1.2.7 -r1.1.2.8
--- SitemapMarkupLanguage.java 2000/10/30 20:20:01 1.1.2.7
+++ SitemapMarkupLanguage.java 2000/12/08 20:38:54 1.1.2.8
@@ -28,6 +28,8 @@
import org.apache.cocoon.components.language.programming.ProgrammingLanguage;
+import org.apache.log.Logger;
+import org.apache.log.LogKit;
import java.io.IOException;
import org.xml.sax.SAXException;
@@ -37,7 +39,7 @@
* <a href="http://xml.apache.org/cocoon/sitemap.html">Sitemap</a>.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Giacomo Pati</a>
- * @version CVS $Revision: 1.1.2.7 $ $Date: 2000/10/30 20:20:01 $
+ * @version CVS $Revision: 1.1.2.8 $ $Date: 2000/12/08 20:38:54 $
*/
public class SitemapMarkupLanguage extends AbstractMarkupLanguage {
@@ -152,6 +154,7 @@
*
*/
protected class PreProcessFilter extends XMLFilterImpl {
+ protected Logger log = LogKit.getLoggerFor("cocoon");
private String filename;
@@ -165,10 +168,10 @@
this.language = language;
}
- public void setParent(XMLReader reader) {
- reader.setContentHandler(this);
- super.setParent(reader);
- }
+ public void setParent(XMLReader reader) {
+ reader.setContentHandler(this);
+ super.setParent(reader);
+ }
public void startDocument() throws SAXException {
super.startDocument();
@@ -183,7 +186,7 @@
}
public void startElement (String namespaceURI, String localName,
- String qName, Attributes atts) throws SAXException {
+ String qName, Attributes atts) throws SAXException {
if (isRootElem) {
isRootElem=false;
// Store path and file name
@@ -193,10 +196,10 @@
this.filename.substring(0,
pos).replace(File.separatorChar, '/');
// update the attributes
AttributesImpl newAtts = new AttributesImpl();
- // FIXME (SSA) workaround a bug in SAX2 that goes in infinite
loop
- // when atts.getLength() == 0
- if (atts.getLength()>0)
- newAtts.setAttributes(atts);
+ // FIXME (SSA) workaround a bug in SAX2 that goes in infinite loop
+ // when atts.getLength() == 0
+ if (atts.getLength()>0)
+ newAtts.setAttributes(atts);
newAtts.addAttribute("", "file-name", "file-name", "CDATA",
name);
newAtts.addAttribute("", "file-path", "file-path", "CDATA",
path);
@@ -223,6 +226,7 @@
*
*/
protected class SitemapTransformerChainBuilderFilter extends
TransformerChainBuilderFilter {
+ protected Logger log = LogKit.getLoggerFor("cocoon");
private Object[] rootElement;
@@ -282,6 +286,7 @@
this.logicsheetMarkupGenerator, href,
this.resolver
);
} catch (IOException ioe) {
+ log.warn("IOException in SitemapMarkupLanguage",
ioe);
throw new SAXException (ioe);
}
}
@@ -325,6 +330,7 @@
this.resolver
);
} catch (IOException ioe) {
+ log.warn("IOException in SitemapMarkupLanguage",
ioe);
throw new SAXException (ioe);
}
} else {
@@ -389,7 +395,7 @@
* @see ContentHandler
*/
public void endElement (String namespaceURI, String localName,
- String qName) throws SAXException {
+ String qName) throws SAXException {
if (finished) {
// Forward the events
super.endElement(namespaceURI, localName, qName);
No revision
No revision
1.1.2.69 +6 -5
xml-cocoon/src/org/apache/cocoon/components/language/markup/sitemap/java/Attic/sitemap.xsl
Index: sitemap.xsl
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/components/language/markup/sitemap/java/Attic/sitemap.xsl,v
retrieving revision 1.1.2.68
retrieving revision 1.1.2.69
diff -u -r1.1.2.68 -r1.1.2.69
--- sitemap.xsl 2000/12/07 13:53:35 1.1.2.68
+++ sitemap.xsl 2000/12/08 20:38:59 1.1.2.69
@@ -76,8 +76,8 @@
* This is the automatically generated class from the sitemap definitions
*
* @author <a href="mailto:[EMAIL PROTECTED]">Giacomo
Pati</a>
- * @author <a href="mailto:[EMAIL PROTECTED]">Berin
Loiritsch</a>
- * @version CVS $Revision: 1.1.2.68 $ $Date: 2000/12/07 13:53:35 $
+ * @author <a href="mailto:[EMAIL PROTECTED]">Berin
Loritsch</a>
+ * @version CVS $Revision: 1.1.2.69 $ $Date: 2000/12/08 20:38:59 $
*/
public class <xsl:value-of select="@file-name"/> extends AbstractSitemap
{
static final String LOCATION = "<xsl:value-of
select="translate(@file-path, '/', '.')"/>.<xsl:value-of select="@file-name"/>";
@@ -116,7 +116,7 @@
<xsl:with-param name="suffix"><xsl:value-of
select="$type"/>_<xsl:value-of select="generate-id(.)"/></xsl:with-param>
</xsl:call-template>
</xsl:variable>
- // The generated matcher for a pattern of "<xsl:value-of
select="@pattern"/>"
+ // The generated matcher for a pattern of "<xsl:value-of
select="@pattern"/>"
<xsl:value-of
select="java:getClassSource($factory-loader,string($src),string($matcher-name),string(@pattern),$config)"/>
</xsl:for-each>
</xsl:if>
@@ -222,7 +222,7 @@
/* catch any exception thrown by a component during configuration */
} catch (Exception e) {
- log.error(e.getMessage(), e);
+ log.warn(e.getMessage(), e);
throw new ConfigurationException ("Sitemap: " + e.getMessage(), e);
}
}
@@ -293,12 +293,13 @@
try {
<xsl:apply-templates select="./*"/>
} catch (Exception e) {
+ log.warn("Error, try to process the error page", e);
<xsl:choose>
<xsl:when test="(./map:handle-errors)">
try {
return error_process_<xsl:value-of
select="$pipeline-position"/> (environment, objectModel, e);
} catch (Exception ex) {
- log.error("Sitemap Error Process", ex);
+ log.warn("Sitemap Error Process", ex);
}
</xsl:when>
<xsl:otherwise>
No revision
No revision
1.1.2.7 +9 -3
xml-cocoon/src/org/apache/cocoon/components/language/markup/xsp/Attic/XSPMarkupLanguage.java
Index: XSPMarkupLanguage.java
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/components/language/markup/xsp/Attic/XSPMarkupLanguage.java,v
retrieving revision 1.1.2.6
retrieving revision 1.1.2.7
diff -u -r1.1.2.6 -r1.1.2.7
--- XSPMarkupLanguage.java 2000/10/22 15:27:13 1.1.2.6
+++ XSPMarkupLanguage.java 2000/12/08 20:39:02 1.1.2.7
@@ -29,6 +29,8 @@
import org.apache.cocoon.Constants;
+import org.apache.log.Logger;
+import org.apache.log.LogKit;
import java.io.IOException;
import org.xml.sax.SAXException;
@@ -39,7 +41,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Ricardo Rocha</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Sebastien Sahuc</a>
- * @version CVS $Revision: 1.1.2.6 $ $Date: 2000/10/22 15:27:13 $
+ * @version CVS $Revision: 1.1.2.7 $ $Date: 2000/12/08 20:39:02 $
*/
public class XSPMarkupLanguage extends AbstractMarkupLanguage {
@@ -184,6 +186,7 @@
*
*/
protected class PreProcessFilter extends XMLFilterImpl {
+ protected Logger log = LogKit.getLoggerFor("cocoon");
private Stack stack;
@@ -228,7 +231,7 @@
* @see ContentHandler
*/
public void startElement (String namespaceURI, String localName,
- String qName, Attributes atts) throws
SAXException {
+ String qName, Attributes atts) throws SAXException
{
if (isRootElem) {
stack.push(new String[] { namespaceURI, localName, qName} );
isRootElem=false;
@@ -255,7 +258,7 @@
* @see ContentHandler
*/
public void endElement (String namespaceURI, String localName,
- String qName) throws SAXException {
+ String qName) throws SAXException {
stack.pop();
super.endElement(namespaceURI, localName, qName);
}
@@ -302,6 +305,7 @@
*/
protected class XSPTransformerChainBuilderFilter extends
TransformerChainBuilderFilter {
+ protected Logger log = LogKit.getLoggerFor("cocoon");
private List startPrefix;
@@ -349,6 +353,7 @@
href, this.resolver
);
} catch (IOException ioe) {
+ log.warn("XSPMarkupLanguage.processingInstruction",
ioe);
throw new SAXException (ioe);
}
}
@@ -401,6 +406,7 @@
location, this.resolver
);
} catch (IOException ioe) {
+ log.warn("XSPMarkupLanguage.startElement", ioe);
throw new SAXException (ioe);
}
} else {
1.1.2.6 +4 -1
xml-cocoon/src/org/apache/cocoon/components/language/markup/xsp/Attic/XSPObjectHelper.java
Index: XSPObjectHelper.java
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/components/language/markup/xsp/Attic/XSPObjectHelper.java,v
retrieving revision 1.1.2.5
retrieving revision 1.1.2.6
diff -u -r1.1.2.5 -r1.1.2.6
--- XSPObjectHelper.java 2000/12/05 22:07:06 1.1.2.5
+++ XSPObjectHelper.java 2000/12/08 20:39:04 1.1.2.6
@@ -12,11 +12,14 @@
import org.xml.sax.SAXException;
+import org.apache.log.Logger;
+import org.apache.log.LogKit;
+
/**
* Base class for XSP's object model manipulation logicsheets
*
* @author <a href="mailto:[EMAIL PROTECTED]">Ricardo Rocha</a>
- * @version CVS $Revision: 1.1.2.5 $ $Date: 2000/12/05 22:07:06 $
+ * @version CVS $Revision: 1.1.2.6 $ $Date: 2000/12/08 20:39:04 $
*/
public class XSPObjectHelper {
/**
1.1.2.7 +4 -2
xml-cocoon/src/org/apache/cocoon/components/language/markup/xsp/Attic/XSPResponseHelper.java
Index: XSPResponseHelper.java
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/components/language/markup/xsp/Attic/XSPResponseHelper.java,v
retrieving revision 1.1.2.6
retrieving revision 1.1.2.7
diff -u -r1.1.2.6 -r1.1.2.7
--- XSPResponseHelper.java 2000/08/31 17:13:32 1.1.2.6
+++ XSPResponseHelper.java 2000/12/08 20:39:05 1.1.2.7
@@ -18,11 +18,13 @@
import org.apache.cocoon.Cocoon;
+import org.apache.log.LogKit;
+
/**
* The XSP <code>HttpResponse</code> object helper
*
* @author <a href="mailto:[EMAIL PROTECTED]">Ricardo Rocha</a>
- * @version CVS $Revision: 1.1.2.6 $ $Date: 2000/08/31 17:13:32 $
+ * @version CVS $Revision: 1.1.2.7 $ $Date: 2000/12/08 20:39:05 $
*/
public class XSPResponseHelper extends XSPObjectHelper {
/**
@@ -64,6 +66,6 @@
try {
response.sendRedirect(location);
}
- catch (IOException e) {}
+ catch (IOException e)
{LogKit.getLoggerFor("cocoon").warn("XSPResponseHelper.sendRedirect", e);}
}
}
No revision
No revision
1.1.2.8 +5 -3
xml-cocoon/src/org/apache/cocoon/components/language/markup/xsp/java/Attic/esql.xsl
Index: esql.xsl
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/components/language/markup/xsp/java/Attic/esql.xsl,v
retrieving revision 1.1.2.7
retrieving revision 1.1.2.8
diff -u -r1.1.2.7 -r1.1.2.8
--- esql.xsl 2000/11/30 21:41:16 1.1.2.7
+++ esql.xsl 2000/12/08 20:39:11 1.1.2.8
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
-<!-- $Id: esql.xsl,v 1.1.2.7 2000/11/30 21:41:16 bloritsch Exp $-->
+<!-- $Id: esql.xsl,v 1.1.2.8 2000/12/08 20:39:11 bloritsch Exp $-->
<!--
============================================================================
@@ -242,11 +242,13 @@
try {
_esql_session.max_rows =
Integer.parseInt(String.valueOf(<xsl:copy-of select="$max-rows"/>));
} catch (Exception _esql_e) {
+ cocoonLogger.warn("MaxRow exception", _esql_e);
_esql_session.max_rows = -1;
}
try {
_esql_session.skip_rows =
Integer.parseInt(String.valueOf(<xsl:copy-of select="$skip-rows"/>));
} catch (Exception _esql_e) {
+ cocoonLogger.warn("SkipRow exceptoin", _esql_e);
_esql_session.skip_rows = 0;
}
try {
@@ -334,9 +336,9 @@
}
_esql_session.statement.close();
} catch (Exception _esql_exception) {
+ cocoonLogger.error("esql XSP exception", _esql_exception);
<xsl:if test="esql:error-results//esql:get-stacktrace">
StringWriter _esql_exception_writer = new StringWriter();
- log.error("esql XSP exception", _esql_exception)
_esql_exception.printStackTrace(new
PrintWriter(_esql_exception_writer));
</xsl:if>
<xsl:apply-templates select="esql:error-results/*"/>
@@ -345,7 +347,7 @@
if (_esql_session.connection != null) {
try {
_esql_session.connection.close();
- } catch (SQLException _esql_exception) {}
+ } catch (SQLException _esql_exception) {cocoonLogger.warn("Could
not close DB connection", _esql_exception);}
}
<xsl:if test="esql:use-connection">
<!-- FIXME - need to release avalon pooling here maybe -->
No revision
No revision
1.1.2.9 +9 -1
xml-cocoon/src/org/apache/cocoon/components/language/programming/java/Attic/AbstractJavaCompiler.java
Index: AbstractJavaCompiler.java
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/components/language/programming/java/Attic/AbstractJavaCompiler.java,v
retrieving revision 1.1.2.8
retrieving revision 1.1.2.9
diff -u -r1.1.2.8 -r1.1.2.9
--- AbstractJavaCompiler.java 2000/12/07 17:10:56 1.1.2.8
+++ AbstractJavaCompiler.java 2000/12/08 20:39:14 1.1.2.9
@@ -14,13 +14,21 @@
import org.apache.cocoon.components.language.programming.*;
+import org.apache.log.LogKit;
+import org.apache.log.Logger;
+
/**
* This class implements the functionality common to all Java compilers.
* @author <a href="mailto:[EMAIL PROTECTED]">Stefano Mazzocchi</a>
- * @version $Revision: 1.1.2.8 $ $Date: 2000/12/07 17:10:56 $
+ * @version $Revision: 1.1.2.9 $ $Date: 2000/12/08 20:39:14 $
* @since 2.0
*/
public abstract class AbstractJavaCompiler implements LanguageCompiler,
Recyclable {
+ /**
+ * The logger
+ */
+ protected Logger log = LogKit.getLoggerFor("cocoon");
+
/**
* The source program filename
*/
1.1.2.15 +6 -1
xml-cocoon/src/org/apache/cocoon/components/language/programming/java/Attic/JavaLanguage.java
Index: JavaLanguage.java
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/components/language/programming/java/Attic/JavaLanguage.java,v
retrieving revision 1.1.2.14
retrieving revision 1.1.2.15
diff -u -r1.1.2.14 -r1.1.2.15
--- JavaLanguage.java 2000/12/07 17:10:58 1.1.2.14
+++ JavaLanguage.java 2000/12/08 20:39:16 1.1.2.15
@@ -31,7 +31,7 @@
* The Java programming language processor
*
* @author <a href="mailto:[EMAIL PROTECTED]">Ricardo Rocha</a>
- * @version CVS $Revision: 1.1.2.14 $ $Date: 2000/12/07 17:10:58 $
+ * @version CVS $Revision: 1.1.2.15 $ $Date: 2000/12/08 20:39:16 $
*/
public class JavaLanguage extends CompiledProgrammingLanguage implements
ThreadSafe {
@@ -118,6 +118,7 @@
return
this.classLoaderManager.loadClass(name.replace(File.separatorChar,
'.'));
} catch (Exception e) {
+ log.warn("Could not load class for program '" + name + "'", e);
throw new LanguageException("Could not load class for program '" +
name + "' due to a " + e.getClass().getName() + ": " + e.getMessage());
}
}
@@ -183,10 +184,13 @@
}
} catch (InstantiationException e) {
+ log.warn("Could not instantiate the compiler", e);
throw new LanguageException("Could not instantiate the compiler: " +
e.getMessage());
} catch (IllegalAccessException e) {
+ log.warn("Could not access the compiler class", e);
throw new LanguageException("Could not access the compiler class: " +
e.getMessage());
} catch (IOException e) {
+ log.warn("Error during compilation", e);
throw new LanguageException("Error during compilation: " +
e.getMessage());
}
}
@@ -202,6 +206,7 @@
try {
return ((Class) program).newInstance();
} catch (Exception e) {
+ log.warn("Could not instantiate program instance", e);
throw new LanguageException("Could not instantiate program instance
due to a " + e.getClass().getName() + ": " + e.getMessage());
}
}
1.1.2.7 +3 -1
xml-cocoon/src/org/apache/cocoon/components/language/programming/java/Attic/Javac.java
Index: Javac.java
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/components/language/programming/java/Attic/Javac.java,v
retrieving revision 1.1.2.6
retrieving revision 1.1.2.7
diff -u -r1.1.2.6 -r1.1.2.7
--- Javac.java 2000/09/08 18:19:32 1.1.2.6
+++ Javac.java 2000/12/08 20:39:17 1.1.2.7
@@ -16,7 +16,7 @@
* This class wraps the Sun's Javac Compiler.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Stefano Mazzocchi</a>
- * @version $Revision: 1.1.2.6 $ $Date: 2000/09/08 18:19:32 $
+ * @version $Revision: 1.1.2.7 $ $Date: 2000/12/08 20:39:17 $
* @since 2.0
*/
@@ -34,10 +34,12 @@
Class.forName(MODERN_CLASS);
modern = true;
} catch (ClassNotFoundException e) {
+ log.warn("Javac()", e);
try {
Class.forName(CLASSIC_CLASS);
modern = false;
} catch (ClassNotFoundException ex) {
+ log.warn("No compiler found in your classpath. Make sure you
added 'tools.jar'", ex);
throw new RuntimeException("No compiler found in your classpath.
Make sure you added 'tools.jar'");
}
}
1.1.2.7 +8 -6
xml-cocoon/src/org/apache/cocoon/components/language/programming/java/Attic/Jikes.java
Index: Jikes.java
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/components/language/programming/java/Attic/Jikes.java,v
retrieving revision 1.1.2.6
retrieving revision 1.1.2.7
diff -u -r1.1.2.6 -r1.1.2.7
--- Jikes.java 2000/11/24 14:40:42 1.1.2.6
+++ Jikes.java 2000/12/08 20:39:17 1.1.2.7
@@ -16,7 +16,7 @@
* This class wraps IBM's <i>Jikes</i> Java compiler
* NOTE: inspired by the Apache Jasper implementation.
* @author <a href="mailto:[EMAIL PROTECTED]">Stefano Mazzocchi</a>
- * @version $Revision: 1.1.2.6 $ $Date: 2000/11/24 14:40:42 $
+ * @version $Revision: 1.1.2.7 $ $Date: 2000/12/08 20:39:17 $
* @since 2.0
*/
@@ -58,6 +58,7 @@
sleep(SLEEP_TIME);
}
} catch (Exception e) {
+ log.warn("Jikes.run()", e);
}
}
}
@@ -70,7 +71,7 @@
*/
protected String[] toStringArray(List arguments) {
int i;
-
+
for (i = 0; i < arguments.size(); i++) {
String arg = (String) arguments.get(i);
if (arg.equals("-sourcepath")) {
@@ -80,16 +81,16 @@
break;
}
}
-
+
String[] args = new String[arguments.size() + 1];
for (i = 0; i < arguments.size(); i++) {
args[i] = (String) arguments.get(i);
- }
+ }
args[i] = file;
return args;
- }
+ }
/**
* Execute the compiler
@@ -130,6 +131,7 @@
this.errors = new ByteArrayInputStream(tmpErr.toByteArray());
} catch (InterruptedException somethingHappened) {
+ log.debug("Jikes.compile():SomethingHappened",
somethingHappened);
return false;
}
@@ -137,7 +139,7 @@
// Check if any error output as well
// Return should be OK when both exitValue and
// tmpErr.size() are 0 ?!
- return ((exitValue == 0) && (tmpErr.size() == 0));
+ return ((exitValue == 0) && (tmpErr.size() == 0));
}
/**
1.1.2.4 +6 -1
xml-cocoon/src/org/apache/cocoon/components/language/programming/java/Attic/JstyleFormatter.java
Index: JstyleFormatter.java
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/components/language/programming/java/Attic/JstyleFormatter.java,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -r1.1.2.3 -r1.1.2.4
--- JstyleFormatter.java 2000/07/29 18:30:31 1.1.2.3
+++ JstyleFormatter.java 2000/12/08 20:39:20 1.1.2.4
@@ -18,15 +18,19 @@
import org.apache.cocoon.components.language.programming.*;
+import org.apache.log.Logger;
+import org.apache.log.LogKit;
+
/**
* This class implements <code>CodeFormatter</code> based on
* Tal Davidson's ([EMAIL PROTECTED]) <i>Jstyle</i> Java
* beautifier. This implementation is very improvised...
*
* @author <a href="mailto:[EMAIL PROTECTED]">Ricardo Rocha</a>
- * @version CVS $Revision: 1.1.2.3 $ $Date: 2000/07/29 18:30:31 $
+ * @version CVS $Revision: 1.1.2.4 $ $Date: 2000/12/08 20:39:20 $
*/
public class JstyleFormatter implements CodeFormatter {
+ protected Logger log = LogKit.getLoggerFor("cocon");
/**
* The default preferred line length. Should be parametrized!
*/
@@ -78,6 +82,7 @@
return this.getString(out, encoding);
} catch (Exception e) {
+ log.debug("JstyleFormatter.format()", e);
return code;
}
}
No revision
No revision
1.1.2.5 +2 -1
xml-cocoon/src/org/apache/cocoon/components/language/programming/javascript/Attic/JavascriptLanguage.java
Index: JavascriptLanguage.java
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/components/language/programming/javascript/Attic/JavascriptLanguage.java,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -u -r1.1.2.4 -r1.1.2.5
--- JavascriptLanguage.java 2000/12/07 17:11:02 1.1.2.4
+++ JavascriptLanguage.java 2000/12/08 20:39:27 1.1.2.5
@@ -20,7 +20,7 @@
* The compiled Javascript (Rhino) programming language processor
*
* @author <a href="mailto:[EMAIL PROTECTED]">Ricardo Rocha</a>
- * @version CVS $Revision: 1.1.2.4 $ $Date: 2000/12/07 17:11:02 $
+ * @version CVS $Revision: 1.1.2.5 $ $Date: 2000/12/08 20:39:27 $
*/
public class JavascriptLanguage extends JavaLanguage
{
@@ -76,6 +76,7 @@
compiler.main(args);
} catch (Exception e) {
+ log.warn("JavascriptLanguage.compile", e);
throw new LanguageException(e.getMessage());
}
}
No revision
No revision
1.1.2.7 +1 -0
xml-cocoon/src/org/apache/cocoon/components/store/Attic/FilesystemStore.java
Index: FilesystemStore.java
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/components/store/Attic/FilesystemStore.java,v
retrieving revision 1.1.2.6
retrieving revision 1.1.2.7
diff -u -r1.1.2.6 -r1.1.2.7
--- FilesystemStore.java 2000/11/29 12:17:47 1.1.2.6
+++ FilesystemStore.java 2000/12/08 20:39:31 1.1.2.7
@@ -108,6 +108,7 @@
IOUtils.serializeObject(file, value);
}
} catch (Exception e) { /* FAILURE */
+ log.warn("FilesystemStore.store()", e);
throw new RuntimeException(e.getMessage());
}
}
No revision
No revision
1.1.2.12 +8 -6
xml-cocoon/src/org/apache/cocoon/generation/Attic/FileGenerator.java
Index: FileGenerator.java
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/generation/Attic/FileGenerator.java,v
retrieving revision 1.1.2.11
retrieving revision 1.1.2.12
diff -u -r1.1.2.11 -r1.1.2.12
--- FileGenerator.java 2000/12/04 13:10:47 1.1.2.11
+++ FileGenerator.java 2000/12/08 20:39:34 1.1.2.12
@@ -20,7 +20,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Pierpaolo Fumagalli</a>
* (Apache Software Foundation, Exoffice Technologies)
- * @version CVS $Revision: 1.1.2.11 $ $Date: 2000/12/04 13:10:47 $
+ * @version CVS $Revision: 1.1.2.12 $ $Date: 2000/12/08 20:39:34 $
*/
public class FileGenerator extends ComposerGenerator implements Poolable {
@@ -36,13 +36,15 @@
parser.setContentHandler(this.contentHandler);
parser.setLexicalHandler(this.lexicalHandler);
parser.parse(super.resolver.resolveEntity(null,this.source));
- } catch (IOException e) {
+ } catch (IOException e) {
+ log.error("FileGenerator.generate()", e);
throw(e);
- } catch (SAXException e) {
+ } catch (SAXException e) {
+ log.error("FileGenerator.generate()", e);
throw(e);
- } catch (Exception e){
- log.error("Could not get parser", e);
+ } catch (Exception e){
+ log.error("Could not get parser", e);
throw new ProcessingException(e.getMessage());
}
- }
+ }
}
1.1.2.4 +20 -19
xml-cocoon/src/org/apache/cocoon/generation/Attic/HTMLGenerator.java
Index: HTMLGenerator.java
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/generation/Attic/HTMLGenerator.java,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -r1.1.2.3 -r1.1.2.4
--- HTMLGenerator.java 2000/12/04 13:10:48 1.1.2.3
+++ HTMLGenerator.java 2000/12/08 20:39:36 1.1.2.4
@@ -15,18 +15,18 @@
import org.xml.sax.SAXException;
import org.xml.sax.InputSource;
-import java.net.URL;
-import java.io.IOException;
+import java.net.URL;
+import java.io.IOException;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
-import org.w3c.tidy.Tidy;
+import org.w3c.tidy.Tidy;
/**
* @author <a href="mailto:[EMAIL PROTECTED]">Davanum Srinivas</a>
- * @version CVS $Revision: 1.1.2.3 $ $Date: 2000/12/04 13:10:48 $
+ * @version CVS $Revision: 1.1.2.4 $ $Date: 2000/12/08 20:39:36 $
*/
public class HTMLGenerator extends ComposerGenerator implements Poolable {
/**
@@ -34,38 +34,39 @@
*/
public void generate()
throws IOException, SAXException, ProcessingException {
- try
+ try
{
- URL url = new URL(this.source);
+ URL url = new URL(this.source);
ByteArrayOutputStream ostream = new ByteArrayOutputStream();
// Setup an instance of Tidy.
- Tidy tidy = new Tidy();
+ Tidy tidy = new Tidy();
tidy.setXmlOut(true);
tidy.setXHTML(true);
- // FIXME (DIMS): Using DOMStreamer will eliminate the need for
an
- // intermediate ByteArrayOutput Stream. But the document created
- // by JTidy has problems. So for now we use the
ByteArrayOutputStream.
- tidy.parseDOM(new BufferedInputStream(url.openStream()),
- new BufferedOutputStream(ostream));
+ // FIXME (DIMS): Using DOMStreamer will eliminate the need for an
+ // intermediate ByteArrayOutput Stream. But the document created
+ // by JTidy has problems. So for now we use the
ByteArrayOutputStream.
+ tidy.parseDOM(new BufferedInputStream(url.openStream()),
+ new BufferedOutputStream(ostream));
log.debug("Looking up " + Roles.PARSER);
// Pipe the results into the parser
Parser parser=(Parser) this.manager.lookup(Roles.PARSER);
parser.setContentHandler(this.contentHandler);
parser.setLexicalHandler(this.lexicalHandler);
- parser.parse(new InputSource
- (new ByteArrayInputStream
- (ostream.toByteArray())));
+ parser.parse(new InputSource
+ (new ByteArrayInputStream
+ (ostream.toByteArray())));
} catch (IOException e){
+ log.error("HTMLGenerator.generate()", e);
throw(e);
} catch (SAXException e){
+ log.error("HTMLGenerator.generate()", e);
throw(e);
} catch (Exception e){
log.error("Could not get parser", e);
throw new ProcessingException(e.getMessage());
}
- }
+ }
}
-
\ No newline at end of file
1.1.2.5 +149 -144
xml-cocoon/src/org/apache/cocoon/generation/Attic/ImageDirectoryGenerator.java
Index: ImageDirectoryGenerator.java
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/generation/Attic/ImageDirectoryGenerator.java,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -u -r1.1.2.4 -r1.1.2.5
--- ImageDirectoryGenerator.java 2000/11/29 12:17:58 1.1.2.4
+++ ImageDirectoryGenerator.java 2000/12/08 20:39:37 1.1.2.5
@@ -6,157 +6,162 @@
import org.apache.avalon.Poolable;
+import org.apache.log.LogKit;
+
/**
* An extension of DirectoryGenerators that adds extra attributes for image
* files.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Donald A. Ball Jr.</a>
- * @version $Revision: 1.1.2.4 $ $Date: 2000/11/29 12:17:58 $
+ * @version $Revision: 1.1.2.5 $ $Date: 2000/12/08 20:39:37 $
*/
public class ImageDirectoryGenerator extends DirectoryGenerator implements
Poolable {
- protected static String IMAGE_WIDTH_ATTR_NAME = "width";
- protected static String IMAGE_HEIGHT_ATTR_NAME = "height";
+ protected static String IMAGE_WIDTH_ATTR_NAME = "width";
+ protected static String IMAGE_HEIGHT_ATTR_NAME = "height";
- /**
- * Extends the <code>setNodeAttributes</code> method from the
- * <code>DirectoryGenerator</code> by adding width and height attributes
- * if the path is a GIF or a JPEG file.
- */
- protected void setNodeAttributes(File path) throws SAXException {
- super.setNodeAttributes(path);
- if (path.isDirectory()) {
- return;
- }
- try {
- int dim[] = getSize(path);
-
attributes.addAttribute("",IMAGE_WIDTH_ATTR_NAME,IMAGE_WIDTH_ATTR_NAME,"CDATA",""+dim[0]);
-
attributes.addAttribute("",IMAGE_HEIGHT_ATTR_NAME,IMAGE_HEIGHT_ATTR_NAME,"CDATA",""+dim[1]);
- } catch (RuntimeException e) {}
- catch (Exception e) {
- throw new SAXException(e);
- }
- }
-
- // returns width as first element, height as second
- public static int[] getSize(File file) throws FileNotFoundException,
IOException {
- String type = getFileType(file);
- try {
- if(type.equals("gif")) return getGifSize(file);
- else return getJpegSize(file);
- } catch(Exception e) {
- throw new RuntimeException("File is not a valid GIF or
Jpeg");
- }
-
- }
-
- // returns width as first element, height as second
- public static int[] getJpegSize(File file) throws
FileNotFoundException, IOException {
- BufferedReader in = null;
- try {
- in = new BufferedReader(new FileReader(file));
- // check for "magic" header
- char[] buf = new char[2];
- int count = in.read(buf, 0, 2);
- if(count < 2) throw new RuntimeException("Not a valid
Jpeg file!");
- if((buf[0]) != 0xFF
- || (buf[1]) != 0xD8 )
- throw new RuntimeException("Not a valid Jpeg file!");
-
- int width = 0;
- int height = 0;
-
- boolean done = false;
- int ch = 0;
-
- try {
- while(ch != 0xDA && !done) {
- /* Find next marker (JPEG markers begin
with 0xFF) */
- while (ch != 0xFF) { ch = in.read(); }
- /* JPEG markers can be padded with
unlimited 0xFF's */
- while (ch == 0xFF) { ch = in.read(); }
- /* Now, ch contains the value of the
marker. */
- if(ch >= 0xC0 && ch <= 0xC3) {
- // skip 3 bytes
- in.read();
- in.read();
- in.read();
- height = 256 * in.read();
- height += in.read();
- width = 256 * in.read();
- width += in.read();
- done = true;
- } else {
- /* We MUST skip variables,
since FF's within variable names are NOT valid JPEG markers */
- int length = 256 * in.read();
- length += in.read();
- if(length < 2) throw new
RuntimeException("Erroneous JPEG marker length");
- for(int foo = 0; foo<length-2;
foo++)
- in.read();
- }
- }
- } catch(Exception e) {
- throw new RuntimeException("Not a valid Jpeg
file!");
- }
-
- int[] dim = { width, height };
- return dim;
-
- } finally {
- if(in != null) try { in.close(); } catch(Exception e) {}
- }
- }
-
- // returns width as first element, height as second
- public static int[] getGifSize(File file) throws FileNotFoundException,
IOException {
- BufferedReader in = null;
- try {
- in = new BufferedReader(new FileReader(file));
- char[] buf = new char[10];
- int count = in.read(buf, 0, 10);
- if(count < 10) throw new RuntimeException("Not a valid
GIF file!");
- if((buf[0]) != 'G'
- || (buf[1]) != 'I'
- || (buf[2]) != 'F' )
- throw new RuntimeException("Not a valid GIF file!");
-
- int w1 = (int)buf[6];
- int w2 = (int)buf[7];
- int h1 = (int)buf[8];
- int h2 = (int)buf[9];
-
- int width = w1 + (256 * w2);
- int height = h1 + (256 * h2);
-
- int[] dim = { width, height };
- return dim;
-
- } finally {
- if(in != null) try { in.close(); } catch(Exception e) {}
- }
- }
-
- // returns "gif", "jpeg" or NULL
- public static String getFileType(File file) throws
FileNotFoundException, IOException {
- BufferedReader in = null;
- try {
- in = new BufferedReader(new FileReader(file));
- char[] buf = new char[3];
- int count = in.read(buf, 0, 3);
- if(count < 3) return null;
- if((buf[0]) == 'G'
- && (buf[1]) == 'I'
- && (buf[2]) == 'F' )
- return "gif";
-
- if((buf[0]) == 0xFF
- && (buf[1]) == 0xD8 )
- return "jpeg";
-
- return null;
-
- } finally {
- if(in != null) try { in.close(); } catch(Exception e) {}
- }
- }
+ /**
+ * Extends the <code>setNodeAttributes</code> method from the
+ * <code>DirectoryGenerator</code> by adding width and height attributes
+ * if the path is a GIF or a JPEG file.
+ */
+ protected void setNodeAttributes(File path) throws SAXException {
+ super.setNodeAttributes(path);
+ if (path.isDirectory()) {
+ return;
+ }
+ try {
+ int dim[] = getSize(path);
+
attributes.addAttribute("",IMAGE_WIDTH_ATTR_NAME,IMAGE_WIDTH_ATTR_NAME,"CDATA",""+dim[0]);
+
attributes.addAttribute("",IMAGE_HEIGHT_ATTR_NAME,IMAGE_HEIGHT_ATTR_NAME,"CDATA",""+dim[1]);
+ } catch (RuntimeException e)
{log.debug("ImageDirectoryGenerator.setNodeAttributes", e);}
+ catch (Exception e) {
+ log.error("ImageDirectoryGenerator.setNodeAttributes", e);
+ throw new SAXException(e);
+ }
+ }
+
+ // returns width as first element, height as second
+ public static int[] getSize(File file) throws FileNotFoundException,
IOException {
+ String type = getFileType(file);
+ try {
+ if(type.equals("gif")) return getGifSize(file);
+ else return getJpegSize(file);
+ } catch(Exception e) {
+ LogKit.getLoggerFor("cocoon").debug("File is not a valid GIF or
Jpeg", e);
+ throw new RuntimeException("File is not a valid GIF or Jpeg");
+ }
+
+ }
+
+ // returns width as first element, height as second
+ public static int[] getJpegSize(File file) throws FileNotFoundException,
IOException {
+ BufferedReader in = null;
+ try {
+ in = new BufferedReader(new FileReader(file));
+ // check for "magic" header
+ char[] buf = new char[2];
+ int count = in.read(buf, 0, 2);
+ if(count < 2) throw new RuntimeException("Not a valid Jpeg
file!");
+ if((buf[0]) != 0xFF
+ || (buf[1]) != 0xD8 )
+ throw new RuntimeException("Not a valid Jpeg file!");
+
+ int width = 0;
+ int height = 0;
+
+ boolean done = false;
+ int ch = 0;
+
+ try {
+ while(ch != 0xDA && !done) {
+ /* Find next marker (JPEG markers begin with 0xFF) */
+ while (ch != 0xFF) { ch = in.read(); }
+ /* JPEG markers can be padded with unlimited 0xFF's */
+ while (ch == 0xFF) { ch = in.read(); }
+ /* Now, ch contains the value of the marker. */
+ if(ch >= 0xC0 && ch <= 0xC3) {
+ // skip 3 bytes
+ in.read();
+ in.read();
+ in.read();
+ height = 256 * in.read();
+ height += in.read();
+ width = 256 * in.read();
+ width += in.read();
+ done = true;
+ } else {
+ /* We MUST skip variables, since FF's within
variable names are NOT valid JPEG markers */
+ int length = 256 * in.read();
+ length += in.read();
+ if(length < 2) throw new RuntimeException("Erroneous
JPEG marker length");
+ for(int foo = 0; foo<length-2; foo++)
+ in.read();
+ }
+ }
+ } catch(Exception e) {
+ LogKit.getLoggerFor("cocoon").debug("Not a valid Jpeg
file!", e);
+ throw new RuntimeException("Not a valid Jpeg file!");
+ }
+
+ int[] dim = { width, height };
+ return dim;
+
+ } finally {
+ if(in != null) try { in.close(); } catch(Exception e)
{LogKit.getLoggerFor("cocoon").debug("Close stream", e);}
+ }
+ }
+
+ // returns width as first element, height as second
+ public static int[] getGifSize(File file) throws FileNotFoundException,
IOException {
+ BufferedReader in = null;
+ try {
+ in = new BufferedReader(new FileReader(file));
+ char[] buf = new char[10];
+ int count = in.read(buf, 0, 10);
+ if(count < 10) throw new RuntimeException("Not a valid GIF
file!");
+ if((buf[0]) != 'G'
+ || (buf[1]) != 'I'
+ || (buf[2]) != 'F' )
+ throw new RuntimeException("Not a valid GIF file!");
+
+ int w1 = (int)buf[6];
+ int w2 = (int)buf[7];
+ int h1 = (int)buf[8];
+ int h2 = (int)buf[9];
+
+ int width = w1 + (256 * w2);
+ int height = h1 + (256 * h2);
+
+ int[] dim = { width, height };
+ return dim;
+
+ } finally {
+ if(in != null) try { in.close(); } catch(Exception e)
{LogKit.getLoggerFor("cocoon").debug("Close stream", e);}
+ }
+ }
+
+ // returns "gif", "jpeg" or NULL
+ public static String getFileType(File file) throws
FileNotFoundException, IOException {
+ BufferedReader in = null;
+ try {
+ in = new BufferedReader(new FileReader(file));
+ char[] buf = new char[3];
+ int count = in.read(buf, 0, 3);
+ if(count < 3) return null;
+ if((buf[0]) == 'G'
+ && (buf[1]) == 'I'
+ && (buf[2]) == 'F' )
+ return "gif";
+
+ if((buf[0]) == 0xFF
+ && (buf[1]) == 0xD8 )
+ return "jpeg";
+
+ return null;
+
+ } finally {
+ if(in != null) try { in.close(); } catch(Exception e)
{LogKit.getLoggerFor("cocoon").debug("Close stream", e);}
+ }
+ }
}
1.1.2.11 +7 -1
xml-cocoon/src/org/apache/cocoon/generation/Attic/PhpGenerator.java
Index: PhpGenerator.java
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/generation/Attic/PhpGenerator.java,v
retrieving revision 1.1.2.10
retrieving revision 1.1.2.11
diff -u -r1.1.2.10 -r1.1.2.11
--- PhpGenerator.java 2000/11/29 16:55:14 1.1.2.10
+++ PhpGenerator.java 2000/12/08 20:39:38 1.1.2.11
@@ -28,7 +28,7 @@
* results into SAX events.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Sam Ruby</a>
- * @version CVS $Revision: 1.1.2.10 $ $Date: 2000/11/29 16:55:14 $
+ * @version CVS $Revision: 1.1.2.11 $ $Date: 2000/12/08 20:39:38 $
*/
public class PhpGenerator extends ServletGenerator implements Poolable {
@@ -78,6 +78,7 @@
try {
output.write(data.getBytes());
} catch (IOException e) {
+ log.debug("PhpGenerator.write()", e);
throw new RuntimeException(e.getMessage());
}
}
@@ -90,12 +91,14 @@
try {
service(request, response, input);
} catch (ServletException e) {
+ log.error("PhpGenerator.run()", e);
this.exception = e;
}
try {
output.close();
} catch (IOException e) {
+ log.error("PhpGenerator.run():SHOULD NEVER HAPPEN", e);
// should never happen
}
}
@@ -135,10 +138,13 @@
// clean up
php.destroy();
} catch (SAXException e) {
+ log.debug("PhpGenerator.generate()", e);
throw e;
} catch (IOException e) {
+ log.debug("PhpGenerator.generate()", e);
throw e;
} catch (Exception e) {
+ log.debug("PhpGenerator.generate()", e);
throw new IOException(e.toString());
}
}
1.1.2.10 +2 -1
xml-cocoon/src/org/apache/cocoon/generation/Attic/ServerPagesGenerator.java
Index: ServerPagesGenerator.java
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/generation/Attic/ServerPagesGenerator.java,v
retrieving revision 1.1.2.9
retrieving revision 1.1.2.10
diff -u -r1.1.2.9 -r1.1.2.10
--- ServerPagesGenerator.java 2000/11/30 21:41:39 1.1.2.9
+++ ServerPagesGenerator.java 2000/12/08 20:39:39 1.1.2.10
@@ -36,7 +36,7 @@
* delegating actual SAX event generation.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Ricardo Rocha</a>
- * @version CVS $Revision: 1.1.2.9 $ $Date: 2000/11/30 21:41:39 $
+ * @version CVS $Revision: 1.1.2.10 $ $Date: 2000/12/08 20:39:39 $
*/
public class ServerPagesGenerator
extends ServletGenerator
@@ -128,6 +128,7 @@
generator = (Generator)
programGenerator.load(file, markupLanguage, programmingLanguage,
resolver);
} catch (Exception e) {
+ log.warn("ServerPagesGenerator.generate()", e);
throw new ProcessingException(e.getMessage());
}
1.1.2.7 +3 -1
xml-cocoon/src/org/apache/cocoon/generation/Attic/StatusGenerator.java
Index: StatusGenerator.java
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/generation/Attic/StatusGenerator.java,v
retrieving revision 1.1.2.6
retrieving revision 1.1.2.7
diff -u -r1.1.2.6 -r1.1.2.7
--- StatusGenerator.java 2000/11/29 12:18:05 1.1.2.6
+++ StatusGenerator.java 2000/12/08 20:39:40 1.1.2.7
@@ -52,7 +52,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Paul Russell</a> (Luminas
Limited)
* @author <a href="mailto:[EMAIL PROTECTED]">Stefano Mazzocchi</a>
- * @version CVS $Revision: 1.1.2.6 $ $Date: 2000/11/29 12:18:05 $
+ * @version CVS $Revision: 1.1.2.7 $ $Date: 2000/12/08 20:39:40 $
*/
public class StatusGenerator extends ComposerGenerator implements Poolable {
@@ -99,8 +99,10 @@
try {
localHost = InetAddress.getLocalHost().getHostName();
} catch ( UnknownHostException e ) {
+ log.debug("StatusGenerator:UnknownHost", e);
localHost = "";
} catch ( SecurityException e ) {
+ log.debug("StatusGenerator:Security", e);
localHost = "";
}
No revision
No revision
1.1.2.3 +7 -1
xml-cocoon/src/org/apache/cocoon/matching/Attic/RegexpTargetHostMatcherFactory.java
Index: RegexpTargetHostMatcherFactory.java
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/matching/Attic/RegexpTargetHostMatcherFactory.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- RegexpTargetHostMatcherFactory.java 2000/11/30 21:41:46 1.1.2.2
+++ RegexpTargetHostMatcherFactory.java 2000/12/08 20:39:48 1.1.2.3
@@ -15,6 +15,9 @@
import org.w3c.dom.traversal.NodeIterator;
+import org.apache.log.LogKit;
+import org.apache.log.Logger;
+
/**
* This class generates source code which represents a specific pattern
matcher
* for request URIs
@@ -22,10 +25,12 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Giacomo Pati</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Berin Loritsch</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Paul Russell</a>
- * @version CVS $Revision: 1.1.2.2 $ $Date: 2000/11/30 21:41:46 $
+ * @version CVS $Revision: 1.1.2.3 $ $Date: 2000/12/08 20:39:48 $
*/
public class RegexpTargetHostMatcherFactory implements MatcherFactory {
+ protected Logger log = LogKit.getLoggerFor("cocoon");
+
public String generateParameterSource (NodeIterator conf)
throws ConfigurationException {
return "RE";
@@ -65,6 +70,7 @@
.append("));");
return sb.toString();
} catch (RESyntaxException rse) {
+ log.warn("RegexpTargetHostMatcherFactory:RESyntaxException",
rse);
throw new ConfigurationException (rse.getMessage(), rse);
}
}
1.1.2.17 +7 -1
xml-cocoon/src/org/apache/cocoon/matching/Attic/RegexpURIMatcherFactory.java
Index: RegexpURIMatcherFactory.java
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/matching/Attic/RegexpURIMatcherFactory.java,v
retrieving revision 1.1.2.16
retrieving revision 1.1.2.17
diff -u -r1.1.2.16 -r1.1.2.17
--- RegexpURIMatcherFactory.java 2000/11/30 21:41:48 1.1.2.16
+++ RegexpURIMatcherFactory.java 2000/12/08 20:39:50 1.1.2.17
@@ -15,16 +15,21 @@
import org.w3c.dom.traversal.NodeIterator;
+import org.apache.log.Logger;
+import org.apache.log.LogKit;
+
/**
* This class generates source code which represents a specific pattern
matcher
* for request URIs
*
* @author <a href="mailto:[EMAIL PROTECTED]">Giacomo Pati</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Berin Loritsch</a>
- * @version CVS $Revision: 1.1.2.16 $ $Date: 2000/11/30 21:41:48 $
+ * @version CVS $Revision: 1.1.2.17 $ $Date: 2000/12/08 20:39:50 $
*/
public class RegexpURIMatcherFactory implements MatcherFactory {
+ protected Logger log = LogKit.getLoggerFor("cocoon");
+
public String generateParameterSource (NodeIterator conf)
throws ConfigurationException {
return "RE";
@@ -80,6 +85,7 @@
sb.append("}");
return sb.toString();
} catch (RESyntaxException rse) {
+ log.debug("RegexpURIMatcherFactory", rse);
throw new ConfigurationException (rse.getMessage(), rse);
}
}
1.1.2.23 +6 -1
xml-cocoon/src/org/apache/cocoon/matching/Attic/WildcardURIMatcherFactory.java
Index: WildcardURIMatcherFactory.java
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/matching/Attic/WildcardURIMatcherFactory.java,v
retrieving revision 1.1.2.22
retrieving revision 1.1.2.23
diff -u -r1.1.2.22 -r1.1.2.23
--- WildcardURIMatcherFactory.java 2000/12/05 22:10:36 1.1.2.22
+++ WildcardURIMatcherFactory.java 2000/12/08 20:39:51 1.1.2.23
@@ -12,6 +12,9 @@
import org.w3c.dom.traversal.NodeIterator;
+import org.apache.log.Logger;
+import org.apache.log.LogKit;
+
/**
* This class generates source code which represents a specific pattern
matcher
* for request URIs
@@ -19,10 +22,11 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Giacomo Pati</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Stefano Mazzocchi</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Berin Loritsch</a>
- * @version CVS $Revision: 1.1.2.22 $ $Date: 2000/12/05 22:10:36 $
+ * @version CVS $Revision: 1.1.2.23 $ $Date: 2000/12/08 20:39:51 $
*/
public class WildcardURIMatcherFactory implements MatcherFactory {
+ protected Logger log = LogKit.getLoggerFor("cocoon");
/** The int representing '*' in the pattern <code>int []</code>. */
protected static final int MATCH_FILE = -1;
@@ -82,6 +86,7 @@
return result.append (sourcePattern[j])
.append ("};\n").toString();
} catch (NullPointerException pe) {
+ log.error("WildcardURIMatcherFactory:NULL", pe);
throw new ConfigurationException (pe.getMessage(), pe);
}
}
No revision
No revision
1.1.2.6 +7 -2
xml-cocoon/src/org/apache/cocoon/reading/Attic/AbstractReader.java
Index: AbstractReader.java
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/reading/Attic/AbstractReader.java,v
retrieving revision 1.1.2.5
retrieving revision 1.1.2.6
diff -u -r1.1.2.5 -r1.1.2.6
--- AbstractReader.java 2000/10/19 14:44:07 1.1.2.5
+++ AbstractReader.java 2000/12/08 20:39:58 1.1.2.6
@@ -14,12 +14,17 @@
import org.xml.sax.EntityResolver;
+import org.apache.log.Logger;
+import org.apache.log.LogKit;
+
/**
*
* @author <a href="mailto:[EMAIL PROTECTED]">Giacomo Pati</a>
- * @version CVS $Revision: 1.1.2.5 $ $Date: 2000/10/19 14:44:07 $
+ * @version CVS $Revision: 1.1.2.6 $ $Date: 2000/12/08 20:39:58 $
*/
public abstract class AbstractReader implements Reader {
+ /** The logger */
+ protected Logger log = LogKit.getLoggerFor("cocoon");
/** The current <code>EntityResolver</code>. */
protected EntityResolver resolver=null;
/** The current <code>Map</code> of the object model. */
@@ -51,7 +56,7 @@
/**
* Get the mime-type of the output of this <code>Serializer</code>
- * This default implementation returns null to indicate that the
+ * This default implementation returns null to indicate that the
* mime-type specified in the sitemap is to be used
*/
public String getMimeType() {
1.1.2.8 +3 -1
xml-cocoon/src/org/apache/cocoon/reading/Attic/ResourceReader.java
Index: ResourceReader.java
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/reading/Attic/ResourceReader.java,v
retrieving revision 1.1.2.7
retrieving revision 1.1.2.8
diff -u -r1.1.2.7 -r1.1.2.8
--- ResourceReader.java 2000/11/26 21:48:04 1.1.2.7
+++ ResourceReader.java 2000/12/08 20:39:59 1.1.2.8
@@ -28,7 +28,7 @@
/**
*
* @author <a href="mailto:[EMAIL PROTECTED]">Giacomo Pati</a>
- * @version CVS $Revision: 1.1.2.7 $ $Date: 2000/11/26 21:48:04 $
+ * @version CVS $Revision: 1.1.2.8 $ $Date: 2000/12/08 20:39:59 $
*/
public class ResourceReader extends AbstractReader {
@@ -64,9 +64,11 @@
lastModified = file.lastModified();
}
} catch (SAXException se) {
+ log.error("ResourceReader: error resolving source \"" + source +
"\"", se);
throw new IOException ("ResourceReader: error resolving source
\""
+source+"\". "+se.toString());
} catch (MalformedURLException mue) {
+ log.error("ResourceReader: malformed source \"" + source + "\"",
mue);
throw new IOException ("ResourceReader: malformed source \""
+src+"\". "+mue.toString());
}
No revision
No revision
1.1.2.4 +8 -1
xml-cocoon/src/org/apache/cocoon/serialization/Attic/AbstractTextSerializer.java
Index: AbstractTextSerializer.java
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/serialization/Attic/AbstractTextSerializer.java,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -r1.1.2.3 -r1.1.2.4
--- AbstractTextSerializer.java 2000/11/30 21:42:00 1.1.2.3
+++ AbstractTextSerializer.java 2000/12/08 20:40:08 1.1.2.4
@@ -20,7 +20,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Pierpaolo Fumagalli</a>
* (Apache Software Foundation, Exoffice Technologies)
* @author <a href="mailto:[EMAIL PROTECTED]">Stefano Mazzocchi</a>
- * @version CVS $Revision: 1.1.2.3 $ $Date: 2000/11/30 21:42:00 $
+ * @version CVS $Revision: 1.1.2.4 $ $Date: 2000/12/08 20:40:08 $
*/
public abstract class AbstractTextSerializer extends AbstractSerializer
implements Configurable {
@@ -42,6 +42,7 @@
Configuration encoding = conf.getChild("encoding");
format.setEncoding(encoding.getValue());
} catch (ConfigurationException ce) {
+ log.debug("No Encoding");
// TODO: how to handle non-existant encoding?
}
@@ -51,6 +52,7 @@
Configuration dtPublic = conf.getChild("doctype-public");
doctypePublic = dtPublic.getValue();
} catch (ConfigurationException ce) {
+ log.debug("No Public Doctype");
doctypePublic = null;
}
@@ -58,6 +60,7 @@
Configuration doctypeSystem = conf.getChild("doctype-system");
format.setDoctype(doctypePublic, doctypeSystem.getValue());
} catch (ConfigurationException ce) {
+ log.debug("No System Doctype");
// TODO: how to handle non-existant doctype-system?
}
@@ -66,6 +69,7 @@
format.setIndenting(true);
format.setIndent(indent.getValueAsInt());
} catch (ConfigurationException ce) {
+ log.debug("No indent");
// TODO: how to handle non-existant indent?
}
@@ -73,6 +77,7 @@
Configuration preserveSpace = conf.getChild("preserve-space");
format.setPreserveSpace(preserveSpace.getValueAsBoolean());
} catch (ConfigurationException ce) {
+ log.debug("No preserve-space");
// TODO: how to handle non-existant preserve-space?
}
@@ -80,6 +85,7 @@
Configuration declaration = conf.getChild("xml-declaration");
format.setOmitXMLDeclaration(!declaration.getValueAsBoolean());
} catch (ConfigurationException ce) {
+ log.debug("No XML Declaration");
// TODO: how to handle non-existant xml-declaration?
}
@@ -87,6 +93,7 @@
Configuration lineWidth = conf.getChild("line-width");
format.setLineWidth(lineWidth.getValueAsInt());
} catch (ConfigurationException ce) {
+ log.debug("No line-width");
// TODO: how to handle non-existant line-width?
}
}
1.1.2.9 +3 -1
xml-cocoon/src/org/apache/cocoon/serialization/Attic/FOPSerializer.java
Index: FOPSerializer.java
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/serialization/Attic/FOPSerializer.java,v
retrieving revision 1.1.2.8
retrieving revision 1.1.2.9
diff -u -r1.1.2.8 -r1.1.2.9
--- FOPSerializer.java 2000/12/08 12:05:06 1.1.2.8
+++ FOPSerializer.java 2000/12/08 20:40:09 1.1.2.9
@@ -29,7 +29,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Giacomo Pati</a>
* (PWR Organisation & Entwicklung)
* @author <a href="mailto:[EMAIL PROTECTED]">Stefano Mazzocchi</a>
- * @version CVS $Revision: 1.1.2.8 $ $Date: 2000/12/08 12:05:06 $
+ * @version CVS $Revision: 1.1.2.9 $ $Date: 2000/12/08 20:40:09 $
*
*/
public class FOPSerializer extends AbstractSerializer implements
MessageListener, Poolable {
@@ -70,8 +70,10 @@
driver.format();
driver.render();
} catch (IOException e) {
+ log.error("FOPSerializer.endDocument()", e);
throw new SAXException (e);
} catch (FOPException e) {
+ log.error("FOPSerializer.endDocument()", e);
throw new SAXException (e);
} finally {
driver = null;
1.1.2.10 +5 -4
xml-cocoon/src/org/apache/cocoon/serialization/Attic/HTMLSerializer.java
Index: HTMLSerializer.java
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/serialization/Attic/HTMLSerializer.java,v
retrieving revision 1.1.2.9
retrieving revision 1.1.2.10
diff -u -r1.1.2.9 -r1.1.2.10
--- HTMLSerializer.java 2000/10/08 21:08:06 1.1.2.9
+++ HTMLSerializer.java 2000/12/08 20:40:10 1.1.2.10
@@ -20,23 +20,24 @@
/**
* @author <a href="mailto:[EMAIL PROTECTED]">Stefano Mazzocchi</a>
- * @version CVS $Revision: 1.1.2.9 $ $Date: 2000/10/08 21:08:06 $
+ * @version CVS $Revision: 1.1.2.10 $ $Date: 2000/12/08 20:40:10 $
*/
public class HTMLSerializer extends AbstractTextSerializer implements
Poolable {
private SerializerFactory factory;
-
+
public HTMLSerializer() {
this.factory = SerializerFactory.getSerializerFactory(Method.HTML);
}
-
+
public void setOutputStream(OutputStream out) {
try {
super.setOutputStream(out);
this.setContentHandler(this.factory.makeSerializer(out,
this.format).asContentHandler());
} catch (Exception e) {
+ log.error("HTMLSerializer.setOutputStream()", e);
throw new RuntimeException(e.toString());
}
- }
+ }
}
1.1.2.17 +2 -0
xml-cocoon/src/org/apache/cocoon/serialization/Attic/SVGSerializer.java
Index: SVGSerializer.java
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/serialization/Attic/SVGSerializer.java,v
retrieving revision 1.1.2.16
retrieving revision 1.1.2.17
diff -u -r1.1.2.16 -r1.1.2.17
--- SVGSerializer.java 2000/12/05 00:24:14 1.1.2.16
+++ SVGSerializer.java 2000/12/08 20:40:11 1.1.2.17
@@ -100,6 +100,7 @@
try {
this.backgroundColour = new Color(Integer.parseInt(bg, 16));
} catch (NumberFormatException e) {
+ log.debug("Invalid color(SVGSerializer)", e);
throw new ConfigurationException(bg + " is not a valid
color.", e);
}
}
@@ -172,6 +173,7 @@
encoder.encode(img, this.output);
this.output.flush();
} catch (IOException ex) {
+ log.warn("SVGSerializer: IOException writing image", ex);
throw new SAXException("IOException writing image ", ex);
}
}
1.1.2.5 +5 -4
xml-cocoon/src/org/apache/cocoon/serialization/Attic/TextSerializer.java
Index: TextSerializer.java
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/serialization/Attic/TextSerializer.java,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -u -r1.1.2.4 -r1.1.2.5
--- TextSerializer.java 2000/09/27 16:15:46 1.1.2.4
+++ TextSerializer.java 2000/12/08 20:40:12 1.1.2.5
@@ -19,23 +19,24 @@
/**
* @author <a href="mailto:[EMAIL PROTECTED]">Stefano Mazzocchi</a>
- * @version CVS $Revision: 1.1.2.4 $ $Date: 2000/09/27 16:15:46 $
+ * @version CVS $Revision: 1.1.2.5 $ $Date: 2000/12/08 20:40:12 $
*/
public class TextSerializer extends AbstractTextSerializer {
private SerializerFactory factory;
-
+
public TextSerializer() {
this.factory = SerializerFactory.getSerializerFactory(Method.TEXT);
}
-
+
public void setOutputStream(OutputStream out) {
try {
super.setOutputStream(out);
this.setContentHandler(this.factory.makeSerializer(out,
this.format).asContentHandler());
} catch (Exception e) {
+ log.error("TextSerializer", e);
throw new RuntimeException(e.toString());
}
- }
+ }
}
1.1.2.9 +5 -4
xml-cocoon/src/org/apache/cocoon/serialization/Attic/XMLSerializer.java
Index: XMLSerializer.java
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/serialization/Attic/XMLSerializer.java,v
retrieving revision 1.1.2.8
retrieving revision 1.1.2.9
diff -u -r1.1.2.8 -r1.1.2.9
--- XMLSerializer.java 2000/09/27 16:15:51 1.1.2.8
+++ XMLSerializer.java 2000/12/08 20:40:13 1.1.2.9
@@ -19,23 +19,24 @@
/**
* @author <a href="mailto:[EMAIL PROTECTED]">Stefano Mazzocchi</a>
- * @version CVS $Revision: 1.1.2.8 $ $Date: 2000/09/27 16:15:51 $
+ * @version CVS $Revision: 1.1.2.9 $ $Date: 2000/12/08 20:40:13 $
*/
public class XMLSerializer extends AbstractTextSerializer {
private SerializerFactory factory;
-
+
public XMLSerializer() {
this.factory = SerializerFactory.getSerializerFactory(Method.XML);
}
-
+
public void setOutputStream(OutputStream out) {
try {
super.setOutputStream(out);
this.setContentHandler(this.factory.makeSerializer(out,
this.format).asContentHandler());
} catch (Exception e) {
+ log.error("XMLSerializer", e);
throw new RuntimeException(e.toString());
}
- }
+ }
}
No revision
No revision
1.1.4.38 +2 -1
xml-cocoon/src/org/apache/cocoon/servlet/Attic/CocoonServlet.java
Index: CocoonServlet.java
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/servlet/Attic/CocoonServlet.java,v
retrieving revision 1.1.4.37
retrieving revision 1.1.4.38
diff -u -r1.1.4.37 -r1.1.4.38
--- CocoonServlet.java 2000/12/07 17:11:06 1.1.4.37
+++ CocoonServlet.java 2000/12/08 20:40:25 1.1.4.38
@@ -52,7 +52,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Stefano Mazzocchi</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Nicola Ken Barozzi</a> Aisa
* @author <a href="mailto:[EMAIL PROTECTED]">Berin Loritsch</a>
- * @version CVS $Revision: 1.1.4.37 $ $Date: 2000/12/07 17:11:06 $
+ * @version CVS $Revision: 1.1.4.38 $ $Date: 2000/12/08 20:40:25 $
*/
public class CocoonServlet extends HttpServlet {
@@ -330,6 +330,7 @@
Notifier.notify(n, req, res);
}
} catch (Exception e) {
+ log.error("Problem with servlet", e);
//res.setStatus(res.SC_INTERNAL_SERVER_ERROR);
Notification n = new Notification(this, e);
n.setType("internal-server-error");
No revision
No revision
1.1.2.15 +2 -1
xml-cocoon/src/org/apache/cocoon/sitemap/Attic/AbstractSitemap.java
Index: AbstractSitemap.java
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/sitemap/Attic/AbstractSitemap.java,v
retrieving revision 1.1.2.14
retrieving revision 1.1.2.15
diff -u -r1.1.2.14 -r1.1.2.15
--- AbstractSitemap.java 2000/11/15 19:29:42 1.1.2.14
+++ AbstractSitemap.java 2000/12/08 20:40:30 1.1.2.15
@@ -34,7 +34,7 @@
* Base class for generated <code>Sitemap</code> classes
*
* @author <a href="mailto:[EMAIL PROTECTED]">Giacomo Pati</a>
- * @version CVS $Revision: 1.1.2.14 $ $Date: 2000/11/15 19:29:42 $
+ * @version CVS $Revision: 1.1.2.15 $ $Date: 2000/12/08 20:40:30 $
*/
public abstract class AbstractSitemap implements Sitemap {
protected Logger log = LogKit.getLoggerFor("cocoon");
@@ -148,6 +148,7 @@
}
return (result.toString());
} catch (Exception e) {
+ log.error("AbstractSitemap:substitute()", e);
throw new PatternException
("error occurred during evaluation of expression \""
+expr+"\" at position "+(i+1)+"\n"
1.1.2.4 +8 -4
xml-cocoon/src/org/apache/cocoon/sitemap/Attic/DefaultComponentHolder.java
Index: DefaultComponentHolder.java
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/sitemap/Attic/DefaultComponentHolder.java,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -r1.1.2.3 -r1.1.2.4
--- DefaultComponentHolder.java 2000/10/19 14:44:18 1.1.2.3
+++ DefaultComponentHolder.java 2000/12/08 20:40:31 1.1.2.4
@@ -16,14 +16,18 @@
import org.apache.cocoon.util.ClassUtils;
-/**
- * This class holds a sitemap component which is not specially marked as
having
+import org.apache.log.Logger;
+import org.apache.log.LogKit;
+
+/**
+ * This class holds a sitemap component which is not specially marked as
having
* a spezial behaviour or treatment.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Giacomo Pati</a>
- * @version CVS $Revision: 1.1.2.3 $ $Date: 2000/10/19 14:44:18 $
+ * @version CVS $Revision: 1.1.2.4 $ $Date: 2000/12/08 20:40:31 $
*/
public class DefaultComponentHolder implements ComponentHolder {
+ protected Logger log = LogKit.getLoggerFor("cocoon");
protected String className;
protected Configuration configuration;
@@ -49,7 +53,7 @@
Component comp = (Component) ClassUtils.newInstance (this.className);
if (comp instanceof Composer) {
((Composer) comp).compose (this.manager);
- }
+ }
if (comp instanceof Configurable) {
((Configurable) comp).configure (this.configuration);
}
1.1.2.7 +2 -2
xml-cocoon/src/org/apache/cocoon/sitemap/Attic/Handler.java
Index: Handler.java
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/sitemap/Attic/Handler.java,v
retrieving revision 1.1.2.6
retrieving revision 1.1.2.7
diff -u -r1.1.2.6 -r1.1.2.7
--- Handler.java 2000/12/07 14:20:48 1.1.2.6
+++ Handler.java 2000/12/08 20:40:31 1.1.2.7
@@ -35,7 +35,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Giacomo Pati</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Stefano Mazzocchi</a>
- * @version CVS $Revision: 1.1.2.6 $ $Date: 2000/12/07 14:20:48 $
+ * @version CVS $Revision: 1.1.2.7 $ $Date: 2000/12/08 20:40:31 $
*/
public class Handler implements Runnable, Configurable, Composer, Processor {
protected Logger log = LogKit.getLoggerFor("cocoon");
@@ -161,8 +161,8 @@
if (smap instanceof Configurable) smap.configure(this.conf);
this.sitemap = smap;
} catch (Exception e) {
- this.exception = e;
log.error("Error compiling sitemap", e);
+ this.exception = e;
} finally {
this.regeneration = null;
this.environment = null;
1.1.2.4 +5 -4
xml-cocoon/src/org/apache/cocoon/sitemap/Attic/PoolableComponentHolder.java
Index: PoolableComponentHolder.java
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/sitemap/Attic/PoolableComponentHolder.java,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -r1.1.2.3 -r1.1.2.4
--- PoolableComponentHolder.java 2000/10/19 14:44:22 1.1.2.3
+++ PoolableComponentHolder.java 2000/12/08 20:40:32 1.1.2.4
@@ -22,12 +22,12 @@
import org.apache.cocoon.util.ComponentPool;
import org.apache.cocoon.Roles;
-/**
- * This class holds a sitemap component which is not specially marked as
having
+/**
+ * This class holds a sitemap component which is not specially marked as
having
* a spezial behaviour or treatment.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Giacomo Pati</a>
- * @version CVS $Revision: 1.1.2.3 $ $Date: 2000/10/19 14:44:22 $
+ * @version CVS $Revision: 1.1.2.4 $ $Date: 2000/12/08 20:40:32 $
*/
public class PoolableComponentHolder extends DefaultComponentHolder
implements ObjectFactory {
@@ -42,7 +42,7 @@
/** The <code>Pool</code> for this components */
protected Pool pool;
-
+
/** Creates a DefaultComponentHolder
* @param className The component class name
* @param configuration The </CODE>Configuration</CODE> for the component
@@ -54,6 +54,7 @@
try {
this.clazz = ClassUtils.loadClass (super.className);
} catch (Exception e) {
+ log.debug("Class is null", e);
this.clazz = null;
}
PoolController pc = (PoolController)super.manager.lookup
(Roles.POOL_CONTROLLER);
1.1.2.6 +39 -35
xml-cocoon/src/org/apache/cocoon/sitemap/Attic/XSLTFactoryLoader.java
Index: XSLTFactoryLoader.java
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/sitemap/Attic/XSLTFactoryLoader.java,v
retrieving revision 1.1.2.5
retrieving revision 1.1.2.6
diff -u -r1.1.2.5 -r1.1.2.6
--- XSLTFactoryLoader.java 2000/10/30 23:02:46 1.1.2.5
+++ XSLTFactoryLoader.java 2000/12/08 20:40:33 1.1.2.6
@@ -1,72 +1,76 @@
-/*****************************************************************************
- * Copyright (C) The Apache Software Foundation. All rights reserved.
*
- * -------------------------------------------------------------------------
*
- * This software is published under the terms of the Apache Software License
*
- * version 1.1, a copy of which has been included with this distribution in
*
- * the LICENSE file.
*
+/*****************************************************************************
+ * Copyright (C) The Apache Software Foundation. All rights reserved.
*
+ * -------------------------------------------------------------------------
*
+ * This software is published under the terms of the Apache Software License
*
+ * version 1.1, a copy of which has been included with this distribution in
*
+ * the LICENSE file.
*
*****************************************************************************/
-
-package org.apache.cocoon.sitemap;
+package org.apache.cocoon.sitemap;
+
import java.util.HashMap;
import org.apache.cocoon.CodeFactory;
import org.apache.cocoon.util.ClassUtils;
import org.w3c.dom.traversal.NodeIterator;
-
-/**
- * This class is used as a XSLT extension class. It is used by the sitemap
- * generation stylesheet to load <code>MatcherFactory</code>s or
+
+import org.apache.log.Logger;
+import org.apache.log.LogKit;
+
+/**
+ * This class is used as a XSLT extension class. It is used by the sitemap
+ * generation stylesheet to load <code>MatcherFactory</code>s or
* <code>SelectorFactory</code>s to get the generated source code.
- *
- * @author <a href="mailto:[EMAIL PROTECTED]">Giacomo Pati</a>
+ *
+ * @author <a href="mailto:[EMAIL PROTECTED]">Giacomo Pati</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Berin Loritsch</a>
- * @version CVS $Revision: 1.1.2.5 $ $Date: 2000/10/30 23:02:46 $
- */
+ * @version CVS $Revision: 1.1.2.6 $ $Date: 2000/12/08 20:40:33 $
+ */
public class XSLTFactoryLoader {
-
+ protected Logger log = LogKit.getLoggerFor("cocoon");
+
HashMap obj = new HashMap();
public String getClassSource(String className, String prefix, String
pattern, NodeIterator conf)
throws ClassNotFoundException, InstantiationException,
IllegalAccessException, Exception {
Object factory = obj.get(className);
- if (factory == null) factory = ClassUtils.newInstance(className);
- obj.put(className, factory);
-
+ if (factory == null) factory = ClassUtils.newInstance(className);
+ obj.put(className, factory);
+
if (factory instanceof CodeFactory) {
return ((CodeFactory) factory).generateClassSource(prefix,
pattern, conf);
}
-
+
throw new Exception ("Wrong class \"" + factory.getClass().getName()
+ "\". Should implement the CodeFactory
interface");
}
-
+
public String getParameterSource(String className, NodeIterator conf)
throws ClassNotFoundException, InstantiationException,
IllegalAccessException, Exception {
Object factory = obj.get(className);
- if (factory == null) factory = ClassUtils.newInstance(className);
- obj.put (className, factory);
+ if (factory == null) factory = ClassUtils.newInstance(className);
+ obj.put (className, factory);
- if (factory instanceof CodeFactory) {
- return ((CodeFactory) factory).generateParameterSource(conf);
- }
+ if (factory instanceof CodeFactory) {
+ return ((CodeFactory) factory).generateParameterSource(conf);
+ }
- throw new Exception ("Wrong class \"" + factory.getClass().getName()
- + "\". Should implement the CodeFactory
interface");
+ throw new Exception ("Wrong class \"" + factory.getClass().getName()
+ + "\". Should implement the CodeFactory interface");
}
-
+
public String getMethodSource(String className, NodeIterator conf)
- throws ClassNotFoundException, InstantiationException,
IllegalAccessException, Exception {
+ throws ClassNotFoundException, InstantiationException,
IllegalAccessException, Exception {
Object factory = obj.get(className);
- if (factory == null) factory = ClassUtils.newInstance(className);
- obj.put (className, factory);
+ if (factory == null) factory = ClassUtils.newInstance(className);
+ obj.put (className, factory);
if (factory instanceof CodeFactory) {
return ((CodeFactory) factory).generateMethodSource(conf);
}
-
+
throw new Exception ("Wrong class \"" + factory.getClass().getName()
+ "\". Should implement the CodeFactory
interface");
}
@@ -75,7 +79,7 @@
boolean result = false;
try {
result = ClassUtils.implementsInterface (className,
CodeFactory.class.getName());
- } catch (Exception e) {}
+ } catch (Exception e) {log.debug("XSLTFactoryLoader.isFactory", e);}
return result;
}
}
No revision
No revision
1.1.2.11 +15 -14
xml-cocoon/src/org/apache/cocoon/transformation/Attic/LogTransformer.java
Index: LogTransformer.java
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/transformation/Attic/LogTransformer.java,v
retrieving revision 1.1.2.10
retrieving revision 1.1.2.11
diff -u -r1.1.2.10 -r1.1.2.11
--- LogTransformer.java 2000/12/06 14:19:43 1.1.2.10
+++ LogTransformer.java 2000/12/08 20:40:40 1.1.2.11
@@ -24,8 +24,8 @@
/**
*
* The <code>LogTransformer</code> is a class that can be plugged into a
pipeline
- * to print the SAX events which passes thru this transformer in a readable
form
- * to a file.
+ * to print the SAX events which passes thru this transformer in a readable
form
+ * to a file.
* <br>
* The file will be specified in a parameter tag in the sitemap pipeline to
the
* transformer as follows:
@@ -38,14 +38,14 @@
* </code>
* </p>
*
- * Because the log file will be hardcoded into the sitemap this
LOGTransformer will
+ * Because the log file will be hardcoded into the sitemap this
LOGTransformer will
* not be thread save!!
* <br>
* This transformations main purpose is debugging.
- *
+ *
* @author <a href="mailto:[EMAIL PROTECTED]">Giacomo Pati</a>
* (PWR Organisation & Entwicklung)
- * @version CVS $Revision: 1.1.2.10 $ $Date: 2000/12/06 14:19:43 $
+ * @version CVS $Revision: 1.1.2.11 $ $Date: 2000/12/08 20:40:40 $
*
*/
public class LogTransformer extends AbstractTransformer {
@@ -54,7 +54,7 @@
private boolean canReset=true;
private String lf = System.getProperty("line.separator", "\n");
-
+
/** true if filename is valid and writeable */
private boolean isValid = true;
/** filename for log file */
@@ -67,7 +67,7 @@
/** BEGIN SitemapComponent methods **/
public void setup(EntityResolver resolver, Map objectModel,
- String source, Parameters parameters)
+ String source, Parameters parameters)
throws ProcessingException, SAXException, IOException {
if (logfile == null) {
String appends = parameters.getParameter("append", null);
@@ -81,9 +81,10 @@
// Check for null, use System.out if logfile is not
specified.
if(logfilename != null)
logfile = new FileWriter(logfilename, append );
- else
+ else
logfile = new FileWriter(java.io.FileDescriptor.out);
} catch (IOException e) {
+ log.debug("LogTransformer", e);
isValid = false;
throw e;
}
@@ -91,7 +92,7 @@
Date date = new Date();
StringBuffer logEntry = new StringBuffer();
logEntry.append ( "---------------------------- [" );
- logEntry.append ( date.toString() );
+ logEntry.append ( date.toString() );
logEntry.append ( "] ----------------------------" );
log("setup", logEntry.toString());
}
@@ -290,10 +291,10 @@
* Report to logfile.
*/
private void log (String location, String description) {
- if (isValid) {
+ if (isValid) {
StringBuffer logEntry = new StringBuffer();
logEntry.append ( "[" );
- logEntry.append ( location );
+ logEntry.append ( location );
logEntry.append ( "] " );
logEntry.append ( description );
logEntry.append ( lf );
@@ -302,17 +303,17 @@
logfile.write( logEntry.toString(), 0,
logEntry.length());
logfile.flush();
}
- catch(IOException ioe) { }
+ catch(IOException ioe) { log.debug("LogTransformer.log",
ioe); }
}
}
}
-
+
/**
* Attempt to close the log file when the class is GC'd
*/
public void destroy() {
try {
logfile.close();
- } catch (Exception e) {}
+ } catch (Exception e) {log.debug("LogTransformer.destroy()", e);}
}
}
1.1.2.14 +10 -2
xml-cocoon/src/org/apache/cocoon/transformation/Attic/SQLTransformer.java
Index: SQLTransformer.java
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/transformation/Attic/SQLTransformer.java,v
retrieving revision 1.1.2.13
retrieving revision 1.1.2.14
diff -u -r1.1.2.13 -r1.1.2.14
--- SQLTransformer.java 2000/11/30 21:42:32 1.1.2.13
+++ SQLTransformer.java 2000/12/08 20:40:42 1.1.2.14
@@ -41,7 +41,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Donald Ball</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Giacomo Pati</a>
* (PWR Organisation & Entwicklung)
- * @version CVS $Revision: 1.1.2.13 $ $Date: 2000/11/30 21:42:32 $ $Author:
bloritsch $
+ * @version CVS $Revision: 1.1.2.14 $ $Date: 2000/12/08 20:40:42 $ $Author:
bloritsch $
*/
public class SQLTransformer extends AbstractTransformer {
@@ -149,6 +149,7 @@
try {
query.execute();
} catch (SQLException e) {
+ log.debug("SQLTransformer", e);
throw new SAXException(e);
}
this.start(query.rowset_name, attr);
@@ -162,6 +163,7 @@
this.end(query.row_name);
}
} catch (SQLException e) {
+ log.debug("SQLTransformer", e);
throw new SAXException(e);
}
this.end(query.rowset_name);
@@ -273,6 +275,7 @@
level = Integer.parseInt( attributes.getValue(my_uri,
MAGIC_ANCESTOR_VALUE_LEVEL_ATTRIBUTE));
} catch (Exception e) {
+ log.debug("SQLTransformer", e);
throwIllegalStateException("Ancestor value elements must
have a "+
MAGIC_ANCESTOR_VALUE_LEVEL_ATTRIBUTE + " attribute");
}
@@ -463,7 +466,7 @@
String driver = properties.getProperty(transformer.MAGIC_DRIVER);
try {
ClassUtils.newInstance(driver);
- } catch (Exception e) {}
+ } catch (Exception e) {log.debug("SQLTransformer", e);}
if (null !=
properties.getProperty(transformer.MAGIC_DOC_ELEMENT)) {
this.rowset_name =
properties.getProperty(transformer.MAGIC_DOC_ELEMENT);
}
@@ -486,6 +489,7 @@
try {
sb.append(query.getColumnValue(av.name));
} catch (SQLException e) {
+ log.debug("SQLTransformer", e);
close();
throw e;
}
@@ -517,6 +521,7 @@
try {
return transformer.getStringValue(rs.getObject(i));
} catch (SQLException e) {
+ log.debug("SQLTransformer", e);
close();
throw e;
}
@@ -526,6 +531,7 @@
try {
return transformer.getStringValue(rs.getObject(name));
} catch (SQLException e) {
+ log.debug("SQLTransformer", e);
close();
throw e;
}
@@ -543,6 +549,7 @@
}
return true;
} catch (SQLException e) {
+ log.debug("SQLTransformer", e);
close();
throw e;
}
@@ -571,6 +578,7 @@
try {
transformer.data(getColumnValue(i));
} catch (SQLException e) {
+ log.debug("SQLTransformer", e);
close();
throw e;
}
1.1.2.13 +15 -11
xml-cocoon/src/org/apache/cocoon/transformation/Attic/XIncludeTransformer.java
Index: XIncludeTransformer.java
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/transformation/Attic/XIncludeTransformer.java,v
retrieving revision 1.1.2.12
retrieving revision 1.1.2.13
diff -u -r1.1.2.12 -r1.1.2.13
--- XIncludeTransformer.java 2000/11/14 21:52:05 1.1.2.12
+++ XIncludeTransformer.java 2000/12/08 20:40:43 1.1.2.13
@@ -48,7 +48,7 @@
* by the SAX event FSM yet.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Donald Ball</a>
- * @version CVS $Revision: 1.1.2.12 $ $Date: 2000/11/14 21:52:05 $ $Author:
dims $
+ * @version CVS $Revision: 1.1.2.13 $ $Date: 2000/12/08 20:40:43 $ $Author:
bloritsch $
*/
public class XIncludeTransformer extends AbstractTransformer implements
Composer {
@@ -91,6 +91,7 @@
base_xmlbase_uri = new URL(source);
log.debug("SOURCE URI: "+base_xmlbase_uri.toString());
} catch (MalformedURLException e) {
+ log.debug("XincludeTransformer", e);
throw new ProcessingException(e.getMessage());
}
}
@@ -106,6 +107,7 @@
try {
startXMLBaseAttribute(uri,name,value);
} catch (MalformedURLException e) {
+ log.debug("XincludeTransformer", e);
throw new SAXException(e);
}
}
@@ -115,8 +117,10 @@
try {
processXIncludeElement(href, parse);
} catch (MalformedURLException e) {
+ log.debug("XincludeTransformer", e);
throw new SAXException(e);
} catch (IOException e) {
+ log.debug("XincludeTransformer", e);
throw new SAXException(e);
}
return;
@@ -140,7 +144,7 @@
if (current_xmlbase_uri == null) {
current_xmlbase_uri = base_xmlbase_uri;
}
- } catch (MalformedURLException e) {}
+ } catch (MalformedURLException e) {log.debug("XincludeTransformer",
e);}
super.setDocumentLocator(locator);
}
@@ -208,14 +212,14 @@
}
} else if (parse.equals("xml")) {
log.debug("Parse type is XML");
- Parser parser = null;
- try {
- log.debug("Looking up " + Roles.PARSER);
+ Parser parser = null;
+ try {
+ log.debug("Looking up " + Roles.PARSER);
parser = (Parser)manager.lookup(Roles.PARSER);
- } catch (Exception e) {
- log.error("Could not find component", e);
- return;
- }
+ } catch (Exception e) {
+ log.error("Could not find component", e);
+ return;
+ }
InputSource input;
if (object instanceof Reader) {
input = new InputSource((Reader)object);
@@ -240,8 +244,8 @@
streamer.stream(list.item(i));
}
} catch (TransformerException e){
- log.error("TransformerException", e);
- return;
+ log.error("TransformerException", e);
+ return;
}
} else {
XIncludeContentHandler xinclude_handler = new
XIncludeContentHandler(super.contentHandler,super.lexicalHandler);
1.1.2.8 +9 -1
xml-cocoon/src/org/apache/cocoon/transformation/Attic/XTTransformer.java
Index: XTTransformer.java
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/transformation/Attic/XTTransformer.java,v
retrieving revision 1.1.2.7
retrieving revision 1.1.2.8
diff -u -r1.1.2.7 -r1.1.2.8
--- XTTransformer.java 2000/12/06 19:21:03 1.1.2.7
+++ XTTransformer.java 2000/12/08 20:40:44 1.1.2.8
@@ -63,11 +63,14 @@
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.ParserConfigurationException;
+import org.apache.log.Logger;
+import org.apache.log.LogKit;
+
/**
* This Transformer use the XT processor.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Sahuc Sebastien</a>
- * @version CVS $Revision: 1.1.2.7 $ $Date: 2000/12/06 19:21:03 $
+ * @version CVS $Revision: 1.1.2.8 $ $Date: 2000/12/08 20:40:44 $
*/
public class XTTransformer extends DocumentHandlerWrapper
implements Transformer, Composer {
@@ -185,6 +188,7 @@
* inner class DocumentHandler that delegates all SAX Events to the XT's
builder.
*/
class DocHandler implements DocumentHandler, DTDHandler {
+ protected Logger log = LogKit.getLoggerFor("cocoon");
/**
* The XT's DocumentHandler instance to which SAX events are forwarded
@@ -222,6 +226,7 @@
// Start processing it by passing the builder
processor.process(builder.getRootNode());
} catch (IOException ioe) {
+ log.error("XTTransformer", ioe);
throw new SAXException(ioe);
}
@@ -255,6 +260,7 @@
class XTProcessor implements Cloneable, ParameterSet, Modifiable {
+ protected Logger log = LogKit.getLoggerFor("cocoon");
private XMLProcessorEx sheetLoader;
private Parser sheetParser;
private Sheet sheet;
@@ -342,6 +348,7 @@
}
void handleXSLException(XSLException e) throws SAXException, IOException
{
+ log.error("XTTransformer", e);
String systemId = null;
int lineNumber = -1;
Node node = e.getNode();
@@ -375,6 +382,7 @@
cloned.params = (HashMap) cloned.params.clone();
return cloned;
} catch (CloneNotSupportedException e) {
+ log.error("unexpected CloneNotSupportedException", e);
throw new Error("unexpected CloneNotSupportedException");
}
}
1.1.2.26 +2 -1
xml-cocoon/src/org/apache/cocoon/transformation/Attic/XalanTransformer.java
Index: XalanTransformer.java
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/transformation/Attic/XalanTransformer.java,v
retrieving revision 1.1.2.25
retrieving revision 1.1.2.26
diff -u -r1.1.2.25 -r1.1.2.26
--- XalanTransformer.java 2000/11/30 21:42:34 1.1.2.25
+++ XalanTransformer.java 2000/12/08 20:40:45 1.1.2.26
@@ -54,7 +54,7 @@
* (Apache Software Foundation, Exoffice Technologies)
* @author <a href="mailto:[EMAIL PROTECTED]">Davanum Srinivas</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Carsten Ziegeler</a>
- * @version CVS $Revision: 1.1.2.25 $ $Date: 2000/11/30 21:42:34 $
+ * @version CVS $Revision: 1.1.2.26 $ $Date: 2000/12/08 20:40:45 $
*/
public class XalanTransformer extends ContentHandlerWrapper
implements Transformer, Composer, Poolable, Configurable {
@@ -137,6 +137,7 @@
Configuration child = conf.getChild("use-cache");
this.useCache = child.getValueAsBoolean(true);
} catch (ConfigurationException ce) {
+ log.debug("XalanTransformer", ce);
this.useCache = false;
}
}
No revision
No revision
1.1.2.8 +4 -1 xml-cocoon/src/org/apache/cocoon/util/Attic/IOUtils.java
Index: IOUtils.java
===================================================================
RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/util/Attic/IOUtils.java,v
retrieving revision 1.1.2.7
retrieving revision 1.1.2.8
diff -u -r1.1.2.7 -r1.1.2.8
--- IOUtils.java 2000/10/02 11:07:32 1.1.2.7
+++ IOUtils.java 2000/12/08 20:40:54 1.1.2.8
@@ -16,13 +16,15 @@
import java.io.ObjectInputStream;
import java.io.IOException;
+import org.apache.log.LogKit;
+
/**
* A collection of <code>File</code>, <code>URL</code> and filename
* utility methods
*
* @author <a href="mailto:[EMAIL PROTECTED]">Ricardo Rocha</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Stefano Mazzocchi</a>
- * @version CVS $Revision: 1.1.2.7 $ $Date: 2000/10/02 11:07:32 $
+ * @version CVS $Revision: 1.1.2.8 $ $Date: 2000/12/08 20:40:54 $
*/
public class IOUtils {
@@ -194,6 +196,7 @@
try {
return file.getCanonicalPath();
} catch (IOException e) {
+ LogKit.getLoggerFor("cocoon").debug("IOUtils.getFullFilename", e);
return file.getAbsolutePath();
}
}
No revision
No revision
1.1.2.3 +6 -1
xml-cocoon/src/org/apache/cocoon/xml/Attic/DocumentHandlerWrapper.java
Index: DocumentHandlerWrapper.java
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/xml/Attic/DocumentHandlerWrapper.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- DocumentHandlerWrapper.java 2000/10/13 04:18:07 1.1.2.2
+++ DocumentHandlerWrapper.java 2000/12/08 20:40:58 1.1.2.3
@@ -20,6 +20,9 @@
import org.xml.sax.SAXException;
import org.xml.sax.helpers.AttributeListImpl;
+import org.apache.log.Logger;
+import org.apache.log.LogKit;
+
/**
* This class is an utility class "wrapping" around a SAX version
1.0
* <code>DocumentHandler</code> and forwarding it those events received
throug
@@ -32,9 +35,11 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Pierpaolo Fumagalli</a>
* (Apache Software Foundation, Exoffice Technologies)
- * @version CVS $Revision: 1.1.2.2 $ $Date: 2000/10/13 04:18:07 $
+ * @version CVS $Revision: 1.1.2.3 $ $Date: 2000/12/08 20:40:58 $
*/
public class DocumentHandlerWrapper extends AbstractXMLConsumer /*implements
Recyclable*/ {
+
+ protected Logger log = LogKit.getLoggerFor("cocoon");
/** The current namespaces table. */
private NamespacesTable namespaces=new NamespacesTable();
No revision
No revision
1.1.2.2 +18 -16
xml-cocoon/src/org/apache/cocoon/xml/dom/Attic/DOMStreamer.java
Index: DOMStreamer.java
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/xml/dom/Attic/DOMStreamer.java,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- DOMStreamer.java 2000/09/05 17:25:31 1.1.2.1
+++ DOMStreamer.java 2000/12/08 20:41:03 1.1.2.2
@@ -5,7 +5,7 @@
* version 1.1, a copy of which has been included with this distribution in
*
* the LICENSE file.
*
*****************************************************************************/
-
+
package org.apache.cocoon.xml.dom;
import java.util.Vector;
@@ -37,7 +37,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Pierpaolo Fumagalli</a>
* (Apache Software Foundation, Exoffice Technologies)
- * @version CVS $Revision: 1.1.2.1 $ $Date: 2000/09/05 17:25:31 $
+ * @version CVS $Revision: 1.1.2.2 $ $Date: 2000/12/08 20:41:03 $
*/
public class DOMStreamer extends AbstractXMLProducer {
@@ -83,18 +83,19 @@
*/
public void stream(Object object)
throws SAXException {
- try {
- processNode((Node)object);
- } catch (ClassCastException e) {
- throw new SAXException(e);
- }
+ try {
+ processNode((Node)object);
+ } catch (ClassCastException e) {
+ log.error("DOMStreamer", e);
+ throw new SAXException(e);
+ }
}
-
+
/** Process a generic node */
private void processNode(Node n)
throws SAXException {
if (n==null) return;
- try {
+ try {
switch (n.getNodeType()) {
case Node.DOCUMENT_NODE:
this.setDocument((Document)n);
@@ -133,6 +134,7 @@
" class "+n.getClass().getName());
}
} catch (ClassCastException e) {
+ log.error("Error casting node to appropriate type", e);
throw new SAXException("Error casting node to appropriate type");
}
}
@@ -143,7 +145,7 @@
NodeList l=n.getChildNodes();
for(int x=0;x<l.getLength();x++) processNode(l.item(x));
}
-
+
/** Process a Document node */
private void setDocument(Document n)
throws SAXException {
@@ -151,7 +153,7 @@
this.processChildren(n);
if (super.contentHandler!=null) super.contentHandler.endDocument();
}
-
+
/** Process a DocumentType node */
private void setDocumentType(DocumentType n)
throws SAXException {
@@ -204,7 +206,7 @@
super.contentHandler.endPrefixMapping(prefix);
}
}
-
+
/** Process a Text node */
private void setText(Text n)
throws SAXException {
@@ -212,7 +214,7 @@
if (super.contentHandler!=null)
super.contentHandler.characters(data,0,data.length);
}
-
+
/** Process a CDATASection node */
private void setCDATASection(CDATASection n)
throws SAXException {
@@ -222,14 +224,14 @@
super.contentHandler.characters(data,0,data.length);
if (super.lexicalHandler!=null) super.lexicalHandler.endCDATA();
}
-
+
/** Process a ProcessingInstruction node */
private void setProcessingInstruction(ProcessingInstruction n)
throws SAXException {
if (super.contentHandler==null) return;
super.contentHandler.processingInstruction(n.getTarget(),n.getData());
}
-
+
/** Process a Comment node */
private void setComment(Comment n)
throws SAXException {
@@ -237,7 +239,7 @@
char data[]=n.getData().toCharArray();
super.lexicalHandler.comment(data,0,data.length);
}
-
+
/** Process a EntityReference node */
private void setEntityReference(EntityReference n)
throws SAXException {