Hi,
I was trying to write an document to an eXist database using the WritingSourceTransformer when I figure out that the user and password defined in cocoon.xconf at:
<component-instance class="org.apache.cocoon.components.source.impl.XMLDBSourceFactory" name="xmldb">
<driver class="org.exist.xmldb.DatabaseImpl" type="exist" user="user" password="password"/>
</component-instance>
were not used.
In the methods writeOutputStream() and delete() of XMLDBSource.java file of the xmldb cocoon block. the call to :
DatabaseManager.getCollection(base);
is used instead of :
DatabaseManager.getCollection(base, user, password) ;
Is there a reason for that ? if not, I've made a little patch (attached to this mail) against the last version of this file from the cocoon-2.1 module of the CVS.
need I fill a bug report too ?
Regards,
-- Gildas
Index: XMLDBSource.java
===================================================================
RCS file:
/home/cvspublic/cocoon-2.1/src/blocks/xmldb/java/org/apache/cocoon/components/source/impl/XMLDBSource.java,v
retrieving revision 1.17
diff -u -r1.17 XMLDBSource.java
--- XMLDBSource.java 16 May 2004 16:13:25 -0000 1.17
+++ XMLDBSource.java 8 Jun 2004 13:53:15 -0000
@@ -493,7 +493,7 @@
base = this.url.substring(0, this.url.lastIndexOf("/"));
name = this.url.substring(this.url.lastIndexOf("/")+1);
}
- Collection collection = DatabaseManager.getCollection(base);
+ Collection collection = DatabaseManager.getCollection(base, user,
password);
if (name.equals("")) {
name = collection.createId();
@@ -526,7 +526,7 @@
base = k.substring(0, k.lastIndexOf("/"));
name = k.substring(k.lastIndexOf("/")+1);
- Collection collection = DatabaseManager.getCollection(base);
+ Collection collection = DatabaseManager.getCollection(base, user,
password);
CollectionManagementService service =
(CollectionManagementService)
collection.getService("CollectionManagementService", "1.0");
@@ -541,7 +541,7 @@
base = this.url.substring(0, this.url.lastIndexOf("/"));
name = this.url.substring(this.url.lastIndexOf("/")+1);
- Collection collection = DatabaseManager.getCollection(base);
+ Collection collection = DatabaseManager.getCollection(base, user,
password);
Resource resource = collection.getResource(name);
if (resource == null) {
