I noticed that you are getting the root collection with ...
col =
DatabaseManager.getCollection("xmldb:xindice-embed/" +
collectionName + "/");
If I am not mistaken, all collections have to live under the root collection
("db" by default), so you have to modify your call to getCollection...
col =
DatabaseManager.getCollection("xmldb:xindice-embed///db/" +
collectionName + "/");
(Assuming that you have created the collection "test" before and your goal
is to create the child collection "subtest" with this code.)
Hope this helps.
Scott
-----Original Message-----
From: _| |_| |_ ][ /-\ |\| [mailto:[EMAIL PROTECTED]
Sent: Wednesday, April 16, 2003 5:54 PM
To: xindice
Subject: NEED HELP URGENT!!
HI,
My project with xindice is about to flatline if I
cannot get past this hurdle, so any help would be
appreciated.
I am using Xindice1.1b and have a GUI that allows
users to move documents betweens collections. If they
want, they can make new collections. The only problem
is that when the new collection is made in the GUI, it
appears in the GUI list of collections, but the
Xindice command line tool does not show it. So when I
restart Tomcat, the collection is no longer in the GUI
or the command line. Also, when I create the
collection via the command line tool, it is not in the
GUI as a collection until I restart Tomcat. Finally,
if I recreate the deleted collection, the original
documents are there rather than having been deleted
with the collection.
I am using jdk1.4.1, red hat 8, xindice 1.1b (CVS
build from 4/11), tomcat 4.1.12LE and cocoon 2.1.
Cocoon is using the xindice-embed pseudo protocol to
access xindice which I configured in cocoon.xconf:
<cocoonxconf:snippet>
<!-- xmldb pseudo protocol -->
<component-instance
class="org.apache.cocoon.components.source.impl.SourceFactoryWrapper"
name="xmldb">
<source-factory
class="org.apache.cocoon.components.source.XMLDBSourceFactory">
<!-- Xindice driver -->
<driver
class="org.apache.xindice.client.xmldb.DatabaseImpl"
type="xindice-embed"/>
<!-- Add here other XML:DB compliant
databases drivers -->
</source-factory>
</component-instance>
</cocoonxconf:snippet>
<sitemap:snippet>
<map:generate src="xmldb:xindice-embed:///db/...
</sitemap:snippet>
and I have a xmldb helper class to create
collections. This also uses xmldb:xindice-embeded
as the root when trying to get the appropriate
collection service. I am confident that there is only
one xindice on my computer and one db location. This
is how I create the collection:
<snippet>
String collectionName = "test";//norm dynamic
String name = "subtest";//norm dynamic
Collection col = null;
col =
DatabaseManager.getCollection("xmldb:xindice-embed/" +
collectionName + "/");
CollectionManager service =
(CollectionManager)
col.getService("CollectionManager", "1.0");
service = (CollectionManager)
col.getService("CollectionManager", "1.0");
Document doc = new DocumentImpl();
Element colEle =
doc.createElement("collection");
colEle.setAttribute("compressed", "true");
colEle.setAttribute("name", name);
doc.appendChild(colEle);
Element filEle =
doc.createElement("filer");
filEle.setAttribute("class",
"org.apache.xindice.core.filer.BTreeFiler");
colEle.appendChild(filEle);
service.createCollection(name, doc);
</snippet>
Lastly, when I do a grep -Rl {newCollectionName}
{dbLocation} the collection is found at
/xindice/db/system/SysSymbols/SysSymbols.tbl and there
are folders and *.tbl files under the db root path.
I have seen others with this problem in the list, but
unfortunately it does not seem to have been solved. I
have also tried running xindice as a servlet in tomcat
and without starting it all. I am hoping I have
provided enough info here.
Thanks All,
Julian
=====
Live simply so others may simply live.
�
-Ghandi
�
Pluralitas non est ponenda sine neccesitate.
"Entities should not be multiplied unneccesarily"
�
-William of Occam
__________________________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo
http://search.yahoo.com
------------------------------------------------------------------------------
Notice: This e-mail message, together with any attachments, contains
information of Merck & Co., Inc. (Whitehouse Station, New Jersey, USA) that may
be confidential, proprietary copyrighted and/or legally privileged, and is
intended solely for the use of the individual or entity named on this message.
If you are not the intended recipient, and have received this message in error,
please immediately return this by e-mail and then delete it.
==============================================================================