JavaBlog.fr / Java.lu DEVELOPMENT,ECM Documentum : Administration Methods : Presentation and examples GET_PATH, DO_METHOD, CHECK_SECURITY, GET_FILE_URL

Documentum : Administration Methods : Presentation and examples GET_PATH, DO_METHOD, CHECK_SECURITY, GET_FILE_URL

Hello,

Here, a simple post concerning the Administration Methods. what are Administration Methods ? which are Administration Methods ?

Administrative methods are methods that perform a variety of administrative and monitoring tasks. They are executed in an application by invoking either the DQL EXECUTE statement or the IDfSession.apply method. You can also execute them interactively through Documentum Administrator.

More information in:
– DQL Reference documentation Documentum_Content_Server_6.7_DQL_Reference.pdf
– Administrator Version 7.2 User Guide http://www.emc.com/collateral/TechnicalDocument/docu57878.pdf


Invoking administration methods via DA

To execute an administration method manually, use Documentum Administrator in the node (Administration/Job Management/Administration Methods). All the methods (except DO_METHOD, WEBCACHE_PUBLISH, and ROLES_FOR_USER) are available through the Methods facility in repository Management. Many of the methods are also available through category-specific pages.
Note: Because DO_METHOD is used to execute user-defined procedures, this method is implemented as part of the Attributes page for user-defined methods.


Invoking administration methods via DQL

To execute an administration method in an application, use the DQL EXECUTE statement. You can also use EXECUTE to invoke an administration method through IDQL.
The EXECUTE statement is the DQL equivalent of the API Apply method. You can use it to execute any of the administration methods except PING or WEBCACHE_PUBLISH.
The EXECUTE statement is not case sensitive. You can enter the administration method name and argument names in uppercase, lowercase, or any combination. You must enclose character string values (including an object ID in a FOR clause) in single quotes when they are included in the EXECUTE statement.

Note : It’s possible to use IDQL32.exe or IAPI32.exe in order to execute DQL or API commands. The scheduling could be done via OS tasks (like Windows Scheduled).

 
 
Some examples….:
DO_METHOD
Executes an external program, a Docbasic script, or a Java method. (Note that use of Docbasic is deprecated.)

EXECUTE do_method WITH METHOD='method_name' {,arguments=value}

Example DQL:

EXECUTE do_method WITH method = 'HUO_JavaBlogMethod', save_results=true, arguments ='-user_name huouser -docbase_name MY_DOCBASE_DEV -myparameters1 "VALUE11, VALUE12"  -myparameters2 "VALUE21, VALUE22" '

 
 
GET_FILE_URL
Returns the URL to a particular content file.

EXECUTE get_file_url FOR object_id WITH format='format_name'[,page=page_number,] [page_modifier='value']
object_id is the object ID of the document that contains the content file.

Example:

EXECUTE get_file_url FOR '090xxxxxx6f' WITH format='excel12book',page=0,page_modifier='0'
<em>...outputs:</em>
result=T		
base_url=''
store=filestore_01	
path=00xxxx5\80\16\1a\22.xlsx	
ticket=''

 
 
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.

EXECUTE check_security WITH user_name='name'|group_name='name',level=security_level,object_list='list_of_objectids

Example 1:

EXECUTE check_security WITH user_name='huseyin1',level=7,object_list='090xxxxxxx6f 090xxxxxxxx12 090xxxxxxx15'
<em>...outputs:</em>
___

 
Example 2:

EXECUTE check_security WITH user_name='huseyin1',level=1,object_list='090xxxxxxx6f 090xxxxxxxx12 090xxxxxxx15'
<em>...outputs:</em>
r_object_id
090xxxxxxx6f
090xxxxxxxx12
090xxxxxxx15

 
 
GET_PATH
Returns the directory location of a content file stored in a distributed storage area.

EXECUTE get_path [FOR] 'content_obj_id' [WITH store = 'value']

Example:

select * from dmr_content where any parent_id = '090xxxxxxxxxc13';
r_object_id=0602xxxxxxb9d , rendition=0 , full_format=txt
r_object_id=060xxxxxxxb9e , rendition=2 , full_format=xml

 
Example 1 (primary rendition):

EXECUTE get_path FOR '0602xxxxxxb9d' WITH store='filestore_01'
<em>...outputs:</em>
result=\\MYDCTMSERVER\data\MY_DOCBASE_DEV\content_storage_01\000XXXX5\80\22\e3\97.txt

 
Example 2 (xml rendition):

EXECUTE get_path FOR '060xxxxxxxb9e' WITH store='filestore_01'
<em>...outputs:</em>
result=\\MYDCTMSERVER\data\MY_DOCBASE_DEV\content_storage_01\000XXXX5\80\22\e3\98.xml

Invoking administration methods via API with specific function

Some administration method have equivalent of API function.

 
 
Some examples….:
GET_PATH
Returns the directory location of a content file stored in a distributed storage area.

API: getpath,c,document_obj_id

Example:

select * from dmr_content where any parent_id = '090xxxxxxxxxc13';
r_object_id=0602xxxxxxb9d , rendition=0 , full_format=txt
r_object_id=060xxxxxxxb9e , rendition=2 , full_format=xml

 
Example 1 (primary rendition):

