Shane A Rai | 1 Dec 2004 06:10

Collection Creation Ques

Hi:
 
I need to make use of some Collection management services such as creating a Collection under the root collection, etc. I came across the service "LocalCollectionManagementService" which I believe is located in org.xmldb.api.reference.modules.*
 
However, when I import the above package, I get a compile time error saying this package does not exist.
 
Ques #1: where can I find the relevant package? Where is this jar file and what is it? Do I need to download the jar file from some other source or does it come with the eXist download?
 
 
Ques #2: this is the code that I am using to create the Collection:
 
LocalCollectionManagementService service = 
     (LocalCollectionManagementService) root_col.getService("LocalCollectionManagementService", "1.0");
     
rsc_col = service.createCollection("resources");
 
where, root_col is the root Collection here and the resources Collection i.e. rsc_col is intended to be created under the root.
 
Is this the most appropriate way to create a Collection or are there some other services?
 
 
Ques #3: Unrelated question. My Java client uses the embedded instance of the server. I am curious to know where are the documents (that are added to the server such as XML files) stored on the local machine? Also, if my client adds say an XML file during one instance, then shuts down, then re-starts, can the client have access to this XML file that was stored previously?
 
I currently use:
Database database = (Database) cl.newInstance();
Since a new instance is created, I am wondering if the files are stored in a persistent state to be retrieved later.
 
Much thanks.
 
Shane

Gmane