/* * Copyright (c) Blue Fish Development Group 1996-2005. All rights reserved. * * This version: * $Author: jduke $ * $Date: 2006/01/02 19:26:31 $ * $Id: BfExampleTwoTbo.java,v 1.1 2006/01/02 19:26:31 jduke Exp $ */ package com.bluefishgroup.sample.bof.tbo; import com.documentum.fc.client.DfDocument; import com.documentum.fc.client.IDfBusinessObject; import com.documentum.fc.client.IDfClient; import com.documentum.fc.client.IDfSession; import com.documentum.fc.client.IDfSessionManager; import com.documentum.fc.common.DfException; import com.documentum.fc.common.IDfDynamicInheritance; import com.documentum.fc.common.IDfId; import com.bluefishgroup.sample.bof.sbo.IBfLogService; /** * Overrides doCheckout method in order to call out to the IBfLogService when a document is checked * out. * * @author Jason Duke * @version $Revision: 1.1 $ */ public class BfExampleTwoTbo extends DfDocument implements IDfBusinessObject, IDfDynamicInheritance { /* * (non-Javadoc) * * @see com.documentum.fc.client.IDfBusinessObject#getVersion() */ public String getVersion() { return "1.0"; } /* * (non-Javadoc) * * @see com.documentum.fc.client.IDfBusinessObject#getVendorString() */ public String getVendorString() { return "Copyright 2006 Blue Fish Development Group. All rights reserved."; } /* * (non-Javadoc) * * @see com.documentum.fc.client.IDfBusinessObject#isCompatible(java.lang.String) */ public boolean isCompatible(String arg0) { return true; } /* * (non-Javadoc) * * @see com.documentum.fc.client.IDfBusinessObject#supportsFeature(java.lang.String) */ public boolean supportsFeature(String arg0) { return true; } /* * (non-Javadoc) * * @see com.documentum.fc.client.IDfPersistentObject#validateAllRules(int) */ public void validateAllRules(int arg0) throws DfException { } /* * (non-Javadoc) * * @see com.documentum.fc.client.DfSysObject#doCheckout(java.lang.String, java.lang.String, * java.lang.String, java.lang.Object[]) */ protected IDfId doCheckout(String versionLabel, String compoundArchValue, String specialAppValue, Object[] extendedArgs) throws DfException { // Let the superclass perform the actual checkout. IDfId newId = super.doCheckout(versionLabel, compoundArchValue, specialAppValue, extendedArgs); // Get a session; it will be released automatically. IDfSession session = getSession(); // Instantiate the SBO. IDfSessionManager sessMgr = session.getSessionManager(); IDfClient client = session.getClient(); IBfLogService logService = (IBfLogService) client.newService(IBfLogService.class.getName(), sessMgr); // Call the SBO method. logService.logCheckout(session.getDocbaseName(), this); // Return the ID. return newId; } }