API> getpath,c,090xxxxxxxxxc13
<em>...outputs:</em>
result=\\MYDCTMSERVER\data\MY_DOCBASE_DEV\content_storage_01\000XXXX5\80\22\e3\97.txt

 
Example 2 (xml rendition):

API> getpath,c,090xxxxxxxxxc13,,xml
<em>...outputs:</em>
\\MYDCTMSERVER\data\MY_DOCBASE_DEV\content_storage_01\000XXXX5\80\22\e3\98.xml

Invoking administration methods via API with APPLY instruction

To execute an administration method in an application, use the specific API instruction APPLY. You can also use these instructions through IAPI. The API Apply method is the API equivalent of the DQL EXECUTE statement. The Apply method returns a collection identifier for a collection that contains the results of the specified method.

Note : It’s possible to use IDQL32.exe or IAPI32.exe in order to execute DQL or API commands. The scheduling could be done via OS tasks (like Windows Scheduled).

 
 
Some examples….:
GET_PATH
Returns the directory location of a content file stored in a distributed storage area.

API: apply,c,content_obj_id,GET_APTH,STORE,S,filestore_id

Example:

select * from dmr_content where any parent_id = '090xxxxxxxxxc13';
r_object_id=0602xxxxxxb9d , rendition=0 , full_format=txt
r_object_id=060xxxxxxxb9e , rendition=2 , full_format=xml

 
Example 1 (primary rendition):

API> apply,c,0602xxxxxxb9d,GET_PATH,STORE,S,filestore_01
API> next,c,q4
API> get,c,q4,result
<em>...outputs:</em>
API> apply,c,0602xxxxxxb9d,GET_PATH,STORE,S,filestore_01
...
q4
API> next,c,q4
...
OK
API> get,c,q4,result
...
\\MYDCTMSERVER\data\MY_DOCBASE_DEV\content_storage_01\000XXXX5\80\22\e3\97.txt

 
Example 2 (xml rendition):

API> apply,c,060xxxxxxxb9e,GET_PATH,STORE,S,filestore_01
API> next,c,q5
API> get,c,q5,result
<em>...outputs:</em>
API> apply,c,060xxxxxxxb9e,GET_PATH,STORE,S,filestore_01
...
q5
API> next,c,q5
...
OK
API> get,c,q5,result
...
\\MYDCTMSERVER\data\MY_DOCBASE_DEV\content_storage_01\000XXXX5\80\22\e3\98.xml

Invoking administration methods via DFC – getSession().apply(…)

To execute an administration method in an application, use the IDfSession.apply method. For information about using IDfSession.apply to invoke an administration method, refer to the Javadocs.

Note : It’s possible to include this code in a custom job executed by dm_agent_exec.

	public void getPathWithSessionApply(String objectId) throws Exception {
		System.out.println("----- getPathWithSessionApply("+objectId+")");
		IDfCollection dfCollection = null;
		try {
            IDfList args = new DfList();
            IDfList dataType = new DfList();
            IDfList values = new DfList();
            //
            args.appendString("STORE");
            dataType.appendString("S");
            values.appendString("filestore_01");
            //
            dfCollection = idfSession.apply(objectId, "GET_PATH", args, dataType, values);
			if(dfCollection !=null && dfCollection.next()){
				System.out.println(dfCollection.getString("result"));
			}
		}finally{
			if(dfCollection!=null){
				dfCollection.close();
			}
		}
	}

…outputs:

----- getPathWithSessionApply(0602xxxxxxb9d)
\\MYDCTMSERVER\data\MY_DOCBASE_DEV\content_storage_01\000XXXX5\80\22\e3\97.txt
----- getPathWithSessionApply(060xxxxxxxb9e)
\\MYDCTMSERVER\data\MY_DOCBASE_DEV\content_storage_01\000XXXX5\80\22\e3\98.xml

Invoking administration methods via DFC – DfAdminCommand.getCommand(…)

There is an alternative to execute an administration method in an application DfAdminCommand.getCommand(…).

Note : It’s possible to include this code in a custom job executed by dm_agent_exec.

	public void getPathWithApplyGetPath(String objectId) throws Exception {
		System.out.println("----- getPathWithApplyGetPath("+objectId+")");
		IDfCollection dfCollection = null;
		try {
			IDfApplyGetPath applyGetPath = (IDfApplyGetPath) DfAdminCommand.getCommand(IDfAdminCommand.APPLY_GET_PATH);
			applyGetPath.setContentId(new DfId(objectId));
			applyGetPath.setString("STORE", "filestore_01");
			dfCollection = applyGetPath.execute(idfSession);
			if(dfCollection !=null && dfCollection.next()){
				System.out.println(dfCollection.getString("result"));
			}
		}finally{
			if(dfCollection!=null){
				dfCollection.close();
			}
		}
	}

…outputs:

----- getPathWithApplyGetPath(0602xxxxxxb9d)
\\MYDCTMSERVER\data\MY_DOCBASE_DEV\content_storage_01\000XXXX5\80\22\e3\97.txt
----- getPathWithApplyGetPath(060xxxxxxxb9e)
\\MYDCTMSERVER\data\MY_DOCBASE_DEV\content_storage_01\000XXXX5\80\22\e3\98.xml

Best regards,

Huseyin

Leave a Reply

Your email address will not be published.

Time limit is exhausted. Please reload CAPTCHA.

Related Post