Open smrgeoinfo opened 7 months ago
For add action, you can only have multiple snippet https://docs.geonetwork-opensource.org/4.2/customizing-application/editor-ui/creating-custom-editor/#creating-custom-editor-action but there is no support to suggest snippet from a codelist.
The other option is indeed to use the keywordPicker directive to configure an element to use a thesaurus. See examples https://github.com/geonetwork/core-geonetwork/blob/main/schemas/iso19139/src/main/plugin/iso19139/layout/config-editor.xml#L54-L79
Keyword picker worked, sort of..., e.g.
<field name="DDEacquisitionType" xpath="mac:MI_Operation/mac:description"
or="description" in="mac:MI_Operation"
use="data-gn-keyword-picker" del="../../../..">
<directiveAttributes data-thesaurus-key="local.theme.acquisitioncodeskos" />
</field>
the pick list that is displayed are all labeled "undefined'. If you pick one, it show the term from the vocabulary.
I have a number of vocabularies that need to be used for populating various text fields in the DDE metadata profile. We have labels and definitions, I can easily generate skos representations. I have gotten a field with templateModeOnly="true" to and a codelist from codelists.xml defined in the template/values/key/codelist element; this shows existing data, but I need to be able to create an add button in the editor that adds a value limited to the codelist.
I tried
this displays teh button, but when you click on it, nothing happens.
in config-editor.xml, batchEdit section, I see:
and in https://github.com/geonetwork/core-geonetwork/pull/7227
After some sleuthing around, I found code for keywordPicker (and keywordSelector, but not codelistPicker) in geonetwork\core-geonetwork\web-ui\src\main\resources\catalog\components\thesaurus\ThesaurusDirective.js, but its not clear what the directive attributes in the example from 7227 do. I assume the key links to the skos file in some fashion? how does this work to bind a text box field element to a codelist? Questions