JavaBlog.fr / Java.lu DCTM : DQL / API

DCTM : DQL / API


——————— INSTALLATION / SERVER CONFIG ————————–


• Config folder Security

1DQL : select folder_security from dm_docbase_config;
21 = enable

• Locales of docbase “Data Dictionary Locales”:

1DQL : select  dd_locales from dm_docbase_config;
2fr
3en

• ACL default mode => 1 : folder

1DQL : select default_acl from dm_server_config;

• DOCBASE OWNER (alias “dm_dbo”) represents the docbase owner.

01DQL : select owner_name  from dm_docbase_config;
02- DEV : DEMAT_ADMIN_DEV
03- PROD : DEMAT_ADMIN_PROD
04 
05SELECT DISTINCT r_install_owner FROM dm_server_config;
06- DEV : mygedadm <br /><br />select owner_name  from dm_docbase_config;<br />- DEV : MY_DOCBASE_NAME </pre>
07<pre>select operator_name  from dm_server_config;
08- DEV : DEMAT_ADMIN_DEV
09- PROD : DEMAT_ADMIN_PROD
10 
11SELECT * from dm_user where user_name = 'dm_dbo';
12OR SELECT * from dm_user where user_name = 'DEMAT_ADMIN_DEV';
13OR SELECT * from dm_user where user_name = 'DEMAT_ADMIN_PROD';
14 
15- DEV :
16r_object_id=110157xxxxxxxxx1
17user_name=DEMAT_ADMIN_DEV
18user_os_name=DEMAT_ADMIN_DEV
19user_group_name=docu
20 
21- PROD :
22r_object_id=1101c0xxxxxxxxx1
23user_name=DEMAT_ADMIN_PROD
24user_os_name=DEMAT_ADMIN_PROD
25user_group_name=docu

• DOCBASE ID from r_object_id : In Documentum every object has a unique identifier (r_object_id) in the repository for accessing it and this unique identifier is composed of a 16 digit hexadecimal(4-bits) value (8 bytes). The structure of the object id is composed of 2-digit hexadecimal id (object type – not the same as r_object_type attribute of an object), a 6 digit hexadecimal docbase id and a 8 digit unique identifier for the corresponding object.

  • Each Object Type is defined by a 2 digit hexadecimal identifier by Documentum Server internally : ’09’ for dm_document type, ‘0b’ for dm_folder type etc.
  • Each Object has the next 6 digits as the docbase id to which it belongs to. The docbase id is theoretically unique globally.
  • The rest of the 8 digit hexadecimal identifier defines a unique identifier to the object in the repository.


To get the DocbaseId :
– get a r_object_id : 090220c58052xxxx
– extract the 6 digits corresponding to the docbase id : 0220c5
– convert this hexa value to decimal : 0220c5 (HEXA) => 139461 (DECIMAL) (http://www.binaryhexconverter.com/hex-to-decimal-converter)
• Server installation folders:

01DQL : select object_name, file_system_path, path_type, r_object_type from dm_location order by 2 ;
02auth_plugin     D:\Documentum\dba\auth  directory   dm_location
03 
04assume_user     D:\Documentum\dba\dm_assume_user.exe    file        dm_location
05 
06change_password     D:\Documentum\dba\dm_change_password.exe    file        dm_location
07 
08config          D:\Documentum\dba\config    directory   dm_location
09 
10validate_user       D:\Documentum\dba\dm_check_password.exe file        dm_location
11 
12check_signature     D:\Documentum\dba\dm_check_password.exe file        dm_location
13 
14convert         D:\Documentum\product\7.1\convert   directory   dm_location
15 
16dsearch         D:\Documentum\fulltext\dsearch  directory   dm_location
17 
18dm_ca_store_fetch_location  D:\Documentum\share\temp\dm_ca_store    directory   dm_location
19 
20ldapcertdb_loc      D:\Documentum\dba\secure\ldapdb directory   dm_location
21 
22log         D:\Documentum\dba\log   directory   dm_location
23 
24dm_dba          D:\Documentum\dba   directory   dm_location
25 
26nls_chartrans       D:\Documentum\product\7.1\install\external_apps\nls_chartrans   directory   dm_location
27 
28temp            D:\Documentum\share\temp    directory   dm_location
29 
30my_store        \\MYFILESSERVER\DEV\Data\MY_DOCBASE_DEV\my_store    directory   dm_location
31 
32test_my         \\MYFILESSERVER\DEV\Data\MY_DOCBASE_DEV\test_my     directory   dm_location
33 
34encrypted_storage_01    \\MYFILESSERVER2\Data\MY_DOCBASE_DEV\encrypted_storage_01   directory   dm_location
35 
36storage_01      \\MYFILESSERVER3\data\MY_DOCBASE_DEV\content_storage_01 directory   dm_location
37 
38replica_storage_01  \\MYFILESSERVER3\data\MY_DOCBASE_DEV\replica_content_storage_01directory    dm_location
39 
40replicate_location  \\MYFILESSERVER3\data\MY_DOCBASE_DEV\replicate_temp_store   directory   dm_location
41 
42streaming_storage_01    \\MYFILESSERVER3\data\MY_DOCBASE_DEV\streaming_storage_01   directory   dm_location
43 
44thumbnail_storage_01    \\MYFILESSERVER3\data\MY_DOCBASE_DEV\thumbnail_storage_01   directory   dm_location
45 
46common          data\common directory   dm_location
47 
48events          data\events directory   dm_location

• Mount point (sharing):

1DQL : select object_name, host_name, file_system_path from dm_mount_point ;
2share   MYAPPDEV    d:\Documentum\share

• Configuration of Accelerated Content Server (ACS).
Reminder : ACS is a content server dedicated to serving content to requests from client applications (Application Server for web application OR User Station for WDK application).

1DQL : select object_name, acs_base_url from dm_acs_config ;
2MYDCTMSERVERACS1

——————— SERVER CONFIG LOG ————————–


• SET_OPTIONS : Turns tracing options off or on via the “sqltrace” = Traces SQL commands sent to the underlying RDBMS for subsequent sessions

1API :  apply,c,NULL,SET_OPTIONS,OPTION,S,sqltrace,VALUE,B,T
2API : close,c,q0

——————— CREATION DOCUMENT ————————–


• Creation instance of custom type via pure API (example 1 : with transaction)

01API : begintran,c
02API : create,c,my_huo_custom_type
03...
040xxxxxxxxxxcf7
05API : set,c,l,object_name
06My object for document 09xxxxxx61
07...
08OK
09API : set,c,l,acl_domain
10dm_dbo
11...
12OK
13API : set,c,l,acl_name
14my_acl_business
15...
16OK
17API : set,c,l,my_tgt_object_id
1809xxxxxx61
19...
20OK
21API : set,c,l,my_date,'dd/mm/yyyy hh:mi:ss'
2227/02/2016 15:23:37
23...
24OK
25API : set,c,l,my_title
26Title reclassification
27...
28OK
29API : set,c,l,my_description
30From 'AAAAA' / 'BBBBB' / 'CCCCC'
31...
32OK
33API : save,c,l
34...
35OK
36API : commit,c

• Creation instance of custom type via pure API (example 2 : one-line commands, repeating, setfile)

01API : create,c,my_huo_custom_type
02...
0309xxxxxxxdf
04API : set,c,l,ref_doc,'SCAN-HUO-JAVA123456789'
05...
06OK
07API : set,c,l,acl_name,'MY-ACL-HUO'
08...
09OK
10API : set,c,l,acl_domain,dm_dbo
11...
12OK
13API : set,c,l,status,6
14...
15OK
16API : set,c,l,category,2
17...
18OK
19API : set,c,l,is_reprise,0
20...
21OK
22API : set,c,l,my_repeat_field1[0],'JAVALU123'
23...
24OK
25API : set,c,l,my_repeat_field1[1],'JAVALU456'
26...
27OK
28API : set,c,l,my_repeat_field2[0],'009'
29...
30OK
31API : set,c,l,my_date1,DATE(now)
32...
33OK
34API : set,c,l,my_date2,DATE(’05/31/2115’)
35...
36OK
37API : set,c,l,my_date3,DATE('NULLDATE')
38...
39OK
40API : set,c,l,object_name,'MY_DOC_JAVALU123456'
41...
42OK
43API : set,c,l,a_content_type
44pdf
45...
46OK
47API : setfile,c,l,T:\HUO\myPDFfile.pdf
48...
49OK
50API : link,c,l,'/Cabinet1/Folder1/Folder12/01 - Mon Dossier 1'
51...
52OK
53API : link,c,l,'/Cabinet1/Folder2/Folder22/01 - Mon Dossier 2'
54...
55OK
56API : save,c,l
57...
58OK

• Creation instance of custom type via pure API (example 3 : repeating, setfile)

01API : create,c,my_huo_custom_type
02...
03090xxxxxx08
04API : set,c,l,acl_domain
05dm_dbo
06...
07OK
08API : set,c,l,acl_name
09MY-ACL-HUO
10...
11OK
12API : set,c,l,status
136
14...
15OK
16API : set,c,l,my_repeat_field1[0]
1770130069
18...
19OK
20API : set,c,l,my_repeat_field1[1]
2170017877
22...
23OK
24API : set,c,l,my_repeat_field2[0]
25009
26...
27OK
28API : set,c,l,my_date1
2931/05/2016
30...
31OK
32API : set,c,l,my_date2
3331/05/2115
34...
35OK
36API : set,c,l,my_date3
37NULLDATE
38...
39OK
40API : set,c,l,ref_doc
41SCAN-HUO-JAVA123456789
42...
43OK
44API : set,c,l,is_reprise
450
46...
47OK
48API : set,c,l,object_name
49MY_DOC_JAVALU123456
50...
51OK
52API : set,c,l,category
532
54...
55OK
56API : link,c,l,'/Cabinet1/Folder1/Folder12/01 - Mon Dossier 1'
57...
58OK
59API : link,c,l,'/Cabinet1/Folder2/Folder22/01 - Mon Dossier 2'
60...
61OK
62API : set,c,l,a_content_type
63pdf
64...
65OK
66API : setfile,c,l,T:\HUO\myPDFfile.pdf
67...
68OK
69API : save,c,l
70...
71OK

• Creation instance of custom type via pure API (example 4 : DM_API_E_CANT_UPDATE error, m_DMCLEAN, )

1API : create,c,my_huo_custom_type
2...
3090xxxxxca

090xxxxxca = r_object_id of the newly created object

01API : set,c,090xxxxxca,object_name
02DATA=MY_DOC_JAVALU123456
03...
04API : set,c,090xxxxxca,a_content_type
05DATA=pdf
06...
07API : setfile,c,090xxxxxca,T:\HUO\myPDFfile.pdf
08...
09API : link,c,090xxxxxca,'/Temp'
10...
11API : save,c,090xxxxxca
12...
13[DM_API_E_CANT_UPDATE]error: Cannot Save/Check-in object because the object is marked invalid.  This is most likely due to an error from a prior operation performed on the object.

As explained in https://community.emc.com/thread/132068?tstart=0, This error occurs if the previous operation on this object Id has got into trouble due to Network / docbase errors.
To get around this clear the _status attribute of the object by reset, c, Object_Id

1API : reset,c,090xxxxxca
2...
3OK
4API : save,c,090xxxxxca
5...
6OK

…checking of creation and deleting.
Note : The deletion of a N version is possible only if the current user has at least a BROWSE access pon the antecedent version N-1. If the current user has not access no rights on the N-1 version of document, the deletion of version N is refused by DCTM because the previous is invisible to this user with the below error:
Emc.Documentum.FS.Runtime.SerializableException]: “Delete” operation failed for object: 0902XXXXXXXXXXXX4b2. [DM_SYSOBJECT_E_CANT_DESTROY]error: “Cannot destroy MyDocument.pdf sysobject.”. [DM_SYSOBJECT_E_CANT_DESTROY]error: “Cannot destroy MyDocument.pdf sysobject.” (Fault Detail is equal to Emc.Documentum.FS.Runtime.SerializableException).

Example of a document with 3 versions (version 2 and 3 with same ACL):
+ VERSION 1 – no access for user (ACL_1)
+ VERSION 2 – DELETE access for user (ACL_2) => Deletion impossible (ERROR) => Deletion possible by the user after obtaining at least BROWSE access on version 1 to the USER (Rollback)
+ VERSION 3 – DELETE access for user (ACL_2) => Removal performed by the user without problems

 

01DQL : select r_object_id, i_contents_id from my_huo_custom_type WHERE r_object_id = '090xxxxxca';
02090xxxxxca  060yyyyyyyyyyyb8
03 
04DQL : select r_object_id, parent_id  from dmr_content WHERE r_object_id = '060yyyyyyyyyyyb8';
05060yyyyyyyyyyyb8    090xxxxxca
06 
07DQL : execute get_path for '060yyyyyyyyyyyb8';
08D:\Documentum\data\mydocbase\content_storage_01\xxxxxx\8092482\6c\6b.pdf
09 
10DQL : SELECT  * FROM dm_document WHERE folder('/Temp');
11090xxxxxca  MY_DOC_JAVALU123456 ....
12 
13DQL : DELETE my_huo_custom_type objects where r_object_id = '090xxxxxca';
141
15 
16DQL : select r_object_id, i_contents_id from my_huo_custom_type WHERE r_object_id = '090xxxxxca';
17___nothing
18 
19DQL : select r_object_id, parent_id  from dmr_content WHERE r_object_id = '060yyyyyyyyyyyb8';
20060yyyyyyyyyyyb8 ''
21 
22DA : EXECUTION DU JOB dm_DMCLEAN
23 
24DQL : select r_object_id, parent_id  from dmr_content WHERE r_object_id = '060yyyyyyyyyyyb8';
25___nothing

——————— UPDATE DOCUMENT ————————–


• Updating a document via API using DQL

1API : execquery,c,F,UPDATE my_doc_pj OBJECTS SET my_attr1=0, SET my_attr2=1, SET my_attr3=1, SET object_name='MY_DOC PIECE IDENTITE' WHERE r_object_id = '0901xxxxxxxf'
2close,c,q0
3...
4OK

• Updating a document in pure API (SOLUTION 1)

01API : fetch,c,0901xxxxxf
02...
03OK
04API : set,c,l,object_name
05MY_DOC_PIECE IDENTITE
06...
07OK
08API : set,c,l,my_attr1,0
09...
10OK
11API : set,c,l,my_attr2,1
12...
13OK
14API : set,c,l,my_attr3,1
15...
16OK
17API : save,c,l
18...
19OK

• Updating a document in pure API (SOLUTION 2)

01API : retrieve,c,my_doc_pj where r_object_id = '090xxxxxxxx6df'
02...
03090xxxxxxxx6df
04API : set,c,l,my_attr1,0
05...
06OK
07API : set,c,l,my_attr2,1
08...
09OK
10API : set,c,l,my_attr3,1
11...
12OK
13API : set,c,l,object_name
14MY_DOC_PIECE IDENTITE
15...
16OK
17API : save,c,l
18...
19OK

• Updating a document in pure API (SOLUTION 3)

