Collection doctype list

Hello!

If you have two or more doctypes/collection, is there possible to get a list with their names using the TaminoAPI4J?

Maybe using an accessor object because the accessor is created on a collection, so should have access to the whole collection.

Thank you.

You could query the ino:collection collection looking for xs:schema documents.
e.g. …/tamino/ino:collection?_xql=xs:schema//tsd:schemaInfo
and extract the values of tsd:collection/@name and tsd:doctype/@name

Hope this helps.

Stuart Fyffe-Collins
Software AG (UK) Ltd.

Hello!

In addition to Stuart’s suggestion, there is an Accessor in the Tamino API for Java called “TSchemaDefinition3Accessor”. (One can be instantiated from a TConnection object using the newSchemaDefinition3Accessor method.)

The TSchemaDefinition3Accessor has the following two methods:

   public java.util.Iterator getSchemaNames(java.lang.String collection)
   public java.util.Iterator getDoctypeNames(java.lang.String collection,
                                             java.lang.String schema)


One or both of these methods will probably be helpful. For example: the Iterator returned from getSchemaNames() contains String objects, the values of which are the names of the schemas.
(So there is no need to handle any DOM objects - just Java Strings.)

Greetings,
Trevor.

I understand that is posible to use TS2 schemas also with Tamino v3.x.
I guess I won’t be able to use the TSchemaDefinition3Accessor with thoose schemas.

But I see that in the javadoc that I have a TSchemaDefinition2Accessor.
So my problem is reduced now only at how to detect which schema TS2 or TS3 is used! Can I?