I am developing a DFS application (оn С#) that imports a document into Documentum as dm_document. A document may be in any format – DOC, DOC, PDF, whatever. Thus, when I create a document, I have to specify corresponding format (it will be put into a_content_type): “gif”, “msw8” etc.
How can I solve this task? I have looked through DFS_66_reference.pdf and DFS-SDK Help – do not see simple solution yet. Can you give me an advice?
I usually do what David suggests for common formats that I am expecting to encounter. This has the added benefit of giving you a reference to look at while debugging your application. For other formats, you can make the following query.
DQL:
SELECT name from dm_format WHERE dos_extension = lower('<extension>')
Note that this is not always reliable, because it could return multiple results for an extension (XLS is a good example), so you should decide how to handle multiple results. You may have to ask the user in that case.
I would recommend caching the responses in your application so you are not making this query needlessly. As David said above, these values do not change unless you change them.