640 likes | 954 Views
Introduction to DFC. Module Objectives. After completing this module, you will be able to: define what the Documentum Foundation Class is understand what the DFC is used for see the benefits of developing using the DFC instead of the traditional API methods
E N D
Module Objectives • After completing this module, you will be able to: • define what the Documentum Foundation Class is • understand what the DFC is used for • see the benefits of developing using the DFC instead of the traditional API methods • comprehend the basic concepts of Object-Oriented programming and how it relates to DFC and Documentum
Topics • Introduction to DFC • What is the DFC • Why should you develop using the DFC • Overview of object-oriented programming concepts in Documentum
What is the Documentum Foundation Classes? • A new programming interface introduced in Documentum 4i to provide a higher-level, object-oriented interface to the Documentum server • Implemented as a set of Java classes and interfaces • some interfaces simply wrap DMCL objects • client, session, persistent object, query collection • some provide high-level logic • data validation, workflow management, version policy • Provided as a wrapper around DMCL • simplifies programming and application development
Application DFC DMCL Docbase DFC is a Wrapper Around DMCL
DesktopClient SmartSpaceIntranet DFC Custom Client/Server App Custom Web App CLIENT DMCL SERVER DMCL Docbase How Applications Use DFC
Why Develop Using DFC? • Reduces coding efforts due to higher-level methods that perform the same operations as several DMCL API calls that were needed in previous development environments • Provides business logic not available through the DMCL • Promotes code/module reuse • DFC is the new standard development language for Documentum applications
The Key Interface ActiveX Dialogs and Controls Architecture - the Developer’s View Documentum Administrator Developer Studio Desktop Client RightSite Server Documentum Foundation Class (DFC) Documentum Client Library (DMCL) Lifecycle Data Dictionary E-Content Server Docbase
DocApp Data Validation Workflow Runtime Version Policy VDM Operations DFC Object-Oriented Access to Server API DMCL Server API Relationship of DFC to DMCL • The DMCL is a library of procedures and functions that implement the e-Content server API • The DFC implements the API and an additional level of business logic • The DFC implements interfaces that clients can access through Java or COM
The Role of DFC Desktop Client RightSite Developer Studio VDM Editor Application Components Workflow Editor Lifecycle Editor Search Component Widgets Common Widgets Validation Widgets DART VDM Library Services Query Builder Validation Core Services Documentum Foundation Class Data Access DMCL Data Server e-Content Server
The DFC • Is a set of Java classes • Classes begin with a Df prefix • Interfaces begin with a IDf prefix • Provides an object oriented interface to the e-Content Server • Can be thought of as DMCL++; a wrapper around DMCL that makes programming simpler and provides additional capabilities such as • Validation • Version Policy • Workflow Runtime
More About DFC • Is installed on each client machine as part of Desktop Client and Developer Studio installation process • Called by the client which makes calls to components which in turn make calls to the DFC which then calls DMCL4.0. • Interfaces into DMCL4.0 • Is packaged in a JAR file and usually installed in c:\program files\documentum\dfcre40\lib\dfc.jar
DFC Interface Hierarchy (Partial) IDfClient IDfLoginInfo IDfSession IDfQuery IDfTypedObject Interfaces that only VB, Docbasic and C++ programmers will use IDfPersistentObject IDfClientX (COM) IDfACL IDfEnumeration (COM) IDfFormat IDfGroup IDfUser IDfType IDfAttr IDfPackage IDfId IDfWorkItem IDfTime IDfSysObject IDfException IDfDocument IDfList IDfDocbaseMap IDfFolder IDfProcessRuntime IDfCollection IDfRouter
DFC Interface Interaction getLocalClient() IDfClient getSharedSession( docbase, IDfLoginInfo, key) newSession( docbase, IDfLoginInfo ) findSession( sessionId ) getClient() IDfSession getObject( objectId ) getSession() newObject( typeName ) getObjectByQualification( qual) getObjectByPath( path ) DFC 4.1 getType(typeName ) getType() IDfPersistentObject IDfType
Visual Basic - access the DFC through COM type libraries supplied with Developer Studio, dfc.tlb Visual J++ - make sure that the DFC class and interface files are located in your CLASSPATH Visual C++ without MFC - include dfc.h and dfc_i.c with MFC - include DfClientX.h, DfClientX.cpp, dfc.h, and dfc_i.c Linking to the DFC
Establishing DFC Clients • Before you call DFC methods, you must create a DFC client object as an interface to DFC • Java Example • IDfClient myclient = DfClient.getLocalClient(); • VB Example • Dim myclient As IDfClient • Dim myclientX As DfClientX • Set myclientX = CreateObject(“Documentum.Dfc”) • Set myclient = myclientX.getLocalClient
Introduction to Object Oriented Programming Concepts and Documentum • Classes • Objects • Properties and Methods • Inheritance • Packages and interfaces
Inheritance • Inheritance allows you to extend and add to the definition of an existing class to reuse some properties and methods, and add or override others.
Packages • A package is a collection of related classes and interfaces. • The DFC classes are organized into the following packages:
Packages, Classes and Interfaces • DFC is presented as a set of packages • Packages are composed of classes and interfaces • Classes contain methods and constants • names begin with Df • Interfaces define a set of methods that objects of a particular class can implement • names begin with IDf Packages contain Classes Interfaces implemented by define Methods
The Hierarchy Package Class Interface Method
Why is this important? Package • Developers typically operate on objects through interfaces that represent the object • Each interface typically has set and get methods for most of the represented system types' attributes • Programmers only use a very small number of actual classes directly • DfClient, DfLoginInformation are two examples Class Interface Method
DFC Interface Hierarchy and the Object Hierarchy IDfClient IDfSession IDfLoginInfo IDfEnumeration (COM) IDfClientX (COM) IDfQuery
Interface Inheritance in Java • Each interface inherits methods and constants from interfaces above it Save() try { IDfDocument docobj = session.newObject("dm_document") docobj.setContentType("msw8"); docobj.setFile("c:\temp\chap1.doc"); docobj.save(); } catch(DfException dfe) { //report error }
Interface Inheritance in the COM Environment • Interface inheritance is not supported • DFC is viewed as a flat type library • contains all of the interfaces but none of the inheritance • to call a method contained in a parent interface, you must convert the object to the appropriate super object before calling the method • this is called "casting" Dim docobj As IDfSysobject Dim pobj As IDfPersistentObject Set docobj = session.newObject("dm_document") docobj.setContentType ("msw8")docobj.setFile ("c:\temp\chap1.doc") set pobj = docobj pobj.save
Interface Definitions • IDfClient • IDfSession • IDfLoginInfo • IDfTypedObject • IDfPersistentObject • IDfObjectType • IDfCollection
IDfClient • Description: • provides functionality to establish and manage sessions • provides information about the server before a session is established • Purpose: • serves as the entry point to DFC code and a "factory" for IDfSession objects • Sample Methods: • getDocbaseMap() • newSession(docbaseName, loginInfo)
IDfSession • Description: • encapsulates a session with a Docbase and all related interaction • Purpose: • used to query Docbase information • create new persistent objects and obtain access to existing objects stored in the Docbase • Sample Methods: • disconnect() • getDocbaseName() • newObject(typename)
IDfLoginInfo • Description: • provides functionality for validating and logging a user onto a Docbase • Purpose: • to obtain and set identification information to be used for login and user authentication • Sample Methods: • setUser(username) • setPassword(password) • getDomain()
IDfTypedObject • Description: • provides the basic functionality for persistent and non-persistent objects • contains methods that act upon any type of ID, such as an object ID, query collection ID or alias set • Purpose: • to provide basic methods to get and set object attributes, and provide object level operations • Sample Methods: • dump() • appendString(attrName, value) • getObjectId()
IDfPersistentObject • Description: • provides basic functionality needed to interact with persistent objects • Purpose: • provide generic methods to view and manipulate typed objects stored in the Docbase • Sample Methods: • getVStamp • fetch() • dump() • save()
IDfObjectType • Description: • individual interfaces designed to work only for system objects with a specific type • i.e. IDfSysObject, IDfFolder etc. • Purpose: • provide methods to interact with the objects of that type and their specific attributes • Sample methods • getContentType() • setObjectName() • getFolderPath(index)
IDfSysObject • Sysobjects can: • own content • be checked in and checked out of a Docbase • be versioned • have permissions • reside in a folder • be part of virtual doc • have attached business policy • Each feature is represented as a category of methods in the IDfSysobject interface
Sysobject Subtypes • some types have their own type-specific interface • not all sub-types have their own interface • custom interfaces can be created to extend existing interfaces
IDfCollection • Description: • provides access to collection objects • Purpose: • allows access to rows returned in a collection object and the data values in those rows • Sample Methods: • next() • close()
The DFC JavaDocs • Documentation for DFC packages, classes, interfaces and methods is provided in JavaDoc format
JavaDoc Organization • Overview • front page of JavaDocs • lists all packages with a description • Package • each package has a page listing all interfaces, classes, exceptions and errors
JavaDoc Organization (continued) • Classes and Interfaces • each class and interface is described, along with the methods defined within that class or exposed by the interface
JavaDoc Organization (continued) • Tree • The tree view shows a class hierarchy page for all packages, or for the currently selected package
Method Detail • Syntax shows any arguments, return value, and exceptions
DFC Documentation in Visual Basic • Choose View>Object Browser or hit F2