EMC | Documentum Technical White Paper

QUICK START: DFS and Adobe Flex: A Quick Start Tutorial

April 2009

EMC | Documentum, Inc.

6801 Koll Center Parkway Pleasanton, CA 94566-7047 phone (925) 600-6800 © 2009 Documentum, Inc. All rights reserved. Documentum, and the corporate logo are trademarks or fax (925) 600-6850 registered trademarks of Documentum, Inc. in the United States and throughout the world. All other company and product names are used for identification purposes only and may be trademarks of their respective owners. Documentum cannot guarantee completion of any future products or product features mentioned in www.documentum.com this document, and no reliance should be placed on their availability. Printed in the U.S.A. 60491003V1

1 EMC | Documentum Technical White Paper Documentum Foundation Services (DFS)

Contents

QUICK START: ...... 1 DFS and Adobe Flex: A Quick Start Tutorial ...... 1 Contents ...... 2 Overview ...... 3 Tutorial Files and Notes ...... 3 Adobe FLEX ...... 4 Documentum Foundation Services (DFS) ...... 4 Adobe LiveCycle Enterprise Suite (ES) ...... 4 BlazeDS ...... 5 Quick Start to Configure the Demo ...... 5 Configuration ...... 7 FLEX Server Configuration ...... 8 Appendix A - Java Source Code ...... 9 Appendix B - FLEX Source Code ...... 22 Appendix C - FLEX Adobe LiveCycle Remoting-Config. ...... 23

2 EMC | Documentum Technical White Paper Documentum Foundation Services (DFS)

Overview

This quick start tutorial will allow a developer to quickly install and run a DFS/Flex demo; the focus of this demo is a simple web based user interface (using Adobe FLEX) using EMC's Documentum Foundation Services (DFS) to query and display some documents from the Documentum repository. The user will enter in some text into the search field and click on the 'Search' button. DFS will query the dm_document document type and return several properties, including Title, Name, Owner, Last Modified and Object ID.

To accomplish this scenario, we will use the Adobe LiveCycle Data Services product.1 Please note that while there are several ways to accomplish this scenario technically, this approach will use the DFS Java productivity layer. There is no need to generate custom WSDL or use another remoting model, like Axis2 or JAX-WS.

Figure 1 - FLEX User Interface (UI) calling DFS

Tutorial Files and Notes This tutorial uses a number of files, shown below.

• Flex 3 Project - testdrive-httpservice.zip

• Eclipse 3.4 Project - testwebappwdfs.zip

In addition, this tutorial focuses on DFS Release D6.5 SP1, using the Java Release 1.5 or greater. This demo was tested on the following platforms.

• MAC OS 10.x

• Windows Vista 64-bit

1 If you do not want to use Adobe LiveCycle, you can use the open-source project BlazeDS.

3 EMC | Documentum Technical White Paper Documentum Foundation Services (DFS)

• Windows 2003 Server

Adobe FLEX Adobe Flex is a collection of technologies released by Adobe Systems for the development and deployment of cross-platform rich Internet applications based on the proprietary platform. The initial release in March 2004 by included a software development kit, an IDE, and a J2EE integration application known as Flex Data Services. Since Adobe acquired Macromedia in 2005, subsequent releases of Flex no longer require a license for Flex Data Services, which has become a separate product rebranded as LiveCycle Data Services.

In February 2008, Adobe released the Flex 3 SDK under the open source Mozilla Public License. , the runtime on which Flex applications are viewed, and Adobe Flex Builder, the IDE built on the open source Eclipse platform and used to build Flex applications, remain proprietary.

Documentum Foundation Services (DFS) EMC Documentum Foundation Services (DFS) are a set of technologies that enable service-oriented programmatic access to the EMC Documentum Content Server platform and related products. It includes the following technologies.

DFS technology Description

Enterprise Content A set of services that provide service-oriented APIs based on DFS to EMC software Services products. Many of these services are delivered as part of the DFS product (delivered with Content Server). Other services require purchase of additional products. For further information on the complete set of services, see the Enterprise Content Services 6.5 Reference

