Kai Woerner wrote:
Thanks for the numerous answers!
OK, CORBA is not in 1.1 anymore, I have to use org.apache.xindice.client.xmldb.xmlrpc.DatabaseImpl in my Java, so that something like...
<CODE>
import org.xmldb.api.DatabaseManager; import org.xmldb.api.base.Collection; import org.xmldb.api.base.Database; import org.xmldb.api.modules.CollectionManagementService;
public class CreateCollection {
public final static String URI = "xmldb:xindice://localhost:8080/";
(...)
String driver = "org.apache.xindice.client.xmldb.xmlrpc.DatabaseImpl";
Class cl = Class.forName(driver);
Database database = (Database) cl.newInstance();
DatabaseManager.registerDatabase(database);
Collection root = DatabaseManager.getCollection(URI + "/db");
CollectionManagementService mgtService =(CollectionManagementService) root.getService("CollectionManagementService", "1.0");
Collection col = mgtService.createCollection("acollection");
(...)
</CODE> ...should work.
Since I don't seem to get _anything_ to work, could someone paste me some code that creates a collection in Xindice 1.1 under tomcat? Very, very simple, no bells & whistles, just create a collection under the root element. That would probably help a lot, since I now guess my problem might as well lie elsewhere.
Take a look at the test suite. Work like this:
1) cvs checkout xml-xindice 2) build 3) xindice start 4) build test
Test suite has lots of functionality, including creation and deletion of numerous collections. It does this for xmlrpc, embed, and managed drivers.
Vadim