PREFACE TO ALL: I have tried to answer some of Mark's questions
but I would appreciate corrections/clarifications for anything that I have
gotten wrong.
=========================================
On Mon, 23 Dec 2002, Mark J. Stang wrote:
> All,
> I am updating from the old 1.0/1.1 version to the CVS version and have a
> few questions.
>
First, for a summary of 1.1. changes, I would point you to the
$XINDICE_HOME/README (just the v1.1 section). I think the only
critical thing that it fails to mention is the change in internal db format.
----------
Conversion
----------
if you want to upgrade an old Xindice db from 1.0,
then you need to export the 1.0 documents (using 1.0 Xindice) and
read them back into Xindice 1.1x. There are some e-mails about this
on the ml... the internal db structure changed ...
Xindice commands to accomplish the last bit are in the guides.
> 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 ...
> 3) The logging is nice, how do I turn it off? Both internally and from
> the command line.
>
sure u want to do this...?
TO *SUPPRESS ALL* LOG MSGS:
kluge-1: you could pipe stdout/stderr to 'dev/null' (win equiv = 'nul')
kguge-2: (servlet) you could try pointing logger entries to dev/null
TO CHANGE LOG LEVEL (pls-research):
build.xml - chg jvmarg for org.apache.commons.logging.simplelog.defaultlog
to 'fatal' ('fatal' appears to be the mimimal log level available ..)
runtime - set arg with -D switch
(for example, look at the last 6-8 lines of $XINDICE_HOME/bin/xindice
script. Try changing LOGLEVEL from 'debug' to 'fatal')
> 4) What is the -d option for and where is a sample file?
>
a) at the moment, this is self-documented in cmd help & readme
b) -d switch specifies db config file name
c) *always* used in conjunction w -l switch (shouldn't one of
these switches be eliminated, since -d only works in local mode?)
d) consider 'system.xml' (in config subdir) to be the sample file ...
> 5) All the examples in the online help, which looks great, expect the
> user to be using XML-RPC or something
> other than Embedded.
>
touche'
pls. see previous threads.
pls. help :-)
> 6) It appears that we are using the System.getProperty(). Which is
> fine, what are the valid values?
>
can you be more specific?
> I have my test programs(embedded) creating collections and documents,
> etc, however they are ending up
> in my home dir. Fine, but when I run "xindice lc -l -c /db", it is
> using $XINDICE_HOME.
>
short answer (if you just want to access your new db):
1) create/edit /your/config/dir/system.xml file with dbroot =
'/your/home/dir/db'
2) add the '-d /your/config/dir/system.xml' switch to your command line
long answer (re-configure your existing project):
pls see earlier note about embedded drvr logic for determining
default dbroot path
> All of this is running on Redhat and 1.3.1.
>
> Thanks!
>
> Mark
>
> --
> Mark J Stang
> System Architect
> Cybershop Systems
>
>
...hopefully there will be some doc added to the 'how-tos' before
long (i'm working on misc newbie dox, but i can't say that they'll
finally make it to theatres near u:-) i'm sure any dox you contribute
will be *very* much appreciated
hey. Xindice's birthday is history. how 'bout a FAQ page?
happy holidays!
j