Data model and API A data model and API, exposed primary as a set of WSDLs and secondarily as Java and .NET class libraries, providing the underlying architecture for DFS services and DFS consumers.

Client productivity layer Optional client-side runtime libraries for DFS consumers. These libraries are based on static proxies generated using JAX-WS for Java clients and Windows Communication Foundation for .NET clients.

Tools for generating Service-generation tools based on JAX-WS (Java API for XML-based Web Services), services and runtime and Ant, which generate deployable DFS services from annotated source code, or from support WSDL. These tools also generate client-side runtime support for Java clients. C# runtime support is generated using the DFS Proxy Generator utility.

SDK A software development kit for development of DFS consumers, which includes the Java and .NET APIs, design-time build tools, and samples. The .NET APIs are CLS compliant, so they can be used to develop consumers using any .NET language (such as Visual Basic).

EMC Documentum DFS provides a custom service registry solution with an administration interface Solution Catalog available in Documentum Composer. DFS also supports existing UDDI version 2 Repository service registries and provides an Ant task for service publication.

Adobe LiveCycle Enterprise Suite (ES) Adobe LiveCycle Enterprise Suite (ES) is a SOA J2EE-based (Java 2 Enterprise Edition) server software product from Adobe Systems Incorporated used to build applications that automate a broad range of business processes for enterprises and government agencies. It combines technologies for data capture, information assurance, document

4 EMC | Documentum Technical White Paper Documentum Foundation Services (DFS) output, content services, and process management to deliver solutions such as account opening, services and benefits enrollment, correspondence management, request for proposal processes, and other manual based workflows. LiveCycle ES incorporates PDF (Portable Document Format) technology with Flex (Flash-based UI technology) to allow developers to create human interactive applications.

Adobe positions LiveCycle ES as a platform to help with customer engagement by providing end users with more compelling experiences which can be extended outside the organization to customers, partners, and citizens. LiveCycle applications also function in both online or offline environments. These capabilities are enabled through the use of Adobe Reader and the Flash Player clients that are found on the majority of desktop computers and mobile devices.2

Figure 2 - The Adobe LiveCycle Install Directory

After installing LiveCycle (or LCDS), you will see a folder under C:\lcds (the default); LCDS will install a Tomcat Server running on port 8400. Adobe Flex will call your Java components on this port. You will configure LCDS from Flex. A file, called remoting-config.xml will contain the ID's and classes of the Java components Flex will use.

BlazeDS An alternative to Adobe LiveCycle, you can use BlazeDS. BlazeDS is a server-based Java remoting and web messaging technology that enables developers to easily connect to back-end distributed data and push data in real- time to Adobe® Flex® and Adobe AIR™ applications for more responsive rich Internet application (RIA) experiences. BlazeDS uses a Tomcat server just like LCDS, and offers the same approach (same port, configuration files). For a great tutorial on installing BlazeDS, check out http://flexbandit.com/archives/55

Quick Start to Configure the Demo

Please follow these steps to quickly setup and run the demo; you will need a running Documentum instance, including DFS D6.5 SP1. You might also want to import some sample data to return some results in the query. I am using the Documentum Developer Edition D6.5 SP1 for this tutorial. Java 1.5 should already be installed.3 Please see the rest of this document for more detail on the projects and source code.

1. Verify that DFS is working, check the WSDL - I am using port 9080 for my install - http://localhost:9080/services/core/ObjectService

2 http://en.wikipedia.org/wiki/Adobe_LiveCycle 3 This tutorial uses the Flex 3 IDE and Eclipse IDE - it is possible to have them in one IDE

5 EMC | Documentum Technical White Paper Documentum Foundation Services (DFS)

2. Step one is to download and install Flex 3 locally (trial copies are available from Adobe)4

3. Download and install Adobe LiveCycle or BlazeDS, this will install the local Tomcat on port 8400. Adobe provides a free trial (not expiring) for developers.

4. Download the Tutorial Source Code from the EMC CMA PS eRoom

