Chapter 7. <oXygen/> XML Editor Developer Guide

Table of Contents

Introduction
Simple Customization Tutorial
XML Schema
Writing the CSS
The XML Instance Template
Advanced Customization Tutorial - Document Type Associations
Creating the Basic Association
First step. XML Schema.
Second step. The CSS.
Defining the General Layout.
Styling the section Element.
Styling the table Element.
Styling the Inline Elements.
Styling Elements from other Namespace
Styling images
Marking elements as foldable
Marking elements as links
Third Step. The Association.
Organizing the Framework Files
Association Rules
Java API: Rules implemented in Java
Schema Settings
Author CSS Settings
Testing the Document Type Association
Packaging and Deploying
Author Settings
Configuring Actions, Menus and Toolbars
The Insert Section Action
The Insert Table Action
Configuring the Toolbar
Configuring the Main Menu
Configuring the Contextual Menu
Author Default Operations
The arguments of InsertFragmentOperation
The arguments of SurroundWithFragmentOperation
Java API - Extending Author Functionality through Java
Example 1. Step by Step Example. Simple Use of a Dialog from an Author Operation.
Example 2. Operations with Arguments. Report from Database Operation.
Configuring New File Templates
Configuring XML Catalogs
Configuring Transformation Scenarios
Configuring Extensions
Configuring an Extensions Bundle
Implementing an Author Extension State Listener
Configuring a Content completion handler
Configuring a Link target element finder
The DefaultElementLocatorProvider implementation
The XPointerElementLocator implementation
The IDElementLocator implementation
Creating a customized link target reference finder
Configuring a custom Drag and Drop listener
Configuring a References Resolver
Configuring CSS Styles Filter
Configuring a Table Column Width Provider
Configuring a Table Cell Span Provider
Configuring an Unique Attributes Recognizer
Customizing the default CSS of a document type
Document type sharing
CSS support in <oXygen/> Author
CSS 2.1 features
Supported selectors
Unsupported selectors
Properties Support Table
<oXygen/> CSS Extensions
Media Type oxygen
Supported Features from CSS Level 3
Namespace Selectors
The attr() function: Properties Values Collected from the Edited Document.
Additional Custom Selectors
Additional Properties
Folding elements: foldable and not-foldable-child properties
Link elements
<oXygen/> Custom CSS functions
The local-name() function
The name() function
The url() function
The base-uri() function
The parent-url() function
The capitalize() function
The uppercase() function
The lowercase() function
The concat() function
The replace() function
The unparsed-entity-uri() function
The attributes() function
Example Files Listings
The Simple Documentation Framework Files
XML Schema files
sdf.xsd
abs.xsd
CSS Files
sdf.css
XML Files
sdf_sample.xml
XSL Files
sdf.xsl
Java Files
InsertImageOperation.java
QueryDatabaseOperation.java
SDFExtensionsBundle.java
SDFSchemaManagerFilter.java
TableCellSpanProvider.java
TableColumnWidthProvider.java
ReferencesResolver.java
CustomRule.java
DefaultElementLocatorProvider.java
XPointerElementLocator.java
IDElementLocator.java

Introduction

Starting with version 9, <oXygen/> adds extensive support for customization.

The Author mode from <oXygen/> was designed for bridging the gap between the XML source editing and a friendly user interface. The main achievement is the fact that the Author combines the power of the source editing and the intuitive interface of a text editor.

Figure 7.1. oXygen Author Editor

oXygen Author Editor


Although <oXygen/> comes with already configured frameworks for DocBook, DITA, TEI, XHTML, you might need to create a customization of the editor to handle other types of documents. For instance in the case you have a collection of XML document types used to define the structure of the documents that are used in your organisation and you want them visually edited by people who are not experienced in using XML.

There are several ways to customize the editor:

  1. Create a CSS file defining styles for the XML elements the user will work with, and create XML files that refer the CSS through an xml-stylesheet processing instruction.

  2. Fully configure a document type association. This involves putting together the CSS files, the XML schemes, actions, menus, etc, bundling them and distributing an archive. The CSS and the GUI elements are settings of the <oXygen/> Author. The other settings like the templates, catalogs, transformation scenarios are general settings and are enabled whenever the association is active, no matter the editing mode (Text, Grid or Author).

We will discuss both approaches in the following sections.