Auto Fill date in Oxygen!

Post here questions and problems related to editing and publishing DITA content.
mu258770
Posts: 157
Joined: Mon Aug 18, 2014 4:11 pm

Auto Fill date in Oxygen!

Post 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
Radu
Posts: 8992
Joined: Fri Jul 09, 2004 5:18 pm

Re: Auto Fill date in Oxygen!

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
chrispitude
Posts: 907
Joined: Thu May 02, 2019 2:32 pm

Re: Auto Fill date in Oxygen!

Post 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).
Radu
Posts: 8992
Joined: Fri Jul 09, 2004 5:18 pm

Re: Auto Fill date in Oxygen!

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
chrispitude
Posts: 907
Joined: Thu May 02, 2019 2:32 pm

Re: Auto Fill date in Oxygen!

Post 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. :)
chrispitude
Posts: 907
Joined: Thu May 02, 2019 2:32 pm

Re: Auto Fill date in Oxygen!

Post by chrispitude »

In the Content Completion window, I see this setting:
image.png
image.png (11.72 KiB) Viewed 2183 times
How does this relate to the following activation path in the Author Action window?
image.png
image.png (20.64 KiB) Viewed 2183 times
Do I need both? If not, is one preferred such that I should omit the other?

Thanks!
chrispitude
Posts: 907
Joined: Thu May 02, 2019 2:32 pm

Re: Auto Fill date in Oxygen!

Post by chrispitude »

When I added the action in the Content Completion window, I saw this setting:
image.png
image.png (11.89 KiB) Viewed 2183 times
How does this relate to the Filter - Remove content completion items list?
image.png
image.png (5.11 KiB) Viewed 2183 times
Again, do I need both or is one preferred over the other?
Radu
Posts: 8992
Joined: Fri Jul 09, 2004 5:18 pm

Re: Auto Fill date in Oxygen!

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Radu
Posts: 8992
Joined: Fri Jul 09, 2004 5:18 pm

Re: Auto Fill date in Oxygen!

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Radu
Posts: 8992
Joined: Fri Jul 09, 2004 5:18 pm

Re: Auto Fill date in Oxygen!

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply