You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by cz...@apache.org on 2001/10/30 08:47:44 UTC

cvs commit: xml-cocoon2/src/org/apache/cocoon/generation XMLDBCollectionGenerator.java XMLDBGenerator.java

cziegeler    01/10/29 23:47:44

  Modified:    src/org/apache/cocoon/generation
                        XMLDBCollectionGenerator.java XMLDBGenerator.java
  Log:
  Major and urgent changes to XML:DB generators
  Submitted by: Gianugo Rabellino [gianugo@rabellino.it]
  
  Revision  Changes    Path
  1.5       +14 -5     xml-cocoon2/src/org/apache/cocoon/generation/XMLDBCollectionGenerator.java
  
  Index: XMLDBCollectionGenerator.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/generation/XMLDBCollectionGenerator.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- XMLDBCollectionGenerator.java	2001/10/11 07:28:21	1.4
  +++ XMLDBCollectionGenerator.java	2001/10/30 07:47:44	1.5
  @@ -23,6 +23,15 @@
   import org.xml.sax.SAXException;
   import org.xml.sax.helpers.AttributesImpl;
   
  +import org.xmldb.api.DatabaseManager;   
  +import org.xmldb.api.base.Collection;   
  +import org.xmldb.api.base.Database;   
  +import org.xmldb.api.base.ErrorCodes;   
  +import org.xmldb.api.base.Resource;   
  +import org.xmldb.api.base.Service;   
  +import org.xmldb.api.base.XMLDBException;   
  +import org.xmldb.api.modules.XMLResource; 
  +
   import java.io.IOException;
   import java.util.Map;
   
  @@ -124,14 +133,14 @@
   
         } catch (XMLDBException xde) {
   
  -        this.getLogger().warn("Unable to connect to the XML:DB database");
  +        this.getLogger().error("Unable to connect to the XML:DB database");
           throw new ProcessingException("Unable to connect to the XML DB" 
             + xde.getMessage());
   
         } catch (Exception e) {
   
  -        this.getLogger().warn("There was a problem setting up the connection");
  -        this.getLogger().warn("Make sure that your driver is available");
  +        this.getLogger().error("There was a problem setting up the connection");
  +        this.getLogger().error("Make sure that your driver is available");
           throw new ProcessingException("Problem setting up the connection: " 
             + e.getMessage());
   
  @@ -201,8 +210,8 @@
   
         } catch (NullPointerException npe) {
   
  -          this.getLogger().debug("The XML:DB driver raised an exception");
  -          this.getLogger().debug("probably the document was not found");
  +          this.getLogger().error("The XML:DB driver raised an exception");
  +          this.getLogger().error("probably the document was not found");
             throw new ProcessingException("Null pointer exception while " + 
             "retrieving document : " + npe.getMessage());
   
  
  
  
  1.5       +18 -8     xml-cocoon2/src/org/apache/cocoon/generation/XMLDBGenerator.java
  
  Index: XMLDBGenerator.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/generation/XMLDBGenerator.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- XMLDBGenerator.java	2001/10/11 07:28:21	1.4
  +++ XMLDBGenerator.java	2001/10/30 07:47:44	1.5
  @@ -22,6 +22,15 @@
   import org.apache.cocoon.environment.SourceResolver;
   import org.xml.sax.SAXException;
   
  +import org.xmldb.api.DatabaseManager;   
  +import org.xmldb.api.base.Collection;   
  +import org.xmldb.api.base.Database;   
  +import org.xmldb.api.base.ErrorCodes;   
  +import org.xmldb.api.base.Resource;   
  +import org.xmldb.api.base.Service;   
  +import org.xmldb.api.base.XMLDBException;   
  +import org.xmldb.api.modules.XMLResource; 
  +
   import java.io.IOException;
   import java.util.Map;
   
  @@ -96,7 +105,7 @@
           this.driver = conf.getChild("driver").getValue();
           this.base = conf.getChild("base").getValue();
         } else {
  -        throw new ConfigurationException("XMLDB configuration not found");
  +        throw new ConfigurationException("XML:DB configuration not found");
         }
       }
   
  @@ -115,14 +124,14 @@
   
         } catch (XMLDBException xde) {
   
  -        this.getLogger().warn("Unable to connect to the XML:DB database");
  -        throw new ProcessingException("Unable to connect to the XML DB" 
  +        this.getLogger().error("Unable to connect to the XML:DB database");
  +        throw new ProcessingException("Unable to connect to the XMLDB database" 
             + xde.getMessage());
   
         } catch (Exception e) {
   
  -        this.getLogger().warn("There was a problem setting up the connection");
  -        this.getLogger().warn("Make sure that your driver is available");
  +        this.getLogger().error("There was a problem setting up the connection");
  +        this.getLogger().error("Make sure that your driver is available");
           throw new ProcessingException("Problem setting up the connection: " 
             + e.getMessage());
   
  @@ -192,11 +201,12 @@
             xde.getMessage());
   
         } catch (NullPointerException npe) {
  +
  +          this.getLogger().error("The XML:DB driver raised an exception");
  +          this.getLogger().error("probably the document was not found");
   
  -          this.getLogger().debug("The XML:DB driver raised an exception");
  -          this.getLogger().debug("probably the document was not found");
             throw new ProcessingException("Null pointer exception while " + 
  -          "retrieving document : " + npe.getMessage());
  +            "retrieving document : " + npe.getMessage());
   
         } 
       }
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org