Sylvain Wallez wrote:
Vadim Gritsenko wrote:
<snip/>
Ehm, we not only start the hsqldb but also an xindice now? Puh! Now, I think the source factory is wrong place because the db could run on a different host/different jvm. So perhaps an on xindice server component that gets this configuration?
I'm totally unaware of how xmldb works, but isn't there an equivalent as JDBC's DriverManager.getConnection(String, Properties) where the properties parameter could hold db-specific configurations?
Hmmm... There is setProperty() on Database... I guess I'll have to make use of it...
So we can envision these properties to be fetched from the SourceFactory configuration in cocoon.xconf.
That's good idea. But I'm lost at how to construct the value for the property. It can not be relative... because current working directory is not known. And it can not be absolute. And there is no any dynamically expandable token which would point to, say, context root... Suggestions?
[Note that currently o.a.xindice.client.embed.DatabaseImpl only gets the property from system properties. It would need to check for a value in its member 'config' before checking for a system property for setProperties to work.]
The path is relative to the servlet container context rather than the cocoon context.
How do you change the current directory within Java? Couldn't we change the current directory to Cocoon's context before instantiating the Database object? Then we can have a Xindice config file in WEB-INF, and that points to a DB file wherever we want within Cocoon's context.
Thoughts?
Upayavira
