oXygen & templates: Include current date as document creation date in XML (not in publication)

TL;DR: How do we create a variable in the template that inserts the current date into the topic document upon creation?

Hi all. We have a series of templates our authors use for their work. In each template's prolog, we have a critical dates section. One of those critical dates is the Created Date, the date at which work began on this topic document (which was based on this template).

Desired end state:

<prolog>

<critdates>

<created date="2019-11-05" />

</critdates>

</prolog>

What's in the templates:

<prolog>

<critdates>

<created date="${date(yyyy-MM-dd)}" />

</critdates>

</prolog>

What's in the final documents:

<prolog>

<critdates>

<created date="${date(yyyy-MM-dd)}" />

</critdates>

</prolog>

You can see the template variable isn't resolved into an actual date.

How do we create a variable in the template that inserts the current date into the topic document upon creation? (It should never be automatically updated.) The date syntax above is from the oXygen help topic https://www.oxygenxml.com/doc/versions/21.1/ug-editor/topics/editor-variables.html.

oXygen Editor 20.1 / Publication Manager 14.0

Thanks!

Parents
  • If your want the XML structure in your content as shown, you could use a Write Plug In to inject the XML into the content on creation.  This would get inserted regardless of how the XML was created in the CMS ( Oxygen, Content Importer, API, etc ).  If you just need to use this information during publishing, you can get the CREATED-ON metadata property exported into the topics MET file, by adjusting the Publish Plugin XML Settings.

Reply
  • If your want the XML structure in your content as shown, you could use a Write Plug In to inject the XML into the content on creation.  This would get inserted regardless of how the XML was created in the CMS ( Oxygen, Content Importer, API, etc ).  If you just need to use this information during publishing, you can get the CREATED-ON metadata property exported into the topics MET file, by adjusting the Publish Plugin XML Settings.

Children