01API : set,c,080xxxxxxxxxx7a,event_date,'dd/mm/yyyy hh:mi:ss'
0227/02/2017 13:11:19
03...
04OK
05API : save,c,080xxxxxxxxxx7a
06...
07OK
08API : set,c,080xxxxxx1d,event_date,'dd/mm/yyyy hh:mi:ss'
0927/02/2017 13:11:19
10...
11OK
12API : save,c,080xxxxxx1d
13...
14OK
15API : set,c,080xxxxxxc50,event_date,'dd/mm/yyyy hh:mi:ss'
1627/02/2017 13:11:19
17...
18OK
19API : save,c,080xxxxxxc50
20...
21OK

• Updating a document in pure DQL

1DQL : UPDATE my_doc_pj  (ALL) OBJECTS set owner_name='myuser1' where owner_name='myuser2';
2UPDATE my_doc_pj  OBJECTS set my_attr10='6' where r_object_id ='[id]';

• Updating a repeating attribute of document in pure DQL

1DQL : UPDATE my_doc_pj  (ALL) OBJECTS SET my_attr_repeating1[0]='0111', SET my_attr_repeating1[1] = '7878', SET my_attr_repeating1[2] = '4545', SET my_attr_repeating2[0] = '814', SET my_attr_repeating2[1] = '001', SET my_attr10=5  where r_object_id='090xxxxxxxxx62';

• Deleting a value in a repeating attribute of document in pure API

01API : remove,c,0901xxxxxxxxxxx62,my_attr_repeating1[1]
02...
03OK
04API : remove,c,0901xxxxxxxxxxx62,my_attr_repeating1[2]
05...
06[DM_OBJECT_W_DELETE_ATTR_POSITION_ERROR]warning: attempt to delete non-existent attribute 86
07API : remove,c,0901xxxxxxxxxxx62,my_attr_repeating1[1]
08...
09OK
10API : save,c,0901xxxxxxxxxxx62
11...
12OK
13API : remove,c,0901xxxxxxxxxxx62,my_attr_repeating2[1]
14...
15OK
16API : save,c,0901xxxxxxxxxxx62
17...
18OK

• Updating a value in simple attribute, repeating attribute and attached aspect’s attribute of a immutable document in pure API.
Note: For the aspect’s attributes, it is necessary to execute these command through DFC (via DA), NOT through DLL (dqMan) otherwise a “[DM_API_E_BADATTRNAME]error: “Bad attribute name ‘my_huo_afs.my_attr’ for document/object.”” occurs.

01API : set,c,{r_object_id},r_immutable_flag
02SET : 0
03...
04OK
05API : insert,c,{r_object_id},my_huo_aspect.projects_number[{pos}]
06SET : {project_number}
07...
08OK
09API : set,c,{r_object_id},my_attribute1
10SET : my_value1
11...
12OK
13API : save,c,{r_object_id}
14...
15OK
16API : set,c,{r_object_id},r_immutable_flag
17SET : 1
18...
19OK
20API : save,c,{r_object_id}
21...
22OK

——————— CONTENT/RENDITON ————————–


• Get the content file of a document via API:

01#----- DOCUMENT and CONTENT :
02DQL : select r_object_id, i_contents_id from my_huo_document WHERE r_object_id = '090xxxxxx8f' order by r_creation_date desc enable(RETURN_TOP 50);
03...
04090xxxxxx8f 060xxxxa84
05 
06 
07#----- Example 1: 090xxxxxx8f = ID of dm_document
08API : getfile,c,090xxxxxx8f,'C:\temp\toto3.pdf',pdf
09...
10 
11#----- Example 2: 090xxxxxx8f = ID of dm_document
12API : getfile,c,090xxxxxx8f
13...
14D:\_____MyUser1dData____\DqMan 5.0.0.7\dmcl....\PJ_8140.pdf

• Document with a XML rendition

1DQL : select r_object_id, rendition, parent_count, content_size, full_format, format, page, page_modifier, storage_id from dmr_content where any parent_id = '09xxxxxxxxxxxxxxx4';
2...
3060xxxxxxxxxxx50    0   1   11739   pdf 270xxxxxxxxxxxxc9   0       280xxxxxxxxxx100
4060xxxxxxxxxxx51    2   1   2447    xml 270xxxxxxxxxxxxff   0       280xxxxxxxxxx100

### Get the CONTENT (or primary rendition) of first logical page

1API : getfile,c,09xxxxxxxxxxxxxxx4
2...
3C:\APP\dqMan\MYSERVER\dmcl\...0xxxx5\....\mydoc.pdf

### Get the CONTENT of a XML rendition of first logical page

1API : getfile,c,09xxxxxxxxxxxxxxx4,,xml
2...
3C:\APP\dqMan\MYSERVER\dmcl\...\0xxxx5\....\mydoc.xml

• Count of content by subtype of dm_document:

1DQL : select d.r_object_type, count(d.i_contents_id) from dmr_content c, dm_document d where any c.parent_id = d.r_object_id group by d.r_object_type;
2dm_document 21366
3my_subytpe1_document    66
4my_subytpe2_document    185
5...

• Size of all contents in repository/docbase in Mo, only of CURRENT version of dm_document, only of all versions of dm_document:

01DQL : select sum(content_size)/(1024*1024) from dmr_content;
02TEST = 6388.72165775299 (~6Go)
03PROD = 1021340.92345428 (~1To)
04...
05DQL : select sum(r_full_content_size)/(1024*1024) from dm_document;
0642646.2632694244
07...
08DQL : select sum(r_full_content_size)/(1024*1024) from dm_document (ALL);
0959575.4518547058
10...
11select (((sum(full_content_size)/1024)/1024)/1024) as sizein_GB from dmr_content
12sizein_GB
1373.3642595726997

• Number of objects by type that have content:

01DQL : select d.r_object_type, count(*) from dmr_content c, dm_document d where any c.parent_id = d.r_object_id group by d.r_object_type;
02...
03dmc_jar 1107
04dmc_preset_package  2
05dmc_rps_schema  2
06dmc_tcf_activity_template   20
07dmc_xfm_adaptor_config  7
08dmc_xfm_layout  5
09dm_docset   1
10dm_document 21352
11dm_esign_template   1
12dm_format_preferences   1
13dm_menu_system  2
14dm_plugin   2
15dm_xfm_form 5
16dm_xfm_instance 4
17dm_xfm_resource 53
18dm_xfm_schema   5
19dm_xml_config   6
20huo_client_document 631340
21huo_company_document    66

• File size of all versions of the docbase in MB (by type) (ALL):

01DQL : select d.r_object_type, sum(content_size)/(1024*1024) from dmr_content c, dm_document (ALL) d  where any c.parent_id = d.r_object_id group by d.r_object_type;
02...
03dmc_jar 13259.1457748413
04dmc_preset_package  0.0616598129272461
05dmc_rps_schema  0.0339202880859375
06dmc_tcf_activity_template   0.0231971740722656
07dmc_xfm_adaptor_config  0.00547695159912109
08dmc_xfm_layout  0.0469779968261719
09dm_docset   0.000401496887207031
10dm_document 1978.51619911194
11dm_esign_template   0.0441122055053711
12dm_format_preferences   0.000110626220703125
13dm_menu_system  0.345424652099609
14dm_plugin   0.1298828125
15dm_xfm_form 0.0764303207397461
16dm_xfm_instance 0.00278568267822266
17dm_xfm_resource 0.0879192352294922
18dm_xfm_schema   0.0179119110107422
19dm_xml_config   0.0766468048095703
20huo_client_document 61000.0035915375
21huo_company_document    48.2166175842285

• Get the physical folderpath of CONTENT (or primary rendition) of first logical page

01# 090xxxxxxxx27= ID of dm_document
02API : getpath,c,090xxxxxxxx27
03...
04\\MYFILESERVER\data\MY_DOCBASE_DEV\content_storage_01\...\00xxxx5\yy\xx\ce\8e.xls
05 
06# 090xxxxxxxxxc13= ID of dm_document
07API : getpath,c,090xxxxxxxxxc13,,xml
08...
09\\MYDCTMSERVER\data\MY_DOCBASE_DEV\content_storage_01\...\00XXXX5\80\22\e3\98.xml
10 
11# 060xxxxx12 = ID of dm_content
12DQL : execute get_path for '060xxxxx12';
13d:\Documentum\data\mydocbase\content_storage_01\...\4f\4c.pdf
14 
15# 060xxxxxx5 = ID of dm_content
16DQL : execute get_path for '060xxxxxx5';
17d:\Documentum\data\mydocbase\content_storage_01\...\0\3c.txt
18 
19### Get the physical folderpath of CONTENT on CENTERA
20# 090xxxxxxxxfc= ID of dm_document
21API : getpath,c,090xxxxxxxxfc
22...
238HP8XXXXXXXXXXXXXXPU

 

• Renditions / contents for a document with XML rendition with 1 logical page:

01select distinct r_object_id, object_name, r_object_type, r_version_label, r_modify_date, title, r_creation_date, subject, owner_name, r_page_cnt, r_content_size, a_content_type, i_contents_id from my_huo_document
02where a_content_type = 'dxl' and r_object_id IN (ID('09xxxxxxxxxxxxxa47'));
03# r_page_cnt : 1
04# r_content_size : 19484
05# a_content_type : dxl
06# i_contents_id : 06xxxxxxxxxxx65
07 
08######### DMR CONTENT
09select * from dmr_content where r_object_id = '06xxxxxxxxxxx65';
10# parent_id [0]: 09xxxxxxxxxxxxxa47
11# page [0]: 0
12# rendition : 0
13# parent_count : 1
14 
15select r_object_id, rendition, parent_count, content_size, full_format, format, page, page_modifier, storage_id from dmr_content where any parent_id = '09xxxxxxxxxxxxxa47';
16# 06xxxxxxxxxxx65 0 1 19484 dxl 27xxxxxxxxxxxxx2c9 0 2xxxxxxxxxxxxxxx100
17# 06xxxxxxxxxxx66 2 1 1694 xml 27xxxxxxxxxxxxx1ff 0 2xxxxxxxxxxxxxxx100
18 
19API : getfile,c,09xxxxxxxxxxxxxa47
20C:\APP\dqMan\....\....\My FILE.dxl
21 
22API : getfile,c,09xxxxxxxxxxxxxa47,,dxl
23C:\APP\dqMan\....\....\My FILE.dxl
24 
25API : getfile,c,09xxxxxxxxxxxxxa47,,dxl,0
26C:\APP\dqMan\....\....\My FILE.dxl
27 
28API : getfile,c,09xxxxxxxxxxxxxa47,,xml
29C:\APP\dqMan\....\....\My FILE.xml
30 
31API : getfile,c,09xxxxxxxxxxxxxa47,,xml,0
32C:\APP\dqMan\....\....\My FILE.xml
33 
34API : getfile,c,09xxxxxxxxxxxxxa47,,dxl,1
35[DM_SYSOBJECT_E_INVALID_PAGE_NUM]error:  "Invalid page number = 1 for My FILE sysobject.  Maximum page count is 1."
36 
37API : getfile,c,09xxxxxxxxxxxxxa47,,xml,1
38[DM_SYSOBJECT_E_INVALID_PAGE_NUM]error:  "Invalid page number = 1 for My FILE sysobject.  Maximum page count is 1."

 

• Renditions / contents for a document WITHOUR  rendition but with 2 logical pages:

01select distinct r_object_id, object_name, r_object_type, r_version_label, r_modify_date, title, r_creation_date, subject, owner_name, r_page_cnt, r_content_size, a_content_type, i_contents_id from  dm_policy
02where r_object_id IN (ID('46xxxxxxxxxxxxxxxb02'));
03# r_page_cnt                 : 2
04# r_content_size             : 5
05# a_content_type             : text
06# i_contents_id              : 06xxxxxxxxxxxx56e
07######### DMR CONTENT
08select * from dmr_content where  r_object_id = '06xxxxxxxxxxxx56e';
09# parent_id               [0]: 46xxxxxxxxxxxxxxxb02
10# page                    [0]: 0
11# rendition                  : 0
12# parent_count               : 1
13 
14select r_object_id, rendition, parent_count, content_size, full_format, format, page, page_modifier, storage_id from dmr_content where any parent_id = '46xxxxxxxxxxxxxxxb02';
15# 06xxxxxxxxxxxx56e 0   1   5   text    27xxxxxxxxxxxxxxxd8 0       2xxxxxxxxxxxxxxx100
16# 060220c58000056f  0   1   5   text    27xxxxxxxxxxxxxxxd8 1       2xxxxxxxxxxxxxxx100
17 
18API : getfile,c,46xxxxxxxxxxxxxxxb02
19C:\APP\dqMan\....\....\5 Phases + Final.txt
20 
21API : getfile,c,46xxxxxxxxxxxxxxxb02,,text
22C:\APP\dqMan\....\....\5 Phases + Final.txt
23 
24API : getfile,c,46xxxxxxxxxxxxxxxb02,,text,0
25C:\APP\dqMan\....\....\5 Phases + Final.txt
26 
27API : getfile,c,46xxxxxxxxxxxxxxxb02,,text,1
28C:\APP\dqMan\....\....\5 Phases + Final16806a9f.txt
29 
30API : getfile,c,46xxxxxxxxxxxxxxxb02,,text,2
31[DM_SYSOBJECT_E_INVALID_PAGE_NUM]error:  "Invalid page number = 3 for 5 Phases + Final sysobject.  Maximum page count is 2."</pre>
32<pre>

 

Content Services for EMC Centera (CSEC)
Example of 2 instances/servers CENTERA (myserver1.mydomain.lu and myserver2.mydomain.lu) used by DCTM server MYDCTMSERVER1 via:

  • 1 license file : D:\Documentum\dba\castore_license
  • 1 fichier PEA dans D:\Documentum\dba\Centera\MYDEMAT.pea
  • 1 dm_ca_store configured on the MY_DOCBASE docbase pointing on D:\Documentum\dba\Centera\MYDEMAT.pea on myserver1.mydomain.lu and myserver2.mydomain.lu servers

Configuration of Centera

01### CENTERA store
02select r_object_id from dm_ca_store;
03...
04r_object_id
056d0xxxxxx114 
06 
07### dm_store
08API : dump,c,6d0xxxxxx114
09...
10  r_object_id                     : 6d0xxxxxx114
11  name                       : centera_store_no_retention
12  a_plugin_id                     : 670xxxxxx100
13  a_storage_params             [0]: myserver1.mydomain.lu,myserver2.mydomain.lu?D:\Documentum\dba\Centera\MYDEMAT.pea
14                               [1]: Read_option:read_ahead_size:170
15                               [2]: Pool_option:max_connections:1
16  a_content_attr_name           []: none
17  a_retention_attr_name           :
18  a_content_attr_desc           []: none
19  a_retention_attr_required       : F
20  a_default_retention_date        : nulldate
21 
22### dm_plugin
23API : dump,c,670xxxxxx100
24...
25  r_object_id                : 670xxxxxx100
26  object_name                : CSEC Plugin
27  r_object_type              : dm_plugin
28  i_contents_id              : 060xxxxxxxx13d
29 
30### dmr_content
31API : dump,c,060xxxxxxxx13d
32...
33  r_object_id                : 060xxxxxxxx13d
34  parent_id               [0]: 670xxxxxx100
35  set_file                   : D:\Documentum\product\7.1\bin\emcplugin.dll
36  i_format                [0]: 27xxxxxxxxx1ec
37 
38### dm_format
39API : dump,c,27xxxxxxxxx1ec
40...
41  r_object_id                : 27xxxxxxxxx1ec
42  name                       : win32shrlib
43 
44  description                : Windows Shared Library
45 
46  can_index                  : F
47 
48  topic_transform            : F