5. Configure Eclipse Project (unpack the project, double check your links, JDK, DFS SDK, et al)

6. Modify the Java code for your local Documentum platform (they are hardcoded currently)

setRepository("documentum"); setUsername("mmohen"); setPassword("password"); setEfsurl("http://localhost:9080/services/"); setDrlprefix(""); setImagesdir("");

7. Configure the Flex Project (make sure the Flex Server configuration is correct)

8. Modify any dfc.properties and dfs-client.xml files (in config folder)

9. Make sure the LCDS Tomcat instance is working (port 8400)

10. Verify the samples for LCDS (the webapp is lcds-samples)

11. Deploy the Flex/DFS code to the LCDS sample webapp, called lcds-samples

12. Deploy the Flex application to LCDS (Export Release Build)

Figure 3 - Export Release Build

4 Flex 3 comes in two flavors, a full IDE and a plug-in - you can use either for this tutorial

6 EMC | Documentum Technical White Paper Documentum Foundation Services (DFS)

Figure 4 - Export Flex Application to LCDS Webapp

Eclipse Configuration When unpacking the Eclipse (dynamic web project) project, please note that this is a pre-configured project. The DFS SDK is located at C:\Java\SDK ... It has been configured to run on the web, so make sure your dfc.properties and dfs-client.xml files are updated with your local configuration. These files are located in the /Classes/Config folder5

5 When packaging a WAR file, the config folder is not deployed properly, please manually copy the config folder into the classes folder

7 EMC | Documentum Technical White Paper Documentum Foundation Services (DFS)

Figure 5 - Eclipse Configuration

In the Eclipse project, you will see four (4) Java files that provide the integration to DFS; they provide the connection information, object types and the core methods for calling the search. The project has been configured for DFS, including all of the JAR files and configuration files. My samples are done using Eclipse Ganymede, but this does not mean you cannot use Composer. If you would like to use these samples in Composer, please make sure you install the Eclipse Web Tools Platform (WTP) project.

Note - Extra code: There is a JSP file called testbean.jsp, and a corresponding Java Bean called HelloWorld.java - this is not part of the tutorial. Rather, it's a sample that shows how to call a DFS Java Bean from a JSP.

FLEX Server Configuration LCDS comes with a sample web application called lcds-samples; it located on the Tomcat instance installed by LCDS. To make this tutorial simple, I installed the DFS and custom code into this webapp. The path to the web application is c:\lcds\tomcat\webapps\lcds-samples. You can generate your own WAR, but using the LCDS samples might be a quicker path for getting the demo up and running.

8 EMC | Documentum Technical White Paper Documentum Foundation Services (DFS)

Figure 6 - Configuring the Flex Server in Flex 3

Appendix A - Java Source Code package com.emc.dfs; import java.util.Properties; public class DFSConnectionInfo {

private static Properties properties = null;

private static DFSConnectionInfo instance;

private String repository;

private String username;

private String password;

private String efsurl;

private String drlprefix;

private String imagesdir;

public String getDrlprefix() { return drlprefix; }

public void setDrlprefix(String drlprefix) { this.drlprefix = drlprefix; }

public DFSConnectionInfo() { loadConfiguration(); }

9 EMC | Documentum Technical White Paper Documentum Foundation Services (DFS)

/** * @return */ public static DFSConnectionInfo getInstance() { if (instance == null) { instance = new DFSConnectionInfo(); } return instance; }

/** * */ private void loadConfiguration() { setRepository("documentum"); setUsername("mmohen"); setPassword("password"); setEfsurl("http://localhost:9080/services/"); setDrlprefix(""); setImagesdir(""); }

public String getEfsurl() { return efsurl; }

public void setEfsurl(String efsurl) { this.efsurl = efsurl; }

public String getPassword() { return password; }

public void setPassword(String password) { this.password = password; }

public String getRepository() { return repository; }

public void setRepository(String repository) { this.repository = repository; }

public String getUsername() { return username; }

public void setUsername(String username) { this.username = username; }

public String getImagesdir() { return imagesdir; }

public void setImagesdir(String imagesdir) { this.imagesdir = imagesdir; }

}

