Author Options: GUI for person-search
Posted: Mon Feb 05, 2024 6:15 pm
Hello, I am completely new to working with Oxygen and I need to write an Author Option in an XML-File with JavaScript. With the option, I want to customize the person search from ediarum. I want to build a GUI window that looks like the one in the image below:
1. It needs a field for user-input which can be typed but at the same time, this field shall keep track on which part of text has been selected by the user.
2. If any change in this field occurs, a method (which I still have to write) shall be fired which extracts matching person-entries from a Personen.xml file and prints all matches in a window below the search-field.
3. The matches in the window shall be clickable and on click, the selection shall be tagged like <persName key="woa_AE0DFAF3-A2B1-4806-BACB-96F4945801E5">Agathon</persName> (the value of key comes from Personen.xml and extracting it will be part of the method I still need to write).
In the documentation, I found this package here (https://www.oxygenxml.com/InstData/Edit ... mmary.html) but I could not figure out how to work with the methods listed there. Since I am actually quite stuck, I have not much code to provide so far, it is only the one given below and I would highly appreciate some help to get me started. Thank you very much in advance!
1. It needs a field for user-input which can be typed but at the same time, this field shall keep track on which part of text has been selected by the user.
2. If any change in this field occurs, a method (which I still have to write) shall be fired which extracts matching person-entries from a Personen.xml file and prints all matches in a window below the search-field.
3. The matches in the window shall be clickable and on click, the selection shall be tagged like <persName key="woa_AE0DFAF3-A2B1-4806-BACB-96F4945801E5">Agathon</persName> (the value of key comes from Personen.xml and extracting it will be part of the method I still need to write).
In the documentation, I found this package here (https://www.oxygenxml.com/InstData/Edit ... mmary.html) but I could not figure out how to work with the methods listed there. Since I am actually quite stuck, I have not much code to provide so far, it is only the one given below and I would highly appreciate some help to get me started. Thank you very much in advance!
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<a:authorAction id="personsearchwindow"
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">
<a:name>Personensuchfenster</a:name>
<a:description>Personensuchfenster</a:description>
<a:operations>
<a:operation id="JSOperation">
<a:arguments>
<a:argument name="script"><![CDATA[function doOperation(){
documentController = authorAccess.getDocumentController();
workspaceAccess = authorAccess.getWorkspaceAccess();
}]]>
</a:argument>
</a:arguments>
</a:operation>
</a:operations>
<a:enabledInReadOnlyContext>false</a:enabledInReadOnlyContext>
</a:authorAction>