Use of Centera

01### STORE
02select * from dm_store ;
03280220c580000100    filestore_01
046d0220c580000128    centera_store_no_retention
05 
06### DOC SUR FILESTORE
07select r_object_id, i_contents_id from dm_document where a_storage_type = 'filestore_01' AND r_object_id  = '090220c5800001b2';
08...
09  r_object_id                : 090220c5800001b2
10  a_storage_type             : filestore_01
11  i_contents_id              : 060220c580000114
12 
13select r_object_id, parent_id, storage_id from dmr_content where storage_id IN (select r_object_id from dm_store) AND any parent_id = '090220c5800001b2' AND r_object_id = '060220c580000114';
14...
15  r_object_id                : 060220c580000114
16  parent_id               [0]: 090220c5800001b2
17  storage_id                 : 280220c580000100
18 
19### DOC SUR CENTERA
20select r_object_id, i_contents_id from dm_document where a_storage_type = 'centera_store_no_retention' AND r_object_id  = '090220c5804eba70';
21...
22  r_object_id                : 090220c5804eba70
23  a_storage_type             : centera_store_no_retention
24  i_contents_id              : 060220c580481fd5 
25 
26select r_object_id, parent_id, storage_id from dmr_content where storage_id IN (select r_object_id from dm_ca_store) AND any parent_id = '090220c5804eba70' AND r_object_id = '060220c580481fd5';
27...
28  r_object_id                : 060220c580481fd5
29  parent_id               [0]: 090220c5804eba70
30  storage_id                 : 6d0220c580000128

 

1</pre>
2<p>select r_object_id, object_name, file_system_path, path_type, r_object_type from dm_location where LOWER(file_system_path) like '%javalufil007%';<br /># 3a0XXXXXXXXXXXXXXXXaf storage_04 \\JAVALUFIL007\E$\Documentum\MY_DOCBASE_PROD\storage_04 directory dm_location<br /># 3aXXXXXXXXXXXXX9b3 storage_03 \\JAVALUFIL007\DATA\MY_DOCBASE_PROD directory dm_location</p>
3<p>select r_object_id, name, current_use, full_current_use, root, base_url from dm_filestore where root IN ('storage_04','storage_03');<br /># 280XXXXXXXXXx198 filestore_04 -1776072175 2961751362065 storage_04<br /># 28XXXXXXXXXXX146 filestore_03 -853300949 2782285506859 storage_03<br />select r_object_id, name, current_use, full_current_use, base_url from dm_store where name IN ('filestore_03','filestore_04');<br /># 28XXXXXXXXXXX146 filestore_03 -853300949 2782285506859<br /># 280XXXXXXXXXx198 filestore_04 -1743348149 2961784086091</p>
4<pre>

 




——————— FOLDER/CABINET ————————–


• Count of subdirectories in a directory

1DQL : SELECT count(object_name) FROM dm_folder WHERE FOLDER('/Temp') AND object_name LIKE 'dm%' ;
20
3DQL : SELECT count(object_name) FROM dm_folder WHERE FOLDER('/Temp',descend) AND object_name LIKE 'dm%' ;
442

• Count of documents (all versions) in a directory

1DQL : SELECT count(mytype.r_object_id) FROM my_subtype_document (ALL) mytype, dm_folder dmfolder
2WHERE FOLDER('/MY_CLIENTS',descend)
3    AND any mytype.i_folder_id=dmfolder.r_object_id
4    AND dmfolder.r_folder_path IS NOT NULLSTRING
5    AND dmfolder.r_folder_path like '/MY_CLIENTS/1789%'
6ENABLE (ROW_BASED);
7123

——————— LEFT OUTER JOIN ————————–


• Use of LEFT OUTER JOIN in DQL:

01DQL : select d.r_object_id, p.project_id, c.company_id
02from my_document d
03left outer join dm_dbo.myproject p on d.project_id = p.project_id
04left outer join dm_dbo.mycompany c on d.company_id = c.company_id
05where r_object_id IN(
06'09xxxxxxxxxxx3'
07) order by r_modify_date desc;
08...
09r_object_id=09xxxxxxxxxxx3
10project_id=
11company_id=123456

• Use of LEFT OUTER JOIN in DQL with sub-query calculating the position of 2 aliasnames ‘MyFirstAlias’ and ‘MySecondAlias’ in aliasset whose name begins with ‘AS_project_%’ and does not end with ‘% _archived’:

01DQL : select alias_set.r_object_id, myfirstalias.pos as myfirstalias_pos, mysecondalias.pos as mysecondalias_pos
02from dm_alias_set alias_set
03left outer join (select r_object_id, -(i_position+1) as pos from dm_dbo.dm_alias_set_r where alias_name in ('MyFirstAlias')) myfirstalias on alias_set.r_object_id = myfirstalias.r_object_id
04 
05left outer join (select r_object_id, -(i_position+1) as pos from dm_dbo.dm_alias_set_r where alias_name in ('MySecondAlias')) mysecondalias on alias_set.r_object_id = mysecondalias.r_object_id
06 
07where alias_set.object_name LIKE 'AS\_project\_%'  escape '\' AND  LOWER(alias_set.object_name) NOT LIKE '%_archived' ;
08 
09............
1066xxxxxxxxxx11  0   2
1166xxxxxxxxxx01  1   3
1266xxxxxxxxxxe2  1   3
13 
14...........
15#Generation of API script via dqMan:
16 
17remove,c,{r_object_id},alias_name[{myfirstalias_pos}]
18remove,c,{r_object_id},alias_value[{myfirstalias_pos}]
19remove,c,{r_object_id},alias_category[{myfirstalias_pos}]
20remove,c,{r_object_id},alias_usr_category[{myfirstalias_pos}]
21remove,c,{r_object_id},alias_description[{myfirstalias_pos}]
22remove,c,{r_object_id},alias_name[{mysecondalias_pos}]
23remove,c,{r_object_id},alias_value[{mysecondalias_pos}]
24remove,c,{r_object_id},alias_category[{mysecondalias_pos}]
25remove,c,{r_object_id},alias_usr_category[{mysecondalias_pos}]
26remove,c,{r_object_id},alias_description[{mysecondalias_pos}]
27append,c,{r_object_id},alias_name
28MyNewAlias
29append,c,{r_object_id},alias_value
30all_teams_users
31append,c,{r_object_id},alias_category
322
33append,c,{r_object_id},alias_usr_category
34-1
35append,c,{r_object_id},alias_description
36Alias entry for all teams
37save,c,{r_object_id}

——————— REPEATING ATTRIBUTE ————————–


• Calculate the POSITION of aliasnames ‘Readers’ and ‘Editors’ in ALIAS SETs (repeating attribute):

01DQL : describe dm_dbo.dm_alias_set_r;
02...
03alias_category  Integer
04alias_description   Char(255)
05alias_name  Char(32)
06alias_usr_category  Integer
07alias_value Char(255)
08i_position  Integer
09r_object_id Char(16)   
10 
11 
12DQL : describe dm_dbo.dm_alias_set_s;
13...
14i_is_replica    Integer
15i_vstamp    Integer
16object_description  Char(128)
17object_name Char(32)
18owner_name  Char(255)
19r_object_id Char(16)   
20 
21DQL : select r_object_id, -(i_position+1) as pos, alias_name from dm_dbo.dm_alias_set_r where alias_name in ('Readers','Editors') order by 1 asc, 2 desc;
22...
23660xxxxxxxxxxx36    16  Editors
24660xxxxxxxxxxx36    14  Readers
25660xxxxxxxxxxxc7    3   Editors
26660xxxxxxxxxxxc7    1   Readers
27 
28API : dump,c,660xxxxxxxxxxxc7
29...
30USER ATTRIBUTES
31  owner_name                 : mysuper001
32  object_name                : AS_myproject_123456
33  object_description         : Alias set for my docs of project 123456
34  alias_name             [ 0]: OtherTeamMembers
35                         [ 1]: Readers
36                         [ 2]: Contributors
37                         [ 3]: Editors
38                         [ 4]: Administrators
39  alias_value            [ 0]: my_grp_nobody
40                         [ 1]: my_grp_all
41                         [ 2]: my_grp_nobody
42                         [ 3]: my_grp_nobody
43                         [ 4]: my_grp_nobody
44  alias_category         [ 0]: 2
45                         [ 1]: 2
46                         [ 2]: 2
47                         [ 3]: 2
48                         [ 4]: 2
49  alias_usr_category     [ 0]: -1
50                         [ 1]: -1
51                         [ 2]: -1
52                         [ 3]: -1
53                         [ 4]: -1
54  alias_description      [ 0]:
55                         [ 1]:
56                         [ 2]:
57                         [ 3]:
58                         [ 4]:
59SYSTEM ATTRIBUTES
60  r_object_id                : 660xxxxxxxxxxxc7
61APPLICATION ATTRIBUTES
62INTERNAL ATTRIBUTES
63  i_is_replica               : F
64  i_vstamp                   : 15

 

Other example:
1<br />select r_object_id, r_accessor_name, -(i_position+1) as pos from dm_acl where r_accessor_name = '%Editors' and acl_class = 1 enable (ROW_BASED) ;<br /># 450XXXXXXXXXXXX104   %Editors    21<br /># 450XXXXXXXXXXXX104  %Editors    20<br /># 450XXXXXXXXXXXX973  %Editors    10<br /># 450XXXXXXXXXXXX46   %Editors    10<br /># 450XXXXXXXXXXXXa6   %Editors    10<br /># 450XXXXXXXXXXXX3a   %Editors    8<br /># 450XXXXXXXXXXXX3b    %Editors    8<br /># 450XXXXXXXXXXXX37    %Editors    8<br /># 450XXXXXXXXXXXX38    %Editors    8<br />


 


——————— DOCUMENT PROPERTIES ————————–


• Displaying all the attributes of an object (except of aspect’s attributes attached)

1API : dump,c,4c01cxxxxxxae
2...
3API : get,c,4c01cxxxxxxae,_dump
4#System.out.println(dfDocument.getString("_dump"));
5...
6r_object_id : 4c01cxxxxxxae
7object_name : test name
8title :
9...

• Displaying xml of an object (except of aspect’s attributes attached)

1API : get,c,090XXXXXXXXXXXXXXX03,_xml_string
2# System.out.println(dfDocument.getString("_xml_string"));
3...
4...

• Generate the query in order to create a custom type (via SAMSON)

01DQL : genesis my_type;
02...
03CREATE TYPE my_type (
04id_client CHAR(32) REPEATING,
05format INT,
06date_reception DATE,
07date_creation DATE,
08statut_valid INT,
09type_doc CHAR(7) REPEATING,
10category INT,
11refs_operation CHAR(25) REPEATING,
12reprise BOOL,
13date_validite DATE,
14ref_doc CHAR(100),
15scan_date DATE,
16my_comments_hist CHAR(255) REPEATING,
17merging_parents_id ID REPEATING,
18code CHAR(32),
19my_comment CHAR(255)
20)
21WITH SUPERTYPE dm_document
22go
23 
24ALTER TYPE my_type MODIFY
25my_comments_hist CHAR(512),
26my_comment CHAR(512)
27go

• Display the attribute informations of a custom type

01DQL : describe my_type;
02or
03API : describe,c,type,my_type;
04.....
05DQL : describe my_type;
06Type Name:  my_type
07SuperType Name: dm_document
08 
09Attributes:    112
10 
11object_name                       CHAR(255)
12r_object_type                     CHAR(32)
13title                             CHAR(400)
14subject                           CHAR(192)
15authors                           CHAR(48)    REPEATING
16keywords                          CHAR(48)    REPEATING
17a_application_type                CHAR(32)
18a_status                          CHAR(16)
19r_creation_date                   TIME
20r_modify_date                     TIME
21r_modifier                        CHAR(32)
22r_access_date                     TIME
23a_is_hidden                       BOOLEAN
24i_is_deleted                      BOOLEAN
25a_retention_date                  TIME
26a_archive                         BOOLEAN
27a_compound_architecture           CHAR(16)
28a_link_resolved                   BOOLEAN
29i_reference_cnt                   INTEGER
30i_has_folder                      BOOLEAN
31i_folder_id                       ID          REPEATING
32r_composite_id                    ID          REPEATING
33[...]
34r_immutable_flag                  BOOLEAN
35r_frozen_flag                     BOOLEAN
36r_has_events                      BOOLEAN
37acl_domain                        CHAR(32)
38acl_name                          CHAR(32)
39[...]
40i_partition                       INTEGER
41i_is_replica                      BOOLEAN
42i_vstamp                          INTEGER
43[...]
44id_client CHAR(32)                REPEATING
45format                            INTEGER
46date_reception                    DATE
47date_creation                     DATE
48statut_valid                      INTEGER
49type_doc                          CHAR(7) REPEATING
50category                          INTEGER
51refs_operation                    CHAR(25) REPEATING
52reprise                           BOOL
53date_validite                     DATE
54ref_doc                           CHAR(100)
55scan_date                         DATE
56my_comments_hist                  CHAR(512) REPEATING
57merging_parents_id                ID REPEATING
58code                              CHAR(32)
59my_comment                        CHAR(512)
001API : get,c,090XXXXXXXXXXXXXXX03,_typestring
002# System.out.println(dfDocument.getString("_typestring"));
003...
0043
005TYPE dm_sysobject 030XXXXXXXXXXXXXX105
006 NULL
00786
008  object_name  STRING S 255
009  r_object_type  STRING S 32
010  title  STRING S 400
011  subject  STRING S 192
012  authors  STRING R 48
013  keywords  STRING R 48
014  a_application_type  STRING S 32
015  a_status  STRING S 16
016  r_creation_date  TIME S 0
017  r_modify_date  TIME S 0
018  r_modifier  STRING S 255
019  r_access_date  TIME S 0
020  a_is_hidden  BOOL S 0
021  i_is_deleted  BOOL S 0
022  a_retention_date  TIME S 0
023  a_archive  BOOL S 0
024  a_compound_architecture  STRING S 16
025  a_link_resolved  BOOL S 0
026  i_reference_cnt  INT S 0
027  i_has_folder  BOOL S 0
028  i_folder_id  ID R 0
029  r_composite_id  ID R 0
030  r_composite_label  STRING R 32
031  r_component_label  STRING R 32
032  r_order_no  INT R 0
033  r_link_cnt  INT S 0
034  r_link_high_cnt  INT S 0
035  r_assembled_from_id  ID S 0
036  r_frzn_assembly_cnt  INT S 0
037  r_has_frzn_assembly  BOOL S 0
038  resolution_label  STRING S 32
039  r_is_virtual_doc  INT S 0
040  i_contents_id  ID S 0
041  a_content_type  STRING S 32
042  r_page_cnt  INT S 0
043  r_content_size  INT S 0
044  a_full_text  BOOL S 0
045  a_storage_type  STRING S 64
046  i_cabinet_id  ID S 0
047  owner_name  STRING S 255
048  owner_permit  INT S 0
049  group_name  STRING S 255
050  group_permit  INT S 0
051  world_permit  INT S 0
052  i_antecedent_id  ID S 0
053  i_chronicle_id  ID S 0
054  i_latest_flag  BOOL S 0
055  r_lock_owner  STRING S 255
056  r_lock_date  TIME S 0
057  r_lock_machine  STRING S 80
058  log_entry  STRING S 120
059  r_version_label  STRING R 32
060  i_branch_cnt  INT S 0
061  i_direct_dsc  BOOL S 0
062  r_immutable_flag  BOOL S 0
063  r_frozen_flag  BOOL S 0
064  r_has_events  BOOL S 0
065  acl_domain  STRING S 255
066  acl_name  STRING S 32
067  a_special_app  STRING S 32
068  i_is_reference  BOOL S 0
069  r_creator_name  STRING S 255
070  r_is_public  BOOL S 0
071  r_policy_id  ID S 0
072  r_resume_state  INT S 0
073  r_current_state  INT S 0
074  r_alias_set_id  ID S 0
075  a_effective_date  TIME R 0
076  a_expiration_date  TIME R 0
077  a_publish_formats  STRING R 32
078  a_effective_label  STRING R 32
079  a_effective_flag  STRING R 8
080  a_category  STRING S 64
081  language_code  STRING S 5
082  a_is_template  BOOL S 0
083  a_controlling_app  STRING S 32
084  r_full_content_size  DOUBLE S 0
085  a_extended_properties  STRING R 32
086  a_is_signed  BOOL S 0
087  a_last_review_date  TIME S 0
088  i_retain_until  TIME S 0
089  r_aspect_name  STRING R 64
090  i_retainer_id  ID R 0
091  i_partition  INT S 0
092  i_is_replica  BOOL S 0
093  i_vstamp  INT S 0
094TYPE dm_document 030XXXXXXXXXX129
095dm_sysobject
0960
097TYPE my_cpy_document 030XXXXXXX59
098dm_document
099 
1004
101  my_metadata1_id  INT S 0
102  my_metadata1_name  STRING S 160
103  my_metadata2_id  INT S 0
104  my_metadata2_name  STRING S 160
105TYPE my_document 030XXXXXXXXXXXXX25a
106 
107my_cpy_document
1083
109  my_metadata3_id  INT S 0
110  my_metadata3_name  STRING S 255
111  is_permanent  BOOL S 0
 