package com.emc.dfs;

public class DFSObject {

private String objId;

private String objName;

private String objTitle;

private String objOwner;

private String objModDate;

public DFSObject() {

}

public DFSObject(String objId, String objName, String objTitle, String objOwner, String objModDate) { this.objId = objId; this.objName = objName; this.objTitle = objTitle; this.objOwner = objOwner; this.objModDate = objModDate;

}

10 EMC | Documentum Technical White Paper Documentum Foundation Services (DFS)

public String getObjId() { return objId; }

public void setObjId(String objId) { this.objId = objId; }

public String getObjModDate() { return objModDate; }

public void setObjModDate(String objModDate) { this.objModDate = objModDate; }

public String getObjName() { return objName; }

public void setObjName(String objName) { this.objName = objName; }

public String getObjOwner() { return objOwner; }

public void setObjOwner(String objOwner) { this.objOwner = objOwner; }

public String getObjTitle() { return objTitle; }

public void setObjTitle(String objTitle) { this.objTitle = objTitle; }

} package com.emc.dfs;

import java.util.ArrayList; import java.util.List;

import com.emc.documentum.fs.datamodel.core.DataObject; import com.emc.documentum.fs.datamodel.core.OperationOptions; import com.emc.documentum.fs.datamodel.core.context.RepositoryIdentity; import com.emc.documentum.fs.datamodel.core.profiles.ContentProfile; import com.emc.documentum.fs.datamodel.core.profiles.FormatFilter; import com.emc.documentum.fs.datamodel.core.properties.PropertySet; import com.emc.documentum.fs.datamodel.core.query.Condition; import com.emc.documentum.fs.datamodel.core.query.ExpressionSet; import com.emc.documentum.fs.datamodel.core.query.FullTextExpression; import com.emc.documentum.fs.datamodel.core.query.PropertyExpression; import com.emc.documentum.fs.datamodel.core.query.QueryExecution; import com.emc.documentum.fs.datamodel.core.query.QueryResult; import com.emc.documentum.fs.datamodel.core.query.QueryStatus; import com.emc.documentum.fs.datamodel.core.query.RepositoryStatusInfo;

11 EMC | Documentum Technical White Paper Documentum Foundation Services (DFS)

import com.emc.documentum.fs.datamodel.core.query.Status; import com.emc.documentum.fs.datamodel.core.query.StructuredQuery; import com.emc.documentum.fs.rt.ServiceInvocationException; import com.emc.documentum.fs.rt.context.ContextFactory; import com.emc.documentum.fs.rt.context.IServiceContext; import com.emc.documentum.fs.rt.context.ServiceFactory; import com.emc.documentum.fs.services.core.client.IObjectService; import com.emc.documentum.fs.services.search.client.ISearchService;

