Archive

Posts Tagged ‘DFC’

DBOF Configurations

May 5, 2010 Comments off

We Know DBOF lives wherever DFC lives, either on the Content Server or Application Server, or on any of the other clients. The following Steps need to be tracked when we are trying to configure DBOF :

1) Configure DMCL.ini to both access DocBase and enable session pooling. Add the following entry to the [DMAPI_CONFIGURATION] section :

connect_pooling_enabled = T

When installing Documentum, a file with the name DMCL.ini is created in the folder

‘:/SYSROOT\system32’.

Example: C:/SYSROOT/system32.

2) Make sure dfc.jar is referenced by the CLASSPATH environment variable of your JVM running the application, dfc.jar is in ‘Shared’ folder under Documentum installation folder.

Example: C:/Program Files/Documentum/Shared

3) Make sure dmcl40.dll is in a directory referenced by the PATH variable. By default the file is placed in folder C:/Program Files/Documentum/Shared.

4) The DFC_DATA system variable must refer to the directory containing Documentum configuration information, usually C:\Documentum. This needs to be a directory that has an immediate subdirectory called C:\Documentum\config. This is where the dbor.properties file is also located.

5) Make sure TBO classes and SBO classes are configured in dbor.properties file on
Application Server.

6) The dbor.properties is editable file. As part of best practices the file should be edited by a program using IDfDbor and IDfDborEntry interfaces provided in DFC classes.The entries in dbor.properties file will
look like:

doc_request=type, com.bp.customObj.DocumentRequestTBO, 1.0
com.bp.customObj.ICreateFolderSBO=service,com.bp.customObj.CreateFolderSBO,1.0

DocumentRequestTBO, ICreateFolderSBO and CreateFolderSBO are the java classes
created for providing our own business logic.doc_request is the custom object type defined in DocBase. One can create custom object types using Documentum DA. ‘type’ represents Type Based Object followed by full class name, 1.0 represents the version number of the class to be used.

The second line represents the mapping of SBO, as the identifier ‘service’ mentions.

7) Make sure TBO and SBO compiled classes are accessible from class path variable on
Application server.

I will try to bring in how to implement the concept of BOF in Documentum in my coming Posts.

Appreciate your comments.

Categories: DOCUMENTUM Tags: , , , , , , ,

Handling LifeCycles in DCTM using DFC

April 27, 2010 Comments off

We know how Documentum helps attach a LifeCycle to a document and How to handle its states viz.How to Promote & Demote a Lifecycle state .Let’s try to bring in the same using DFC Concepts.

Attach a LifeCycle to a document in docbase:

public void attachLifeCycle() throws Exception{
IDfSysObject sysObj = (IDfSysObject) idfSession.
getObjectByQualification(“dm_document where
object_name= ‘UniqueDocName’ “);
IDfSysObject procObj = (IDfSysObject)
idfSession.getObjectByQualification(“dm_policy where object_name=
‘LifeCycle Name’ “);
sysObj.attachPolicy(procObj.getObjectId(), “Author”,””);
}

Promote a LifeCycle state of a document inside a docbase:

public void promoteLifeCycle (String State) throws Exception {
IDfSysObject sysObj = (IDfSysObject) idfSession.
getObjectByQualification(“dm_document where
object_name = ‘UniqueDocName’ “);
sysObj.promote(State,false,false);
}

Demote a LifeCycle state of a document inside a docbase:

public void demoteLifeCycle(String state) throws Exception {
IDfSysObject sysObj = (IDfSysObject) idfSession.
getObjectByQualification(“dm_document where
object_name = ‘UniqueDocName’ “);
sysObj.demote(state,false);
}

How to suspend or resume a LifeCycle of a document in Documentum ?

Expire a LifeCycle state of a document in a docbase:

public void expireLifeCycle (String state) throws Exception {
IDfSysObject sysObj = (IDfSysObject) idfSession.
getObjectByQualification(“dm_document where
object_name=’UniqueDocName’ “);
sysObj.suspend(state,false,false);
}

Resume a LifeCycle state of a document inside docbase:

public void resumeLifeCycle (String state) throws Exception {
IDfSysObject sysObj = (IDfSysObject) idfSession.
getObjectByQualification(“dm_document where
object_name=’UniqueDocName’ “);
sysObj.resume(state,false,false,false);
}

Your valuable comments matters , i will work on the same if any tuning to the above piece of snippets is required.

Thank You

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/log4j.properties”);
IDfSysObject cSysObj = (IDfSysObject) idfSession.getObjectByPath(“/Cabinet
Name/Folder Level 1/trace.log”);
pSysObj.setIsVirtualDocument(true);
pSysObj.save();
IDfVirtualDocument vDoc = pSysObj.asVirtualDocument(“CURRENT”, false);
IDfVirtualDocumentNode pNode = vDoc.getRootNode();
pSysObj.checkout();
IDfVirtualDocumentNode nodeChild1 = vDoc.addNode(pNode, null,
cSysObj.getChronicleId(),”CURRENT”, false,
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/log4j.properties”);
if (sysObj.isVirtualDocument()) {
IDfVirtualDocument vdoc = sysObj.asVirtualDocument(“CURRENT”,
false);
IDfExportNode expNode = (IDfExportNode) expOpr.add(sysObj);
expOpr.setDestinationDirectory(expOpr.
getDefaultDestinationDirectory());
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/log4j.properties”);
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().
getObjectName());
}
}
}

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 (coll.next() ) {
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 )
coll.close();
}

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
sysObj.checkout();
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
sysObj.checkin(false,”CURRENT”);
}
}

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”);
sysObj.setRepeatingString(“authors”,1,”author2″);
sysObj.save();
}

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()) {
list.add(st.nextElement());
}
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();
importOper.setSession(idfSession);
if (importOpr == null ) {
System.out.println(“operation object is null”);
return;
}
importOpr.setDestinationFolderId(sysObj.getObjectId());
importOpr.setVersionLabels(“imported using operation”);
IDfImportNode node = (IDfImportNode) importOpr.add (“C:\\Documentum\\config\\ Test-Document”);
node.setFormat(“pdf”);
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.

%d bloggers like this: