Page 1 of 1

Class extending from DITASchemaManagerFilter does not work properly

Posted: Wed Dec 06, 2023 7:16 pm
by oliverv
Hi oXygen xml team.

I have an issue when I try to customize the standard auto-completion of oXygen in author mode. I have a class extending from DITASchemaManagerFilter and I am modifying the method filterElements(). In this method there is a new condition when the element is a note, then, I automatically add a child <p>

Unfortunately, it seems I am in the wrong method, my code does work in Text mode, but does not in Author mode. I notice that if I add the first note, the code does not add the paragraph but if I add a new note next to the first one, it works.

Does not work:
image.png
Works:
image.png
I suppose there is a different context so my changes must be made in another place but a I do not have a clue where those should be

Re: Class extending from DITASchemaManagerFilter does not work properly

Posted: Thu Dec 07, 2023 10:18 am
by Radu
Hi,
That <note> entry in the content completion window is "special", it does not come from the schema content completion, it is an Author action which is inserted in the content completion window and replaces the regular "note" entry.
If in the Oxygen Preferences->"Document Type Association" page you edit your DITA framework extension, in the "Author->Content completion" tab there is a "Current actions" list containing the "note" action. So this replacement of the initial <note> content completion item with the "insert.note" action is at a higher level and that's why your code no longer has effect.
As possible workarounds either:
- Remove the "note" action from the "Current actions" list.
or:
- Edit the "insert.note" action in the "Author->Actions" list and change its definition to include the paragraph inside the <note> element.
Regards,
Radu

Re: Class extending from DITASchemaManagerFilter does not work properly

Posted: Fri Dec 08, 2023 9:04 pm
by oliverv
Thank you, It works :D