2 Using the export filters
2.8 Configuration packages
Advanced users may add further formats/styles to the lists in the export dialog. This is done using configuration packages, which are custom extensions to OOo containing further configurations for Writer2LaTeX or Writer2xhtml.
A configuration package can contain:
-
A configuration file for Writer2LaTeX or Writer2xhtml, see section 4.
-
An xhtml template (Writer2xhtml only).
-
An OOo template.
-
An OOo registry file to glue the parts together.
The Writer2LaTeX distribution contains a sample configuration package xhtml-config-sample.oxt that demonstrates this.
As a demonstration of the principles of configuration packages, you can install this into OOo using the Extension Manager:
-
If you export to xhtml, the dialog will show an additional entry Sample custom style in the Style list.
-
If you open Templates and Documents in OOo you will find a new folder xhtml-sample-config. This folder contains a Writer template. If you create a document based on this template, Sample custom style will be preselected when you export to xhtml.
You can create your own configuration package based on this sample. Use a zip utility to unpack the extension. The following explains the individual parts of the sample configuration package.
The file description.xml
This files identifies the extension in OOo. For your own configuration package you should choose a unique name for the identifier and a version number, eg.
<?xml version="1.0" encoding="UTF-8"?>
<description
xmlns="http://openoffice.org/extensions/description/2006"
xmlns:d="http://openoffice.org/extensions/description/2006">
<identifier value="MyConfigPackage" />
<version value="1.0" />
</description>
The files META-INF/manifest.xml and Paths.xcu
These files should be left unchanged.
The folder template
Put your OOo Writer template in this folder (it is recommended to use a subfolder with a descriptive name). You may add more that one templates, and if you don't want to include a Writer template you may leave it empty (do not delete the folder).
The folder config
Put your Writer2LaTeX/Writer2xhtml configuration in this folder. If you are using Writer2xhtml, you should also put your xhtml template here.
The file Options.xcu
This is the central configuration file that glues together the content of the configuration package. See the following example for an explanation of the structure.
<?xml version='1.0' encoding='UTF-8'?>
<oor:component-data oor:name="Options"
For LaTeX, Writer2xhtml should be replaced by Writer2LaTeX here:
oor:package="org.openoffice.da.Writer2xhtml"
xml:lang="en-US"
xmlns:oor="http://openoffice.org/2001/registry"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
XhtmlOptions may be replaced by XhtmlOptionsCalc or LaTeXOptions:
<node oor:name="XhtmlOptions">
<node oor:name="Configurations">
The configuration needs a unique name (you may define several configurations in the same package):
<node oor:name="myconfig1" oor:op="replace">
You can define options which are normally set in the filter dialog. In that case you can lock (disable) the corresponding parts of the dialogs. To do so, add a comma separated list of options as value here. See below for the options that can be locked for each of the three filters.
<prop oor:name="LockedOptions" oor:type="xs:string">
<value></value>
</prop>
The DisplayName is the name displayed in the style/format list in the filter dialog.
<prop oor:name="DisplayName" oor:type="xs:string" oor:localized="true">
<value>My Config Package</value>
</prop>
This path points to the configuration within the extension, you want to use:
<prop oor:name="ConfigURL" oor:type="xs:string">
<value>%origin%/config/myconfig.xml</value>
</prop>
This property (xhtml only) points to the xhtml template within the extension, you want to use.
<prop oor:name="TargetTemplateURL" oor:type="xs:string">
<value>%origin%/config/mytemplate.xhtml</value>
</prop>
</node>
</node>
The next section defines the OOo template you wish to connect with your configuration:
<node oor:name="Templates">
The entry needs a unique name:
<node oor:name="mytemplate1" oor:op="replace">
<prop oor:name="TemplateName" oor:type="xs:string">
The name of the OOo template is defined here (leave out .odt).
<value>MyWriterTemplate</value>
</prop>
<prop oor:name="ConfigName" oor:type="xs:string">
The configuration to link to is defined here.
<value>myconfig1</value>
</prop>
</node>
</node>
</node>
</oor:component-data>
About locked options
The options you can specify for the LockedOptions property depends on the filter. The following list details which options are available to lock for each filter (see section 4).
Writer2LaTeX |
Writer2xhtml |
Calc2xhtml |
backend inputencoding multilingual greek_math additional_symbols 6 use_bibtex bibtex_style wrap_lines_after split_linked_sections split_toplevel_sections save_images_in_subdir notes metadata original_image_size simple_table_limit float_tables float_figures float_options ignore_hard_page_breaks ignore_hard_line_breaks ignore_empty_paragraphs ignore_double_spaces |
scaling column_scaling convert_to_px original_image_size notes use_dublin_core display_hidden_sheets
display_hidden_rows
display_filtered_rows apply_print_ranges use_title_as_heading
use_sheetnames_as calc_split save_images_in_subdir xslt_path |
scaling column_scaling convert_to_px original_image_size notes use_dublin_core ignore_hard_line_breaks ignore_empty_paragraphs ignore_double_spaces split_level repeat_levels save_images_in_subdir
|
6 This is a pseudo-option which locks all the options use_pifont, use_ifsym, use_wasysym, use_eurosym and use_tipa.