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 Brian McCallister <br...@apache.org> on 2004/02/16 02:52:30 UTC

Xindice 1.1 Embedded

I cannot seem to find any clear docs on getting Xindice embedded 
working. Can anyone provide pointers? The closest I have found is the 
Cocoon 2.1 Xindice integration docs, which are enough to tantalize me 
-- but not to accomplish anything.

Current state -- meaningless exception (no message) when i try to 
access database.

Presume I have done nothing right as I haven't found the docs, and... 
pointer to the docs?

Thanks!

-Brian



Re: Xindice 1.1 Embedded

Posted by Vadim Gritsenko <va...@reverycodes.com>.
Brian McCallister wrote:

> On Feb 15, 2004, at 10:34 PM, Vadim Gritsenko wrote:
>
>> I don't know what docs are you referring to - but Cocoon works with 
>> the Xindice out of the box. Download Cocoon, run "build", run "cocoon 
>> servlet", go to http://localhost:8888/samples/xmldb/
>
>
> Ah, but I am not using it with Cocoon ;-) Digging into how cocoon does 
> it is my next step, but finding docs is easier than tracing cocoon 
> configs down.
>
>> XML:DB docs should be enough to get started with XML:DB drivers 
>> (disclaimer: I have not read those, that's why "should"); 
>> bin\xindice.bat in Xindice CVS is enough to understand about system 
>> properties (like config location, db location), and DatabaseImpl 
>> javadoc [1] explains the rest.
>
>
> Will happily do -- once I get it all working will definitely write up 
> how I did it and put it on wiki, or as howto for cvs'd docs -- 
> whatever is most convenient.


There is new wiki at wiki.apache.org/xindice - new articles are welcome.


> Basically I want to embed it in a non-servlet app; not expose any of 
> the remote access, etc; and ideally enable it to auto-create its 
> repository (though this is probably okay to not do). Setting 
> environment variables on the command line is really not ideal, but 
> again, can be done if need be.


Starting with 1.1b4-dev, it does not need to be system properties, it 
can be driver parameters (see javadoc). See also how XMLTools use embed 
mode (switches -l, -d)

Vadim


Re: Xindice 1.1 Embedded

Posted by Upayavira <uv...@upaya.co.uk>.
Brian McCallister wrote:

> On Feb 15, 2004, at 10:34 PM, Vadim Gritsenko wrote:
>
>> I don't know what docs are you referring to - but Cocoon works with 
>> the Xindice out of the box. Download Cocoon, run "build", run "cocoon 
>> servlet", go to http://localhost:8888/samples/xmldb/
>
>
> Ah, but I am not using it with Cocoon ;-) Digging into how cocoon does 
> it is my next step, but finding docs is easier than tracing cocoon 
> configs down.

src/blocks/xmldb/java/org/apache/cocoon/components/source/impl/XMLDBSource
src/blocks/xmldb/java/org/apache/cocoon/components/source/impl/XMLDBSourceFactory 

src/blocks/xmldb/conf/xmldb.xconf

Those three should give you a pretty good idea. Basically, to use 
embedded mode, use a connection string of xmldb:xindice-embed:/// 
instead of xmldb:xindice. The rest should be pretty automatic.

Make sure that only one instance of the application is connecting to the 
database (esp for writes). Embedded mode cannot handle multiple JVMs 
accessing the DB. For that, you need to run it as a servlet (you can 
always start up an embedded Jetty app to serve multiple apps, if that is 
your need).

>> XML:DB docs should be enough to get started with XML:DB drivers 
>> (disclaimer: I have not read those, that's why "should"); 
>> bin\xindice.bat in Xindice CVS is enough to understand about system 
>> properties (like config location, db location), and DatabaseImpl 
>> javadoc [1] explains the rest.
>
> Will happily do -- once I get it all working will definitely write up 
> how I did it and put it on wiki, or as howto for cvs'd docs -- 
> whatever is most convenient.

Great.

> Basically I want to embed it in a non-servlet app; not expose any of 
> the remote access, etc; and ideally enable it to auto-create its 
> repository (though this is probably okay to not do). Setting 
> environment variables on the command line is really not ideal, but 
> again, can be done if need be. 

Not needed. System.setProperty(...,...) before initialising your DB is 
enough. Alternatively, Vadim provided a way around doing this recently, 
but can't remember it right now.

> Will dig around more tomorrow. Sleepy =)

Hope you slept well.

> -Bran

Seems that you needed that sleep ;-)

Regards, Upayavira



Re: Xindice 1.1 Embedded

Posted by Brian McCallister <br...@apache.org>.
On Feb 15, 2004, at 10:34 PM, Vadim Gritsenko wrote:

> I don't know what docs are you referring to - but Cocoon works with 
> the Xindice out of the box. Download Cocoon, run "build", run "cocoon 
> servlet", go to http://localhost:8888/samples/xmldb/

Ah, but I am not using it with Cocoon ;-) Digging into how cocoon does 
it is my next step, but finding docs is easier than tracing cocoon 
configs down.

> XML:DB docs should be enough to get started with XML:DB drivers 
> (disclaimer: I have not read those, that's why "should"); 
> bin\xindice.bat in Xindice CVS is enough to understand about system 
> properties (like config location, db location), and DatabaseImpl 
> javadoc [1] explains the rest.

Will happily do -- once I get it all working will definitely write up 
how I did it and put it on wiki, or as howto for cvs'd docs -- whatever 
is most convenient.

Basically I want to embed it in a non-servlet app; not expose any of 
the remote access, etc; and ideally enable it to auto-create its 
repository (though this is probably okay to not do). Setting 
environment variables on the command line is really not ideal, but 
again, can be done if need be.

Will dig around more tomorrow. Sleepy =)

-Bran



Re: Xindice 1.1 Embedded

Posted by Vadim Gritsenko <va...@reverycodes.com>.
Brian McCallister wrote:

> I cannot seem to find any clear docs on getting Xindice embedded 
> working. Can anyone provide pointers? The closest I have found is the 
> Cocoon 2.1 Xindice integration docs, which are enough to tantalize me 
> -- but not to accomplish anything.


I don't know what docs are you referring to - but Cocoon works with the 
Xindice out of the box. Download Cocoon, run "build", run "cocoon 
servlet", go to http://localhost:8888/samples/xmldb/


> Current state -- meaningless exception (no message) when i try to 
> access database.
>
> Presume I have done nothing right as I haven't found the docs, and... 
> pointer to the docs?


XML:DB docs should be enough to get started with XML:DB drivers 
(disclaimer: I have not read those, that's why "should"); 
bin\xindice.bat in Xindice CVS is enough to understand about system 
properties (like config location, db location), and DatabaseImpl javadoc 
[1] explains the rest.

If you think that Javadoc missing something, just fill in the holes and 
send patch to the list.

Thanks,
Vadim

[1] 
http://cvs.apache.org/viewcvs.cgi/xml-xindice/java/src/org/apache/xindice/client/xmldb/embed/DatabaseImpl.java?rev=1.25&view=auto