Oxygen comes with full support for CALS tables in DITA and Docbook
documents, meaning that you can easily make selections, resize columns, and invoke
special actions like insert or delete rows and columns, join, or split cells. You can
also easily customize tables properties such as alignments, separators, and table
borders. But what if you are editing documents from other vocabularies, containing
tables with CALS structure? What you can do to obtain the same table editing
features?
One option is to use a plugin that adds CALS table editing support along with specific
table related actions: https://github.com/oxygenxml/web-author-sample-plugins/tree/master/web-author-CALS-table-plugin.
Another option is to customize your framework configuration:
Let's suppose that you already created an Oxygen framework for your documents vocabulary
(if you need further information about frameworks, see The Oxygen SDK (Part 2: Frameworks)). What we want to obtain next is to extract all the
CALS tables related support from Docbook framework and add it to your custom
framework. Why Docbook and not DITA as reference? Because the DITA
customization is based on the "class" attribute checking while the Docbook one is
more general (element-name oriented).
- Table rendering
- copy
[oXygen_install_dir]\frameworks\docbook\css\cals_table.css
and
[oXygen_install_dir]\frameworks\docbook\css\html_cals_table.css
in your framework css directory
- in the Document Type edit dialog,
Author tab,
CSS sub-tab, add the
${framework}/css/cals_table.css entry to
the list of the CSSs
In this way the table will be rendered properly in Author mode and the
following features will be available:
- Create table actions
Here are the table-related actions implemented in
Docbook that you can implement also in you framework:
- Copy
[oXygen_installation_dir]\frameworks\docbook\docbook.jar
in your framework directory (this jar contains all the table operations
classes needed to create table actions). In Document
type edit dialog go to
Classpath tab and add the docbook.jar from
your framework directory to the list of paths. In this way you have access
to all table operations from your framework.
- For every table action you have to define a corresponding action in the
Document type configuration dialog. Here
are the details: https://www.oxygenxml.com/doc/ug-editor/#topics/the-action-dialog.html. You can look at the corresponding
Docbook action to see the properties (id, name, icons, the conditions that
enables it, the specific operation for CALS tables).
Once you created
these actions you can add them to the UI.
- Add table actions to menu, toolbar and contextual menu
- To add an action to the menu go to Document
Type configuration dialog,
Author tab,
Menu sub-tab, select the action from
Available actions section and add it to the
Current action section.
- To add an action to the contextual menu go to Document
Type configuration dialog,
Author tab, Contextual
menu sub-tab, select the action from
Available actions section and add it to the
Current action section.
- To add an action to the toolbar go to Document
Type configuration dialog,
Author tab,
Toolbar sub-tab, select the action from
Available actions section and add it to the
Current action section.
If all goes well, your custom framework which uses the standard CALS table naming
mechanism will properly handle tables, both for display and for table-related
operations.