Introduction

The connector supports the export and import of content and media items in ECM Documentum, by using Documentum's REST API. The exporter exports data from Documentum to our Unified Data Model (UDM), and the importer imports data from our UDM to Documentum. In this Article I'll explain the import functionality of the connector. 

Installation

The Documentum connector is written in Xill IDE, to make it work extract the zip and add it as a project in Xill. 

Next the properties have to be set accordingly to your environment, open the file xill.properties. For the importer to work the following variables, like the Documentum import cabinet and folder, have to be set:

#udm
db.name=udm_documentum_import
udm.identity=documentum_import

#paths
project.root=D:/projects/connector-documentum/demo_import/
project.exportPath=1.export/
project.tempPath=temp/
project.binaryPath=1.export/
project.imagePath=1.export/
connector.documentum.mappingPathImport=config/import/mapping/

#import
documentum.url=http://localhost/dctm-rest/repositories/
documentum.repository=MyRepo
documentum.cabinetID=0c0007c280008435
documentum.importFolderID=0b0007c28000a342
documentum.user=dmadmin
documentum.pass=password

# ContentTypes that are a folder in documentum, separated by comma
documentum.folderList=Folder

The connector has a demo project included that will create and fill the UDM in MongoDB, but normally, you'd have done this part already. 

Usage

Once installed, the mapping of the content types have to be created. This has to be done in /config/import/mapping/<ContentType>.xill, over here you can create as many content type mappings as are necessary. 

The demo already has Folder and Document in which the object_name is set, this happens in the function mapDocument for Document (and mapFolder for folder):

function mapDocument(document, data) {
    document += {
        "object_name" : data.source.current.file.name
    };
    return document;
}

Naturally, this function from the import demo project can be extended with all the metadata fields you want. 

After you've created all the mappings you need, you can run Main.xill to build the mapper file based on a template, for this it scans through all the files in the /config/import/mapping/ folder.

To start an import, run project/import.xill. It queries the UDM for items that have a parent with id 0 (root items), and imports recursively into Documentum. After and item is importer, Documentum returns an id of the imported item, this id is then stored in the UDM for future needs, like importing relations. 

The file API.xill and Commons.xill in the connector folder contain all Documentum import (and export) functions you can imagine, like importing files with or without renditions, importing versions, importing relations, etc. However, not all functions are used in the demo, but the demo script can be extended quite easily with the use of those functions.