public class DFSSearchService {

public DFSSearchService() {

d = DFSConnectionInfo.getInstance();

}

public List getSimpleSearch(String strCriteria) throws Exception {

List list = new ArrayList();

IServiceContext isc = getSimpleServiceContext(d.getRepository(), d

.getUsername(), d.getPassword());

ISearchService iss = getService(isc);

try {

// Create query

StructuredQuery q = new StructuredQuery();

q.addRepository(d.getRepository());

q.setObjectType("dm_document");

q.setIncludeHidden(false);

q.setDatabaseSearch(true);

ExpressionSet expressionSet = new ExpressionSet();

expressionSet.addExpression(new FullTextExpression(strCriteria));

q.setRootExpressionSet(expressionSet);

12 EMC | Documentum Technical White Paper Documentum Foundation Services (DFS)

q.setRootExpressionSet(expressionSet);

// Execute Query

int startingIndex = 0;

int maxResults = 100;

int maxResultsPerSource = 20;

QueryExecution queryExec = new QueryExecution(startingIndex,

maxResults, maxResultsPerSource);

QueryResult queryResult = iss.execute(q, queryExec, null);

QueryStatus queryStatus = queryResult.getQueryStatus();

RepositoryStatusInfo repStatusInfo = queryStatus

.getRepositoryStatusInfos().get(0);

if (repStatusInfo.getStatus() == Status.FAILURE) {

System.out.println(repStatusInfo.getErrorTrace());

throw new RuntimeException("Query failed to return result.");

}

// print results

for (DataObject dataObject : queryResult.getDataObjects()) {

PropertySet docProperties = dataObject.getProperties();

String objId = dataObject.getIdentity().getValueAsString();

String objName = docProperties.get("object_name")

.getValueAsString();

String objTitle = docProperties.get("title").getValueAsString();

String objOwner = docProperties.get("owner_name")

.getValueAsString();

String objModDate = docProperties.get("r_modify_date")

.getValueAsString();

list.add(new DFSObject(objId, objName, objTitle, objOwner, objModDate));

;

}

13 EMC | Documentum Technical White Paper Documentum Foundation Services (DFS)

} catch (Exception e) {

e.printStackTrace();

}

return list;

}

public static IServiceContext getSimpleServiceContext(

String repositoryName, String userName, String password) {

ContextFactory contextFactory = ContextFactory.getInstance();

IServiceContext context = contextFactory.newContext();

RepositoryIdentity repoId = new RepositoryIdentity();

repoId.setRepositoryName(repositoryName);

repoId.setUserName(userName);

repoId.setPassword(password);

context.addIdentity(repoId);

return context;

}

public com.emc.documentum.fs.services.search.client.ISearchService getService(

IServiceContext context) {

ServiceFactory serviceFactory = ServiceFactory.getInstance();

ISearchService searchService = null;

;

try {

searchService = serviceFactory.getRemoteService(

ISearchService.class, context, "core", d.getEfsurl());

} catch (ServiceInvocationException e) {

e.printStackTrace();

}

return searchService;

14 EMC | Documentum Technical White Paper Documentum Foundation Services (DFS)

}

DFSConnectionInfo d = null;

}

package com.emc.dfs;

import java.io.File;

import java.io.IOException;

import java.util.List;

import com.emc.documentum.fs.datamodel.core.DataObject;

import com.emc.documentum.fs.datamodel.core.DataPackage; import com.emc.documentum.fs.datamodel.core.ObjectIdentity; import com.emc.documentum.fs.datamodel.core.ObjectIdentitySet; import com.emc.documentum.fs.datamodel.core.ObjectPath; import com.emc.documentum.fs.datamodel.core.OperationOptions; import com.emc.documentum.fs.datamodel.core.Qualification; import com.emc.documentum.fs.datamodel.core.ReferenceRelationship; import com.emc.documentum.fs.datamodel.core.Relationship; import com.emc.documentum.fs.datamodel.core.content.BinaryContent; import com.emc.documentum.fs.datamodel.core.content.Content; import com.emc.documentum.fs.datamodel.core.content.ContentTransferMode; import com.emc.documentum.fs.datamodel.core.content.FileContent; import com.emc.documentum.fs.datamodel.core.context.RepositoryIdentity; import com.emc.documentum.fs.datamodel.core.profiles.ContentProfile; import com.emc.documentum.fs.datamodel.core.profiles.ContentTransferProfile;

import com.emc.documentum.fs.datamodel.core.profiles.FormatFilter; import com.emc.documentum.fs.datamodel.core.properties.PropertySet; import com.emc.documentum.fs.rt.ServiceException; import com.emc.documentum.fs.rt.ServiceInvocationException; import com.emc.documentum.fs.rt.context.ContextFactory; import com.emc.documentum.fs.rt.context.IServiceContext; import com.emc.documentum.fs.rt.context.ServiceFactory;

15 EMC | Documentum Technical White Paper Documentum Foundation Services (DFS)

import com.emc.documentum.fs.services.core.CoreServiceException; import com.emc.documentum.fs.services.core.client.IObjectService;

