2

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?

KellyLynch
  • 241
  • 2
  • 9
  • 30

2 Answers2

3

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.

Brendan Hannemann
  • 2,084
  • 1
  • 18
  • 33
  • Thank you.In addition I could tell: in principle it is possible to use a software that reads a file and RECOGNIZES its format by its content. Example of such software is Oracle Outside In component - it recognizes HUNDREDS of formats. But this solution is, of course, expensive one – KellyLynch Jun 28 '11 at 06:51
  • @KellyLynch yes, you could try to use another tool/library to determine the type as well (using MIME or other headers). – Brendan Hannemann Dec 14 '12 at 15:58
0

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"/>
David Pierre
  • 9,459
  • 4
  • 40
  • 32
  • Well, my question was broader - I would like to know a best solution for the problem: how to specify corresponding format when my software [automatically, without possibility to ask a user] imports lot of documents into Documentum. Yes, I have understood your answer - this is what I need. – KellyLynch Apr 06 '11 at 07:34
  • I don't see where I am suggesting asking the user. And for a more generic solution, you can read dm_format objects in the docbase... But I don't really see the point, these objects almost never change. An hardcoded mapping is just simpler. – David Pierre Apr 06 '11 at 11:51