Begin forwarded message: Date: Wed, 6 Nov 2002 11:32:20 +0100 From: "Per Nyfelt" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Subject: FW: Configuring an XML:DB database
Hi Lars, I've been trying to send this mail to the xapi list but I can't get it though. At least I do not see it showing up. Could you please forward it to the list for me? Best regards, Per -----Original Message----- From: Per Nyfelt [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 05, 2002 6:17 PM To: [EMAIL PROTECTED] Subject: Configuring an XML:DB database This did not seem to reach the list so I'm resending it... Friends, There has been some discussion on the eXist mailing list on how to configure an XML:DB database. Currently the API does not provide a very good support for this IMHO. If we could add a configure method to a Database instance that takes a DOM document as a parameter it would provide good flexibility for this. What do think about adding something like configure(org.w3c.dom.Document configuration); to the org.xmldb.api.base.Database interface? The content of this configuration document would be proprietary, i.e. it's up to each implementation to decide how to handle this. Maybe it just refers to the location of other resources or maybe it contains the actual configuration information. From what I've seen of Xindice and eXist at least, this change should fit well in with them. I do not know about other implementations though so I'm looking forward to see some feed-back on this. Maybe there are better solutions that address the same issue... Below is some snippets from the discussions on the eXist mail list that contains some more info on the reasons for this request. Best regards, Per __________________ > What about passing in a configuration org.w3c.Document and suggest to add > that to the XML:DB api? This way we could not only specify multiple db instances in one configuration file (see previous message), but also the location of the configuration file itself. Good idea. __________________ On Thursday 17 October 2002 17:03, you wrote: > While its nice to be able to configure the location of exist from the > commandline/system properties. I always find myself disliking the > restriction this usually imposes on the software. Always configuring > things from System.properties means that if I want to load from > somewhere else, or have multiple db's running under a single JVM > thread/process I'm stuck with the fact that there's only one place the > package is getting "exist.home" and its immutable. I agree with you that we should find a better solution to configure the db and improvements will be welcome. I'm just not sure how to add such a configuration facility to the xmldb API. Xindice for example defines a DatabaseInstanceManager service. The problem is that services (as far as I understand the API) are exclusively retrieved through Collection.getService(), so you need to have a valid collection object before getting access to the service. Thus a service would not be the right place to configure the db and get it up and running. Another possibility would be to add a method to the DatabaseImpl driver class to configure the db. This would be rather easy, but you will need to cast the Database object retrieved from Class.newInstance() to org.exist.xmldb.DatabaseImpl, e.g.: Class driver = Class.forName( driverName ); Database db = (Database)driver.newInstance(); if(db instanceof org.exist.xmldb.DatabaseImpl) ((org.exist.xmldb.DatabaseImpl)db).configure(confFile); DatabaseManager.registerDatabase( db ); Wolfgang -- ______________________________________________________________________ Lars Martin mailto:[EMAIL PROTECTED] SMB GmbH http://www.smb-tec.com Tel: +49-(0)341-699 46 04 Fax: +49-(0)341-699 47 04 Product Management BusinessServer BS1 ---------------------------------------------------------------------- Post a message: mailto:[EMAIL PROTECTED] Unsubscribe: mailto:[EMAIL PROTECTED] Contact administrator: mailto:[EMAIL PROTECTED] Read archived messages: http://archive.xmldb.org/ ----------------------------------------------------------------------