Missing pseudo-classes after redo (Ctrl+Y)
-
- Posts: 99
- Joined: Fri Jul 01, 2022 12:08 pm
Missing pseudo-classes after redo (Ctrl+Y)
Post by shikhar_472 »
We are adding a toggle class on click of action in oxygen web author-
actionPerformed(callback) {
jaEditor.getActionsManager().invokeOperation('ro.sync.ecss.extensions.commons.operations.TogglePseudoClassOperation', {
elementLocation: '//cite.query', name: 'collapse', includeAllNodes: 'no'
});
callback();
}
cite\.query:collapse{
-oxy-display-tags:none;
}
So this is the code which i am using to collapse the tag but issue what i am facing is if cite.query is present in side some tag eg.--
<paratext> some test data <cite.query>some test data</cite.query></paratext>
So after collapse it will look like--
<paratext> some test data some test data </paratext>
Now if i select "some test data1" and remove it, it will look like this --
<paratext> some test data </paratext>
Now if i will do undo again so in this case collapse class is not coming into the html, it will become like this --
<paratext> some test data <cite.query>some test data</cite.query></paratext>
But expected scenario is -
<paratext> some test data some test data </paratext>
Thanks,
Shikhar.
-
- Site Admin
- Posts: 172
- Joined: Tue Mar 20, 2018 5:28 pm
Re: query on undo operation phesudo classes are not getting back is there any way to resolve this.
Post by Bogdan Dumitru »
We are a little bit confused because in the post title you are referring "pseudo classes" but from the "expected scenario" we see a difference in the document structure:
Is there a problem with one of the APIs from the Oxygen SDK or with the undo and/or redo actions?it will become like this --
<paratext> some test data <cite.query>some test data</cite.query></paratext>
But expected scenario is -
<paratext> some test data some test data </paratext>
http://www.oxygenxml.com
-
- Site Admin
- Posts: 172
- Joined: Tue Mar 20, 2018 5:28 pm
Re: query on undo operation phesudo classes are not getting back is there any way to resolve this.
Post by Bogdan Dumitru »
http://www.oxygenxml.com
-
- Posts: 99
- Joined: Fri Jul 01, 2022 12:08 pm
Re: query on undo operation phesudo classes are not getting back is there any way to resolve this.
Post by shikhar_472 »
Or the problem is that if you delete an element and then invoke the undo action to undo the deletion, after undoing the element is added back in the document but without pseudo-classes?
Yes you got it right this is the issue i am facing.
Thanks.
-
- Site Admin
- Posts: 172
- Joined: Tue Mar 20, 2018 5:28 pm
Re: query on undo operation phesudo classes are not getting back is there any way to resolve this.
Post by Bogdan Dumitru »
In order to invoke that method from an operation you have to define a custom AuthorOperation that calls this method. See this topic.
http://www.oxygenxml.com
-
- Posts: 99
- Joined: Fri Jul 01, 2022 12:08 pm
Re: Missing pseudo-classes after redo (Ctrl+Y)
Post by shikhar_472 »
I tried using this class it is allowing to undo the toggle class.
But after delete a element if i am doing undo toggle class is not getting added.
-
- Site Admin
- Posts: 172
- Joined: Tue Mar 20, 2018 5:28 pm
Re: Missing pseudo-classes after redo (Ctrl+Y)
Post by Bogdan Dumitru »
Yes, as stated in the documentation of the AuthorDocumentController.setPseudoClassUndoable() method, the pseudo-class is subject to undo/redo, meaning that the Undo Manager will revert/restore the pseudo-classes added with this method.
If you invoke AuthorDocumentController.setPseudoClassUndoable() over an element, delete it manually using either Delete or Backspace, and then invoke the undo action, after undo you should see the pseudo-class on the element.
By the way, if you make multiple changes/edits to the document and you want them to be atomically handled by the Undo Manager, see AuthorDocumentController.beginCompoundEdit() and AuthorDocumentController.endCompoundEdit().
http://www.oxygenxml.com
-
- Posts: 99
- Joined: Fri Jul 01, 2022 12:08 pm
Re: Missing pseudo-classes after redo (Ctrl+Y)
Post by shikhar_472 »
It's not working for me, i am adding the code for the reference,
@Override
public String doOperation(AuthorDocumentModel model, ArgumentsMap args)
throws IllegalArgumentException, AuthorOperationException {
AuthorAccess authorAccess = model.getAuthorAccess();
AuthorDocumentController docCtrl = authorAccess.getDocumentController();
AuthorNode[] paratextNodes = docCtrl.findNodesByXPath("//cite.query", true, true, true);
docCtrl.beginCompoundEdit();
for (AuthorNode citeQueryNode : paratextNodes) {
AuthorElement cQElement = (AuthorElement) citeQueryNode;
docCtrl.setPseudoClassUndoable("collapse", cQElement);
}
docCtrl.endCompoundEdit();
return null;
}
-
- Posts: 99
- Joined: Fri Jul 01, 2022 12:08 pm
Re: Missing pseudo-classes after redo (Ctrl+Y)
Post by shikhar_472 »
I have observed that on undo and redo pseudo class is getting added but on deleting the element then if i am doing undo pseudo class is not getting added
-
- Site Admin
- Posts: 172
- Joined: Tue Mar 20, 2018 5:28 pm
Re: Missing pseudo-classes after redo (Ctrl+Y)
Post by Bogdan Dumitru »
You're right!
It seems that after undo the pseudo-classes are actually NOT present on the restored element. From the first analysis, this seems to be a bug. I've registered an issue on our internal issue tracker for it.
http://www.oxygenxml.com
-
- Posts: 99
- Joined: Fri Jul 01, 2022 12:08 pm
Re: Missing pseudo-classes after redo (Ctrl+Y)
Post by shikhar_472 »
-
- Site Admin
- Posts: 172
- Joined: Tue Mar 20, 2018 5:28 pm
Re: Missing pseudo-classes after redo (Ctrl+Y)
Post by Bogdan Dumitru »
Unfortunately, we didn't manage to find a workaround, at least not yet.
Regarding "when it will be available", please help us to understand the impact of this bug on your customization. Do you see this bug as critical or somewhat like nice to have?
We usually consider pseudo-classes as volatile markers on elements, markers that are used to customize element rendering. Even the folding state of the elements relies on pseudo-classes. We also consider it reasonable that the rendering of an element is reset after undo (not ideal but reasonable).
http://www.oxygenxml.com
-
- Posts: 99
- Joined: Fri Jul 01, 2022 12:08 pm
Re: Missing pseudo-classes after redo (Ctrl+Y)
Post by shikhar_472 »
Any idea, till when we can expect the resolution for this.
Thanks
-
- Posts: 517
- Joined: Thu Sep 04, 2014 4:22 pm
Re: Missing pseudo-classes after redo (Ctrl+Y)
Post by cristi_talau »
The issue is not currently scheduled for implementation. In order to be able to prioritize this issue better, we need to understand the impact that it has on the experience of your end-users.
Best,
Cristian
-
- Posts: 99
- Joined: Fri Jul 01, 2022 12:08 pm
Re: Missing pseudo-classes after redo (Ctrl+Y)
Post by shikhar_472 »
For our user's this is a critical issue we are going soon in production and it is going to make a huge impact across 1000 users who will be using the oxygen.
Thanks
-
- Posts: 517
- Joined: Thu Sep 04, 2014 4:22 pm
Re: Missing pseudo-classes after redo (Ctrl+Y)
Post by cristi_talau »
Code: Select all
:root:collapsed cite\.query { ... }
-
- Posts: 99
- Joined: Fri Jul 01, 2022 12:08 pm
Re: Missing pseudo-classes after redo (Ctrl+Y)
Post by shikhar_472 »
You're right!
It seems that after undo the pseudo-classes are actually NOT present on the restored element. From the first analysis, this seems to be a bug. I've registered an issue on our internal issue tracker for it.
can i have a solution for this issue
-
- Posts: 517
- Joined: Thu Sep 04, 2014 4:22 pm
Re: Missing pseudo-classes after redo (Ctrl+Y)
Post by cristi_talau »
At this point I this thread is very long and I am not sure what your current problem is.
In my understanding, you modified the plugin to set the "collapsed" pseudo-class on the root element. Now if the user invokes the action to collapse some element's tags and then presses undo, the element tags are not collapse anymore. And your expectation is that they are still collapsed.
Is this the problem you described?
Best,
Cristian
-
- Posts: 99
- Joined: Fri Jul 01, 2022 12:08 pm
-
- Posts: 517
- Joined: Thu Sep 04, 2014 4:22 pm
Re: Missing pseudo-classes after redo (Ctrl+Y)
Post by cristi_talau »
I suspect this happens because you use "setPseudoClassUndoable". If you use "setPseudoClass", this will not happen.
Best,
Cristian
-
- Posts: 99
- Joined: Fri Jul 01, 2022 12:08 pm
Re: Missing pseudo-classes after redo (Ctrl+Y)
Post by shikhar_472 »
Does this issue got resolved in the latest oxygen release
-
- Site Admin
- Posts: 234
- Joined: Wed Aug 30, 2023 2:33 pm
Re: Missing pseudo-classes after redo (Ctrl+Y)
This issue has not been resolved in version 26.0 of Oxygen Web Author
As soon as we have a solution, we will notify you in this post.
Best Regards,
Cosmin
www.oxygenxml.com
- 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