Content Management Guide

CHAPTER 7

Importing and Exporting Content

This chapter describes the import and export facilities provided with the exteNd Director Content Management (CM) subsystem. It has these sections:

 
Top of page

About importing and exporting

The CM subsystem includes facilities for importing and exporting data between databases or within a single database.

Uses for the import and export facilities include:

This chapter describes how the import and export functions work and how you can customize them.

 
Top of section

Using the import/export facilities

For more information    You can use the import/export facilities in the CMS Administration Console to import and export content.

For more information    For more information, see Importing and Exporting Content

 
Top of page

About the export facility

The export facility comprises these elements:

Export facility element

Description

Export component(s)

A portal portlet (or other UI element) that gets the data export descriptor (DED) selected by the user and lets the user save the CM archive generated by the EbiExporter object.

NOTE:   This function is provided in the CMS Administration Console.

Data export descriptor (DED)

An XML descriptor that defines the export data selected by the user.

For more information    For more information, see Customizing the data export descriptor (DED).

EbiExporter

Contains the API for exporting CM data. This object queries the CM repository for data based on the scope specified in the DED and then packages the result into a CM archive.

CM export servlet

Provides a connection between the EbiExporter object and the exporter portlet. This object passes the DED from the portlet to the exporter API and then gets the CM archive from the exporter and returns it to the portlet.

CM archive

A ZIP file that contains the CM export data and a default data import descriptor (DID) for subsequent use with the import facility.

For more information    For a description of the archive contents, see Structure of the data import or export archive.

 
Top of section

Export process

Here is how the export process works:

exportProcess

  1. The export process begins when a portlet gets the selected DED and passes it to the CM export servlet.

  2. The export servlet forwards the DED to an object that implements the EbiExporter API.

    NOTE:   The servlet provides remote access to the EbiExporter API; however, the portlet could call the API directly.

  3. The CM exporter API uses the DED to create a query representing all data and infrastructure the user has identified and executes the query against the CM database.

  4. The CM database responds to the query by returning a raw result set.

  5. The CM exporter API formats the raw query result into a structured ZIP archive file containing the content and data descriptors and returns the archive to the export servlet.

  6. The export servlet returns the ZIP file to the portlet as bytes of content with a MIME type of application/zip.

  7. The export portlet gets the ZIP file and saves it in a disk location specified by the user.

 
Top of page

About the import facility

The import facility is made up of these elements:

Import facility element

Description

Import component(s)

A portal portlet (or other UI element) that provides the UI for the user to select import data. This import function is provided in the CMS Administration Console.

Data import descriptor (DID)

An XML descriptor based on the contents of the CM archive generated by the exporter.

For more information    For more information, see Customizing the data import descriptor (DID).

EbiImporter

Contains the API for importing CM data. It extracts the DID from the CM archive and uses it to insert data into the target database.

CM import servlet

Provides a connection between the EbiImporter and the CMS Administration Console. This object passes the CM archive to the importer API and creates an XML document that enumerates any warnings and failures encountered in the import process.

 
Top of section

Import process

Here is how the import process works:

importProcess

  1. The import process begins when a portlet allows the user to select the CM archive containing the DID.

    The CM archive is generated by the export facility.

  2. The import portlet posts the ZIP file to the CM import servlet via HTTP.

    NOTE:   The servlet provides remote access to the EbiImporter API; however, the portlet could call the API directly.

  3. The import servlet passes the ZIP file to the CM importer as an input stream.

  4. The CM importer extracts the DID from the ZIP and uses it to transfer the data from the ZIP file to the underlying content repository.

  5. The CM importer returns a summary of its execution to the CM import servlet.

  6. The import servlet creates an XML document that represents successes, warnings, and failures that were encountered during the import process.

  7. The import servlet returns the XML document to the portlet, which generates a report for the user.

 
Top of page

Customizing imports and exports

You can customize data imports and exports several ways:

Operation

Customizing option

For an export

Providing a custom DED file before executing an export

For an import

Editing the generated DID before executing an import

Adding or deleting items from the CM archive before executing an import

For an export or an import

Providing your own logic by implementing the import and export APIs

 
Top of section

Customizing the data export descriptor (DED)

The data export descriptor (DED) is an XML file you can use to:

Format for entries   The entries in your DED must conform to the DTDs in your project's library/ContentMgmtService/ContentMgmtService.spf/DTD directory.

Sample DED files   There are several sample DED files in your project's library/ContentMgmtService/ContentMgmtService.spf/DTD directory. Each of these samples represents a typical export scenario:

Sample file

Demonstrates how to

contentmgmt-export-descr_5_0_sample.xml

  • Export all data out of the CM system

  • Specify options for the operation

contentmgmt-export-descr_5_0_sample2.xml

  • Export specific infrastructural data out of the CM system

contentmgmt-export-descr_5_0_sample3.xml

  • Export specific infrastructural data out of the CM system

  • Export dependent items in the element hierarchy

contentmgmt-export-descr_5_0_sample4.xml

  • Export all documents and supporting infrastructure using default configuration options

contentmgmt-export-descr_5_0_sample5.xml

  • Export certain elements of documents that satisfy a query conforming to contentmgmt-docmeta-search_5_0.dtd

 
Top of section

Customizing the data import descriptor (DID)

The data import descriptor (DID) is an XML file you can use to:

Format for entries   The entries in your DID must conform to contentmgmt-import-descr_5_0.dtd in your project's library/ContentMgmtService/ContentMgmtService.spf/DTD directory.

Sample DID file   There is a sample DID file in your project's library/ContentMgmtService/ContentMgmtService.spf/DTD directory that shows how to set all available import options:

 
Top of section

Accessing the import and export API

In most cases, editing the descriptors or the CM archive should provide most of the flexibility you need. However you can access the import and export API directly for tasks ranging from ad hoc imports and exports to writing your own facility.

Potential uses of the functionality provided by EbiImporter and EbiExporter include:

For more information    For more information, see the online API documentation for EbiExporter and EbiImporter.



Copyright © 2003 Novell, Inc. All rights reserved. Copyright © 1997, 1998, 1999, 2000, 2001, 2002, 2003 SilverStream Software, LLC. All rights reserved.  more ...