Page 1 of 1

Insert date from date picker as tagged elements

Posted: Fri Feb 07, 2025 8:46 pm
by mboudreau
Is it possible (if not, this is a feature request) to prompt a user to select a date in a calendar-style date picker and then insert that value as a tagged XML fragment?

I'm working on a little tool to add JATS markup to an article that has been retracted. Using InsertFragmentOperation, I'm currently inserting this:

Code: Select all

<pub-history>
  <event event-type="${ask('Event type:', combobox, ('retraction':'Retraction';'removal':'Removal'; 'expression_of_concern':'Expression of concern'), 'retraction')}">
    <date>
      <day>${ask('Day:', generic)}</day>
      <month>${ask('Month:', generic)}</month>
      <year>${ask('Year:', generic)}</year>
    </date>
  </event>
</pub-history>
But I'd prefer to present the user with a date picker and have that converted to the necessary markup. Is this already possible, in a way I just haven't found yet?

Re: Insert date from date picker as tagged elements

Posted: Mon Feb 10, 2025 8:49 am
by Radu
Hi,
I'm afraid we do not have such a feature for the $ask editor variable. Also the $ask editor variable would return a single output but you seem to want to split that output in three different fields so not sure how that would play with our current implementation of these editor variables.
For working in the Author visual editor besides the InsertFragmentOperation there is also a JSOperation which would allow one to use Javascript in order to create more complex workflows.
There are some samples here, for example a JSOperation which shows a dialog to the end user and then inserts XML content in the document:
https://github.com/oxygenxml/javascript ... XMLFrag.js
That particular dialog would need to be implemented in Java Swing.
Regards,
Radu