public class DFSObjectService {

public DFSObjectService() {

d = DFSConnectionInfo.getInstance();

}

public byte[] getObjectBytes(String strId) throws Exception {

// String r = null;

byte[] r = null;

IServiceContext isc = getSimpleServiceContext(d.getRepository(), d

.getUsername(), d.getPassword());

IObjectService = getService(isc);

try {

String strQual = "dm_document where r_object_id = '" + strId + "'";

ObjectIdentity objIdentity = new ObjectIdentity(new Qualification(

strQual), d.getRepository());

ContentTransferProfile transferProfile = new ContentTransferProfile();

transferProfile.setGeolocation(geoLoc);

transferProfile.setTransferMode(trMode);

isc.setProfile(transferProfile);

ContentProfile contentProfile = new ContentProfile();

contentProfile.setFormatFilter(FormatFilter.ANY);

OperationOptions operationOptions = new OperationOptions();

operationOptions.setContentProfile(contentProfile);

operationOptions.setProfile(contentProfile);

16 EMC | Documentum Technical White Paper Documentum Foundation Services (DFS)

ObjectIdentitySet objectIdSet = new ObjectIdentitySet();

List objIdList = objectIdSet.getIdentities();

objIdList.add(objIdentity);

DataPackage dataPackage = ios.get(objectIdSet, operationOptions);

DataObject dataObject = dataPackage.getDataObjects().get(0);

List contentList = dataObject.getContents();

for (Content content : contentList) {

r = content.getAsByteArray();

}

} catch (Exception e) {

}

return r;

}

public Object savePDF(byte[] bytes, String strPath) throws IOException {

IServiceContext isc = getSimpleServiceContext(d.getRepository(), d

.getUsername(), d.getPassword());

IObjectService ios = getService(isc);

String r = null;

try {

// Create path

ObjectPath objPath = new ObjectPath(strPath);

ObjectIdentity folderIdentity = ios.createPath(objPath, d

.getRepository());

System.out.println(folderIdentity.getValueAsString());

17 EMC | Documentum Technical White Paper Documentum Foundation Services (DFS)

ObjectIdentity objIdentity = new ObjectIdentity(d.getRepository());

DataObject dataObject = new DataObject(objIdentity, "dm_document");

PropertySet properties = dataObject.getProperties();

properties.set("object_name", "Company Statistics"

+ System.currentTimeMillis());

properties.set("title", "Company Statistics");

properties.set("a_content_type", "");

dataObject.getContents().add(new BinaryContent(bytes, "pdf"));

ReferenceRelationship folderRelationship = new ReferenceRelationship();

folderRelationship.setName(Relationship.RELATIONSHIP_FOLDER);

folderRelationship.setTarget(folderIdentity);

folderRelationship.setTargetRole(Relationship.ROLE_PARENT);

dataObject.getRelationships().add(folderRelationship);

OperationOptions operationOptions = null;

DataPackage objDp = ios.create(new DataPackage(dataObject),

operationOptions);

DataObject objDo = objDp.getDataObjects().get(0);

//String objId = objDo.getIdentity().getValueAsString();

String objId = folderIdentity.getValueAsString();

r = d.getDrlprefix() + objId;

} catch (CoreServiceException e) {

r = e.getMessage();

} catch (ServiceException e) {

r = e.getMessage();

}

return r;

}

public Object loadGifFiles(String strPath) throws IOException {

IServiceContext isc = getSimpleServiceContext(d.getRepository(), d

18 EMC | Documentum Technical White Paper Documentum Foundation Services (DFS)

.getUsername(), d.getPassword());

IObjectService ios = getService(isc);

String r = null;

try {

// Create path

ObjectPath objPath = new ObjectPath(strPath);

ObjectIdentity folderIdentity = ios.createPath(objPath, d

.getRepository());

DataPackage dp = new DataPackage();

OperationOptions operationOptions = null;

File fldr = new File(d.getImagesdir());

File[] fList = fldr.listFiles();

for (int i = 0; i < fList.length; i++) {

if (fList[i].getName().endsWith("gif")) {

ObjectIdentity objIdentity = new ObjectIdentity(d

.getRepository());

DataObject dataObject = new DataObject(objIdentity,

"dm_document");

PropertySet properties = dataObject.getProperties();

properties.set("object_name", fList[i].getName());

properties.set("title", "Nokia Cellphone");

properties.set("a_content_type", "gif");

String[] keywords = new String[] { "nokia", "cellphone" };

properties.set("keywords", keywords);

dataObject.getContents().add(

new FileContent(fList[i].getAbsolutePath(), "gif"));

19 EMC | Documentum Technical White Paper Documentum Foundation Services (DFS)

ReferenceRelationship folderRelationship = new ReferenceRelationship();

folderRelationship

.setName(Relationship.RELATIONSHIP_FOLDER);

folderRelationship.setTarget(folderIdentity);

folderRelationship.setTargetRole(Relationship.ROLE_PARENT);

dataObject.getRelationships().add(folderRelationship);

dp.addDataObject(dataObject);

}

}

DataPackage objDp = ios.create(dp, operationOptions);

int iObj = objDp.getDataObjects().size();

r = iObj + " objects created";

} catch (CoreServiceException e) {

r = e.getMessage();

} catch (ServiceException e) {

r = e.getMessage();

}

return r;

}

public static IServiceContext getSimpleServiceContext(

String repositoryName, String userName, String password) {

ContextFactory contextFactory = ContextFactory.getInstance();

IServiceContext context = contextFactory.newContext();

RepositoryIdentity repoId = new RepositoryIdentity();

repoId.setRepositoryName(repositoryName);

repoId.setUserName(userName);

repoId.setPassword(password);

context.addIdentity(repoId);

return context;

20 EMC | Documentum Technical White Paper Documentum Foundation Services (DFS)

}

public IObjectService getService(IServiceContext context) {

ServiceFactory serviceFactory = ServiceFactory.getInstance();

IObjectService objectService = null;

;

try {

objectService = serviceFactory.getRemoteService(

IObjectService.class, context, "core", d.getEfsurl());

} catch (ServiceInvocationException e) {

e.printStackTrace();

}

return objectService;

}

public DataObject newCabinet(String name) {

DataObject result = new DataObject(

newObjectIdentity(d.getRepository()), "dm_cabinet");

PropertySet properties = new PropertySet();

properties.set("object_name", name);

result.setProperties(properties);

return result;

}

public static ObjectIdentity newObjectIdentity(String docbase) {

return new ObjectIdentity(docbase);

}

DFSConnectionInfo d = null;

private ContentTransferMode trMode = ContentTransferMode.MTOM;

21 EMC | Documentum Technical White Paper Documentum Foundation Services (DFS)

private String geoLoc = "DC";

}

