Configuration

From OpenOffice.org Wiki

Jump to: navigation, search
Image:Book.png


PAGE_TITLE: Q29uZmlndXJhdGlvbg==

For OpenOffice.org to be able to make use of this filtering component, the filter and the type that it handles must be defined in the TypeDetection.xcu file.

The type section defines certain file types and their extensions. The filter section contains the actual filter definition.

Below is an example of a type and filter definition in the TypeDetection.xcu file. It describes a PocketWord filter.

<!-- Type section -->
  <node oor:name="writer_PocketWord_File" oor:op="replace">
      <prop oor:name="UIName">
          <value xml:lang="en-US">Pocket Word</value>
      </prop>
      <prop oor:name="Data">
          <value>0,,,,psw,20002,</value>
      </prop>
  </node>
 
  <!-- Filter section -->
  <node oor:name="PocketWord File" oor:op="replace">
      <prop oor:name="UIName">
          <value xml:lang="en-US">Pocket Word</value>
      </prop>
      <prop oor:name="Data">
          <value>
              0,
              writer_PocketWord_File,
              com.sun.star.text.TextDocument,
              com.sun.star.comp.Writer.XmlFilterAdaptor,
              524355,
              com.sun.star.documentconversion.XMergeBridge;
                  classes/pocketword.jar;
                  com.sun.star.comp.Writer.XMLImporter;
                  com.sun.star.comp.Writer.XMLExporter;
                  staroffice/sxw;application/x-pocket-word,
              0,
              ,
          </value>
      </prop>
      <prop oor:name="Installed" oor:type="xs:boolean">
          <value>true</value>
      </prop>
  </node>

The type section defines a type writer_PocketWord_File with "Pocket Word" as UIName in File - Open. The file extension of this type is specified as .psw in the Data property.

The filter section defines the same UI name "Pocket Word" for the filter, and a number of settings in the Data property, simply separated by commas:

Type

This is the id of the file type definition that defines the type of file that this filter can handle, in this case "writer_PocketWord_File”. This value refers to the oor:name of the type section.

Office application

This is the application that will be used to open the document, in this case Writer (“com.sun.star.text.TextDocument”).

Filter Component

This is the component that OpenOffice.org will initialize when importing or exporting, in this case “com.sun.star.comp.Writer.XmlFilterAdaptor“.

User Data

Section containing the filtering component that the XML filter adapter will initialize and use for filtering. In this example “com.sun.star.documentconversion.XMergeBridge;classes/pocketword.jar;com.sun.star.comp.Writer.XMLImporter;

com.sun.star.comp.Writer.XMLExporter;staroffice/sxw;application/x-pocket-word

From this example, you see that this Filter uses the XML filter adapter. When the XML filter adapter initializes, it initializes the XMergeBridge that is specified in the UserData section. The rest of the information in the UserData section has been included for use by the XMergeBridge filtering component, including the com.sun.star.comp.Writer.XMLImporter, which will be used by the XML filter adapter to create the XDocumentHandler when importing.

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