Page 1 of 1

Auto Fill date in Oxygen!

Posted: Wed Feb 24, 2021 5:04 pm
by mu258770
Hi team,

Is it possible to auto-fill a field in Oxygen with current date?

Currently, in DITA topic, we are using <change-completed> element inside <change-info> to enter the current date for a change/update in the topic. We would like to know if it is possible to insert current date in the field as soon as we insert the element in Oxygen Author view?

We are using Oxygen Author 20.1 Eclipse plugin.

Regards,
Shabeer

Re: Auto Fill date in Oxygen!

Posted: Thu Feb 25, 2021 10:19 am
by Radu
Hi Shabeer,

There is this older blog post explaining how you can create a custom Author action and add it to the content completion window:
https://blog.oxygenxml.com/topics/custo ... etion.html

Regards,
Radu

Re: Auto Fill date in Oxygen!

Posted: Thu Feb 25, 2021 3:37 pm
by chrispitude
Ahhh excellent! This is a reminder that I need to auto-populate the @author attribute of our <project-label> element (which is a specialization of <draft-comment> used to specifically track project-related development).

Re: Auto Fill date in Oxygen!

Posted: Thu Feb 25, 2021 3:53 pm
by Radu
Hi Chris,

Right, you can use the ${author.name} editor variable for that:
https://www.oxygenxml.com/doc/versions/ ... ables.html

Regards,
Radu

Re: Auto Fill date in Oxygen!

Posted: Sat Mar 13, 2021 12:24 am
by chrispitude
Thanks Radu!

I know we previously discussed idea for evaluating Oxygen variables in the cc_config.xml file like this - do you know if we ever filed an enhancement issue for it?

Code: Select all

<elementProposals path="project-label">
  <insertAttribute name="author" value="${author.name}"/>
</elementProposals>
I was not able to get author actions to work in our Oxygen environment. I will create a standalone Oxygen project and follow the instructions and carefully and see if I have better luck. :)

Re: Auto Fill date in Oxygen!

Posted: Sat Mar 13, 2021 3:21 am
by chrispitude
In the Content Completion window, I see this setting:
image.png
image.png (11.72 KiB) Viewed 2217 times
How does this relate to the following activation path in the Author Action window?
image.png
image.png (20.64 KiB) Viewed 2217 times
Do I need both? If not, is one preferred such that I should omit the other?

Thanks!

Re: Auto Fill date in Oxygen!

Posted: Sat Mar 13, 2021 3:29 am
by chrispitude
When I added the action in the Content Completion window, I saw this setting:
image.png
image.png (11.89 KiB) Viewed 2217 times
How does this relate to the Filter - Remove content completion items list?
image.png
image.png (5.11 KiB) Viewed 2217 times
Again, do I need both or is one preferred over the other?

Re: Auto Fill date in Oxygen!

Posted: Mon Mar 15, 2021 10:11 am
by Radu
Hi Chris,

So:

1) Editor variables expansion in cc_config.xml, we have an issue for that started by one of your requests:
EXM-47298 Expand editor variables specified in cc_config.xml
we'll look into it possibly for Oxygen 24 (October this year)
2) From what I looked in our code when the "Replacement for" is filled the activation xpath is no longer used in the Author action to determine if the action is fit to appear enabled in the content completion window or not. So a combination of "Replacement from" and the checkbox "Display item only when..." checkbox means the activation xpath set in the custom Author action should no longer be executed whenever you press ENTER to show the content completion window. But it does not hurt having it there.
3) Once you specify the "Replacement for" field, you no longer need to remove the old item from the content completion window "Filter - Remove content completion items" list.

Regards,
Radu

Re: Auto Fill date in Oxygen!

Posted: Mon Mar 15, 2021 11:06 am
by Radu
Hi,

Coming back to this, Chris provided samples and we added an issue related to the "Replacement for" field and xpath activation expressions not properly working in RNG-based DITA topics.
About my (2) point above, the xpath activation expression is still used but only when you press ENTER to select the item in the list, if the xpath expression is not evaluated to true(), you receive an error dialog.

Regards,
Radu

Re: Auto Fill date in Oxygen!

Posted: Tue Apr 13, 2021 12:54 pm
by Radu
Hi,

The latest minor bug fix of Oxygen 23.1 on our web site should have a fix for this issue.

Regards,
Radu