Finding an Object’s Content File

Everyone knows that Documentum (in its default state) stores content on the file system and retains a pointer to the content in its database.  Likely, you have navigated the file store on the Content Server and discovered directories like ../data/docbase/content_storage_01/000001/80/00/23.  How in the world does this directory structure relate back to a particular object?

Documentum uses several objects to hold persistence information about content; we will use five of them to determine where the content for an object with r_object_id = '0900000180023d07' resides:  dmr_content, dm_format, dm_filestore, dm_docbase_config, and dm_location.  The following query will get us all the information we need to assemble the path to the object’s content.

select data_ticket, dos_extension, file_system_path, r_docbase_id from dmr_content c, dm_format f, dm_filestore fs, dm_location l, dm_docbase_config dc where any c.parent_id = ‘0900000180023d07’ and f.r_object_id = c.format and fs.r_object_id = c.storage_id and l.object_name = fs.root

Result

data_ticket = -2147474649
dos_extension = txt
file_system_path = C:/Documentum/data/docbase/content_storage_01
r_docbase_id = 1

The trick to determining the path to the content is in decoding the data_ticket's 2’s complement decimal value.  Convert the data_ticket to a 2’s compliment hexadecimal number by first adding 2^32 to the number and then converting it to hex.  You can use a scientific calculator to do this or grab some Java code off the net.

-2147474649 + 2^32 = (-2147474649 + 4294967296) = 2147492647

converting 2147492647 to hex = 80002327

Now, split the hex value of the data_ticket at every two characters, append it to file_system_path and docbase_id (padded to 8 bits), and add the dos_extension.  Viola! you have the complete path to the content file.

C:/Documentum/data/docbase/content_storage_01/0000001/80/ 00/23/27.txt

I think this is a really clever way to manage the creation and assignment of directories and filenames, don’t you?  In addition, this scheme guarantees that there is never more than 256 files in a single directory, increasing optimization.

You can do it in reverse also. Say you have file with this path: /80/00/20/23.txt. What is its r_object_id?

converting 80002023 to decimal = 2147491875
subtract 2^32: 2147491875 – 4294967296 = -2147475421

select r_object_id, object_name from dm_sysobject s, dmr_content c where any c.parent_id = s.r_object_id and c.data_ticket = -2147475421.0

Note:  You must append “.0” to the data_ticket value to force DQL to process the variable as a floating point number, otherwise you get an integer overflow error.

Of course, you can always use the GET_FILE administrative method to find an object’s content’s file path.  Just remember, that the content ID it is asking for is the r_object_id for the dmr_content object.

Advertisements

About Scott
I have been implementing Documentum solutions since 1997. In 2005, I published a book about developing Documentum solutions for the Documentum Desktop Client (ISBN 0595339689). In 2010, I began this blog as a record of interesting and (hopefully) helpful bits of information related to Documentum, and as a creative outlet.

8 Responses to Finding an Object’s Content File

  1. doquent says:

    Scott,

    This post made me smile. I recalled the Aha moment, when I had first sorted this out. So thanks for posting it; I am sure many readers will enjoy it and benefit from it.

    The content persistence explanation in the book “Documentum 6.5 Content Management Foundations” provides illustrated details of the same concepts, in a paragraph that starts with “What is the exact physical location of the primary content file?”

    Further, the section starts with this note:

    “Documentum provides multiple options for locating the content file. DFC provides the getPath() method and DQL provides get_file_url administration method for this purpose. This section has been included to satisfy the reader’s curiosity about content persistence and works through the information manually. This discussion can be treated as supplementary to technical fundamentals.”

    I just couldn’t leave this stuff out 🙂

    Thanks,
    Pawan

    Like

  2. Pingback: Finding an Object’s Content File in Documentum | Armedia Blog

  3. Kenneth says:

    Already 2013, this post still make people like me smile 🙂
    I am doing some storage migration task. But some files is missing on the storage, i have to find the r_object_id…. This is great, I have been working on DCTM for few years but never know about this… always use api to retrieve the path. Thanks!!

    Like

  4. Reblogged this on dump dm_documentum and commented:
    Finding an Object’s Content File

    Like

  5. Pingback: Locating an Object’s Content in the Filestore | axelhawker.com

  6. Pingback: Find Content File Spreadsheet | dm_misc: Miscellaneous Documentum Information

  7. Prithu says:

    Scott,

    I can’t help but refresh Kenneth words, but just changing the year..
    In 2015, yet same old post makes people like me and Kenneth smile..

    Great work!

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: