Difference between revisions of "Documentation/DevGuide/OfficeDev/Configuring a Filter in OpenOffice.org"

From Apache OpenOffice Wiki
Jump to: navigation, search
m (1 revision(s))
m (Robot: Changing Category:Office Development)
Line 21: Line 21:
  
 
{{PDL1}}
 
{{PDL1}}
[[Category: Office Development]]
+
 
 +
[[Category:Documentation/Developers Guide/Office Development]]

Revision as of 10:20, 4 June 2008



As previously discussed, the whole process of loading and saving content works generically in many components and can be adapted to the needs of a user through the addition of custom modules or the removal of others. All this information about services and parameters are organized in a special configuration branch of OpenOffice.org called org.openoffice.Office.TypeDetection. The principal structure is shown below:

Structure of org.openoffice.Office.TypeDetection Configuration Branch

As shown on the left, the file consists of lists called sets. The list items are described by the structures shown on the right to which the arrows point. It works similar to 1:n relations in a database. Every filter, frame loader, detector is registered for one or multiple types. The detection of the proper type is important for the functionality of the whole system. If the right loader or filter cannot be found, the load or save request does not produce the right results.

To extend OpenOffice.org to load or save new content formats, a new type entry is added describing the new content. Furthermore, a filter item is registered for this new type. An optional and recommended change for a detector can be done.

Documentation caution.png It is not a good idea to edit the configuration branch files directly to make these changes. It is better to use the configuration API to do so, because the format of the file may be changed in the future. The properties describing the components, such as types and filters, are always the same and are not likely to be changed or in an incompatible manner. It is better to add entries by specifying their properties using the API only. To make this easier for external programmers, this manual provides a OpenOffice.org Basic script that is used for that purpose called regfilter.bas.

The work to be done by the filter programmer is to provide an ini file that includes the properties and start the basic script inside OpenOffice.org. The script reads the file and uses it to change the configuration package. These changes are done for the user layer of the configuration, so it is possible to restore the original state. There is also an example ini file in the samples folder for this manual that can be used for your own purposes called regfilter.ini.

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