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:
select 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:
"<item name="$FILE" seal="true" sign="true" summary="true"><object><file compression="none" encoding="unknown" flags="storedindoc" hosttype="msdos" name="1540453.htm" size="7759"> <created><datetime>20141104T065226,37-05</datetime></created> <modified><datetime>20141104T065226,37-05</datetime></modified> <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:
dm_document r_object_id : 090xxxxxxxxxxeef i_contents_id : 060xxxxxxxxxxa84 object_name : binary.gif dmr_content r_object_id : 060xxxxxxxxxxa84 parent_id [0]: 090xxxxxxxxxxeef content_attr_name [0]: SHA-1 [1]: Width [2]: Height [3]: Format [4]: Color Mode [5]: Compression [6]: Jpeg Quality [7]: Gif Interleave [8]: Color Components [9]: Sample Bands [10]: Sample Depth [11]: Colorspace content_attr_value [0]: e97c9xxxxxxxxxxxxxxxxxxf36bc [1]: [2]: [3]: GIF [4]: Indexed [5]: LZW [6]: [7]: false [8]: [9]: [10]: [11]: RGB full_content_size : 905
DQL:
select 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' ); 060xxxxxxxxx0ca 090xxxxxxxxbbe SHA-1 1c195cxxxxxxxxxxxxxxxxxx83db select r_object_id, r_page_cnt, r_content_size, a_content_type, i_contents_id from my_huo_document where r_object_id ='090xxxxxxxxbbe'; 090xxxxxxxxbbe 1 7759 html 060xxxxxxxxx0ca
Best regards,
Huseyin OZVEREN