Using collections to organize a docbase
How to create collections. How to store and retrieve documents in collections.
IxiaDocBaseServices docbase = // ...
Documents stored in document bases are kept in the repository, in which they can be grouped and organized hierarchically, in a tree-like structure, as they would be in a Windows or Linux file system.
Each node of the tree is called a collection. Collections are containers for documents and other collections.
The root collection is the repository itself: the repository can contain collections and documents that are not in collections.
In TEXTML Console (a management application delivered as part of TEXTML Server), collections are displayed graphically much like the directories (folders) in the Windows file system.
To create collections in a document base:
You can easily modify sample program SetDocuments to add documents to a specified collection in the specified docbase:
ProgramFiles\IxiaSoft\TextmlServer45\...\SetDocuments.Java
To use sample program GetDocument to get a document that is in a collection, you do not need to change the program. When you run GetDocument, specify the collection path as part of the document name:
getdocument user=domain\user password=yourpass docbase=test server=localhost «
path=c:\Temp\ docname=news/entertainment/film/review1001.xml
Do not confuse the directory path of document files on disk with the collection path of documents in a docbase. In the above command:
docname=news/entertainment/film/review1001.xml
is the collection path and document name of a document in docbasetest
.path=c:\Temp\
is the location on disk where the document will be saved. (The separator is a backslash ("/
") because the file system, in this example, is Windows. For Linux, use a forward slash ("/
") as you would normally.)