Below are the steps to create a TBO for a Type. Go through the prerequisite link for creating the workspace and a simple document type.
Prerequisite
Below are the steps for creating the TBO.
- Create the Implementation and Interface class for TBO
- Create the Jar definition for Implementation and Interface
- Create TBO module
- Install the Documentum project
Create the Implementation and Interface class for TBO
1. TBO Project Structure
As shown below create two source folders one for Implementation class and one for Interface class. It is not mandatory but is just a good practice.
2. Source Code
IDCTMGurusDoc.java
package com.dctmgurus.modules.tbo; import com.documentum.fc.client.IDfBusinessObject; import com.documentum.fc.client.IDfSysObject; import com.documentum.fc.common.DfException; public interface IDCTMGurusDoc extends IDfSysObject,IDfBusinessObject{ public void setDemoAttr(String demoAttr) throws DfException; public String getDemoAttr() throws DfException; }
DCTMGurusDoc.java
package com.dctmgurus.modules.tbo; import com.documentum.fc.client.DfSysObject; import com.documentum.fc.common.DfException; import com.documentum.fc.common.IDfDynamicInheritance; public class DCTMGurusDoc extends DfSysObject implements IDCTMGurusDoc,IDfDynamicInheritance{ @Override public String getVendorString() { // TODO Auto-generated method stub return null; } @Override public String getVersion() { // TODO Auto-generated method stub return null; } @Override public boolean isCompatible(String arg0) { // TODO Auto-generated method stub return false; } @Override public boolean supportsFeature(String arg0) { // TODO Auto-generated method stub return false; } @Override public String getDemoAttr() throws DfException { System.out.println("[DCTMGurusDoc] Getting the value of the dg_demo_attr attribute"); return getString("dg_demo_attr"); } @Override public void setDemoAttr(String demoAttr) throws DfException { System.out.println("[DCTMGurusDoc] Setting the value of the dg_demo_attr attribute"); setString("dg_demo_attr", demoAttr); } protected synchronized void doSave(boolean keepLock, String versionLabels, Object[] extendedArgs) throws DfException { System.out.println("[DCTMGurusDoc] Logging from DCTMGurusDoc TBO"); super.doSave(keepLock, versionLabels, extendedArgs); } }
3. Create Jar Files
Export the implementation class as dctmgurus_tbo_impl.jar
Export the interface class as dctmgurus_tbo_int.jar
Create the Jar definition for Implementation and Interface
1. Right Click the project -> New -> Jar Definition
2. Give name for the “Jar Definition”, this will be used as “Jar definition” for Implementation jar.
3. Click Browse and select the Jar
4. Now the Jar is selected and the “Type” should be selected as “Implementation” as shown below
5. Similarly do it for the Interface jar
Create TBO module
1. Right Click the project -> New -> Module
2. Give the Object Types as the name of the module(It is mandatory). Here in this case we are creating TBO for dctmgurus_doc Object type.
3. The below screen appears by default
4. Change/Set the values of “Type” , “Implementation Jars” , “Interface Jars” and “Class Name” as below
5. Install the Documentum Project
Give the credenials and click “Login” and “Finish”
6. You can verify whether the TBO is created or not by checking the “/System/Modules/TBO” folder as shown below