JavaBlog.fr / Java.lu DEVELOPMENT,Documentum,ECM,TOOLS DCTM Documentum : Relation MAIL With External Internal Attachments (dm_relation, content_attr_name, content_attr_value…)

Documentum : Relation MAIL With External Internal Attachments (dm_relation, content_attr_name, content_attr_value…)

Hello,

Just a mini post concerning the persistence/saving of MAIL document with external/internal attachments. Here, 2 solutions for the relation between MAIL document and its attachments in Documentum.

For external attachment of MAIL document, a simple solution is the creation of dm_document/dmr_content for each external attachment and the creation of dm_relation with specific type (relation_name = ‘mail_attachment’) for the link between attachments and MAIL document:
o parent_id = r_object_id of MAIL document (dm_document -> dmr_content)
o child_id = r_object_id of attachment document (dm_document -> dmr_content)
 
DQL:

1select relation_name, parent_id, child_id from dm_relation where relation_name = 'mail_attachment' and parent_id = '090xxxxxxxxcd' ;

 
 

For the internal attachment inside MAIL document (the system generates automaticaly a SHA-1 for each attachment which is stored directly in the MAIL content)
 
Exemple of MAIL document/content:

1"<item name="$FILE" seal="true" sign="true" summary="true"><object><file compression="none" encoding="unknown" flags="storedindoc" hosttype="msdos" name="1540453.htm" size="7759">
2<created><datetime>20141104T065226,37-05</datetime></created>
3<modified><datetime>20141104T065226,37-05</datetime></modified>
4<filedata>1c195c............6e83db</filedata></file></object></item>"

 
So, a solution is the creation of dm_document/dmr_content for each external attachment and the use of the storing of this SHA-1 value in the dmr_content repeating attributes content_attr_name and content_attr_value instead of the dm_relation objects.
 
The DFC javadoc contains several methods for these dmr_content repeating attributes:

o String getStringContentAttr(String name, String formatName, int page, String pageModifier) throws DfException = Return a string content attribute.
Parameters:
– name : the name of the attribute.
– formatName :the name for the content objects format.
– page : the content page.
– pageModifier : the content object’s page modifier.

o void setStringContentAttribute(String name, String value, String formatName, int page, String pageModifier) throws DfException = Set a String content attribute.
Parameters:
– name : the name of the attribute.
– value : the value of the attribute.
– formatName : the name for the content objects format.
– page : the content page.
– pageModifier : the content object’s page modifier.

 

Example:

01dm_document
02  r_object_id                : 090xxxxxxxxxxeef
03  i_contents_id              : 060xxxxxxxxxxa84
04  object_name                : binary.gif
05 
06 
07dmr_content
08  r_object_id                : 060xxxxxxxxxxa84
09  parent_id                 [0]: 090xxxxxxxxxxeef
10  content_attr_name         [0]: SHA-1
11                [1]: Width
12                [2]: Height
13                [3]: Format
14                [4]: Color Mode
15                [5]: Compression
16                [6]: Jpeg Quality
17                [7]: Gif Interleave
18                [8]: Color Components
19                [9]: Sample Bands
20                [10]: Sample Depth
21                [11]: Colorspace
22  content_attr_value        [0]: e97c9xxxxxxxxxxxxxxxxxxf36bc
23                [1]:
24                [2]:
25                [3]: GIF
26                [4]: Indexed
27                [5]: LZW
28                [6]:
29                [7]: false
30                [8]:
31                [9]:
32                [10]:
33                [11]: RGB
34 
35  full_content_size          : 905

 

DQL:

1select r_object_id, parent_id, content_attr_name, content_attr_value  from dmr_content where ANY (content_attr_name = 'SHA-1' and content_attr_value='1c195cxxxxxxxxxxxxxxxxxx83db' );
2060xxxxxxxxx0ca 090xxxxxxxxbbe  SHA-1   1c195cxxxxxxxxxxxxxxxxxx83db
3 
4select r_object_id, r_page_cnt, r_content_size, a_content_type, i_contents_id from my_huo_document where r_object_id ='090xxxxxxxxbbe';
5090xxxxxxxxbbe  1   7759    html    060xxxxxxxxx0ca

 

Best regards,

Huseyin OZVEREN

Leave a Reply

Your email address will not be published.

Time limit is exhausted. Please reload CAPTCHA.

Related Post