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:
1 | 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:
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:
02 | r_object_id : 090xxxxxxxxxxeef |
03 | i_contents_id : 060xxxxxxxxxxa84 |
04 | object_name : binary.gif |
08 | r_object_id : 060xxxxxxxxxxa84 |
09 | parent_id [ 0 ]: 090xxxxxxxxxxeef |
10 | content_attr_name [ 0 ]: SHA- 1 |
22 | content_attr_value [ 0 ]: e97c9xxxxxxxxxxxxxxxxxxf36bc |
35 | full_content_size : 905 |
DQL:
1 | 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' ); |
2 | 060xxxxxxxxx0ca 090xxxxxxxxbbe SHA-1 1c195cxxxxxxxxxxxxxxxxxx83db |
4 | 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' ; |
5 | 090xxxxxxxxbbe 1 7759 html 060xxxxxxxxx0ca |
Best regards,
Huseyin OZVEREN
Related