Page 1 of 1

Loss of actions from Oxygen XML to Oxygen Web

Posted: Mon Jan 27, 2020 6:30 pm
by Alper B
Hi,

We integrated Oxygen into our application a few years ago and we started a process to integrate Oxygen Web into a Web application with our existing frameworks.

In my web application, when I use these same frameworks, some basic actions do not work, such as inserting tables, rows or columns, while cell splitting actions work.
In my definition of the insert table action, I call the class InsertTableOperation, but I don't find it in the sources (I've dija.jar in the framework's classpath description). I see that it's annotated @WebappCompatible(false) in the desktop version.

What does Oxygen Web offer to insert tables?

Another question, I saw in my browser's devtools that the actions called made a REST call (ex: .../rest/v21.1.1.0/actions/invokeAction/doc1312739847.992242374/delete.table.column), where is the source code of the actions we call?

I am using version 21.1.1 of Oxygen Web and version 21.1.0.2 of Oxygen.

Thanks!
Alper

Re: Loss of actions from Oxygen XML to Oxygen Web

Posted: Tue Jan 28, 2020 12:08 pm
by cristi_talau
Hello,

Custom frameworks can be ported between Oxygen XML Editor/Author and Oxygen XML Web Author, but some additional customization is sometimes required.

In Oxygen, an action is defined as a mapping between an activation XPath and a corresponding operation [1] that executes when that XPath is valid. Operations are implemented in Java. Some of them show Java dialogs - these operations are not compatible with Web Author and are annotated as such.

In Web Author, to make these actions work, one can implement them in JavaScript [2]. The builtin frameworks already do that for the most common actions.

To answer your questions:
  • To insert a table I would suggest to just insert a dialog with 3 rows and 3 columns without showing any dialog to the user. You can use: ro.sync.exml.editor.xmleditor.operations.InsertXMLFragmentOperation for this purpose.
  • The actions in Web Author can either be specified in the Document Type Configuration dialog box, or overwritten in the "web/framework.js" script in the framework.
  • The source code of the AuthorOperations can be found here [3].
Best,
Cristian

[1] https://www.oxygenxml.com/doc/versions/ ... ialog.html
[2] https://www.oxygenxml.com/maven/com/oxy ... ction.html
[3] https://www.oxygenxml.com/maven/com/oxy ... /21.1.0.2/

Re: Loss of actions from Oxygen XML to Oxygen Web

Posted: Tue Jan 28, 2020 5:21 pm
by Alper B
Hello,

Thank you for your answer.

Okey for the insertion of a predefined table, but must we also use insertFragmentOperation to insert a row in the table? There is no dialog in this action, it should work natively in Web Author.

Behind my question on the source codes of actions, I actually wanted to know the mechanism that there is in Web Author behind this call, because the called class isn't present in the sources of my project.

Regards,
Alper

Re: Loss of actions from Oxygen XML to Oxygen Web

Posted: Tue Jan 28, 2020 5:59 pm
by cristi_talau
Hello,

Regarding the "insert row operation", you are right - it should work out-of-the-box. However, we started annotating AuthorOperations as WebappCompatible several years ago. If your framework is older than that, it might not work.
Also in recent versions of Oxygen we made it possible to "extend" a framework - this makes it easy to port your customization to newer versions of Oxygen as they are released.

Regarding the invokeAction REST call, it is started by the JS code in Web Author. On the server, Web Author's does the following steps:
  • Identity the action defined in the Document Type Configuration dialog box by its ID
  • Evaluate its activation XPath expressions to identify the proper AuthorOperation to execute
  • Execute the identified AuthorOperation
The source code for most of the AuthorOperations can be found here [1].

Best,
Cristian

[1] https://www.oxygenxml.com/maven/com/oxy ... ources.jar