dynamically determine documentname

Does anyone know how to determine a document name at runtime. I would like to have a service which has a document as input and gives the document name as output.

tnx, Erwin

Trading Networks has a document type recognition facility for XML documents. It can identify the document type by looking for the presence of specific tags (typically the root tag) or specific values within specific tags.

Something similar can be done with other types of documents by searching the top of the document looking for specific elements/data.


Is there anyway to determine the (local) documentname based in the properties of the document (via a java service which has the document as an input) instead of looking for specific tags in the document?

There is also a topic ([URL]wmusers.com) where this issue is discussed and mcarlson says:

Well, you can, of course, get the local name of the document type without the namespace (folder.subfolder) qualification using just the IDataCursor.getKey() method.

How can this be done? An example would be appreciated.



No. The coupling between document and a document type is a design-time only facility managed by Developer. At run-time, IS has no knowledge of which document type a document conforms to.

Mark is referring to getting the name of the root element of an IS document, which is conceptually the same thing as querying the root tag of an XML node. If that root element/tag matches the name of the document type, then you’re part way there.

But as he mentions, there is no way to determine the fully-qualified name without making assumptions of some sort.

The IS document type is not stored in any way within an IS document so there is no other way to connect a document to a document type other than examining the contents for identifying tags/values and making assumptions.

It looks like that’s one reason why we have to fill the “documentTypeName” when we publish a document.

Correct. This has been noted in various threads.