Feeds:
Posts
Comments

Posts Tagged ‘GET_PATH’

We are working on a demo application and we had a need to retrieve the comments on an activity in a workflow. Today morning one of my colleagues approached me regarding the same. I was not of much help to her. Few hours later she figured out that the comments were to be retrieved from the package (dmi_package). I was disappointed because I realized that I knew it but it was lost somewhere in my mind. I decided to once again explore the comments in a workflow.

I remember that the comments are stored as objects of type dm_note. I fired a simple select query on my docbase for retrieving all the objects of type dm_note.

SELECT * FROM dm_note

While scrolling through the result, I noticed that the column for a_content_type was displaying the value ‘crtext’ for all the results. The content type ‘crtext’ is used for the txt/notepad documents and I recalled immediately that the comments are stored in the file store as txt files.
Thus, in a way dm_note is similar to dm_document. I was eager to check the supertype of dm_note. I used the following query for the same.

SELECT super_name FROM dm_type WHERE name = 'dm_note'

The result was dm_sysobject. I was on the right track. Even the txt file for dm_note should be stored as dmr_content. I was happy to find that the i_contents_id of a dm_note object was of the format ’06XXXXXXXXXXXXXX’. I used the same query to get the content file path on the file system which I have mentioned in my earlier post regarding dmr_content.

EXECUTE GET_PATH FOR '06XXXXXXXXXXXXXX'

I got the following file path as a result:
D:\Documentum\data\TrainingBase\content_storage_010000065\800\60\3c.txt

I navigated to the mentioned file path on my file store and as expected 3c.txt had the comments that were entered in the workflow task.

As I knew that the attached documents in a workflow are actually linked to the package which in turn is linked to workflow, it was quiet logical that even the comments (the dm_note objects) are linked to the package. I found that the dmi_package has an attribute called r_note_id and it was repeating. This is the attribute which links the comments with the package. I checked the Object Relation diagram to confirm it.

dm_note

dm_note

I was correct in saying that the comments are linked to package much in a similar way as attached documents are linked to it.

I realize that I have left a gap regarding the linkage of documents in a workflow (package) and workflow in general. I will try to bridge it in my next post.

Advertisements

Read Full Post »

Where are the documents (contents) stored in repository? Is it possible to find the documents by navigating to them in the file system? The question has been bothering me for quiet some time. I have heard lot many answers regarding this but I was never convinced. Till few weeks ago, in my earlier organization I was loaded with so much of work that I could never explore it myself.

Couple of weeks ago in an interview one of my colleagues asked the candidate about dmr_content. Later when I asked him he told me that the contents of renditions are stored as dmr_content. In an another incident that happened yesterday another colleague asked me about dmr_content while I was making a presentation on Object and Types. I recalled that a friend had told me once that the content of a deleted document can be retrieved using dmr_content. She was not satisfied with the response.

These incidents had developed enough curiosity in me about dmr_content. It was now my turn to explore it myself.

I checked the Object Relational Model. The i_contents_id of dm_sysobject (or it’s subtypes such as dm_document) is linked to the r_object_id of dmr_content. dmr_content also has a repeating attribute called parent_id which is linked to the r_object_id of dm_sysobject.

I was able to establish the relation between dm_document and dmr_content. The actual document or the content is stored as dmr_content and it is linked to dm_document which stores the metadata. In fact all the contents are stored as objects of dmr_content. That is the reason for creation of a new dmr_content object when we create a rendition.

But why is the parent_id a repeating attribute? It should mean that many dm_document objects can be linked to a single dmr_content object. Does that make sense? I performed the following operations on a document in order to check that.

  1. Check out a document and check it back in as a new version without making any changes to it.

  2. Create a copy of a document.

In both the cases a new object of dmr_content was created and the new document/version got linked to it. Interestingly even when I checked in the document as the same version, a new dmr_content object was created. The deletion of dm_document did not delete the associated dmr_content object either. Both of the above mentioned operations had resulted in the creation of orphan dmr_content objects. I read on a forum that the dm_clean job removes all such orphan objects. So, until the dm_clean job runs, it is possible to retrieve the content of a deleted document. Further the content files on the host file system which doesn’t have a referring dmr_content object are deleted by dm_filescan job.

Here is the most interesting part and the answer to the introductory question: I found this DQL query in the discussion forum of powerlink.
EXECUTE GET_PATH FOR ‘06XXXXXXXXXXXXXX’

This was the thing I was looking for. In order to verify it I imported an image file named object_type.jpg in my repository using DA. I used the following query to find the r_object_id of the dmr_content it was associated with.

SELECT r_object_id
FROM dmr_content
WHERE any parent_id in
(SELECT r_object_id
FROM dm_document
WHERE object_name = 'object_type.jpg')

Alternatively, the following query can also be used.

SELECT i_contents_id AS DMR_CONTENT_ID
FROM dm_document
WHERE object_name = 'object_type.jpg'

The return value of the query was ‘060003f08000c93e’. This value was used as input for the second query.

EXECUTE GET_PATH
FOR '060003f08000c93e'

Any guesses? The query returned me the following content path.

C:/Documentum/data/ASSAPArchive/content_storage_01/000003f0/80/00/59/e2.jpg

The e2.jpg was same as the object_type.jpg which I had imported. In other words, the file was stored in the host file system but it was renamed. GET_PATH is an Administration method and can be found under Administration >> Job Management >> Administration Method node in Documentum Administrator.

I am sorry but I don’t want to indulge in any more puzzles now. You can get some help in Robin’s Post if you want to understand the logic of resolving the content path of dmr_content. As per Object Relational Diagram, the storage_id and data_ticket attributes are used to refer to the content stored in the host file system.

In the end I got the answer for the long standing question. But one question remained unanswered. Why is parent_id a repeating attribute? Any thoughts on that?

Related Articles:

Read Full Post »