Access Binary Content of a Document from .NET
| March 2006 | |
|
Software Environment
| Feature | Tested on |
| Operating System | Windows 2000 Server SP4 |
| Compiler | Sun JDK 1.4.2_08, Microsoft (R) Visual C# 2005 Compiler version 8.00.50727.42 |
| Runtime | Sun JRE 1.4.2_08, Microsoft (R) Windows (R) 2005 Framework version 2.0.50727 |
| DFC | 5.3 SP2 |
| Content Server | 5.3 SP1 |
| DFC PIA | 5.3.0.53 |
Abstract
The DFC method IDfSysObject#getContent() cannot be used from .NET because this method returns a Java-specific object that cannot be translated to .NET. This article looks at using a Service-based Business Object(SBO) to overcome this and access the binary content from .NET.
Introduction
The method IDfSysObject#getContent() returns a Java object of type java.io.ByteArrayInputStream. This object cannot be translated to .NET and hence this method cannot be used from .NET. One way to overcome this problem is to use a Service-base Business Object (SBO) that translates the Java object into another that can be read from .NET. This SBO can then be accessed from .NET to obtain the binary data.
SBO
The SBO is written in Java and hence can call the getContent() method. It obtains the ByteArrayInputStream object and converts the bytes to an com.documentum.fc.common.IDfList DFC object that can be read in .NET. The IDfList contains the list of bytes from the ByteArrayInputStream object. The .NET code can call the SBO and get the IDfList object, from which it can read the bytes.
Download
AccessBinaryContentFromDotNET.zip
Installation and Configuration
- Extract the above file to a convenient location.
- The file contains the following -
-
binaryContentService.jar - The interface jars for the SBO
-
binaryContentServiceImpl.jar - The implementation class jar for the SBO
-
source.zip - The Java and .NET source code files. The .NET source code shows how to invoke the SBO
- Register the SBO following the instructions in the article BOF 2.0 Registration. Following are the parameters of the SBO -
Name - com.documentum.devprog.bincontent.IBinaryContentService
Interface - com.documentum.devprog.bincontent.IBinaryContentService
Implementation Class - com.documentum.devprog.bincontent.impl.BinaryContentService
Interface Jar - binaryContentService.jar
Implementation Class Jar - binaryContentServiceImpl.jar
|