You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xindice-users@xml.apache.org by Frank Burough <fb...@elixirpharm.com> on 2003/01/31 20:17:13 UTC

Changing location of the database in Xindice 1.1

Hi--

Here is the question: How do you specifiy the location of the database
to Xindice1.1? I want to be able to put the database in a directory
different from the one from which the application which embeds xindice
will run. 

Is this possible? 

Thanks for your help,

Frank


Re: Changing location of the database in Xindice 1.1

Posted by "Mark J. Stang" <ma...@earthlink.net>.
> 1) How do I specify to the command-line "xindice" which directory to
use
> for "db"?
> It seems to be using $XINDICE_HOME...
>

* ---------- *
* Local Mode *
* ---------- *
To change the default root directory, you will need to create/modify
'dbroot' attribute of 'root-collection' in your own db configuration
file (you can use $XINDICE_HOME/config/system.xml as the template).

Done?  The linux command to use it will resemble:

$XINDICE_HOME/bin/xindice lc -v -l -d /my/config/dir/system.xml -c /db

win:
%XINDICE_HOME%\bin\xindice {...etc}

N.B.
- dbroot = a relative path? => path will be relative to XINDICE_HOME
- dbroot = an absolute path? (recommended!) ensure u can write to it

* 'Serv-er/let' Mode *
The 'build' db location is specified in WEB-INF/system.xml.  you may
also
use a web-engine-specific .xml config file, but you will have to write
it
yourself :-]

> 2) Same as 1, but from within my application?
> It seems to be using where I am starting the app from...
>

Again, you can override the default db location using system.xml ...

At the *moment*, it appears embedded mode will attempt to use the
db config info in the following order:

1) Xindice.PROP_XINDICE_CONFIGURATION (i.e. 'xindice.configuration')

2) if prev property not set, uses Xindice.DEFAULT_CONFIGURATION
(hard-coded ... uncanny similarity to out-of-the-box system.xml :-)

And here's a coding suggestion from
http://marc.theaimsgroup.com/?l=xindice-users&m=103407719205206&w=2
(Tankut Koray):

System.setProperty( "xindice.home", "path/to/xindice");
new Kernel("path/to/config/system.xml");

(I haven't tried last one ... let us know... 'config' *is* the
arg to _init ... but i imagine you could just as easily do
System.setProperty( "xindice.configuration",
"/where/u/put/it/system.xml");)

if you want to whip up your own config string, try cut-n-paste of
DEFAULT_CONFIGURATION string in Xindice.java ...

------------
Servlet Mode
------------
In servlet mode, setting db path only really presents a problem if
you are trying to run app as .WAR.  No joy.  You'll have to unpack
the .war and edit the server.xml in the WEB-INF dir

NOTE
Logic for determining/overriding default db path is still being
hashed out now and again on the dev list if you're interested ...



Frank Burough wrote:

> Hi--
>
> Here is the question: How do you specifiy the location of the database
> to Xindice1.1? I want to be able to put the database in a directory
> different from the one from which the application which embeds xindice
> will run.
>
> Is this possible?
>
> Thanks for your help,
>
> Frank
>

--
Mark J Stang
System Architect
Cybershop Systems