<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>oXygen XML Editor Blog</title>
</head>
<body>
<style type="text/css">
h1 a:hover {background-color:#888;color:#fff ! important;}
div#emailbody table#itemcontentlist tr td div ul {
list-style-type:square;
padding-left:1em;
}
div#emailbody table#itemcontentlist tr td div blockquote {
padding-left:6px;
border-left: 6px solid #dadada;
margin-left:1em;
}
div#emailbody table#itemcontentlist tr td div li {
margin-bottom:1em;
margin-left:1em;
}
table#itemcontentlist tr td a:link, table#itemcontentlist tr td a:visited, table#itemcontentlist tr td a:active, ul#summarylist li a {
color:#000099;
font-weight:bold;
text-decoration:none;
}
img {border:none;}
</style>
<div xmlns="http://www.w3.org/1999/xhtml" id="emailbody" style="margin:0 2em;font-family:Georgia,Helvetica,Arial,Sans-Serif;line-height:140%;font-size:13px;color:#000000;">
<table style="border:0;padding:0;margin:0;width:100%">
<tr>
<td style="vertical-align:top" width="99%">
<h1 style="margin:0;padding-bottom:6px;">
<a style="color:#888;font-size:22px;font-family:Arial, Helvetica, sans-serif;font-weight:normal;text-decoration:none;" href="http://blog.oxygenxml.com/" title="(http://blog.oxygenxml.com/)">[oXygen XML Editor Blog] - Adding CALS-table related functionality to your custom Oxygen framework</a>
</h1>
</td>
<td width="1%" />
</tr>
</table>
<hr style="border:1px solid #ccc;padding:0;margin:0" />
<table id="itemcontentlist">
<tr xmlns="">
<td style="margin-bottom:0;line-height:1.4em;">
<p style="margin:1em 0 3px 0;">
<a name="1" style="font-family:Arial, Helvetica, sans-serif;font-size:18px;" href="http://feedproxy.google.com/~r/AboutOxygenXmlEditor/~3/dZaVU4PwlCc/adding-cals-table-related-functionality.html?utm_source=feedburner&utm_medium=email">Adding CALS-table related functionality to your custom Oxygen framework</a>
</p>
<p style="font-size:13px;color:#555;margin:9px 0 3px 0;font-family:Georgia,Helvetica,Arial,Sans-Serif;line-height:140%;font-size:13px;">
<span>Posted:</span> 30 Oct 2015 07:32 AM PDT</p>
<div style="margin:0;font-family:Georgia,Helvetica,Arial,Sans-Serif;line-height:140%;font-size:13px;color:#000000;"><div class="body taskbody"> <div class="section context"> <p class="p">Oxygen comes with full support for <strong class="ph b">CALS</strong> tables in <strong class="ph b">DITA</strong> and <strong class="ph b">Docbook</strong> 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 <strong class="ph b">CALS</strong> structure? What you can do to obtain the same table editing features?</p> <p class="p">Let's suppose that you already created an Oxygen framework for your documents vocabulary (if you need further information about frameworks, see <a class="xref" href="http://blog.oxygenxml.com/2014/08/the-oxygen-sdk-part-2-frameworks.html" target="_blank">http://blog.oxygenxml.com/2014/08/the-oxygen-sdk-part-2-frameworks.html</a>). What we want to obtain next is to extract all the CALS tables related support from <strong class="ph b">Docbook</strong> framework and add it to your custom framework. Why <strong class="ph b">Docbook</strong> and not <strong class="ph b">DITA</strong> as reference? Because the <strong class="ph b">DITA</strong> customization is based on the "class" attribute checking while the <strong class="ph b">Docbook</strong> one is more general (element-name oriented).</p> </div> <ol class="ol steps"><li class="li step stepexpand"> <span class="ph cmd"><strong class="ph b">Table rendering</strong></span> <ol type="a" class="ol substeps"> <li class="li substep"> <span class="ph cmd">copy <samp class="ph codeph">[oXygen_install_dir]\frameworks\docbook\css\cals_table.css</samp> in your framework css directory</span> </li> <li class="li substep"> <span class="ph cmd">in the <samp class="ph codeph">Document Type</samp> edit dialog, <samp class="ph codeph">Author</samp> tab, <samp class="ph codeph">CSS</samp> sub-tab, add the <samp class="ph codeph">${framework}/css/cals_table.css</samp> entry to the list of the CSSs</span> </li> </ol> <div class="itemgroup stepresult"> <p class="p">In this way the table will be rendered properly in Author mode and the following features will be available: </p> <ul class="ul"> <li class="li">select cells (<samp class="ph codeph">CTRL+click</samp>), rows (click before the row), columns (click on top of the row), tables (click in the left-up corner of the table)</li> <li class="li">resize table column</li> </ul> </div> </li><li class="li step stepexpand"> <span class="ph cmd"><strong class="ph b">Create table actions</strong></span> <div class="itemgroup info"> <p class="p">Here are the table-related actions implemented in Docbook that you can implement also in you framework:</p> <ul class="ul"> <li class="li">Expand colspecs</li> <li class="li">Insert/Delete Rows</li> <li class="li">Insert/Delete Columns</li> <li class="li">Table Properties</li> <li class="li">Join cells</li> <li class="li">Split cell</li> </ul> </div> <ol type="a" class="ol substeps"> <li class="li substep substepexpand"> <span class="ph cmd">Copy<samp class="ph codeph"> [oXygen_installation_dir]\frameworks\docbook\docbook.jar</samp> in your framework directory (this jar contains all the table operations classes needed to create table actions). In <samp class="ph codeph">Document type</samp> edit dialog go to <samp class="ph codeph">Classpath</samp> 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.</span> </li> <li class="li substep substepexpand"> <span class="ph cmd">For every table action you have to define a corresponding action in the <samp class="ph codeph">Document type</samp> configuration dialog. Here are the details: <a class="xref" href="https://www.oxygenxml.com/doc/versions/17.1/ug-editor/#topics/the-action-dialog.html" target="_blank">https://www.oxygenxml.com/doc/versions/17.1/ug-editor/#topics/the-action-dialog.html</a>. 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).</span> <div class="itemgroup stepresult">Once you created these actions you can add them to the UI. </div> </li> </ol> </li><li class="li step stepexpand"> <span class="ph cmd"><strong class="ph b">Add table actions to menu, toolbar and contextual menu</strong></span> <ol type="a" class="ol substeps"> <li class="li substep"> <span class="ph cmd">To add an action to the menu go to <samp class="ph codeph">Document Type</samp> configuration dialog, <samp class="ph codeph">Author</samp> tab, <samp class="ph codeph">Menu</samp> sub-tab, select the action from <samp class="ph codeph">Available actions</samp> section and add it to the <samp class="ph codeph">Current action</samp> section.</span> </li> <li class="li substep"> <span class="ph cmd">To add an action to the contextual menu go to <samp class="ph codeph">Document Type</samp> configuration dialog, <samp class="ph codeph">Author</samp> tab, <samp class="ph codeph">Contextual menu</samp> sub-tab, select the action from <samp class="ph codeph">Available actions</samp> section and add it to the <samp class="ph codeph">Current action</samp> section.</span> </li> <li class="li substep"> <span class="ph cmd">To add an action to the toolbar go to <samp class="ph codeph">Document Type</samp> configuration dialog, <samp class="ph codeph">Author</samp> tab, <samp class="ph codeph">Toolbar</samp> sub-tab, select the action from <samp class="ph codeph">Available actions</samp> section and add it to the <samp class="ph codeph">Current action</samp> section.</span> </li> </ol> </li></ol> <div class="section postreq" id="task_z4x_g3t_vt__postreq_rcp_cmt_vt">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.</div> </div><img src="http://feeds.feedburner.com/~r/AboutOxygenXmlEditor/~4/dZaVU4PwlCc?utm_source=feedburner&utm_medium=email" height="1" width="1" alt=""/></div>
</td>
</tr>
</table>
<table style="border-top:1px solid #999;padding-top:4px;margin-top:1.5em;width:100%" id="footer">
<tr>
<td style="text-align:left;font-family:Helvetica,Arial,Sans-Serif;font-size:11px;margin:0 6px 1.2em 0;color:#333;">You are subscribed to email updates from <a href="http://blog.oxygenxml.com/">oXygen XML Editor Blog</a>.<br />To stop receiving these emails, you may <a href="https://feedburner.google.com/fb/a/mailunsubscribe?k=y_tRXtumvTurKTedh51JnlYsGXw">unsubscribe now</a>.</td>
<td style="font-family:Helvetica,Arial,Sans-Serif;font-size:11px;margin:0 6px 1.2em 0;color:#333;text-align:right;vertical-align:top">Email delivery powered by Google</td>
</tr>
<tr>
<td colspan="2" style="text-align:left;font-family:Helvetica,Arial,Sans-Serif;font-size:11px;margin:0 6px 1.2em 0;color:#333;">Google Inc., 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States</td>
</tr>
</table>
</div>
</body>
</html>