Enabling the Outline Pane for DITA and Other Frameworks
Oxygen XML Web Author includes an Outline side-pane that displays a general tag overview of the current document. It is enabled and available, by default, for DITA Map, DocBook, TEI, and XHTML documents. However, it is possible to configure other frameworks (such as DITA topics) to display the pane.
- Create a configuration file named webAuthorOutlineConfig.xml.
The following is an example of what this configuration file looks like for
DocBook:
<outline> <structureMode editable="yes" default="no"> <preferredAttributes names="id xml:id"/> </structureMode> <tocMode editable="yes" default="yes"> <elements names="section sect1 sect2 sect3 sect4 sect5 simplesect article book"/> </tocMode> </outline>
Notice that there are two elements that define the two modes:
<structureMode>
(for the Structure mode that displays the information in the pane as a general tag overview of the current XML document) and<tocMode>
(for the Contents mode that displays the information in the pane like a table of contents).By using
editable="yes"
, the document structure can be edited from the Outline view using drag-and-drop or contextual menu actions. - The configuration file must be stored in a folder included in the framework's classpath.
To add the folder to the classpath:
- In Oxygen XML Editor/Author, go to and edit the document type configuration for your custom framework.
- In the Classpath tab, add a link to the folder where you
stored the configuration file.Note: It is important to reference the exact folder that contains the configuration file (it cannot be located in a subfolder within the referenced folder).
- Create an archive that only contains your custom framework folder and upload the changes to your framework to Web Author.
outlineConfigurationProvider
loading option. This function that has a
callback that receives the JSON configuration as a parameter. It can be set like
this:goog.events.listen(workspace,sync.api.Workspace.EventType.BEFORE_EDITOR_LOADED,function(e)
{
e.options.outlineConfigurationProvider = function(callback) {
callback("{\n" +
" \"structureMode\": {\n" +
" \"editable\": \"yes\",\n" +
" \"defaultMode\": \"no\",\n" +
" \"preferredAttributes\": {\"names\": \"id xml:id\"}\n" +
" },\n" +
" \"tocMode\": {\n" +
" \"editable\": \"yes\",\n" +
" \"defaultMode\": \"yes\",\n" +
" \"elements\": {\"names\": \"topic\"}\n" +
" }\n" +
"}");
}
});
How to Configure the Displayed Names of Elements in the Outline Pane
The Contents mode (table of contents mode) uses a heuristic algorithm to present the title (name) for any given element. For advanced use-cases, it is possible to configure the location of the element title presented in the Outline pane.
<tocMode>
element would look
like for this type of
configuration:<outline>
<tocMode editable="no">
<elements names="section sect1 sect2 sect3 sect4 sect5 simplesect article book"/>
<titleLocator element="section" location="title, @spectitle"/>
<titleLocator element="section1" location="title"/>
</tocMode>
</outline>
@location
attribute is a simplified
XPath syntax that supports a comma-separated list of the following:- Element names (e.g.
"title,h1,h2"
). You can also use an XPath simplified selector in the form"elementName1/elementName2/.../elementNameN"
. When there are multiple elements, the first one in the order takes precedence. - Attribute names prefixed with "@" (e.g.
"@title"
). - Any before functions that matches "before" pseudo-elements (e.g.
"before(1030)"
). - Descendent element names prefixed by ".//" (e.g.
".//title"
).
The first element in the list returned by the XPath is used. If no
<titleLocator>
element is present, or if no match is found in the
document, the default algorithm is used to retrieve the text for the given element.
How to Configure Which Side of the UI the Outline Pane Appears
You can configure which side the Outline pane is displayed on by setting either of the following:
outlinePlacement
loading option (URL parameter)PLUGIN_CUSTOM_OPTIONS.outlinePlacement
in the options.xml
In both cases, the accepted values are: left or right.