——————— ACTIONS DOCUMENT / FOLDER ————————–


• Request to move directories:
#### Via DA: Identify folders that need to be moved, then manually add those folders to Clipboard (Edit –> Add to Clipboard), go to the new folder location then “Edit –> Move Here” using Webtop or DA.

#### via DQL:

1update dm_folder objects  move to '/New_Cabinet/New_Folder' where
2r_object_id in (select r_object_id from dm_folder where object_name = 'MySubFolder' and any r_folder_path like '/Current_Cabinet/MyFolder%')
3OR
4r_object_id in (select r_object_id from dm_folder where r_creation_date < DATE('date_value', 'mm/dd/yyyy') and FOLDER('/Current_Cabinet/Current_Folder', descend))
5;

• Request to move documents:

1update dm_document object move to '/New_Cabinet/New_Folder/SubFolderName' where r_object_id='090xxxxxxx140';
2 
3update dm_document (all) objects move to '/New_Cabinet/New_Folder/SubFolderName' where FOLDER('/Current_Cabinet/Current_Folder',descend)
4    AND r_modify_date >= date('2015-01-01 00:00:00','yyyy-mm-dd hh:mi:ss'AND r_modify_date <= date('2015-01-31 23:59:59','yyyy-mm-dd hh:mi:ss') ;
5 
6update my_huo_document (all) OBJECTS move to '/Current_Cabinet/MyFolder/MySubFolder' where r_object_id IN ('090xxxxxx811', '090xxxxxxxd03');
7;

 

• Freeze, checkin, checkout, lock,…a document:

http://www.javablog.fr/documentum-freeze-checkin-checkout-lock.html

——————— INDEX ————————–


During the creation of INDEX in Documentum, it is possible to precise the tablespace used. If the tablespace is unspecified, the default is the tablespace or segment associated with the repository. The behaviour is same during the creation of a type.

Same problem occurs, if the DBA creates the indexes. In Oracle, if the tablespace is unspecified, the INDEXEs are created in the same tablespace used for the table.

An example of error would be :
[DM_QUERY_E_CURSOR_ERROR]error: “A database error has occurred during the creation of a cursor (‘ORA-01652: unable to extend temp segment by 128 in tablespace TEMP’).”

So, if the INDEXEs are created in DOCUMENTUM, there are some DQL methods to move, drop INDEX to TABLESPACES.

—— MAKE_INDEX
Creates an index for a persistent object type.
EXECUTE make_index
WITH type_name=’object_type’,attribute=’property_name’
{,attribute=’property_name’}
[,unique=true|false][,index_space=’name’][,index_name=’name’]
[,use_id_col=true|false][,use_pos_col=true|false]
[,global_index=true|false]
[,PARALLEL_DEGREE=<integer value>][,NOLOGGING=[true|false][,ONLINE =true|false]

+ INDEX_SPACE STRING Name of tablespace or segment : Specifies the tablespace or segment in which to store the index. If unspecified, the default is the tablespace or segment associated with the repository.

+ Permissions = You must have Superuser privileges to use this method.

—— MOVE_INDEX
Moves an existing object type index from one tablespace or segment to another.
EXECUTE move_index FOR ‘dmi_index_obj_id’ WITH name = ‘new_home’ [,global_index=true|false]

+ NAME STRING new_home
Identifies the new tablespace or segment for the index. Use the name of the tablespace or segment.

+ GLOBAL_INDEX BOOLEAN TRUE or FALSE
Indicates whether the index being created is a global index. This parameter can only be used for partitioned types. The default is FALSE.

+ Permissions = You must have Sysadmin or Superuser privileges to use this method.

—— DROP_INDEX
Destroys a user-defined object type index.
EXECUTE drop_index [[FOR] ‘dmi_index_id’] [WITH name = ‘index_name’]
Do not include the FOR clause if you include the NAME argument.

+ NAME STRING index_name
Identifies the index by the name of its index (dmi_index) object.

+ Permissions = You must have Superuser privileges to use this method.

 

 

• Creation of DCTM INDEX via MAKE_INDEX DQL command. The Superuser privileges is needed to use this method.
The attribute <bmy_huo_field1< b=””> belongs to my_huo_type type, creation of simple index via the following sentence:

1DQL : EXECUTE make_index WITH type_name = 'my_huo_type', attribute = 'my_huo_field1'

The attributes <bmy_huo_field12< b=””> and <bmy_huo_field34< b=””> belong to my_huo_type type, creation of composite index via the following sentence:

1DQL : EXECUTE make_index WITH type_name = 'my_huo_type', attribute = 'my_huo_field12', attribute = 'my_huo_field34'

IN ORACLE : Creation of an index (DataBase level) in my table MY_TABLE whith the next command:

1CREATE INDEX indice_huo_1 ON MY_HUO_TABLE_S (ID_OBJECT,MY_HUO_FIELD2)

</bmy_huo_field34<></bmy_huo_field12<></bmy_huo_field1<>

Creation of index on attributes my_huo_field96 belongs to my_huo_aspect ASPECT, via the following sentence:

  1. Find the internal name (aspect table) of an aspect:
    1DQL : select i_attr_def from dmc_aspect_type   where object_name = 'my_huo_aspect';
    2dmi_030xxxxxx0b
  2. Make the index
    1DQL : EXECUTE make_index WITH type_name = 'dmi_030xxxxxx0b', attribute='my_huo_field96'

• Destroying a user-defined object type index via DROP_INDEX DQL command :
The Superuser privileges is needed to use this method.
These examples illustrate using EXECUTE to drop a user-defined index on the dm_user object type. The first example identifies the index by its name, user_index, and the second example identifies the index by its object ID.

1DQL : EXECUTE drop_index WITH name=’user_index’
2DQL : EXECUTE drop_index FOR ’1f00000011231563a’

• List the indexes on my_huo_type type

01DQL : select i.r_object_id as index_id, i.index_type as type_id, i.attribute as attributes, i.attr_count, i.name as index_name, i.data_space
02from dmi_index i
03where any i.attribute &amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;= 0 and i.index_type in (select t.r_object_id from dm_type t where t.name='my_huo_type');
04...
051fxxxxx00   030xxxxxx25a    117 1   IDX_HUO_TYPE_MY_HUO_FIELD_1 DM_MY_DOCBASE_DEV_INDEX
061fxxxxx52   030xxxxxx25a    101,114 2   IDX_HUO_TYPE_MY_HUO_FIELD_1_AND_3   DM_MY_DOCBASE_DEV_INDEX
07 
08select * from dm_type t where t.name='my_huo_type';
09  name                       : my_huo_type
10  attr_name             [117]: my_huo_field1
11                        [101]: my_huo_field2
12                        [114]: my_huo_field3

• List the indexes on my_huo_aspect ASPECT:

1DQL : select i.r_object_id as index_id, i.index_type as type_id, i.attribute as attributes, i.attr_count, i.name as index_name, i.data_space
2from dmi_index i
3where any i.attribute &amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;= 0 and i.index_type in (select t.r_object_id from dm_type t where t.name='dmi_03xxxxxx57');
4 
51f0xxxxxxxxe45  030xxxxxxx257   2   1   IDX_MAILASP_APPROVERS   DM_MY_DOCBASE_DEV_INDEX
61f0xxxxxxxxe46  030xxxxxxx257   3   1   IDX_MAILASP_REQUESTER   DM_MY_DOCBASE_DEV_INDEX
71f0xxxxxxxxe48  030xxxxxxx257   3   2   IDX_MAILASP_STATUS_REQ  DM_MY_DOCBASE_DEV_INDEX
81f0xxxxxxxxe48  030xxxxxxx257   0   2   IDX_MAILASP_STATUS_REQ  DM_MY_DOCBASE_DEV_INDEX

• Check if an index exists on an attribute my_huo_field123 of my_huo_type:

01DQL : select i.r_object_id as index_id, i.index_type as type_id, i.attribute as attributes, i.attr_count, i.name as index_name, i.data_space
02from dmi_index i
03where any i.attribute &amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;= 0 and i.index_type in (select t.r_object_id from dm_type t where t.name='my_huo_type')
04and any i.attribute IN (
05    select -(r.i_position+1)
06    from dm_dbo.dm_type_r r, dm_dbo.dm_type_s s
07    where r.attr_name in ('my_huo_field123')
08        and r.r_object_id = s.r_object_id
09    and s.name = 'my_huo_type'
10);

——————— WORKFLOW / PROCESS / ACTIVITY / METHOD ————————–


• Getting a List of All the Installed Workflows.
->Workflow template must be “installed”, which means that all of its associated activities are all valid and installed.

1select * from dm_process where r_definition_state=2;
2...
3r_definition_state
40 = Draft
51 = Validated
62 = Installed

• Workflow instance informations:

01select * from dm_process where object_name  like 'my_demat_wkf%';
02  r_object_id                : 4bxxxxxxxxxx29b
03  r_object_type              : dm_process
04  object_name                : my_demat_wkf
05  r_act_def_id = dm_activity.r_object_id
06    [0]: 4c02xxxxx0291
07    [1]: 4c02xxxxxx292
08    [2]: 4c02xxxxxx293
09    [3]: 4c02xxxxxx294
10    [4]: 4c02xxxxxx295
11    [5]: 4c02xxxxxx296
12    [6]: 4c02xxxxxx297
13 
14----- dm_process.r_act_def_id = : 4c02xxxxx0291 = dm_activity.r_object_id

• Activity instance informations:

1SELECT r_object_id, object_name, exec_method_id FROM dm_activity where r_object_id = '4c02xxxxx0291';
2  r_object_id                : 4c02xxxxx0291
3  object_name                : Inclassable
4  exec_method_id             : 10xxxxxx622a
5 
6----- dm_activity.exec_method_id : 10xxxxxx622a = dm_method.r_object_id

• To view task in inbox
The following query will return the items in myuser1’s inbox. In this query, the item_id is the r_object_id of the document in the inbox and the stamp is the r_object_id of the dmi_queue_item that represents the work item.

1SELECT stamp, item_id, item_name, date_sent, priority FROM dm_queue WHERE name = 'myuser1';

• Workflows according to their state => ALL RUNNING (400 wkf)

1select count(*), r_runtime_state   from dm_workflow group by r_runtime_state;

• Workflows with an activity in error (200 wkf)

1select * from dm_workflow where any r_act_state in(-1,3,4,0);

• Documents without workflow:

1SELECT r_object_id, object_name, r_modify_date FROM huo_my_document WHERE i_chronicle_id not in (select r_component_chron_id FROM dmi_package);

• Document as part of a workflow:

1select w.object_name from dm_workflow w, dmi_package p, dm_document d
2    where w.r_object_id=p.r_workflow_id
3    and any p.r_component_chron_id = d.r_object_id

• For a workflow, see the workitems that has a non existing dmi_queue_item reference ( = r_object_id of workflow = 4d0xxxxxx4905):

1select r_object_id as workitem_id, r_performer_name, r_queue_item_id
2    from dmi_workitem where r_workflow_id = 'workflowId'
3    and r_queue_item_id != '0000000000000000'
4    and r_queue_item_id not in (select r_object_id from dmi_queue_item);

• List workflow attachments ( = r_object_id of workflow = 4d0xxxxxx4905):

1select r_component_id, r_component_name from dmi_wf_attachment where r_workflow_id = 'workflowId';

• List workflow information ( = r_object_id of workflow = 4d0xxxxxx4905):

1select task_name, task_state, actual_start_date, dequeued_date from dmi_queue_item where router_id = 'workflowId';

• Find active workflows, supervisors of the workflows:

1select r_object_id, object_name, title, owner_name,r_object_type, r_creation_date, r_modify_date, a_content_type
2    from dm_document
3    where r_object_id in(select r_component_id from dmi_package where r_workflow_id in (select r_object_id from dm_workflow where r_runtime_state = 1));

• Select the components of a workitem:

1select r_component_id from dmi_package p where
2    exists (select r_object_id from dmi_workitem w where w.r_object_id = and w.r_workflow_id = p.r_workflow_id and w.r_act_seq_no = p.r_act_seq_no);

• Find workflows of a document:

1select r_object_id, object_name, process_id, r_runtime_state, supervisor_name, parent_id, parent_act_name, r_act_state, parent_act_seqno
2    from dm_workflow where r_object_id in (select r_workflow_id from dmi_package where any r_component_id
3    in (select r_object_id from dm_sysobject (all) where i_chronicle_id
4        in (select i_chronicle_id from dm_sysobject where r_object_id='090xxxxxx178a'))) and r_runtime_state='1';
5...
6# Workflow.r_object_id = '4d0xxxxxx4905'
7# Workflow.r_runtime_state=1 = RUNNING
8# Workflow.r_act_state = '2,4' --- Finished, Failed'

• Find the QUEUE_ITEM of a document workflow ( = r_object_id of workflow = 4d0xxxxxx4905):

1select r_object_id, item_id, item_name, task_name, task_state, actual_start_date, dequeued_date from dmi_queue_item where router_id = 'workflowId'
2...
3# r_object_id  item_id  item_name  task_name  task_state  actual_start_date  dequeued_date
4# 1b0xxxxxxxxx993a  4a0xxxxxxx915  paused  1  paused

• Find the WORKITEM, ACTIVITY of a workflow:

01select r.r_object_id as workitem_id, r.r_runtime_state as workitem_state, r.r_performer_name as workitem_performer_name, r.r_queue_item_id as workitem_queue_item_id,
02    r.r_act_seqno, wf.r_object_id as workflow_id, r.r_act_def_id as activity_id, act.object_name as activity_name
03    from dmi_workitem r, dm_workflow wf, dm_activity act
04    where wf.r_object_id = r.r_workflow_id
05        and r.r_act_def_id = act.r_object_id
06        and wf.r_object_id = '4d0xxxxxx4905';
07 
08...
09# workitem_id  workitem_state  workitem_performer_name  workitem_queue_item_id  r_act_seqno  workflow_id  activity_id  activity_name
10# 4a0xxxxxxx911  2  DMAT_ADMIN  0000000000000000  0  4d0xxxxxx4905  4c01xxxxxxxx12ca  Restart
11# 4a0xxxxxxx915  5  DMAT_ADMIN  1b0xxxxxxxxx993a  1  4d0xxxxxx4905  4c0xxxxxxxxx12d1  1

• Find an activity

1select * from dm_activity where r_object_id ='4c0xxxxxxxxx12d1'
2# Set the state of workitem '4a0xxxxxxx915' from 5 (A-HALTED) to 1 (ACQUIRED) ?
3# Set the state of acivity '4c0xxxxxxxxx12d1' from 4 (FAILED) to 1 (ACTIVE) ?

——————— TRANSACTION ————————–


• Transaction management in pure API.

1begintran,c
2#
3retrieve,c,my_custom_type where r_object_id = '090xxxxxxxxxd' AND my_title = '123456 JAVA.LU'
4set,c,l,acl_name
5my_acl_huo123
6save,c,l
7#
8commit,c
9### abort,c

• Transaction management in pure DQL.

01########### Example 1 : NO TRANSACTION - COMMIT AUTO
02UPDATE my_custom_document objects SET company_name='ICAP PlcXXXXX' WHERE project_id=0 AND r_object_id IN ('090220c5804ebb5d','090220c5804ebb5e','090220c5804ebb61');
03 
04########### Example 2 : COMMIT AUTO
05BEGIN TRAN;
06UPDATE my_custom_document objects SET company_name='ICAP PlcXXXXX' WHERE project_id=0 AND r_object_id IN ('090220c5804ebb5d','090220c5804ebb5e','090220c5804ebb61');
07 
08########### Example 3 : EXPLICIT TRANSACTION COMMITED
09BEGIN TRAN;
10UPDATE my_custom_document objects SET company_name='ICAP PlcXXXXX' WHERE project_id=0 AND r_object_id IN ('090220c5804ebb5d','090220c5804ebb5e','090220c5804ebb61');
11COMMIT TRAN;
12 
13########### Example 4 : EXPLICIT TRANSACTION ABORTED
14BEGIN TRAN;
15UPDATE my_custom_document objects SET company_name='ICAP PlcXXXXX' WHERE project_id=0 AND r_object_id IN ('090220c5804ebb5d','090220c5804ebb5e','090220c5804ebb61');
16ABORT TRAN;

——————— COUNT HAVING ————————–


• Example 1:

1select r_object_id, count(my_repeat_field1), count(my_repeat_field2)
2from my_subtype_document
3group by r_object_id
4HAVING count(my_repeat_field1)&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;1 AND count(my_repeat_field2)&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;1
5enable (ROW_BASED) ;

——————— AUDIT TRAIL ————————–


• Creation of AuditTrail object via pure API:

01create,c,dm_audittrail
02set,c,l,event_name
03my_event_huo_name
04set,c,l,event_source
05My process
06set,c,l,user_name
07My process
08set,c,l,audited_obj_id
0909xxxxxx62
10set,c,l,string_1
11Value Str 1
12set,c,l,string_2
13Value Str 2
14set,c,l,string_3
15Value Str 3
16set,c,l,id_1
1709xxxxx621
18set,c,l,id_2
1909xxxxxx622
20set,c,l,sid_3
2109xxxxxx623
22save,c,l

The informations user_id, session_id, owner_name, time_stamp, time_stamp_utc, host_name are filled automatically by Content Server. Yet, the informations acl_name, acl_domain, chronicle_id, object_type, version_label, object_name are extracted from the audited object (audited_obj_id).

• Deleting of existing AuditTrail object via pure API:

1API : retrieve,c,dm_audittrail where r_object_id ='5f0xxxxxx7'
2...
35f0xxxxxx7
4API : destroy,c,l
5...
6OK

• Updating of existing AuditTrail object via DQL or API => It is not possible.

01DQL : UPDATE dm_audittrail OBJECTS set user_name='huseyin1' where event_name = 'my_event' and r_object_id ='5f02xxxxxxxa'
02...
03[DM_QUERY_E_UP_NOT_UPDATEABLE]error: You have specified a non updateable type name (dm_audittrail).
04...
05 
06API : fetch,c,5f02xxxxxxxa
07...
08OK
09API : set,c,l,user_name
10huseyin1
11...
12OK
13API : save,c,l
14...
15[DM_AUDITTRAIL_E_CANT_MODIFY]error: You can not modify any existing AuditTrail object 5f02xxxxxxxa.

• Number of audittrail events:

01DQL : select event_name, count(*) from dm_audittrail group by event_name order by 1;
02...
03event_name          count(*)
04...
05Calling VersioningMethod    659.0
06Executing WKF_FinishMethod      340326.0
07Executing WKF_InclassableMethod     2422.0
08Executing WKF_VersioningMethod  659.0
09Executing WKF_WorkflowMethod    792367.0
10dm_audit    1.0
11dm_checkin  860420.0
12dm_checkout     861471.0
13dm_destroy  91128.0
14dm_link     801360.0
15dm_lock     861471.0
16dm_logon_failure    6599.0
17dm_save     3663335.0
18dm_setfile  1192112.0
19dm_unlink   387180.0
20dm_unlock   860499.0

 

• Activate/Unactivate the audit_trail via pure API:

API>Audit
Purpose Initiates auditing of an event.
Syntax
dmAPIExec("audit,session[,object_id],event_name
[,audit_subtypes][,controlling_app]
[,policy_id[,state_name]][,sign_audit][,authentication]
[,event_description][,attribute_list]
[,esignature_required]")
1select * from dm_type ;&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;lt;/pre&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;lt;pre&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;# 030xxxxxxxxxf0  my_huo_document my_root_document
2audit,c,030xxxxxxxxxf0,dm_save,F

API>Unaudit
Purpose Stops auditing of an event.
Syntax
dmAPIExec(“unaudit,session[,object_id],event_name
[,controlling_app][,policy_id ][,state_name]]”)

1&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;lt;/pre&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;
2&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;lt;p&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;select * from dm_type ;&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;# 030xxxxxxxxxf0 my_huo_document my_root_document&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;unaudit,c,030xxxxxxxxxf0,dm_save&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;

 

EX: dm_audittrail “dm_save” when a document has been modified
event_name : dm_save
audited_obj_id : 0902XXXXXXXXXXX2
attribute_list : my_attribute_1=1,…
attribute_list_old : my_attribute_1=0,…

 

 

 


——————— GROUP / USER ————————–


• User creation via API:

01create,c,dm_user
02set,c,l,user_name
03my_browse_user
04set,c,l,user_os_name
05my_browse_user
06set,c,l,user_privileges
070
08set,c,l,client_capability
090
10save,c,l

• Group creation via API:

01create,c,dm_group
02set,c,l,group_name
03access-browse-my-group
04set,c,l,owner_name
05dm_dbo
06set,c,l,is_private
07F
08set,c,l,globally_managed
09F
10set,c,l,group_class
11group
12set,c,l,description
13Browse access to all documents
14save,c,l

• Add group and user to group via API/DQL:

01execquery,c,F,alter group 'access-main-delete-group' add 'my-sub-group-1';
02close,c,q0
03execquery,c,F,alter group 'access-main-delete-group' add 'MyHuoUser1';
04close,c,q0
05...
06# access-main-delete-group / groups_names            []: none
07retrieve,c,dm_group where group_name = 'access-main-delete-group'
08append,c,l,groups_names
09my-sub-group-1
10append,c,l,groups_names
11my-sub-group-2
12save,c,l

• Remove subgroup and user from group via API/DQL:

1execquery,c,F,alter group 'access-main-delete-group' drop 'my-sub-group-1';
2close,c,q0
3execquery,c,F,alter group 'access-main-delete-group' drop 'MyHuoUser1';
4close,c,q0
5...
6# access-main-delete-group / groups_names            [0]: my-sub-group-1 [1]: my-sub-group-2
7retrieve,c,dm_group where group_name = 'access-main-delete-group'
8remove,c,l,groups_names[1]
9save,c,l

• The groups of an user via DQL:

1select g.group_name from dm_group g, dm_user u where any g.users_names = u.user_name and u.user_name IN ('huseyin1');
2...
3development_team
4ecm_team

• Number of users in a group (not including subgroup users) via DQL:

1select count(u.user_name), g.group_name from dm_group g, dm_user u
2where any g.users_names = u.user_name and (g.group_name like 'ecm_team%')
3group by g.group_name;
4...
510  ecm_team

• Number of users in a group including subgroup users via DQL:

1SELECT count(DISTINCT i_all_users_names),group_name FROM dm_group g
2WHERE (g.group_name like 'grp-%' or group_name like 'ecm_team%')
3group by g.group_name;
4...
580  ecm_team

• Users in a group (not including subgroup users) via DQL:

1select u.user_name from dm_group g, dm_user u  where any g.users_names = u.user_name and g.group_name = 'ecm_team';
2huseyin1
3...
410 rows

• Users in a group including subgroup users via DQL:

1select i_all_users_names from dm_group g where g.group_name = 'ecm_team';
2huseyin1
3...
480 rows

• Subgroup and supergroup of ‘grp_all’ and ‘ecm_team’ groups via DQL:

1select distinct group_name, groups_names, i_supergroups_names from DM_GROUP where group_name IN ('grp_all') ENABLE (ROW_BASED);
2...
3grp_all     ecm_team    grp_all
4 
5select distinct group_name, groups_names, i_supergroups_names from DM_GROUP where group_name IN ('ecm_team') ENABLE (ROW_BASED);
6...
7ecm_team    ____        grp_all

• Number of users according to each state via DQL:

01select count(user_name), user_state from dm_user where user_name not  like 'dm_%' group by user_state;
02...
03count(dm_user.user_name)  user_state
045128    1
05131205  0
062   3
07...
080, indicating a user who can log in (= active)
091, indicating a user who cannotlog in (= inactive)
102, meaning a user who is locked
113, meaning a user who is locked and inactive

• Find the accesses of users using the ACL template (PST) or instances of PST via DQL:

01########## PST my_acl_pst_1 for user 'myuser001'
02 
03select * from dm_acl where object_name = 'my_acl_pst_1';
04...
05# 450XXXXXXXXXXX7b  my_acl_pst_1
06 
07### analyse of accesses via PST for 'myuser001'
08select * from dm_group where group_name in (select r_accessor_name from dm_acl where object_name = 'my_acl_pst_1') and any i_all_users_names = 'myuser001';
09...
10# 120xxxxxxxxxxxxe18    group1
11# 120xxxxxxxxxxxx15 group2
12 
13### analyse of accesses via instances of PST for 'myuser001'
14select * from dm_group where group_name in (select r_accessor_name from dm_acl where r_template_id = '450XXXXXXXXXXX7b') and any i_all_users_names = 'myuser001';
15...
16# 120xxxxxxxxxxxxe18    group1
17# 120xxxxxxxxxxxx15 group2

• Group docu : The docu group is the default documentum group which contains repository_owner, installation_owner, dm_autorender_win32, dm_autorender_mac, dm_mediaserver, superusers:

01select owner_name  from dm_docbase_config;
02DEMAT_ADMIN_DEV
03....
04select operator_name  from dm_server_config;
05DEMAT_ADMIN_DEV
06....
07SELECT * from dm_group where group_name = 'docu';
08  i_all_users_names       [0]: DEMAT_ADMIN_DEV
09                          [1]: dm_autorender_mac
10                          [2]: mysuperuser
11                          [3]: dm_mediaserver
12                          [4]: dm_autorender_win31
13 
14  users_names             [0]: DEMAT_ADMIN_DEV
15                          [1]: mysuperuser
16                          [2]: dm_autorender_win31
17                          [3]: dm_autorender_mac
18                          [4]: dm_mediaserver

• Group admingroup = When you grant Superuser privileges to a user, you may also need to add that user to the admingroup group to enable them to run jobs or administration methods. The admingroup group is created at server installation or upgrade, when the administration tool suite is installed. It contains all the Superusers in the repository. At server installation, there are the repository owner and installation owner. After an upgrade, it contains all Superusers in the repository. Members of the admingroup group have no inherent privileges other than those they have as Superusers. However, administrative jobs, methods, and other related objects use an ACL which restricts their use to the admingroup group.

01select owner_name  from dm_docbase_config;
02DEMAT_ADMIN_DEV
03....
04select operator_name  from dm_server_config;
05DEMAT_ADMIN_DEV
06....
07SELECT * from dm_group where group_name = 'admingroup';
08  users_names             [1]: DEMAT_ADMIN_DEV
09                          [2]: dm_fulltext_index_user
10                          [3]: mysuperuser
11 
12  i_all_users_names       [0]: mysuperuser
13                          [1]: dm_fulltext_index_user
14                          [2]: DEMAT_ADMIN_DEV

——————— ACL ————————–


• Creation of User ACL (acl_class=0) via API

001API : begintran,c
002...
003OK
004API : create,c,dm_acl
005...
006450xxxxxxxxxxxx23
007API : set,c,l,object_name
008TEST ACL HUO World Write
009...
010OK
011API : set,c,l,owner_name
012dm_dbo
013...
014OK
015API : set,c,l,r_is_internal
016FALSE
017...
018OK
019 
020 
021API : set,c,l,globally_managed
022FALSE
023...
024OK
025API : set,c,l,acl_class
0260
027...
028OK
029API : set,c,l,description
030All Users have Write Access
031...
032OK
033API : grant,c,l,dm_world,AccessPermit,,6
034...
035OK
036API : grant,c,l,dm_owner,AccessPermit,,7
037...
038OK
039API : grant,c,l,mysuperuser,AccessPermit,,7
040...
041OK
042API : save,c,l
043...
044OK
045API : commit,c
046...
047OK
048 
049#
050# Others instructions:
051#
052#set,c,l,r_accessor_permit[0]
053#3
054#set,c,l,r_accessor_xpermit[0]
055#1048576
056#set,c,l,r_accessor_permit[1]
057#1
058#set,c,l,r_accessor_xpermit[1]
059#3
060 
061#append,c,l,r_accessor_name
062#docu
063#append,c,l,r_is_group
064#TRUE
065#append,c,l,r_accessor_permit
066#7
067#append,c,l,r_accessor_xpermit
068#0
069 
070#append,c,l,r_accessor_name
071#my-grp-wkf
072#append,c,l,r_is_group
073#TRUE
074#append,c,l,r_accessor_permit
075#6
076#append,c,l,r_accessor_xpermit
077#0
078 
079#append,c,l,r_accessor_name
080#my_all_users
081#append,c,l,r_is_group
082#TRUE
083#append,c,l,r_accessor_permit
084#6
085#append,c,l,r_accessor_xpermit
086#0
087 
088API : dump,c,450xxxxxxxxxxxx23
089...
090USER ATTRIBUTES
091 
092  object_name                : TEST ACL HUO World Write
093  description                : All Users have Write Access
094  owner_name                 : MYDOCBASEDEV
095  globally_managed           : F
096  acl_class                  : 0
097 
098SYSTEM ATTRIBUTES
099 
100  r_object_id                : 450xxxxxxxxxxxx23
101  r_is_internal              : F
102  r_accessor_name         [0]: dm_world
103                          [1]: dm_owner
104                          [2]: mysuperuser
105  r_accessor_permit       [0]: 6
106                          [1]: 7
107                          [2]: 7
108  r_accessor_xpermit      [0]: 0
109                          [1]: 0
110                          [2]: 0
111  r_is_group              [0]: F
112                          [1]: F
113                          [2]: F
114  r_has_events               : F
115  r_permit_type           [0]: 0
116                          [1]: 0
117                          [2]: 0
118  r_application_permit    [0]:
119                          [1]:
120                          [2]:
121  r_template_id              : 0000000000000000
122  r_alias_set_id             : 0000000000000000
123 
124APPLICATION ATTRIBUTES
125 
126INTERNAL ATTRIBUTES
127 
128  i_has_required_groups      : F
129  i_has_required_group_set   : F
130  i_has_access_restrictions  : F
131  i_partition                : 0
132  i_is_replica               : F
133  i_vstamp                   : 0

• Modification of previous ACL via API

01API : retrieve,c,dm_acl where object_name = 'TEST ACL HUO World Write'
02...
03450xxxxxxxxxxxx23
04API : grant,c,l,dm_world,AccessPermit,,1
05...
06OK
07API : save,c,l
08...
09OK
10 
11#
12# Others instructions:
13#
14#grant,c,l,dm_world,AccessPermit,,1
15#grant,c,l,my_grp1,AccessPermit,,7
16#grant,c,l,my_grp2,AccessPermit,,5
17#revoke,c,l,my_grp1,AccessPermit,,7
18#revoke,c,l,dm_world,ExtendedPermit,,EXECUTE_PROC
19#grant,c,l,my_grp1,ExtendedPermit,,CHANGE_LOCATION
20#grant,c,l,my_grp2,ExtendedPermit,,CHANGE_PERMIT
21 
22#dump,c,r_object_id_ofACL
23#grant,c,l,dm_world_GROUPE,PERMIT(1à7),XPERMIT(chiffre)
24#OR
25#grant,c,l,dm_world_GROUPE,PERMIT(1à7),XPERMIT(nom_de_xpermit)
26 
27API : dump,c,450xxxxxxxxxxxx23
28...
29USER ATTRIBUTES
30 
31  object_name                : TEST ACL HUO World Write
32  description                : All Users have Write Access
33  owner_name                 : MYDOCBASEDEV
34  globally_managed           : F
35  acl_class                  : 0
36 
37SYSTEM ATTRIBUTES
38 
39  r_object_id                : 450xxxxxxxxxxxx23
40  r_is_internal              : F
41  r_accessor_name         [0]: dm_world
42                          [1]: dm_owner
43                          [2]: mysuperuser
44  r_accessor_permit       [0]: 1        --- modified ---
45                          [1]: 7
46                          [2]: 7
47  r_accessor_xpermit      [0]: 0
48                          [1]: 0
49                          [2]: 0
50  r_is_group              [0]: F
51                          [1]: F
52                          [2]: F
53  r_has_events               : F
54  r_permit_type           [0]: 0
55                          [1]: 0
56                          [2]: 0
57  r_application_permit    [0]:
58                          [1]:
59                          [2]:
60  r_template_id              : 0000000000000000
61  r_alias_set_id             : 0000000000000000
62 
63APPLICATION ATTRIBUTES
64 
65INTERNAL ATTRIBUTES
66 
67  i_has_required_groups      : F
68  i_has_required_group_set   : F
69  i_has_access_restrictions  : F
70  i_partition                : 0
71  i_is_replica               : F
72  i_vstamp                   : 2

• Deleting of ACL via API

1API : retrieve,c,dm_acl where object_name = 'TEST ACL HUO World Write'
2...
3450xxxxxxxxxxxx23
4API : destroy,c,l
5...
6OK

• CHECK_ACL and CHECK_SECURITY via DQL
CHECK_ACL : provides similar security enforcement for queries against registered tables as DQL does for queries against sysobjects. When a non-superuser issues a DQL statement against dm_sysobject or its subtypes, an ACL security-checking clause is appended at the end of the SQL statement issued against the database. The CHECK_ACL function is used similarly to enforce security with registered tables. Since there is no security-checking clause added to DQL statements run against registered tables, the CHECK_ACL function must be ANDed with the other qualifications in the statement. The registered table must contain a column that has the ACL domain and the ACL name for each table row to use for the security check.

CHECK_SECURITY : Checks a user’s or group’s access permissions on one or more objects or checks a user’s or group’s permission level in one or more ACLs.

01DQL : SELECT * FROM my_huo_document  WHERE r_object_id = '09XXXXXXX9b' AND CHECK_ACL('acl_domain', 'acl_name', 'myuser001');
02 
03# BROWSE, READ, RELATE, VERSION, WRITE, DELETE
04DQL : SELECT FOR READ FROM my_huo_document  WHERE r_object_id = '09XXXXXXX9b' AND CHECK_ACL('acl_domain', 'acl_name', 'myuser001');
05DQL : SELECT FOR DELETE FROM my_huo_document  WHERE r_object_id = '09XXXXXXX9b' AND CHECK_ACL('acl_domain', 'acl_name', 'myuser001');
06 
07# 1 for None, 2 for Browse, 3 for Read, 4 for Relate, 5 for Version, 6 for Write, 7 for Delete,
08DQL : EXECUTE check_security WITH user_name='myuser001', level=3,object_list='09XXXXXXX9b';
09DQL : EXECUTE check_security WITH user_name='myuser001', level=7,object_list='09XXXXXXX9b';
10 
11 
12# TESTS : access via which group ?
13### huo001 : OK
14select r_object_id, group_name from dm_group  where LOWER(group_name) IN(select LOWER(r_accessor_name) from dm_acl where object_name IN (select acl_name from my_huo_document where r_object_id IN('090XXXXXXXXXX1cc'))) AND any i_all_users_names = 'huo001';
15# 120XXXXXXXXXXXX18 access_all
16# 120XXXXXXXXXXXXc5 access-delete-group
17SELECT * FROM my_huo_document  WHERE r_object_id = '090XXXXXXXXXX1cc' AND CHECK_ACL('acl_domain', 'acl_name', 'huo001');
18SELECT FOR BROWSE * FROM my_huo_document  WHERE r_object_id = '090XXXXXXXXXX1cc' AND CHECK_ACL('acl_domain', 'acl_name', 'huo001');
19# 090XXXXXXXXXX1cc  My Document Name

 

Warning : The superuser has the permission of document’s OWNER permission unless he has direct permission. For example, if the OWNER has the permission VERSION on a document, the superuser will not have the permission WRITE/DELETE on this document.
So, the superuser will not can update its properties without creating new version.

Example : document associated with ACL which has the following permissions:
r_accessor_name [0]: dm_world
[1]: dm_owner
[2]: user_delete_right
r_accessor_permit [0]: 1
[1]: 5
[2]: 7

01############### With USER user_delete_right
02# This APi instruction allows to know the rights of a connected user "user_delete_right"
03API&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt; get,c,090XXXXXXXXXXX,_permit
04...
057
06 
07SELECT FOR DELETE * FROM my_huo_document  WHERE r_object_id = '090XXXXXXXXXXX';
08# 090XXXXXXXXXXX    My_doc_title.pdf
09 
10SELECT FOR VERSION * FROM my_huo_document  WHERE r_object_id = '090XXXXXXXXXXX' AND CHECK_ACL('acl_domain', 'acl_name', 'my_super_user');
11# nothing
12SELECT FOR READ * FROM my_huo_document  WHERE r_object_id = '090XXXXXXXXXXX' AND CHECK_ACL('acl_domain', 'acl_name', 'my_super_user');
13# 090XXXXXXXXXXX    My_doc_title.pdf
14 
15############### With USER my_super_user
16# This APi instruction allows to know the rights of a connected user "user_delete_right"
17API&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt; get,c,090XXXXXXXXXXX,_permit
18...
195
20 
21SELECT FOR VERSION * FROM my_huo_document  WHERE r_object_id = '090XXXXXXXXXXX';
22# 090XXXXXXXXXXX    My_doc_title.pdf
23SELECT FOR WRITE * FROM my_huo_document  WHERE r_object_id = '090XXXXXXXXXXX';
24# nothing
25 
26SELECT FOR DELETE * FROM my_huo_document  WHERE r_object_id = '090XXXXXXXXXXX' AND CHECK_ACL('acl_domain', 'acl_name', 'user_delete_right');
27# nothing
28SELECT FOR WRITE * FROM my_huo_document  WHERE r_object_id = '090XXXXXXXXXXX' AND CHECK_ACL('acl_domain', 'acl_name', 'user_delete_right');
29# nothing
30SELECT FOR VERSION * FROM my_huo_document  WHERE r_object_id = '090XXXXXXXXXXX' AND CHECK_ACL('acl_domain', 'acl_name', 'user_delete_right');
31# 090XXXXXXXXXXX    My_doc_title.pdf

 

 


——————— ALIAS SET / TEMPLATE ACL (PERMISSION SET TEMPLATE) ————————–


• Creation of Alias Set (dm_alias_set) via API

01API : begintran,c
02...
03OK
04API : create,c,dm_alias_set
05...
06660xxxxxxd3e
07API : set,c,l,object_name
08TEST AS HUO Simple
09...
10OK
11API : set,c,l,owner_name
12dm_dbo
13...
14OK
15API : set,c,l,object_description
16Desc 4 TEST AS HUO Simple
17...
18OK
19API : append,c,l,alias_name
20AS4MyGroup
21...
22OK
23API : append,c,l,alias_value
24huo_grp_all_users
25...
26OK
27API : append,c,l,alias_category
282
29...
30OK
31API : append,c,l,alias_usr_category
32-1
33...
34OK
35API : append,c,l,alias_description
36Entry for a group alias (huo_grp_all_users)
37...
38OK
39API : append,c,l,alias_name
40AS4SuperUser
41...
42OK
43API : append,c,l,alias_value
44myuser001
45...
46OK
47API : append,c,l,alias_category
481
49...
50OK
51API : append,c,l,alias_usr_category
52-1
53...
54OK
55API : append,c,l,alias_description
56Entry for a user alias (myuser001)
57...
58OK
59API : save,c,l
60...
61OK
62API : commit,c
63...
64OK
65 
66 
67API : dump,c,660xxxxxxd3e
68...
69USER ATTRIBUTES
70  owner_name                 : dm_dbo
71  object_name                : TEST AS HUO Simple
72  object_description         : Desc 4 TEST AS HUO Simple
73  alias_name              [0]: AS4MyGroup
74                          [1]: AS4SuperUser
75  alias_value             [0]: huo_grp_all_users
76                          [1]: myuser001
77  alias_category          [0]: 2
78                          [1]: 1
79  alias_usr_category      [0]: -1
80                          [1]: -1
81  alias_description       [0]: Entry for a group alias (huo_grp_all_users)
82                          [1]: Entry for a user alias (myuser001)
83 
84SYSTEM ATTRIBUTES
85  r_object_id                : 660xxxxxxd3e
86 
87APPLICATION ATTRIBUTES
88 
89INTERNAL ATTRIBUTES
90  i_is_replica               : F
91  i_vstamp                   : 0

Concerning the the category (alias_category ) for the alias in the specified index position in the alias set. This value is set by the creator of the alias object and used by Documentum client applications. The server does not verify the category value against the alias value to ensure that alias value is in the specified category.
Currently, only the following values are allowed:

  • 0 (Unknown)
  • 1 (User, alias_value is a user)
  • 2 (Group, alias_value is a group)
  • 3 (User or Group, alias_value is either a user or a group)
  • 4 (Cabinet Path, alias_value is a cabinet path)
  • 5 (Folder Path, alias_value is a folder path)
  • 6 (ACL Name, alias_value is an ACL name)

 

• Creation of Template ACLs or Permission Set Template (acl_class=1) via API

01API : begintran,c
02...
03OK
04API : create,c,dm_acl
05...
06450xxxxxxx94f
07API : set,c,l,object_name
08TEST PST HUO Simple
09...
10OK
11API : set,c,l,owner_name
12dm_dbo
13...
14OK
15API : set,c,l,acl_class
161
17...
18OK
19API : set,c,l,description
20Desc 4 TEST PST HUO Simple
21...
22OK
23API : grant,c,l,dm_world,AccessPermit,,3
24...
25OK
26API : grant,c,l,dm_owner,AccessPermit,,3
27...
28OK
29API : grant,c,l,%AS4MyGroup,AccessPermit,,6
30...
31OK
32API : grant,c,l,%AS4SuperUser,AccessPermit,,7
33...
34OK
35API : save,c,l
36...
37OK
38API : commit,c
39...
40OK
41 
42API : dump,c,450xxxxxxx94f
43...
44USER ATTRIBUTES
45  object_name                : TEST PST HUO Simple
46  description                : Desc 4 TEST PST HUO Simple
47  owner_name                 : MYDOCBASEDEV
48  globally_managed           : F
49  acl_class                  : 1
50 
51SYSTEM ATTRIBUTES
52  r_object_id                : 450xxxxxxx94f
53  r_is_internal              : F
54  r_accessor_name         [0]: dm_world
55                          [1]: dm_owner
56                          [2]: %AS4MyGroup
57                          [3]: %AS4SuperUser
58  r_accessor_permit       [0]: 3
59                          [1]: 3
60                          [2]: 6
61                          [3]: 7
62  r_accessor_xpermit      [0]: 0
63                          [1]: 0
64                          [2]: 0
65                          [3]: 0
66  r_is_group              [0]: F
67                          [1]: F
68                          [2]: F
69                          [3]: F
70  r_has_events               : F
71  r_permit_type           [0]: 0
72                          [1]: 0
73                          [2]: 0
74                          [3]: 0
75  r_application_permit    [0]:
76                          [1]:
77                          [2]:
78                          [3]:
79  r_template_id              : 0000000000000000
80  r_alias_set_id             : 0000000000000000
81 
82APPLICATION ATTRIBUTES
83 
84INTERNAL ATTRIBUTES
85  i_has_required_groups      : F
86  i_has_required_group_set   : F
87  i_has_access_restrictions  : F
88  i_partition                : 0
89  i_is_replica               : F
90  i_vstamp                   : 0

• Modification of Template ACLs or Permission Set Template (acl_class=1) via API

1API : begintran,c
2API : retrieve,c,dm_acl where r_object_id='450xxxxxxx4c’
3API : revoke,c,l,%AS4MyGroup,AccessPermit,,6
4API : revoke,c,l,%AS4SuperUser,AccessPermit,,7
5API : save,c,l
6API : commit,c

• Creation of Instance of Template ACL using the PST previous and AS (acl_class=2) via API
An instance of an ACL template is created when an AliasSet and PST are associated to a document. It is not possible to create directly manually an instance of PST.
The error DM_ACL_E_CANT_CHANGE_INSTANCE occurs if the user tries to modify a instance of PST (acl_class=2). To modify the instances of PST, it is necessary to modify the PST or PST/AliasSet associated to theses instances.

01API : begintran,c
02...
03OK
04API : create,c,dm_document
05...
06090xxxxxx321
07API : set,c,l,object_name
08Test DOC HUO WITH AS AND PST
09...
10OK
11API : set,c,l,a_content_type
12pdf
13...
14OK
15API : setfile,c,l,C:\temp\test.pdf
16...
17OK
18API : link,c,l,'/Temp'
19...
20OK
21API : set,c,l,r_alias_set_id
22660xxxxxxd3e
23...
24OK
25API : set,c,l,acl_domain
26dm_dbo
27...
28OK
29API : set,c,l,acl_name
30TEST PST HUO Simple
31...
32OK
33API : save,c,l
34...
35OK
36API : commit,c
37...
38OK
39 
40API : dump,c,090xxxxxx321
41...
42USER ATTRIBUTES
43  object_name                : Test DOC HUO WITH AS AND PST
44  acl_domain                 : MYDOCBASEDEV
45  acl_name                   : dm_450xxxxxxx94_xxxxd3e
46 
47SYSTEM ATTRIBUTES
48  r_object_id                : 090xxxxxx321
49  r_object_type              : dm_document

So, the association between document, AliasSet and Templace ACL generates an instance of Templace ACL (acl_class=2) with name like dm_450xxxxxxx94_xxxxd3e. This instance is created only if its is not already exist.

01API : dump,c,450xxxxx950
02...
03USER ATTRIBUTES
04  object_name                : dm_450xxxxxxx94_xxxxd3e
05  description                : dm_450xxxxxxx94_xxxxd3e
06  owner_name                 : MYDOCBASEDEV
07  globally_managed           : F
08  acl_class                  : 2
09 
10SYSTEM ATTRIBUTES
11  r_object_id                : 450xxxxx950
12  r_is_internal              : T
13  r_accessor_name         [0]: dm_world
14                          [1]: dm_owner
15                          [2]: huo_grp_all_users
16                          [3]: myuser001
17  r_accessor_permit       [0]: 3
18                          [1]: 3
19                          [2]: 6
20                          [3]: 7
21  r_accessor_xpermit      [0]: 0
22                          [1]: 0
23                          [2]: 0
24                          [3]: 0
25  r_is_group              [0]: F
26                          [1]: F
27                          [2]: F
28                          [3]: F
29  r_has_events               : F
30  r_permit_type           [0]: 0
31                          [1]: 0
32                          [2]: 0
33                          [3]: 0
34  r_application_permit    [0]:
35                          [1]:
36                          [2]:
37                          [3]:
38  r_template_id              : 450xxxxxxx94f
39  r_alias_set_id             : 660xxxxxxd3e
40 
41APPLICATION ATTRIBUTES
42 
43INTERNAL ATTRIBUTES
44  i_has_required_groups      : F
45  i_has_required_group_set   : F
46  i_has_access_restrictions  : F
47  i_partition                : 0
48  i_is_replica               : F
49  i_vstamp                   : 0

• Deleting of AliasSet, Template ACL (PST) and Instance of Template ACL via API:

01## Give DELETE permission to super user on TEMPLATE ACL (PST) in order to delete the elements
02API : retrieve,c,dm_acl where object_name = 'TEST PST HUO Simple'
03...
04450xxxxxxx94f
05API : grant,c,l,mysuper001,AccessPermit,,7
06...
07OK
08API : save,c,l
09...
10OK
11 
12API : retrieve,c,dm_document where object_name like 'Test DOC HUO WITH AS AND PST';
13...
14090xxxxxx321
15API : destroy,c,l
16...
17OK
18API : retrieve,c,dm_acl where object_name = 'dm_450xxxxxxx94_xxxxd3e'
19...
20450xxxxx950
21API : destroy,c,l
22...
23OK
24API : retrieve,c,dm_acl where object_name = 'TEST PST HUO Simple'
25...
26450xxxxxxx94f
27API : destroy,c,l
28...
29OK
30API : retrieve,c,dm_alias_set where object_name = 'TEST AS HUO Simple'
31...
32660xxxxxxd3e
33API : destroy,c,l
34...
35OK

——————— LINKING ————————–


• Link a document to other folder:

01API : retrieve,c,my_custom_type where r_object_id = '090xxxxxxxx6df'
02...
03090xxxxxxxx6df
04API : set,c,l,my_attr1,0
05...
06OK
07API : set,c,l,my_attr2,1
08...
09OK
10API : set,c,l,my_attr3,1
11...
12OK
13API : link,c,l,'/MYCABINET/My Folder1, Fondation/SubFolder2 of Folder1'
14...
15OK
16API : save,c,l
17...
18OK
19 
20DQL : UPDATE my_custom_type OBJECTS LINK '/MYCABINET/My Folder1, Fondation/SubFolder2 of Folder1' WHERE r_object_id = '090xxxxxxxx6df'
21 
22DQL : select r_object_id, count(i_folder_id) from my_custom_type group by r_object_id having count(i_folder_id)&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;1 enable (ROW_BASED) ;
23 
24090xxxxxxxx6df
25i_folder_id = Parent Folder IDs - REPEATING of ID
26i_cabinet_id = Primary Cabinet - ID
27 
28i_folder_id[0]: 0b0xxxxxx16 = /MYCABINET/My Folder1, Fondation/SubFolder1 of Folder1
29i_folder_id[1]: 0b0xxxxxxaa = /MYCABINET/My Folder1, Fondation/SubFolder2 of Folder1
30i_cabinet_id : 0c0xxxxxx02 = /MYCABINET

——————— VALUES MAPPINGS / ASSISTANCE ————————–


• Values mapping of custom type:

1DQL : select label_text, map_display_string, map_data_string from dm_nls_dd_info
2where parent_id in (select r_object_id from dm_aggr_domain where type_name='my_subtype_document' and any attr_name='doc_type')
3#and any map_display_string like '____-%'
4;
5...
6select * from dm_nls_dd_info where parent_id in (select r_object_id from dm_aggr_domain where type_name='my_subtype_document');
7...

• Check whether a specific data should be deployed via DataDictionnary:

1DQL : select resync_needed  From dmi_dd_attr_info Where type_name=’type’ AND attr_name=’attr’;
2 
3Exemple: Select resync_needed  From dmi_dd_attr_info Where type_name='my_subtype_document' AND attr_name='type_doc';
40 = no needed
51 = needed

——————— TYPES ————————–


• Get informations concerning types (supertype…):

1DQL : select r_object_id, r_type_name, r_supertype from dmi_type_info where r_type_name IN ('dm_document', 'dm_sysobject','my_client_document','my_company_document')
2;
3...
42exxxxxx105 dm_sysobject    dm_sysobject
52exxxxx0129 dm_document dm_document,dm_sysobject
62exxxxx4500 my_company_document dm_sysobject,my_company_document,dm_document
72exxxxx4501 my_client_document  my_company_document,my_client_document,dm_document,dm_sysobject
8...

• Get informations concerning types / aspects (attributes…):

1DQL : select r_object_id, name, super_name, attr_count, start_pos from dm_type where name IN ('dm_document', 'dm_sysobject','my_client_document','dmi_030xxxxxx308','my_company_document');
2...
3030xxxxxx129    dm_document dm_sysobject    76  76
4030xxxxx0105    dm_sysobject        76  0
5030xxxxxx308    dmi_030xxxxxx308    6   0
6030xxxxx025a    my_client_document  my_company_document 123 91
7030xxxxx0259    my_company_document dm_document 91  76
8...

——————— ASPECTS ————————–


• Find the internal name (aspect table) of an aspect:

1DQL : select i_attr_def from dmc_aspect_type   where object_name = 'my_huo_aspect'
2;
3...
4dmi_030xxxxxx0b
5...

• Find attributes of an ASPECT via 2 internal tables for repeating and simple fields:

01DQL : select i_attr_def from dmc_aspect_type   where object_name = 'my_huo_aspect2'
02;
03...
04dmi_03xxxxxx30c
05...
06DQL : describe dmi_03xxxxxx30c_r;
07....
08i_partition Integer
09i_position  Integer
10r_object_id Char(16)
11my_repeating_field1 Integer
12my_repeating_field2 Char(255)
13...
14DQL : describe dmi_03xxxxxx30c_s;
15....
16i_partition Integer
17r_object_id Char(16)
18my_simple_field1  Char(512)

• Default aspect of a type. Multiple default aspects can be associated with one object type. An object type inherits all the default aspects defined for its supertypes. When you add a default aspect to a type, the newly added aspect is only associated with new instances of the type or subtype created after the addition. Existing instances of the type or its subtypes are not affected. Similarly, removal of a default aspect does not affect the existing instances of the type. Default aspects for an object type are recorded in the default_aspects property in the corresponding dmi_type_info object.

01DQL : select r_object_id, r_type_name, r_supertype, default_aspects from dmi_type_info where r_type_name IN ('dm_document', 'dm_sysobject','my_client_document','dmi_030xxxxxx30a','dmi_0302xxxxx30b','my_company_document')
02;
03...
042exxxxxx105 dm_sysobject    dm_sysobject
052exxxxx0129 dm_document dm_document,dm_sysobject
062exxxxx4500 my_company_document dm_sysobject,my_company_document,dm_document
072exxxxx4501 my_client_document  my_company_document,my_client_document,dm_document,dm_sysobject
082exxxxxx901 dmi_030xxxxxx30a    dmi_030xxxxxx30a
092exxxxxxd00 dmi_0302xxxxx30b    dmi_0302xxxxx30b
10...

——————— DAR / JAR / MODULE / METHOD ————————–


• Example for a SBO “MySecurityPolicyServiceBO” sur GLOBALR:

01# Last versions of Module : Definition of java class
02select r_object_id, object_name, r_creation_date, r_modify_date, r_version_label from dmc_module (all) where LOWER(object_name)  like '%security%' ORDER BY r_modify_date desc ;
030bxxxxxxx542    com.huo.lu.business.sbo.ecm.security.IMySecurityPolicyService   23/11/2011 09:05:58 17/03/2017 14:38:05 1.0,CURRENT
04 
05 
06# Last versions of JARS (Java Method):
07select r_object_id, object_name, r_creation_date, r_modify_date, r_version_label from dmc_jar (all) where LOWER(object_name)  like '%security%' ORDER BY r_modify_date desc ;
08090xxxxx8775    security-policy-impl    17/03/2017 14:38:02 17/03/2017 14:38:02 1.130,CURRENT
09090xxxxx8777    security-policy 17/03/2017 14:38:02 17/03/2017 14:38:02 1.130,CURRENT
10 
11# Last versions of DAR:
12select r_object_id, object_name, r_creation_date, r_modify_date, r_version_label from dmc_dar (all) where LOWER(object_name)  like '%security%' ORDER BY r_modify_date desc ;
1308xxxxa8779 MySecurityPolicyServiceBO   17/03/2017 14:38:03 17/03/2017 14:38:03 1.119,CURRENT

• Example for a TBO “MyHuoBO – my_huo_document” on MY_DOCBASE_XXX:

01# Last versions of Module : Definition of java class
02select r_object_id, object_name, r_creation_date, r_modify_date, r_version_label from dmc_module (all) where LOWER(object_name)  like '%huo_document%' ORDER BY r_modify_date desc ;
030bxxxxxxx9a9    my_huo_document 21/06/2010 09:30:48 21/03/2017 11:34:24 CURRENT,1.0
04 
05# Last versions of JARS (Java Method):
06select r_object_id, object_name, r_creation_date, r_modify_date, r_version_label from dmc_jar (all) where LOWER(object_name)  like '%huo_document%' ORDER BY r_modify_date desc ;
07-
08 
09# Last versions of DAR:
10select r_object_id, object_name, r_creation_date, r_modify_date, r_version_label from dmc_dar (all) where LOWER(object_name)  like '%myhuobo%' ORDER BY r_modify_date desc ;
11080xxxxx484 MyHuoBO 21/03/2017 11:34:17 21/03/2017 11:34:17 1.372,CURRENT
12 
13 
14 
15# Last versions of TBO:
16SELECT   * FROM  dm_document WHERE  folder('/System/Modules/TBO/my_custom_document') ORDER BY   r_creation_date DESC;
17090XXXXb11  my_custom_document
18090XXXXb0f  my_custom_document-Impl

• Example for Java methods called in Workflow (Workflow Manager):

01# Last versions of Java Methods:
02SELECT r_object_id, object_name, r_creation_date, r_modify_date, trace_launch,  method_type, use_method_server, method_verb, r_version_label from dm_method (all) where object_name  in ('FinishMethod','InclassableMethod','VersioningMethod','WorkflowMethod') ORDER BY r_modify_date;
0310xxxxxx622a    InclassableMethod   24/02/2016 13:19:20 25/02/2016 15:03:19 1   java    1   com.huo.lu.myged.persistence.documentum.bof.InclassableMethod   CURRENT,1.1
0410xxxxx4624e    FinishMethod        24/02/2016 13:19:23 25/02/2016 15:03:19 1   java    1   com.huo.lu.myged.persistence.documentum.bof.FinishMethod    CURRENT,1.1
0510xxxxxx622c    VersioningMethod    24/02/2016 13:19:21 25/02/2016 15:03:14 1   java    1   com.huo.lu.myged.persistence.documentum.bof.VersioningMethod    1.1,CURRENT
0610xxxxxx622e    WorkflowMethod      24/02/2016 13:19:21 25/02/2016 15:03:14 1   java    1   com.huo.lu.myged.persistence.documentum.bof.WorkflowMethod  1.1,CURRENT
07...
08 
09# Last versions of JARS (Java Method):
10select r_object_id, object_name, r_creation_date, r_modify_date, r_version_label from dmc_jar (all) where object_name  in ('FinishMethod','InclassableMethod','VersioningMethod','WorkflowMethod') ORDER BY r_modify_date desc ;
11090xxxxx35ba    WorkflowMethod  10/04/2014 18:02:58 10/04/2014 18:02:59 CURRENT,1.35
12090xxxxxx5b4    FinishMethod    10/04/2014 18:02:57 10/04/2014 18:02:58 1.35,CURRENT
13090xxxxxx5b6    InclassableMethod   10/04/2014 18:02:58 10/04/2014 18:02:58 1.35,CURRENT
14090xxxxx35b8    VersioningMethod    10/04/2014 18:02:58 10/04/2014 18:02:58 CURRENT,1.35
15...
16 
17# Last versions of Module : Definition of java class
18select r_object_id, object_name, r_creation_date, r_modify_date, r_version_label from dmc_module (all) where object_name  like 'com.huo.lu.myged.persistence.documentum.bof.%' ORDER BY r_modify_date desc ;
190b0xxxxxx93a    com.huo.lu.myged.persistence.documentum.bof.FinishMethod    07/01/2013 17:27:24 10/04/2014 18:03:00 1.0,CURRENT
200b01xxxx093b    com.huo.lu.myged.persistence.documentum.bof.InclassableMethod   07/01/2013 17:27:24 10/04/2014 18:03:00 1.0,CURRENT
210b0xxxxx093e    com.huo.lu.myged.persistence.documentum.bof.VersioningMethod    07/01/2013 17:27:25 10/04/2014 18:03:00 1.0,CURRENT
220b01xxxx0941    com.huo.lu.myged.persistence.documentum.bof.WorkflowMethod  07/01/2013 17:27:25 10/04/2014 18:03:00 1.0,CURRENT
23 
24# Last versions of DAR:
25select r_object_id, object_name, r_creation_date, r_modify_date, r_version_label from dmc_dar (all) where object_name  like 'MyDematClient%' ORDER BY r_modify_date desc ;
26080xxxxxx5bc    MyDematClient   10/04/2014 18:02:59 10/04/2014 18:02:59 CURRENT,1.30
27...

• Example for Custom Job:

01# Last versions of Module : Definition of java class
02select r_object_id, object_name, r_creation_date, r_modify_date, r_version_label from dmc_module (all) where LOWER(object_name)  like '%customexample1%' ORDER BY r_modify_date desc ;
030b0xxxxx2833    HUO_CustomExample1Module    13/10/2016 13:28:03 13/10/2016 15:43:20 CURRENT,1.0
04 
05# Last versions of JARS (Java Method):
06select r_object_id, object_name, r_creation_date, r_modify_date, r_version_label from dmc_jar (all) where LOWER(object_name)  like '%customexample1%' ORDER BY r_modify_date desc ;
07090xxxxx29a3    HUO_CustomExample1MethodJob 13/10/2016 14:49:32 13/10/2016 15:43:19 1.1
0809xxxxxx2a7c    HUO_CustomExample1MethodJob 13/10/2016 15:43:19 13/10/2016 15:43:19 1.2,CURRENT
09090xxxxx283d    HUO_CustomExample1MethodJob 13/10/2016 13:28:04 13/10/2016 14:49:32 1.0
10 
11# Last versions of DAR:
12select r_object_id, object_name, r_creation_date, r_modify_date, r_version_label from dmc_dar (all) where LOWER(object_name)  like '%customexample1%' ORDER BY r_modify_date desc ;
13080xxxxx2a7e    ECMCustomExample1MethodJob  13/10/2016 15:43:19 13/10/2016 15:43:20 CURRENT,1.2
14080xxxxxx9a5    ECMCustomExample1MethodJob  13/10/2016 14:49:33 13/10/2016 14:49:33 1.1
15080xxxxxx848    ECMCustomExample1MethodJob  13/10/2016 13:28:09 13/10/2016 13:28:09 1.0
16 
17# Last versions of JARS (Java Method):
18SELECT r_object_id, object_name, r_creation_date, r_modify_date, trace_launch,  method_type, use_method_server, method_verb, r_version_label from dm_method (all) where LOWER(object_name)  like '%customexample1%' ORDER BY r_modify_date;
1910xxxxxxx851    HUO_CustomExample1Method    13/10/2016 13:28:08 13/10/2016 15:43:18 1   java    1   HUO_CustomExample1Module    1.0,CURRENT
20 
21# Last versions of Jobs:
22SELECT r_object_id, object_name, r_creation_date, r_modify_date, r_version_label from dm_job (all) where LOWER(object_name)  like '%customexample1%' ORDER BY r_modify_date;
23080xxxxxxx49    HUO_CustomExample1Job   13/10/2016 14:49:32 13/10/2016 15:43:18 1.0,CURRENT

• Example for Aspect:

01# Last versions of Module : Definition of java class
02select r_object_id, object_name, r_creation_date, r_modify_date, r_version_label from dmc_module (all) where LOWER(object_name)  like '%aspect_myaspect1%' ORDER BY r_modify_date desc ;
030b0xxxxxxfc3    aspect_myaspect1    08/12/2016 10:51:06 09/12/2016 09:41:29 CURRENT,1.0
04 
05# Last versions of JARS (Java Method):
06select r_object_id, object_name, r_creation_date, r_modify_date, r_version_label from dmc_jar (all) where LOWER(object_name)  like '%myaspect1%' ORDER BY r_modify_date desc ;
07090xxxxx8efd0   MyAspect1-impl  08/12/2016 10:51:23 09/12/2016 09:41:28 1.0
08090xxxxx906f9   MyAspect1-impl  09/12/2016 09:41:28 09/12/2016 09:41:28 CURRENT,1.1
090902xxxx906f7   MyAspect1   09/12/2016 09:41:24 09/12/2016 09:41:27 CURRENT,1.1
10090xxxx48efcf   MyAspect1   08/12/2016 10:51:22 09/12/2016 09:41:24 1.0
11 
12# Last versions of DAR:
13select r_object_id, object_name, r_creation_date, r_modify_date, r_version_label from dmc_dar (all) where LOWER(object_name)  like '%myaspect1%' ORDER BY r_modify_date desc ;
14080xxxxxx06fb   ECMMyAspect1    09/12/2016 09:41:29 09/12/2016 09:41:29 CURRENT,1.1
15080xxxxx8efda   ECMMyAspect1    08/12/2016 10:51:24 08/12/2016 10:51:24 1.0
16 
17# Last versions of JARS (Java Method):
18SELECT r_object_id, object_name, r_creation_date, r_modify_date, trace_launch,  method_type, use_method_server, method_verb, r_version_label from dm_method (all) where LOWER(object_name)  like '%myaspect1%' ORDER BY r_modify_date;
19-
20 
21# Last versions of Aspect:
22select r_object_id, object_name, primary_class, r_object_type, r_folder_path, i_attr_def from dmc_aspect_type where LOWER(object_name) like 'aspect_myaspect1%';
230b0xxxxxxfc3    aspect_myaspect1    com.huo.lu.my.ecm.aspect.impl.MyAspect1 dmc_aspect_type /System/Modules/Aspect/aspect_myaspect1 dmi_0302xxxxx0252

——————— SESSION ————————–


• Some DQL requests:

1EXECUTE show_sessions;
2...
3EXECUTE list_sessions;
4...
5EXECUTE count_sessions;

——————— JOB ————————–


• Documentum : Job : Force the starting and stopping of a running job (DQL, API)
http://www.javablog.fr/documentum-job-force-the-starting-and-stopping-of-a-running-job-dql-api.html
• Modify a job via API (remove, append method arguments…):

01API : begintran,c
02...
03OK
04API : retrieve,c,dm_job where object_name = 'HuO_MyChangeOwner'
05...
06080xxxxxxxx45
07API : remove,c,l,method_arguments
08...
09OK
10API : remove,c,l,method_arguments
11...
12OK
13API : append,c,l,method_arguments
14-grace_period 1
15...
16OK
17API : append,c,l,method_arguments
18-condition my_id IN (SELECT my_id FROM dm_dbo.my_table WHERE my_condition_1 IN (12,34,56))
19...
20OK
21API : save,c,l
22...
23OK
24API : commit,c
25...
26OK
27API : dump,c,l
28...
29USER ATTRIBUTES
30 
31  object_name                : HuO_MyChangeOwner
32  title                      : HuO
33  subject                    :
34  authors                  []:
35  keywords                 []:
36  resolution_label           :
37  owner_name                 : myuserprd
38  owner_permit               : 7
39  group_name                 : docu
40  group_permit               : 6
41  world_permit               : 3
42  log_entry                  :
43  acl_domain                 : HuOCOMPANYPROD
44  acl_name                   : dm_4502xxxxxxxxx0102
45  language_code              :
46  method_name                : HuO_MyChangeOwner
47  method_arguments        [0]: -grace_period 1
48                          [1]: -condition my_id IN (SELECT my_id FROM dm_dbo.my_table WHERE my_condition_1 IN (12,34,56))
49  pass_standard_arguments    : T
50  start_date                 : 21/07/2010 00:00:00
51  expiration_date            : 21/07/2031 00:00:00
52  max_iterations             : 0
53  run_interval               : 1
54  run_mode                   : 2
55  is_inactive                : F
56  inactivate_after_failure   : F
57  target_server              :
58  method_trace_level         : 10
59  run_now                    : F
60  method_data              []:
61 
62SYSTEM ATTRIBUTES
63 
64  r_object_id                : 080xxxxxxxx45
65  r_object_type              : dm_job
66  r_version_label         [0]: 1.0
67                          [1]: CURRENT
68....

——————— DELETE / DESTROY ————————–


The destroy delete only the CURRENT version, you must pass the documents in a specific order otherwise it does not work on previous versions.
1destroy,session,object_id[,force_flag]

Removes an object from the repository.
+ session Identifies an open repository session.
+ object_id Identifies the object that you want to remove from the repository. Use the object’s ID or an indirect reference (@object_id) that points to the object.
+ force_flag Valid only when object_id represents an ACL or lifecycle object, this flag allows Superusers to force the removal of an ACL or lifecycle that is still in use. The default is F. Set this to T to remove an ACL or lifecycle that is still in use.


The prune deletes the whole tree:
1prune,session,object_id[,keepSLabel]
2...
3prune,c,{r_object_id_current},FALSE

Removes unwanted versions of an object.
+ session Identifies an open repository session.
+ object_id Specifies the object whose version tree you want to prune. Use the object’s ID or an indirect reference (@object_id) that points to the object.
+ keepSLabel Directs the server to keep or remove versions having symbolic labels. The default is T. To remove versions that have symbolic labels, set this flag to F.

——————— SQL ————————–


• generate SQL of DQL request:

1DQL : select * from dm_document where r_object_id = '090XXXXXXXXXXX'  ENABLE(GENERATE_SQL_ONLY);
2 
3-- generate_sql
4select all dm_document.r_object_id,dm_document.object_name,dm_document.title,dm_document.subject,dm_document.resolution_label,dm_document.owner_name,dm_document.owner_permit,dm_document.group_name,dm_document.group_permit,dm_document.world_permit,dm_document.log_entry,dm_document.acl_domain,dm_document.acl_name,dm_document.language_code,dm_document.r_object_type,dm_document.r_creation_date,dm_document.r_modify_date,dm_document.a_content_type from dm_document_sp  dm_document where ((dm_document.r_object_id='090XXXXXXXXXXX')) and (dm_document.i_has_folder = 1 and dm_document.i_is_deleted = 0)





——————— STORE / LOCATION ————————–


01####### MY_COMPANY_UAT - huo_client_document : filesstores used
02select DISTINCT a_storage_type from huo_client_document;
03 
04## Number of contents in each STORE
05select s.name, count(*) as cpt from huo_client_document (all) d, dmr_content c, dm_store s where any c.parent_id=d.r_object_id and c.storage_id=s.r_object_id group by s.name;
06# myas_filestore        191
07# myas_filestore_01 2
08# centera_store_no_retention    92
09# filestore_01  136341
10# filestore_02  283184
11# filestore_03  41904
12# filestore_04  34063
13# filestore_para    2288
14# thumbnail_store_01    229313
15 
16 
17 
18## STORE
19select r_object_id, name, current_use, full_current_use, base_url from dm_store WHERE name IN (select DISTINCT a_storage_type from huo_client_document);
20# 6d0XXXXXX13c  centera_store_no_retention  0   0  
21# 280XXXXXX15b  myas_filestore_01           133837  133837 
22# 280XXXXXX16f  filestore_04            -1434144515 93055135997
23# 280XXXXXX132  filestore_para          223420137   223420137  
24# 280XXXXXX166  filestore_03            -1997491449 96786756359
25# 280XXXXXX15c  myas_filestore          1934668370  1934668370 
26# 280XXXXXX100  filestore_01            -1173273693 518517769123   
27# 280XXXXXX101  thumbnail_store_01      -111919445  12772982443 http://MYDCTMAPP001:8081/thumbsrv/getThumbnail?
28# 280XXXXXX151  filestore_02            -1862826846 822770893986   
29#
30#
31select r_object_id, name, current_use, full_current_use, base_url, root from dm_filestore WHERE name IN (select DISTINCT a_storage_type from huo_client_document);
32# 280XXXXXX15b  myas_filestore_01       133837  133837      myas_storage_01
33# 280XXXXXX16f  filestore_04        -1433775093 93055505419     storage_04
34# 280XXXXXX132  filestore_para      223420137   223420137       storage_para
35# 280XXXXXX166  filestore_03        -1997491449 96786756359     storage_03
36# 280XXXXXX15c  myas_filestore      1934668370  1934668370      myas_storage
37# 280XXXXXX100  filestore_01        -1173273255 518517769561        storage_01
38# 280XXXXXX101  thumbnail_store_01  -111919445  12772982443 http://MYDCTMAPP001:8081/thumbsrv/getThumbnail? thumbnail_storage_01
39# 280XXXXXX151  filestore_02        -1862826846 822770893986        storage_02
40#
41#
42select r_object_id, name, current_use, full_current_use, base_url, a_storage_params from dm_ca_store WHERE name IN (select DISTINCT a_storage_type from huo_client_document);
43# 6d0XXXXXX13c  centera_store_no_retention  0   0       huo1ecs01.huo.myserver.com,huo2ecs01.huo.myserver.com.....
44 
45 
46 
47## LOCATION of STORE
48select r_object_id, object_name, file_system_path, path_type, r_object_type from dm_location order by 2;
49#
50select r_object_id, object_name, file_system_path, path_type, r_object_type from dm_location where object_name IN (select DISTINCT root from dm_filestore WHERE name IN (select DISTINCT a_storage_type from huo_client_document));
51# 3aXXXXXXXbef  myas_storage_01     \\myasfiles123\d$\TEST\Data\MY_COMPANY_UAT\myas_storage_01  directory   dm_location
52# 3aXXXXXXX861  storage_04          \\myfiles456\d$\DATA\MY_COMPANY_UAT\content_storage_04  directory   dm_location
53# 3aXXXXXXX22d  storage_03          \\myfiles456\f$\DATA\MY_COMPANY_UAT\content_storage_03  directory   dm_location
54# 3aXXXXXXX13f  storage_01          \\myfiles456\d$\DATA\MY_COMPANY_UAT\content_storage_01  directory   dm_location
55# 3aXXXXXXX346  storage_para            \\myfiles456\e$\DATA\ATAs                           directory   dm_location
56# 3aXXXXXXXbf0  myas_storage            \\myasfiles123\d$\TEST\Data\MY_COMPANY_UAT\myas_storage     directory   dm_location
57# 3aXXXXXXXf4d  storage_02          \\myfiles456\e$\DATA\MY_COMPANY_UAT\content_storage_02  directory   dm_location
58# 3aXXXXXXX15a  thumbnail_storage_01    \\myfiles456\d$\DATA\MY_COMPANY_UAT\thumbnail_storage_01    directory   dm_location
59 
60 
61 
62 
63## Some documents CONTENT on a specific STORE
64select c.r_object_id from huo_client_document (all) d, dmr_content c, dm_store s where any c.parent_id=d.r_object_id and c.storage_id=s.r_object_id AND s.name='filestore_01' enable(RETURN_TOP 50);
65# 060XXXXXXXXd19
66# 060XXXXXXXXd1a

….TO BE CONTINUED