You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xindice-dev@xml.apache.org by Kevin Ross <Ke...@iVerticalLeap.com> on 2003/07/17 17:42:51 UTC

RE: [PATCH][APPLIED] XTools adds user.dir to absolute paths

This patch was quite simple, and should not break existing code.  I saw
no reason not to apply it. 

Thanks Vadim.

Now, how about that ' XINDICE_HOME catch 22' patch?  ;)

-Kevin Ross

-----Original Message-----
From: news [mailto:news@main.gmane.org] On Behalf Of Vadim Gritsenko
Sent: Wednesday, July 16, 2003 10:41 PM
To: xindice-dev@xml.apache.org
Subject: Re: [PATCH] XTools adds user.dir to absolute paths

Can somebody apply the patch?

Also, any comment from any committer on user.dir?

Thanks,
Vadim



Vadim Gritsenko wrote:
> Hi guys,
> 
> One more issue when trying to use embedded driver from command line 
> tool. It always tries to prepend user.dir to the path to the
config.xml 
> file. When path to the config.xml is absolute this is becoming ugly.
> 
> Propsed patch - check for absolute paths. Hope it gets applied.
> 
> PS I don't know why user.dir is appended in the first place; I would 
> remove this completely.
> 
> Vadim


[PATCH] Fix collection initialization order, was: XTools adds user.dir to absolute paths

Posted by Vadim Gritsenko <va...@verizon.net>.
Vadim Gritsenko wrote:

> Kevin Ross wrote:
>
>> Now, how about that ' XINDICE_HOME catch 22' patch?  ;)
>

Almost ready! There is one issue though. There were some recent changes 
in the CollectionManager and I feel that those broke something. Change 
I'm talking about is here, on the last page:
  
http://cvs.apache.org/viewcvs.cgi/xml-xindice/java/src/org/apache/xindice/core/CollectionManager.java.diff?r1=1.10&r2=1.11&diff_format=h

With this change, during initialization of the 'system' (and 'meta') 
collection, col.setConfig(cfg) for nested collections (like SysConfig, 
SysSymbols) is being called way before collection sets its own root via 
setCollectionRoot() in Collection.setConfig() method, around line 1358.

The result of such behavior is not pretty. Here is resulting directory 
structure:

$HOME
$HOME/bin
$HOME/bin/Metas
$HOME/bin/Metas/Metas.tbl
$HOME/bin/SysConfig/SysConfig.tbl
$HOME/bin/SysSymbols/SysSymbols.tbl
$HOME/db
$HOME/db/meta
$HOME/db/system
...

Result was achived by doing: "xindice lc -l -c /db -d 
..\config\system.xml" in the $HOME/bin directory.

Patch is quite simple and attached. Once applied, I'll send next patch - 
for catch 22 problem :)

Vadim


Re: [PATCH][APPLIED] XTools adds user.dir to absolute paths

Posted by Vadim Gritsenko <va...@verizon.net>.
Vadim Gritsenko wrote:

> Kevin Ross wrote:
>
>> Now, how about that ' XINDICE_HOME catch 22' patch?  ;)
>

Ok, here it is. In short: I found out that XINDICE_DB_HOME is already 
defined in the Xindice.java and (almost) used in XindiceServlet. 
Behavior is that XINDICE_DB_HOME is optional, and when present, it 
overrides other preferences:
 - XindiceServlet prefers /WEB-INF directory as default location.
 - Embedded database impl prefers directory of the system.xml file as 
default location.

All this happens only when system.xml contains relative path. Once this 
patch is applied, following is possible:

set xindice_home=<xindice cvs checkout>
set xindice_db_home=<any dir>
cd %xindice_home%\bin
xindice lc -l -c /db -d ..\config\system.xml

Patch attached.

PS There is still place for improvement... Does it make sense to allow 
initializing DB with arbitrary system.xml file?

PPS PROP_CMD_HOME was not used anywhere. xmlRpcDriver and 
getXmlRpcDriver() too. So I took the liberty of removing them.

Vadim


Re: [PATCH][APPLIED] XTools adds user.dir to absolute paths

Posted by Vadim Gritsenko <va...@verizon.net>.
Kevin Ross wrote:

>This patch was quite simple, and should not break existing code.  I saw
>no reason not to apply it.
>

Thanks, Kevin.


>Now, how about that ' XINDICE_HOME catch 22' patch?  ;)
>

I'm back from vacation and (as usual, if time permits) will revisit this 
thread and come up with a patch.

Vadim