Document API Filter Development

From Apache OpenOffice Wiki
< Documentation‎ | DevGuide
Revision as of 12:21, 1 November 2007 by Jsc (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search



First, we provide an overview of the import and export process using a document API, and gain an understanding of the general concepts.

Introduction

Inside OpenOffice.org a document is represented by its document service, called model. On disk, the same document is represented as a file or possibly as a dynamic generated output, for example, of a database statement. We cannot assign it to a file on disk, so we call it content to describe it. A filter component is used to convert between these different formats.

Import/Export Filter Process

If you make use of UNO, this above diagram can be turned into programming reality quite easily. The three entities in the diagram, content, model, and filter, all have direct counterparts in UNO services. The services consist of several interfaces that map to a specific implementation, for example, using C++ or Java.

The filter writer creates a class that implements the com.sun.star.document.ExportFilter or com.sun.star.document.ImportFilter services, or both. To achieve this, the corresponding stream or URL is obtained from the com.sun.star.document.MediaDescriptor. The incoming data is then interpreted and the model is used by calling the appropriate methods. The available methods depend on the type of document as described by the document service.

For a list of available document services, refer to the section Document Specific Features.

Content on this page is licensed under the Public Documentation License (PDL).
Personal tools