Help with Authoring Action in Oxy 23.0

ckabstein
Posts: 107
Joined: Fri Apr 24, 2015 12:28 pm

Help with Authoring Action in Oxy 23.0

Post by ckabstein » Wed Jan 13, 2021 3:40 pm

Hi,

I have a working author action in Oxygen 22.1 that no longer works in Oxygen 23.0.
I have exported the action to be used in the new framework. It's found, and it works fine in 22, but it's just not working in 23.

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<a:authorAction xmlns:a="http://www.oxygenxml.com/ns/author/external-action"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.oxygenxml.com/ns/author/external-action http://www.oxygenxml.com/ns/author/external-action/authorAction.xsd"
  id="smtg.update.revised">
  <a:name>Update the revised element on save</a:name>
  <a:description>Update the revised element on save</a:description>
  <a:operations>
    <a:operation id="ChangeAttributeOperation">
      <a:xpathCondition>//revised[string-length(@modified) = 0 or xs:date(@modified) != current-date()]</a:xpathCondition>
      <a:arguments>
        <a:argument name="elementLocation">//revised</a:argument>
        <a:argument name="name">modified</a:argument>
        <a:argument name="value">${date(yyyy-MM-dd)}</a:argument>
      </a:arguments>
    </a:operation>
  </a:operations>
  <a:enabledInReadOnlyContext>false</a:enabledInReadOnlyContext>
</a:authorAction>
I don't have the slightest clue why this no longer works. Could you help me with this, please?

I know there is the DITA Prolog Updater add-on, but this just doesn't work for us, so at the moment, we want to stick with our action.

Thanks and regards,
Christina
oXygen XML Editor 23.1 build 2021061407
DITA OT 3.6

alex_jitianu
Posts: 832
Joined: Wed Nov 16, 2005 11:11 am

Re: Help with Authoring Action in Oxy 23.0

Post by alex_jitianu » Wed Jan 13, 2021 5:04 pm

Hello,

I've tested the action myself in version 23 and it worked as expected, at least how I expected it to work. here is what I did:
- I open a DITA topic that has a revised element with an older date:

Code: Select all

<prolog>
        <critdates>
            <revised modified="2021-01-01"/>
        </critdates>
    </prolog>
- I click the action. The @modified attribute is updated.

Perhaps you can tell me more about what is happening. Is the action disabled when it should have been enabled? Or it is enabled but it doesn't do anything when invoked?

What i see from the action is that it's not enabled nor does it handle the case in which there is no revised element present in the document. Perhaps, in version 23, you have such a document....

Best regards,
Alex

ckabstein
Posts: 107
Joined: Fri Apr 24, 2015 12:28 pm

Re: Help with Authoring Action in Oxy 23.0

Post by ckabstein » Thu Jan 14, 2021 10:41 am

Hi Alex,

Thanks for your quick reply.

Yes, normally, actions need to be clicked on or selected, but this action here normally already works when I just save the document (which is some kind of click, yes). But this action is normally not actively invoked by an author. They just save their documents and don't need to think about their revision dates.

I had a revised element in the document. I had an empty one and an old one. None of that worked.

You wrote that this action might not be enabled. How do I enable this? Is there some kind of checkbox that I've missed?
It looks like this action is not enabled. In the Find action dialog, this action is shown as disabled.

Has there been a change in how actions are handled?

Thanks,
Christina
oXygen XML Editor 23.1 build 2021061407
DITA OT 3.6

alex_jitianu
Posts: 832
Joined: Wed Nov 16, 2005 11:11 am

Re: Help with Authoring Action in Oxy 23.0

Post by alex_jitianu » Thu Jan 14, 2021 10:58 am

Hi Christina,

An author action doesn't normally run when an editor is saved, so it must be some kind of a hook installed in your previous Oxygen version. It might be this plugin: ExecuteAuthorActionsOnSaveHook.

To check if this the one, in oxygen 22.1 go to Options->Preferences... on page Plugins and have a look at the installed plugins. If you see it, select it in the list and you will also see its installation directory on the bottom of the page. Just copy it in the similar location in the Oxygen 23 installation.

Best regards,
Alex

ckabstein
Posts: 107
Joined: Fri Apr 24, 2015 12:28 pm

Re: Help with Authoring Action in Oxy 23.0

Post by ckabstein » Thu Jan 14, 2021 11:16 am

Hi Alex,

This is one of those embarrassing moments when I have to admit that I've been a complete blockhead. Sorry for wasting your precious time, Alex.
You are absolutely right. My brain just wouldn't want to think about that plug-in that we've been using for ages now. :D

Thanks for updating my brain.

All the best for you,
Christina
oXygen XML Editor 23.1 build 2021061407
DITA OT 3.6

alex_jitianu
Posts: 832
Joined: Wed Nov 16, 2005 11:11 am

Re: Help with Authoring Action in Oxy 23.0

Post by alex_jitianu » Thu Jan 14, 2021 11:29 am

Hi Christina,

There's no trouble at all! I'm the one that implemented the plugin a long time ago so I'm quite glad to see that it is still helpful! :)

Best regards,
Alex

Post Reply