问题
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?
回答1:
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.
回答2:
Are you asking how to match the dos extension to Documentum format ?
If yes, the simplest is to simply hardcode the mapping directly in your application.
In Webtop file wdk/app.xml there is the mapping it uses.
Here is what I have in mine :
<format extension="txt" name="crtext"/> <format extension="xls" name="excel8book"/> <format extension="doc" name="msw8"/> <format extension="ppt" name="ppt8"/> <format extension="vsd" name="vsd"/> <format extension="zip" name="zip"/> <format extension="wpd" name="wp8"/> <format extension="psd" name="photoshop6"/> <format extension="au" name="audio"/> <format extension="jpeg" name="jpeg"/> <format extension="jpg" name="jpeg"/> <format extension="html" name="html"/> <format extension="htm" name="html"/> <format extension="ai" name="illustrator10"/>
来源:https://stackoverflow.com/questions/5535446/how-to-fill-format-a-content-type-while-creating-a-document-in-dfs