Athor mode, HTML tables and validating/controlling markup?

Oxygen general issues.
andlut
Posts: 3
Joined: Mon Apr 04, 2011 11:19 pm

Athor mode, HTML tables and validating/controlling markup?

Post by andlut »

I'm trying to determine if the table tools in the Author view can be controlled - e.g. with a custom schema along with a xhtml schema. For example, I would like to force the table cells to have predefined classes, so when an editor edits a table, these classes will be automatically added and also validated against a schema.

Something were a table would like this:

Code: Select all


<table>
<tr>
<td class="A">A value</td>
<td class="B">B value</td>
<td class="C">C value</td>
</tr>
</table>
And follow these rules:
  • Minimum of 3 columns and 1 row
  • Any number of columns and rows allowed
  • Class attribute values in order would be "A, B, C" with additional columns also having class "C"
  • When an editor creates a new column or row, it will be created with predefined class names
I hope this makes sense, I've spent the better part of the day trying to figure this out without even knowing if this is possible.
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Athor mode, HTML tables and validating/controlling markup?

Post by sorin_ristache »

Hello,

You want a custom action for inserting a table in Author editing mode. Also you need an additional schema for validating your (XHTML ?) document that should be applied by a validation action after the table is added or edited.

For writing the custom action I suggest starting from the Java source code of the table related actions for inserting a table/table row/table column from one of the predefined frameworks (XHTML, DITA, DocBook, TEI). You can find these actions in Author SDK (more details on the Developer page). For example the action for inserting a table in an XHTML document in Author mode is displayed as Customize and insert table on the Author toolbar and Insert table on the popup menu of the Author editor. The name of the Java class for this action is ro.sync.ecss.extensions.commons.table.operations.xhtml.InsertTableOperation.

For the restrictions on the number of rows and columns and values of the class attribute you should write a schema and validate the document with that schema. Starting with version 12.2 which we will release in less than a month you will have the option of adding any validation scenario that you want to a framework (like XHTML, DITA, DocBook, etc) but in the current version (12.1) you will have to add these restrictions to the unique schema used for validating the documents of your framework. For example for XHTML documents you locate the schema that you must customize by going to menu Options -> Preferences -> Document Type Association -- XHTML -- the Edit button -- the Schema tab -- the Schema URI combo box.


Regards,
Sorin
Post Reply