Content completion for specialized table row
Post here questions and problems related to oXygen frameworks/document types.
-
- Posts: 15
- Joined: Tue Jun 11, 2019 9:01 pm
Content completion for specialized table row
Post by jeff_hooker »
Hi folks,
First question; is there a guide to the schema for your framework files? When I google element names I come up dry; even when I search your site for information about elements I come up dry.
Second, I'm trying to create a content completion template for a specialized table row. This is what I've done. The reg-reference element in the specialized DTD takes the place of the row element, and the tbody element is replaced by a reg-references element.
My DTD requires one of either a p, ol, or ul in the <reg-details> element and so I'm trying to force a <p> element. So far, the addition is being ignored. I'm just extrapolating what I think the actionMode element should look like by reading the rest of the .framework files, because I can't find where this format is documented.
Thanks,
Jeff.
First question; is there a guide to the schema for your framework files? When I google element names I come up dry; even when I search your site for information about elements I come up dry.
Second, I'm trying to create a content completion template for a specialized table row. This is what I've done. The reg-reference element in the specialized DTD takes the place of the row element, and the tbody element is replaced by a reg-references element.
Code: Select all
<actionMode>
<field name="xpathCondition">
<String>ancestor-or-self::node()[self::*contains(@class," firmware-d/reg-reference ")]]</String>
</field>
<field name="argValues">
<serializableOrderedMap>
<entry>
<String>insertLocation</String>
<String>ancestor-or-self::*[contains(@class," firmware-d/reg-reference ")][1]</String>
</entry>
<entry>
<String>insertPosition</String>
<String>After</String>
</entry>
<entry>
<String>fragment</String>
<String>
<reg-reference>
<reg-address> </reg-address>
<reg-size> <reg-size>
<reg-name>Name</reg-name>
<reg-details>
<p/>
</reg-details>
</reg-reference>
</String>
</entry>
</serializableOrderedMap>
</field>
<field name="operationID"> <String>ro.sync.ecss.extensions.commons.table.operations.cals.InsertSingleRowOperation</String>
</field>
</actionMode>
Thanks,
Jeff.
Re: Content completion for specialized table row
Hi Jeff,
The DITA 1.3 specification is also available on the Oxygen XML web site along with quick references for all DITA elements:
https://www.oxygenxml.com/dita/1.3/spec ... rence.html
Also in the Author visual editing mode if you press F2 when the caret is inside a DITA element you will have a tooltip window showing documentation and links to the specification.
What you want is not achievable by defining a custom Author action because actions need to be triggered but you want some kind of content to be automatically inserted when the "reg-references" element is inserted.
Instead, we have a separate "cc_config.xml" file in the DITA framework ("OXYGEN_INSTALL_DIR\frameworks\dita\resources") in which you can define the possible elements which should be automatically inserted when a parent element is inserted:
https://www.oxygenxml.com/doc/versions/ ... g_elements
Regards,
Radu
Do you mean specific documentation for each DITA element?First question; is there a guide to the schema for your framework files? When I google element names I come up dry; even when I search your site for information about elements I come up dry.
The DITA 1.3 specification is also available on the Oxygen XML web site along with quick references for all DITA elements:
https://www.oxygenxml.com/dita/1.3/spec ... rence.html
Also in the Author visual editing mode if you press F2 when the caret is inside a DITA element you will have a tooltip window showing documentation and links to the specification.
I will assume you created a DITA DTD specialization and Oxygen uses it when you open the DITA topic, for example if a "reg-references" element is already inserted in the document Oxygen does not report validation errors for it.Second, I'm trying to create a content completion template for a specialized table row. This is what I've done. The reg-reference element in the specialized DTD takes the place of the row element, and the tbody element is replaced by a reg-references element.
What you want is not achievable by defining a custom Author action because actions need to be triggered but you want some kind of content to be automatically inserted when the "reg-references" element is inserted.
Instead, we have a separate "cc_config.xml" file in the DITA framework ("OXYGEN_INSTALL_DIR\frameworks\dita\resources") in which you can define the possible elements which should be automatically inserted when a parent element is inserted:
https://www.oxygenxml.com/doc/versions/ ... g_elements
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 15
- Joined: Tue Jun 11, 2019 9:01 pm
Re: Content completion for specialized table row
Post by jeff_hooker »
Thanks Radu,
For the record, I was asking about documentation for the elements of your framework files (actionMode, serializableOrderedMap, etc.) not DITA. There's lots of help available for DITA.
Cheers,
Jeff.
For the record, I was asking about documentation for the elements of your framework files (actionMode, serializableOrderedMap, etc.) not DITA. There's lots of help available for DITA.
Cheers,
Jeff.
-
- Posts: 15
- Joined: Tue Jun 11, 2019 9:01 pm
Re: Content completion for specialized table row
Post by jeff_hooker »
Ok, so let's try this again.
Currently, Author does recognize and validate my specializations. However, when I try to use the Add Row command, Author responds by by adding a whole new tbody element at the bottom of the table and adding a conventional CALS row within it.
From poking around in the .framework file, it looks like these functions are controlled by actionmode elements, so I appended a "not" statement to the actionmode element for inserting a new row after a row in order to exclude my specialized rows:
And then I tried to write an actionmode element that would apply to one of my specializations:
However, Author's behavior remains unchanged.
Looking at the actionmode elements, it is pretty clear that the xpathcondition field is used to identify the target nodes, and the operationID field element is used to call the java function, however, the syntax available to me in between remains a bit of a mystery.
Is there a relationship between the fields in the actionmode element and parameters of the java class being called (https://www.oxygenxml.com/InstData/Edit ... ation.html)?
Currently, Author does recognize and validate my specializations. However, when I try to use the Add Row command, Author responds by by adding a whole new tbody element at the bottom of the table and adding a conventional CALS row within it.
From poking around in the .framework file, it looks like these functions are controlled by actionmode elements, so I appended a "not" statement to the actionmode element for inserting a new row after a row in order to exclude my specialized rows:
Code: Select all
<actionMode>
<field name="xpathCondition">
<String>ancestor-or-self::node()[self::*[contains(@class," topic/row ") or contains(@class," topic/strow ") or contains(@class, " topic/sthead ")]][1][self::*[contains(@class," topic/row ")]][not(self::*[contains(@class, "firmware-d/reg-reference")] or self::*[contains(@class, "struct-d/dword")] or self::*[contains(@class, "software-d/field")] or self::*[contains(@class, "struct-d/include")] or self::*[contains(@class, "firmtest-d/test")] or self::*[contains(@class, "m-software-d/register-reference")])]</String>
</field>
<field name="argValues">
<serializableOrderedMap>
<entry>
<String>insertLocation</String>
<String>ancestor-or-self::*[contains(@class," topic/row ")][1]</String>
</entry>
<entry>
<String>insertPosition</String>
<String>After</String>
</entry>
</serializableOrderedMap>
</field>
<field name="operationID">
<String>ro.sync.ecss.extensions.commons.table.operations.cals.InsertSingleRowOperation</String>
</field>
</actionMode>
Code: Select all
<actionMode>
<field name="xpathCondition">
<String>ancestor-or-self::node()[self::*[contains(@class," firmware-d/reg-reference ")]]</String>
</field>
<field name="argValues">
<serializableOrderedMap>
<entry>
<String>insertLocation</String>
<String>ancestor-or-self::node()[*[contains(@class," firmware-d/reg-reference ")]][1]</String>
</entry>
<entry>
<String>insertPosition</String>
<String>After</String>
</entry>
<entry>
<String>fragment</String>
<String>
<reg-reference>
<reg-address> </reg-address>
<reg-size> <reg-size>
<reg-name>Name</reg-name>
</reg-details>
</reg-reference>
</String>
</entry>
</serializableOrderedMap>
</field>
<field name="operationID">
<String>ro.sync.ecss.extensions.commons.table.operations.cals.InsertSingleRowOperation</String>
</field>
</actionMode>
Looking at the actionmode elements, it is pretty clear that the xpathcondition field is used to identify the target nodes, and the operationID field element is used to call the java function, however, the syntax available to me in between remains a bit of a mystery.
Is there a relationship between the fields in the actionmode element and parameters of the java class being called (https://www.oxygenxml.com/InstData/Edit ... ation.html)?
Re: Content completion for specialized table row
Hi Jeff,
About this remark:
Regards,
Radu
About this remark:
This is just an XML format in which we serialize the framework configuration objects, we usually expect that the ".framework" file be modified through our user's interface, by editing the framework in the "Document Type Association" preferences page. This is why we do not document the serialization format.For the record, I was asking about documentation for the elements of your framework files (actionMode, serializableOrderedMap, etc.)
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Re: Content completion for specialized table row
Hi Jeff,
Coming back to your table specializations:
If in the Oxygen Preferences->"Document Type Associations" page you edit your DITA framework configuration, in the Author->Actions tab there is the "insert.table.row.below" action definition. The action definition has about 5 xpath activation modes, in each mode it calls a Java operation. You can add your own activation modes for your own table structure.
The "ro.sync.ecss.extensions.dita.topic.table.cals.InsertSingleRowOperation" Java operation works well for CALS tables which have certain names for rows and cells but for your specific specializations you will probably need to create your own "CustomInsertSingleRowOperation" which overrides from the super class the "getRowElementName" and "getCellElementName" methods and return the proper names for your table specialization.
Regards,
Radu
Coming back to your table specializations:
If in the Oxygen Preferences->"Document Type Associations" page you edit your DITA framework configuration, in the Author->Actions tab there is the "insert.table.row.below" action definition. The action definition has about 5 xpath activation modes, in each mode it calls a Java operation. You can add your own activation modes for your own table structure.
The "ro.sync.ecss.extensions.dita.topic.table.cals.InsertSingleRowOperation" Java operation works well for CALS tables which have certain names for rows and cells but for your specific specializations you will probably need to create your own "CustomInsertSingleRowOperation" which overrides from the super class the "getRowElementName" and "getCellElementName" methods and return the proper names for your table specialization.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 15
- Joined: Tue Jun 11, 2019 9:01 pm
Re: Content completion for specialized table row
Post by jeff_hooker »
Ok, so just make sure I'm not misunderstanding this, it sounds like you're saying that the only way to add the "add row" feature to my table specializations in Oxygen is to literally write my own custom Java classes and add them to the configuration. Correct?
I can do that, but it seems intense for something as ordinary as dealing with a dita specialization. I'm surprised that there's not a generalized class that just adds whatever the DTD says is valid or plugs in a fragment template.
I can do that, but it seems intense for something as ordinary as dealing with a dita specialization. I'm surprised that there's not a generalized class that just adds whatever the DTD says is valid or plugs in a fragment template.
Re: Content completion for specialized table row
Hi Jeff,
Looking upper in this thread, I found this previously unanswered question:
When you press the action button on the toolbar, Oxygen looks in the list of action modes defined inside the Author action for the first action mode for which the XPath activation expression evaluates as positive. When found, it invokes for that action mode the corresponding author operation with the parameters you have set.
The action with ID "insert.table.row.below" is the one called by default when you invoke the toolbar action for inserting a table row. When the caret is placed inside an existing table the action will call the existing "ro.sync.ecss.extensions.dita.topic.table.cals.InsertSingleRowOperation" Java operation. This operation by default looks if the cursor is placed inside a table row and if it is, it will duplicate that table row along with its cells (with empty content) and then insert the table row. So if the cursor is inside an existing table cell and you use the action you should get a row with your specialization names inserted.
If the cursor is not an existing table row, the action will create a new table row with the name <row> and with the cells named <entry>. Indeed we should work more to make this behavior more specialization friendly or at least add parameters to control the row and cell names, I added an issue for it.
Regards,
Radu
Looking upper in this thread, I found this previously unanswered question:
No, there is not. An action can have multiple action modes, each action mode has an activation XPath expression and an Author operation which can be invoked with certain parameters.Is there a relationship between the fields in the actionmode element and parameters of the java class being called
When you press the action button on the toolbar, Oxygen looks in the list of action modes defined inside the Author action for the first action mode for which the XPath activation expression evaluates as positive. When found, it invokes for that action mode the corresponding author operation with the parameters you have set.
There are two table types which can be inserted in a DITA topic: CALS and simple table. I will assume yours is a CALS table specialization, if it's a simple table specialization I will need to look again into this as it calls a distinct operation.I'm surprised that there's not a generalized class that just adds whatever the DTD says is valid or plugs in a fragment template.
The action with ID "insert.table.row.below" is the one called by default when you invoke the toolbar action for inserting a table row. When the caret is placed inside an existing table the action will call the existing "ro.sync.ecss.extensions.dita.topic.table.cals.InsertSingleRowOperation" Java operation. This operation by default looks if the cursor is placed inside a table row and if it is, it will duplicate that table row along with its cells (with empty content) and then insert the table row. So if the cursor is inside an existing table cell and you use the action you should get a row with your specialization names inserted.
If the cursor is not an existing table row, the action will create a new table row with the name <row> and with the cells named <entry>. Indeed we should work more to make this behavior more specialization friendly or at least add parameters to control the row and cell names, I added an issue for it.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Return to “SDK-API, Frameworks - Document Types”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service