Connecting to Documentum using. Net (DFC)

Source: Internet
Author: User

September 14 connecting to Documentum using. neti've spoke in an earlier post about working with Documentum in. net. in this post, I'll show you how to connect to a docbase, and get the list of cabinets. the following code will connect to a docbase. it assumes that you have a username, password and docbase variables declared that contain valid information: // get a client objectdfclientx _ clientx = new dfclientx ();
Idfclient _ client = _ clientx. getlocalclient ();

If (_ client = NULL)
Throw new exception ("failed creating Documentum client ");

// Retrieve the client's version
Console. writeline ("using DFC version '{0}'", _ clientx. getdfcversion ());

// Create an object with the credentials of the user
Idflogininfo _ logininfoobj = _ clientx. getlogininfo ();
_ Logininfoobj. setuser (username );
_ Logininfoobj. setpassword (password );

// Create a new session to the requested docbase
Idfsession _ session = _ client. newsession (docbase, _ logininfoobj );

If (_ session = NULL |! _ Session. isconnected ())
{
Console. writeline ("failed conecting to Documentum ");
If (_ session! = NULL)
{
Console. writeline ("DFC messages: \ r \ n {0}", _ session. getmessage (1 ));
}
Return;
}

Console. writeline ("using server version' {0} '", _ session. getserverversion ());
Now, once we're new to the Documentum docbase, We'll list all the cabinets:

Idfquery query = _ clientx. getquery ();
// Quering the "dm_cabinet" Table returns only items of dm_cabinet type
Query. setdql (

"Select r_object_id, object_name, title from dm_cabinet ");

// Query the session for the cabinets
Idfcollection Col = query.exe cute (_ session, (INT) dfclib. tagdfquerytypes. idfquery_df_read_query );

// Loop through all the items in the collection
While (Col. Next ())
{
// Get the current item from the collection
Idftypedobject typedobj = col. gettypedobject ();
// Print the item's name
Console. writeline ("Cabinet name: {0}", typedobj. getstring ("object_name "))
}
Col. Close ();

One of the most important thing to remember, is that you have to close the idfcollection. each session has a very limited number of Collections It can have open at the same time. if you need more collections, I wocould suggest just caching the items inside. net collection for later use.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.