-
-
Notifications
You must be signed in to change notification settings - Fork 489
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Editor / Add configuration for field to use a thesaurus. #3078
Conversation
Does this approach also allow users to not use the pull-down value and enter an alternative text (which is then stored as characterstring in stead of anchor? as described here #2867 |
Yes the pull down is only suggestions from the thesaurus. Free text is still allowed. |
How does this work on xml for multilingual, like this?
but then is missing the locale or alternatively:
|
Testing with Oxygen, the schema validation works when you only substitute the CharacterString with the Anchor. The multilingual part is the same. |
Seems 6 modes of configuration are relevant for any text element
The one missing in the current approach seems anchor+optional codelist, in which a user could select a value from a codelist or enter a value+link manually And missing is a way to switch between anchor and string for no-codelist fields as described in #2867 |
2b553ef
to
5dcc45c
Compare
@pvgenuchten, what do you mean by suggest ? helpers set in labels.xml ? I don't think we should bother editor with a choice between CharacterString or Anchor choice. The rule could be simple : if a link is defined, encode with an Anchor, if not, use a CharacterString. This is handled by https://github.com/geonetwork/core-geonetwork/pull/3078/files#diff-d7aa3900840fb8648241a671c2b92be1R414. This is working now in this branch for keyword picker based field. So we should add this to standard field and apply the rule when a link is set. Then maybe the layout of this link field should be improved. We should avoid usage of helpers (and maybe drop support for it at some point) and prefer use of thesaurus codelist. |
I like the idea of not bothering the user with anchor/string choice. Some use cases around anchor/string/codelist, derived from dutch profile. Text field that either or not has an anchor-link defined <gmd:identifier>
<gmd:MD_Identifier>
<gmd:code>
<Anchor
xlink:href="http://domein/id/record/ee543323-0fe4-4353">
ee543323-0fe4-4353-9161-eda61ff26c07</Anchor>
</gmd:code>
</gmd:MD_Identifier>
</gmd:identifier> Text field that could use a value from a codelist
An example here is gmd:protocol in onlineresource <gmd:protocol>
<gmx:Anchor
xlink:href="https://www.iana.org/assignments/media-types/application/json">
json</gmx:Anchor>
</gmd:protocol> Dropdown field that must use a value from a codelist
<gmd:report>
<gmd:title>
<gmx:Anchor
xlink:href="http://inspire.ec.europa.eu/id/document/tg/au">
Data specificatie administratieve eenheden
</gmx:Anchor>
</gmd:title>
</gmd:report> challenge here is that individual quality reports or restriction elements may require values from multiple codelists. What could be an option here is to create a field entry in config.xml for each thesaurus to be used |
…definition. Define number of suggestions.
When using a gnKeywordPicker sends an _ID_xlinkCOLONhref field with the selected keyword's URI to be processed by the backend to replace `gco:CharacterString` with a `gmx:Anchor` in case the schema requires it.
Call to a new SchemaPlugin method to preprocess the elements. For example to replace a CharacterString for an Anchor.
…mpty xlink with no anchor.
…n concept id. More doc.
…multilingual mode + typeahead.
9b02ce7
to
4695eb3
Compare
A review/merge of this one would be good to not to have to solve conflict for weeks. It has been tested by Ifremer and is used for custom editor views using both ISO19139 and ISO19115-3 (changes ready camptocamp/iso19115-3@d81d758 to be integrated in metadata101). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have tested (no multilingual) using Text and Anchors for Use limitations and looks working fine.
schemas/iso19139/src/main/java/org/fao/geonet/schema/iso19139/ISO19139Namespaces.java
Outdated
Show resolved
Hide resolved
the widget does not have a help-icon/tooltip yet |
return el; | ||
} else { | ||
el.setNamespace(GMX).setName("Anchor"); | ||
el.setAttribute("href", "", XLINK); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fxprunayre , why not
el.setAttribute("href", attributeValue, XLINK);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe because the attribute value is assigned after in https://github.com/geonetwork/core-geonetwork/blob/master/services/src/main/java/org/fao/geonet/api/records/editing/AjaxEditUtils.java#L236 ? Not 100% sure.
Due to the increase of usage of registries (#2741) for managing list of values, catalogue administrators need to be able to configure which thesaurus to use to populate a field in the editor form.
When configured, then an autocomplete list is available in the editor:
Example of usage for use limitation which propose a list of values based on INSPIRE recommendation and Creative commons licenses https://www.youtube.com/watch?v=k5lONHoz-rU&feature=youtu.be
Editor can still enter an alternative text and not pick a value from the list.
Work description
Sample configurations:
Use LimitationsOnPublicAccess INSPIRE codelist to populate gmd:useLimitation. This is the easiest configuration where you use the
data-gn-keyword-picker
directive pointing to the thesaurus identified by thedata-thesaurus-key
. The thesaurus key is available in the admin console > thesaurus panel.Additional attributes are available to customize the suggestion:
data-number-of-suggestions
define the number of suggestions to listdata-display-definition
allows to display the definition... the configuration would be:
This mode is recommended to be used instead of using helper which may trigger issues in multilingual context (#3076)
Schema plugin changes for ISO19139 extension:
by
by
Future work to plan