23.4 Creating and Linking a File in a Docbase Cabinet
We saw a very simple example to establish a session with the Docbase. Once the Docbase session has been created, you can perform a host of operations in the Docbase. In this example, we will see how to create a document object in the Docbase, associate it with a text file, and link this object to a cabinet in the Docbase via DFC methods.
Create a simple Java file LinkingFileDFC.java
as shown below:
import com.documentum.fc.client.*; import com.documentum.fc.common.*; import java.io.IOException; public class LinkingFileDFC{ //Main method public static void main(String args[]){ IDfSession session = null; IDfSessionManager sMgr = null; try { String strDocbaseName = "dev_doc"; //Connecting to DocBase IDfClient client = new DfClient().getLocalClient(); sMgr = client.newSessionManager(); IDfLoginInfo loginInfo = new DfLoginInfo(); loginInfo.setUser( "documentum" ); loginInfo.setPassword( "solutions" ); sMgr.setIdentity(strDocbaseName, loginInfo...