Collection

Could someone please tell me how can I find out whether a collection name using API for Java is already available in the tamino database or not

Thank you

Package: com.softwareag.tamino.db.API.accessor

Interfaces: TSchemaDefinition3Accessor

Method: getCollectionNames()
Gets an iterator for the list of all collection names referenced by TSD2 schemas.

can any one tell me how can i create a collection using tamino API dynamically

Hi Nagesh,
You can use code like this to define a schema. If the schema definition contains a new Collection name, the new Collection will be defined in Tamino.

TConnectionFactory connectionFactory = TConnectionFactory.getInstance();
connection = connectionFactory.newConnection( databaseURI );
accessor = connection.newSchemaDefinition3Accessor(TDOMObjectModel.getInstance());
//content is a String containing your new Schema, perhaps read from a file...
xmlObject = TXMLObject.newInstance(content); 
TResponse response = accessor.define(xmlObject);
System.out.println("Response: " + response.getReturnValue()); 


HTH

Hi Bill,

Thank you very much for the help, i have tried and it worked fine.

I have one more doubt regarding API, i can get document (xml instance in tamino collection) properties (i.e., last modified) using TResponse.getFirstXMLObject().getLastModified()
So my question is can i add new properties (user defined) and get them using API.

Thanks in Advance.
Nagesh

Hi all,

Is it possible to create a collection with in a tamino collection? if so, how will i use tamino API to get sub-collection information?

Thanks in Advance,
Nagesh.

Hello Nagesh,
Tamino has a flat collection model.
You cannot nest collections.

Best regards
Walter

Regarding API, i can get document properties (i.e., last modified) using TResponse.getFirstXMLObject().getLastModified()

So my question is can i add new properties (user defined) and get them using API. If so how?

Hi Nagesh,

Basically, there is no provision known so far in Tamino to define “user defined” properties.

Rahul Roy

Tamino API for Java
Software AG (INDIA)