2 Using the export filters
2.7 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 LO 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).
A LO template.
A LO 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 LO 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 LO 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 LO. 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 LO 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>
This property (XHTML only) points to style sheet within the extension, you want to include (for EPUB export):
<prop oor:name="StyleSheetURL" oor:type="xs:string">
<value>%origin%/config/mytemplate.xhtml</value>
</prop>
</node>
</node>
The next section defines the LO 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 LO 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
backend, inputencoding, multilingual, greek_math, additional_symbols2, 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
Writer2xhtml (XHTML export)
scaling, column_scaling, convert_to_px, image_size, notes, use_dublin_core, ignore_hard_line_breaks, ignore_empty_paragraphs, ignore_double_spaces, split_level, repeat_levels, save_images_in_subdir, xslt_path
Writer2xhtml (EPUB export)
scaling, column_scaling, relative_font_size, font_scaling, use_default_font, default_font_name, convert_to_px, image_size, ignore_hard_line_breaks, ignore_empty_paragraphs, ignore_double_spaces, display_hidden_text, notes, split_level, page_break_split, split_after, image_split, cover_image, external_toc_depth, include_toc
Calc2xhtml
scaling, column_scaling, convert_to_px, image_size, notes, use_dublin_core, display_hidden_sheets, display_hidden_rows_cols, display_filtered_rows_cols, apply_print_ranges, use_title_as_heading, use_sheetnames_as_headings, calc_split, save_images_in_subdir
2 This is a pseudo-option which locks all the options use_pifont, use_ifsym, use_wasysym, use_eurosym and use_tipa.