Difference between revisions of "Documentation/DevGuide/OfficeDev/Document API Filter Development"

From Apache OpenOffice Wiki
Jump to: navigation, search
(Initial author Sun Microsystems, Inc.)
 
m (1 revision(s))
(No difference)

Revision as of 13:03, 15 February 2008



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