Appendix B - FLEX Source Code

import flash.net.navigateToURL; import mx.controls.Alert; import mx.rpc.events.FaultEvent; import mx.rpc.events.ResultEvent; import mx.events.ListEvent; import flash.display.*; import flash.net.URLRequest;

[Bindable] public var vObjId:String;

[Bindable] public var vObjName:String;

private function itemClickEvent(event:ListEvent):void { var selectedId:String=event.currentTarget.selectedItem.objId; vObjId=selectedId; vObjName=event.currentTarget.selectedItem.objName; srv2.getObjectBytes.send(); }

private function resultHandler(event:ResultEvent):void { var byteArray:ByteArray = event.result as ByteArray; var loader:Loader=new Loader(); loader.loadBytes(byteArray); }

]]>

{srchCriteria.text}

{vObjId}

22 EMC | Documentum Technical White Paper Documentum Foundation Services (DFS)

Appendix C - FLEX Adobe LiveCycle Remoting-Config.xml

When Flex calls LCDS to access a Java class, it uses the remoting-config.xml file on the LCDS server. This file has the Java classes and their IDs.

flex.samples.product.ProductService

flex.samples.runtimeconfig.ChatRoomService application

flex.samples.census.CensusService

flex.samples.pdfgen.PDFService

com.emc.dfs.DFSSearchService

com.emc.dfs.DFSObjectService

flex.samples.pdfgen.XDPXFAService

flex.samples.qos.FlexClientConfigService

24