Posts Tagged ‘DFC’

Handling Virtual Documents using DFC

April 21, 2010 Comments off

Today’s post i will try to put in some useful examples to create and handle Virtual documents and etc in Documentum docbase using Documentum Foundation Classes.

1. Create a virtual document in docbase:

public void createVirtualDocument() throws Exception {
IDfSysObject pSysObj = (IDfSysObject) idfSession.getObjectByPath(“/Cabinet
Name/Folder Level 2/”);
IDfSysObject cSysObj = (IDfSysObject) idfSession.getObjectByPath(“/Cabinet
Name/Folder Level 1/trace.log”);
IDfVirtualDocument vDoc = pSysObj.asVirtualDocument(“CURRENT”, false);
IDfVirtualDocumentNode pNode = vDoc.getRootNode();
IDfVirtualDocumentNode nodeChild1 = vDoc.addNode(pNode, null,
cSysObj.getChronicleId(),”CURRENT”, false,
pSysObj.checkin(false, “CURRENT”);

2. Export a virtual document from docbase:

public void exportVirtualDocument() throws Exception {
System.out.println(“exporting virtual document”);
IDfExportOperation expOpr = new DfExportOperation();
IDfSysObject sysObj = (IDfSysObject) idfSession.getObjectByPath(“/Cabinet
Name/Folder Level 2/”);
if (sysObj.isVirtualDocument()) {
IDfVirtualDocument vdoc = sysObj.asVirtualDocument(“CURRENT”,
IDfExportNode expNode = (IDfExportNode) expOpr.add(sysObj);
boolean flag = expOpr.execute();

3. View virtual document from docbase:

public void viewVirtualDocument() throws Exception {
IDfSysObject pSysObj = (IDfSysObject) idfSession.getObjectByPath(“/Cabinet
Name/Folder Level 2/”);
if (pSysObj.isVirtualDocument() ) {
System.out.println(“virtual document –> true”);
IDfVirtualDocument vDoc = pSysObj.asVirtualDocument(“CURRENT”, false);
IDfVirtualDocumentNode pNode = vDoc.getRootNode();
for ( int i=0;i<pNode.getChildCount();i++) {
IDfVirtualDocumentNode cNode = pNode.getChild(i);
System.out.println("Child Name " +cNode.getSelectedObject().

4. Retrieve document from documentum using IDQL:

public void collection() throws Exception {
IDfQuery query = new DfQuery();
query.setDQL(“select * from dm_document where object_name=’New Document’
and any r_version_label like ‘CURRENT%'”);
IDfCollection coll = query.execute(idfSession, 0);
while ( ) {
IDfTypedObject typeObject = (IDfTypedObject) coll.getTypedObject();
System.out.println(“Object Name ” + typeObject.getString(“r_object_id”));
System.out.println(“creation date ” + typeObject.getString(“r_creation_date”));
if ( coll != null )

Handling Basic Operations in DCTM using DFC

April 20, 2010 Comments off

1.Check out a document from docbase:

public void checkoutDocument() throws Exception {
IDfSysObject sysObj = (IDfSysObject) idfSession.getObjectByPath(“/Cabinet
Name/Folder Level 1/Test-Document”);
if (!sysObj.isCheckedOut()) // if it is not checked out
System.out.println(“is Check out ” + sysObj.isCheckedOut());

2.Check in a document to docbase:

public void checkinDocument() throws Exception {
IDfSysObject sysObj = (IDfSysObject) idfSession.getObjectByPath(“/Cabinet
Name/Folder Level 1/Test-Document”);
if (sysObj.isCheckedOut()) { // if it is checked out

3.Delete a document from docbase:

public void deleteDocument() throws Exception {
IDfSysObject sysObj = (IDfSysObject) idfSession.getObjectByPath(“/Cabinet
Name/Folder Level 1/Test-Document”);
if (sysObj != null ) {
sysObj.destroyAllVersions(); // delete all versions
System.out.println(“object destroyed…..”);

4.Update document’s metadata\attributes in docbase:

public void updateAttributes() throws Exception {
IDfSysObject sysObj = (IDfSysObject) idfSession.getObjectByPath(“/Cabinet
Name/Folder Level 1/New Document”);
sysObj.setString(“object_name”, “New Document”);
sysObj.setString(“authors”, “author1”);

5.Retrieve document’s metadata\attributes from docbase:

public void getAttributes() throws Exception {
IDfSysObject sysObj = (IDfSysObject) idfSession.getObjectByPath(“/Cabinet
Name/Folder Level 1/New Document”);
if (sysObj != null ) {
System.out.println(“objectName ” + sysObj.getString(“object_name”));
//System.out.println(“authors ” + sysObj.getString(“authors”));
String authors = sysObj.getAllRepeatingStrings(“authors”, “,”);
ArrayList list = new ArrayList();
StringTokenizer st = new StringTokenizer(authors, “,”);
System.out.println(“length of st ” + st.countTokens());
while( st.hasMoreTokens()) {
System.out.println(“length ” + list.size());
for (int i=0;i<list.size();i++) {
System.out.println("Author["+i+"] " + list.get(i));

Documentum Foundation Classes Examples for Java-Contd.

April 19, 2010 Comments off

Today let us discuss few more examples on DFC.
1. Check out a document from docbase using IDfOperations:

public void checkoutDocument() throws Exception {
IDfCheckoutOperation checkoutOpr = new DfCheckoutOperation();
System.out.println(“Checkout Dir ” + checkoutOpr.getDefaultDestinationDirectory()); checkoutOper.setDestinationDirectory(checkoutOpr.getDefaultDestinationDirectory());
IDfSysObject sysObj = (IDfSysObject) idfSession.getObjectByPath(“/Cabinet Name/Folder Level 2/ Test-Document”);
IDfCheckoutNode node = (IDfCheckoutNode) checkoutOpr.add(sysObj); boolean flag = checkoutOpr.execute();

2.Check in a document to docbase using IDfOperations:

public void checkinDocument() throws Exception {
IDfCheckinOperation checkinOpr = new DfCheckinOperation();
IDfCheckinNode node = (IDfCheckinNode) checkinOpr.add(sysObj);
System.out.println(“Flag —->” + checkinOpr.execute());

3.Making use of IAPI methods:

public void dmclAPI() throws Exception {
IDfSysObject sysObj = (IDfSysObject) idfSession.getObjectByQualification (“dm_document where object_name=’Test-Document'”);
String objId = sysObj.getObjectId().getId();
String name = (String)idfSession.apiGet(“get”, objId + “,object_name”);
System.out.println(“Name :” + name); //idfSession.apiSet(“set”, objId +”,title”,”sample-doc”); idfSession.apiExec(“link”, objId +”,/Cabinet Name/Folder Level 2″);
System.out.println(“Linked ” + idfSession.apiExec(“save”, objId));

4.To import a document into docbase:

public void importDocument() throws Exception {
IDfSysObject sysObj= (IDfFolder) idfSession.getObjectByPath (“/Cabinet Name/Folder Level 2”); System.out.println(“Object ID” + sysObj.getObjectId());
IDfImportOperation importOpr = new DfImportOperation();
if (importOpr == null ) {
System.out.println(“operation object is null”);
importOpr.setVersionLabels(“imported using operation”);
IDfImportNode node = (IDfImportNode) importOpr.add (“C:\\Documentum\\config\\ Test-Document”);
boolean flag = importOpr.execute();

5.Cancelcheckout a document into docbase:

public void cancelCheckoutDocument() throws Exception {
IDfCancelCheckoutOperation cancelcheckoutOpr = new DfCancelCheckoutOperation();
IDfSysObject sysObj = (IDfSysObject) idfSession.getObjectByPath (“/Cabinet Name/Folder Level 2/ Test-Document”);
IDfCancelCheckoutNode node = (IDfCancelCheckoutNode) cancelcheckoutOpr.add (sysObj); boolean flag = cancelcheckoutOpr.execute();

Stay tuned preparing few more examples.

Documentum Foundation Classes Examples for Java

April 18, 2010 Comments off

Today i have to tried to put in some of the examples describing the DFC usage in Documentum.
1.Connecting to the content server docbase and establishing session :

public IDfSession getDfSession (String userName, String password, String docbaseName) throws Exception {
IDfLoginInfo loginInfo = new DfLoginInfo();
IDfClient client = new DfClient();
IDfSessionManager sessMgr = client.newSessionManager();
sessMgr.setIdentity(docbaseName, loginInfo);
idfSession = sessMgr.getSession(docbaseName);
if ( idfSession != null )
System.out.println(“Session created successfully”); return idfSession;

2.Get a list of available docbase:

public void getAllDocbases() throws Exception {
IDfClient client = DfClient.getLocalClient();
IDfDocbaseMap docbaseMap = client.getDocbaseMap();
for(int i=0;i<docbaseMap.getDocbaseCount();i++) {
System.out.println(“Docbase Name : ” + docbaseMap.getDocbaseName(i)); System.out.println(“Docbase Desc : ” + docbaseMap.getDocbaseDescription(i));
3. Create a cabinet (dm_cabinet object) in docbase:

public void createCabinet() throws Exception {
IDfFolder cabinetObj = (IDfFolder) idfSession.newObject(“dm_cabinet”);
if (cabinetObj != null) {
cabinetObj.setObjectName(“Cabinet Name”);;

4. Create a folder (dm_folder object) in docbase:

public void createFolder() throws Exception {
IDfFolder folderObj = (IDfFolder) idfSession.newObject(“dm_folder”);
if (folderObj != null) {
folderObj.setObjectName(“Folder Level 2”);“/Cabinet Name”);;

5. Create a document (dm_document object) in docbase:

public IDfDocument createDocument() throws Exception {
IDfDocument documentObj = (IDfDocument) idfSession.newObject(“dm_document”);
if (documentObj!= null) {
documentObj.setContentType(“crtext”); documentObj.setFile(“C:\\Documentum\\config\\”);“/Cabinet Name/Folder Level 2”);;
return documentObj;

DFC Programming Approach

April 17, 2010 Comments off

DFC enables programmers to access content management functionality through both high-level operations and low-level object method calls. A services layer encapsulates business logic for common processes, such as workflow, data validation, searching, and virtual document management.

 DFC is organized into a set of Interfaces and Classes.

 • DFC implementation classes will begin with Df

 • Interfaces will begin with IDf

Package Description Facilitates accessing DFC from COM
com.documentum.fc.client Provides basic functionality:Establishing DFC sessionsRetrieving and validating data

Managing workflows

Manipulating virtual documents

Working with document versions

common.documentum.fc.client.qb Constructs and run queries and SmartLists.
com.documentum.fc.common Supplies utility methods for other DFC classes.
com.documentum.operations Provides high-level functionality, such as checking documents or virtual documents in and out. Provides XML Support.
com.documentum.registry Maintains Documentum information on the client’s system, using the window registry on win32 platforms, and .ini files otherwise.
com.documentum.xml.xql Facilitates constructing Docbase queries that return results in an XML format.

Categories: DOCUMENTUM Tags: , , ,

DFC Installation and Configuration

April 16, 2010 Comments off

The below steps will guide  you to install & Configure  DFC :

Step 1: Use dfcWinSuiteSetup.exe to start the DFC installation.

Step 2: A welcome dialog box appears, click next to proceed to the next window.

Step 3: The license agreement is displayed, select the accept option and click next.

Step 4: Mention the path where you need to install DFC programs and click next.

Step 5: Specify whether to install optional components for developers like developer documentation and Primary Interop Assembly Installer.

Step 6: Specify the root directory for documentum user information and click next.

Step 7: Specify the host and port number for the connection broker machine.

Step 8: Check the global registry checkbox to use DFC as global registry.

Step 9: See the progress and click finish when the installation reports that it has successfully installed DFC.

The Following Files are required to run DFC and BOF programs. You can find the files in Directory “<<drive>>”:\Documentum\config


Set preferences for how DFC handles certain choices in the course of its execution.

This file contains documentation of all recognized properties and their default settings. (Do not modify this file and copy the properties to file)

Another important property is set dfc.registry.mode = file. This causes DFC to use a file to store certain settings, rather than the Windows registry. This is the standard setting for UNIX systems. It also works for Windows systems, but that setting is incompatible with Documentum Desktop.

Contains registry entries for BOF classes.

Configuring Log Properties

Edit dmcl.ini found in C:\WINNT


Host: Docbroker IP

Port: Port which Docbroker is listening

Documentum Foundation Classes (DFC)

April 15, 2010 Comments off

Documentum Foundation Classes (DFC)

The Documentum DMCL contains the core API to communicate to server. The DFC provides a robust, object oriented wrapper around DMCL API and includes additional functionality.

Documentum Applications depend on Documentum object model and DFC exposes this object model as an object oriented client library. Client side applications such as desktop, WDK, middle-tier libraries use DFC.

          Documentum Foundation Classes (DFC) is an object oriented application programming interface (API) and framework for accessing, customizing, and extending Documentum functionality.

DFC includes

  • A set of interfaces and implementation classes
  • A collection of DLLs to provide DFC functionality
  • A shared library that must be loaded to use DFC with non MS JVM
  • A type library to access DFC via COM

DFC Provides

  • Java-COM Bridge (DJCB) to access the DFC interfaces from COM
  • Primary Interop Assembly (PIA) to access DFC from .NET
  • BOF to embody business rules and patterns in re usable elements

DFC Uses

  • Access Documentum Functionality
  • Customize or extend Documentum Products (Web Top, Desktop)
  • Write method/procedure to be executed on server as part of workflow or lifecycle – method execution on server.
  • Integration of Content Management Functionality into third party Enterprise Applications

Categories: DOCUMENTUM Tags: , ,
%d bloggers like this: