Web Author "Paste as XML" shortcuts

NicoAMP
Posts: 52
Joined: Tue Mar 06, 2018 2:07 pm
Contact:

Web Author "Paste as XML" shortcuts

Post by NicoAMP » Tue Apr 07, 2020 10:17 am

Hi,

In Oxygen Web Author, I would like to create a shortcut to "Paste special / Paste as XML" directly?
It seems that this operation doesn't exist in Author Action Dialog Box, so I can't associate a shortcut.

Is it possible to create this shortcut simply in a framework?
If not, is it possible at least to check radio button "Paste as XML" by default in "Paste special" dialog box?

Thanks for your help.

cristi_talau
Posts: 293
Joined: Thu Sep 04, 2014 4:22 pm

Re: Web Author "Paste as XML" shortcuts

Post by cristi_talau » Tue Apr 07, 2020 5:29 pm

Hello,

The "Paste as XML" action is a part of a bigger action - "Paste special" and it cannot be associated a shortcut by itself. Also the "Paste special" action is not configurable.

The actions are global actions that cannot be configured using the Document Type Dialog Box which control only the framework-specific actions. On the other hand, you can change shortcuts using the JS API [1].

On the other hand it is not hard to implement a custom action that implements "Paste as XML". I created a small plugin that replaces the "Paste Special" action with two individual actions: "Paste as Text" (Ctrl+Alt+T) and "Paste as XML" (Ctrl+Alt+X).

You can find it here: https://github.com/oxygenxml/web-author ... te-actions . You are free to modify it to suit your needs.

Best,
Cristian

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

NicoAMP
Posts: 52
Joined: Tue Mar 06, 2018 2:07 pm
Contact:

Re: Web Author "Paste as XML" shortcuts

Post by NicoAMP » Thu Apr 09, 2020 5:54 pm

Hi Cristian,

I installed your plugin on my Web Author server but something strange appends.
When I used custom actions "Paste as text" and "Paste as XML" in right click menu, all is OK. Perfect :)
But when I try to use shortcuts :
  • Ctrl+Alt+T works only one time. When I try to reuse it nothing appends
  • Ctrl+Alt+X display message "Synchronizing with server" indefinitely and page is freezed
Do you know why?

Thanks.

Regards,
Nicolas

cristi_talau
Posts: 293
Joined: Thu Sep 04, 2014 4:22 pm

Re: Web Author "Paste as XML" shortcuts

Post by cristi_talau » Thu Apr 09, 2020 5:59 pm

Hello,

There was a bug in the plugin - I forgot to call a callback. You can download it again now.

Best,
Cristian

NicoAMP
Posts: 52
Joined: Tue Mar 06, 2018 2:07 pm
Contact:

Re: Web Author "Paste as XML" shortcuts

Post by NicoAMP » Thu Apr 09, 2020 7:59 pm

Hi Cristian,

Did you commit it on github?

Regards,
Nicolas

cristi_talau
Posts: 293
Joined: Thu Sep 04, 2014 4:22 pm

Re: Web Author "Paste as XML" shortcuts

Post by cristi_talau » Fri Apr 10, 2020 10:15 am

Hello,

Sorry. I pushed the changes now.

Best,
Cristian

NicoAMP
Posts: 52
Joined: Tue Mar 06, 2018 2:07 pm
Contact:

Re: Web Author "Paste as XML" shortcuts

Post by NicoAMP » Tue Apr 14, 2020 9:38 am

Thanks a lot Cristian.

Just a last remark: I still have the problem with Ctrl+Alt+X (message "Synchronizing with server" indefinitely and page freeze).

If I use an other shortcut for this action (e.g. Ctrl+Alt+P) I don't have the problem anymore.
Maybe it have a conflict with Ctrl+Alt+X shorcut...

cristi_talau
Posts: 293
Joined: Thu Sep 04, 2014 4:22 pm

Re: Web Author "Paste as XML" shortcuts

Post by cristi_talau » Tue Apr 14, 2020 1:57 pm

Hello,

You are right. The shortcut somehow interferes with the handling for Ctrl+X which means "Cut". I made some changes to the plugin to avoid this problem.

Best,
Cristian

Post Reply