InsertFragmentOperation on XHTML5

Having trouble deploying Oxygen XML Web Author? Got a bug to report? Post it all here.
NicoAMP
Posts: 98
Joined: Tue Mar 06, 2018 2:07 pm
Contact:

InsertFragmentOperation on XHTML5

Post by NicoAMP »

Hello,
I created a custom framework to edit XHTML5 files, with OWA v24.
I created a toolbar button to insert a XML fragment with following code:

Code: Select all

insertFragment(xml) {
      this.actionsManager_.invokeOperation(
        "ro.sync.ecss.extensions.commons.operations.InsertFragmentOperation",
        {
          fragment: xml,
          schemaAware: 'true',
          insertEvenIfInvalid: 'false'
        },
        function () {
          console.log("Fragment inserted by click");
        }
      );
    }
It looks like it's not working as it should.
In documentation, about schemaAware parameter, I can read:
Controlling if the insertion is schema aware or not. When is enabled and the fragments insertion is not allowed, a dialog will be shown proposing one of following solutions if they apply:
- insert the fragments inside a new element. The name of the element to wrap the fragments in is computed by analyzing the left or right siblings;
- split an ancestor of the node at insertion offset and insert the fragments between the resulted elements;
- insert the fragments somewhere in the proximity of the insertion offset(left or right without skipping content);
- insert at offset the plain text resulted after removing the mark-up;
- insert the fragments at insertion offset, even they are not allowed.
But, even schemaAware is true, if I insert my fragment at an invalid place dialog is never displayed and Oxygen automatically found the better location to insert it.

How can I activate dialog displaying here?

Thanks for any help.

Regards,
Nicolas
Nicolas Delobel
AmeXio
nicolas.delobel at amexiogroup.com
mihai_coanda
Posts: 81
Joined: Wed Jul 20, 2016 8:22 am

Re: InsertFragmentOperation on XHTML5

Post by mihai_coanda »

Hello,
The dialog behavior is specific to Oxygen Standalone and is not supported by the Web Author.
If you could elaborate on the issue you are having with the lack of dialog maybe we can propose an approach that fits your requirements.

Best Regards,
Michael
Michael

https://www.oxygenxml.com
Post Reply