-
-
Notifications
You must be signed in to change notification settings - Fork 477
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 list mode #7998
Editor / Add list mode #7998
Conversation
The list can be used to display a list of contact with only organisation name for example. This can facilitate building simple form hiding the details of ISO elements. In this case, use a contact directory to add new contact makes sense. This mode can be also more efficient when record contains lots of contacts which in some case can create large HTML form which can take time to build, download and render in the browser (eg. when having more than 100 contacts in a record). If only `label` are used the form will be faster to render. For large XML record, form may trigger error like `Form with too many keys [1001 > 1000]` when submitted. The list mode allows to deal with such situation. eg. ```xml <action type="add" forceLabel="true" addDirective="data-gn-directory-entry-selector" or="pointOfContact" in="/gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification"> <directiveAttributes data-template-add-action="false" data-search-action="true" data-popup-action="true" data-template-type="contact" data-variables="gmd:role/gmd:CI_RoleCode/@codeListValue~{role}"/> </action> <list name="Contact point" xpath="/gmd:MD_Metadata/gmd:identificationInfo/*/gmd:pointOfContact[*/gmd:role/*/@codeListValue = 'pointOfContact']" del="." sortBy="gmd:organisationName/gco:CharacterString"> <item href="*[1]/@uuid"> <label xpath="*/gmd:organisationName/gco:CharacterString/text()"/> </item> </list> <list name="Originator" xpath="/gmd:MD_Metadata/gmd:identificationInfo/*/gmd:pointOfContact[*/gmd:role/*/@codeListValue = 'originator']" sortBy="gmd:organisationName/gco:CharacterString"> <item> <field xpath="*/gmd:organisationName"/> </item> </list> ``` Funded by Ifremer
228d4d0
to
1357ce2
Compare
<xs:complexType> | ||
<xs:sequence> | ||
<xs:element ref="label"/> | ||
<xs:element ref="text"/> |
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.
What is the difference between text
and the other values?
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.
See https://github.com/geonetwork/core-geonetwork/blob/main/schemas/config-editor.xsd#L1447-L1453 so you can also add text in the list item. It is not used for now but for example, we could think of
Org name
<hr/>
Address ...
<item> | ||
<field xpath="*/gmd:organisationName"/> | ||
</item> | ||
</list> |
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.
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.
Yes, there is no del
attribute in list, so the item has no button for removal. The org name is a normal field so can be removed as usual. If using
<field xpath="*/gmd:organisationName" del="ancestor::gmd:pointOfContact"/>
would remove the contact.
For now, we are more thinking using this mode with directory entries and only label.
This is needed when the custom editor is also used as a formatter.
Quality Gate passedIssues Measures |
A feature catalogue can contain one or more feature types description. When describing a model with lots of feature types, then the editor can be quite large (and then can cause issue related to timeout or number of fields) The problem is quite similar to #7998 (ie. timeout, number of form fields). To better manage this case, make a list of existing feature types and user can click on it to edit only one feature type at a time. This is enable by default for ISO19110 and ISO19115-3 feature catalogue in all views. The first table is selected by default. A selector can be manually configured using the following: ```xml <section name="gfc:featureType"> <select name="Select a feature type" xpath="/gfc:FC_FeatureCatalogue/gfc:featureType" parameter="featureType" value="*/gfc:typeName/gco:LocalName/text()" layout="dropdown"/> <!--tabs|pills|dropdown--> <section xpath="/gfc:FC_FeatureCatalogue/gfc:featureType[ */gfc:typeName/gco:LocalName = $p2/featureType or (not($p2/featureType) and position() = 1) or ($p3 = 'md.format.html')]" or="featureType" in="/gfc:FC_FeatureCatalogue"/> </section> ``` `$p2` correspond to the variable `request` and `$p3` to the `service` in the XSL template (see `base-variables.xsl` and `evaluate.xsl`). So if there is no `featureType` parameter, the first feature type will be displayed. If the view mode is `md.format.html`, all feature types will be displayed. It has only been tested for feature catalogue but can be probably reuse in other places eg. conformity * Dropdown (default) * Tabs * Pills * Avoid JS error on large forms by using JQuery `empty()` instead of find and remove: ``` RangeError: Maximum call stack size exceeded at Sizzle.select (jquery-2.2.4.js?v=dc93b22fa65aadfbbe3d7ad69b4d5d83601574de:2592:12) at Function.Sizzle [as find] (jquery-2.2.4.js?v=dc93b22fa65aadfbbe3d7ad69b4d5d83601574de:869:9) at jQuery.fn.init.find (jquery-2.2.4.js?v=dc93b22fa65aadfbbe3d7ad69b4d5d83601574de:2792:11) at refreshForm (EditorService.js:324:42) ``` * ISO19110 to ISO19115-3 conversion / Convert cardinality to CharacterString
A feature catalogue can contain one or more feature types description. When describing a model with lots of feature types, then the editor can be quite large (and then can cause issue related to timeout or number of fields) The problem is quite similar to #7998 (ie. timeout, number of form fields). To better manage this case, make a list of existing feature types and user can click on it to edit only one feature type at a time. This is enable by default for ISO19110 and ISO19115-3 feature catalogue in all views. The first table is selected by default. A selector can be manually configured using the following: ```xml <section name="gfc:featureType"> <select name="Select a feature type" xpath="/gfc:FC_FeatureCatalogue/gfc:featureType" parameter="featureType" value="*/gfc:typeName/gco:LocalName/text()" layout="dropdown"/> <!--tabs|pills|dropdown--> <section xpath="/gfc:FC_FeatureCatalogue/gfc:featureType[ */gfc:typeName/gco:LocalName = $p2/featureType or (not($p2/featureType) and position() = 1) or ($p3 = 'md.format.html')]" or="featureType" in="/gfc:FC_FeatureCatalogue"/> </section> ``` `$p2` correspond to the variable `request` and `$p3` to the `service` in the XSL template (see `base-variables.xsl` and `evaluate.xsl`). So if there is no `featureType` parameter, the first feature type will be displayed. If the view mode is `md.format.html`, all feature types will be displayed. It has only been tested for feature catalogue but can be probably reuse in other places eg. conformity * Dropdown (default) * Tabs * Pills * Avoid JS error on large forms by using JQuery `empty()` instead of find and remove: ``` RangeError: Maximum call stack size exceeded at Sizzle.select (jquery-2.2.4.js?v=dc93b22fa65aadfbbe3d7ad69b4d5d83601574de:2592:12) at Function.Sizzle [as find] (jquery-2.2.4.js?v=dc93b22fa65aadfbbe3d7ad69b4d5d83601574de:869:9) at jQuery.fn.init.find (jquery-2.2.4.js?v=dc93b22fa65aadfbbe3d7ad69b4d5d83601574de:2792:11) at refreshForm (EditorService.js:324:42) ``` * ISO19110 to ISO19115-3 conversion / Convert cardinality to CharacterString
A feature catalogue can contain one or more feature types description. When describing a model with lots of feature types, then the editor can be quite large (and then can cause issue related to timeout or number of fields) The problem is quite similar to #7998 (ie. timeout, number of form fields). To better manage this case, make a list of existing feature types and user can click on it to edit only one feature type at a time. This is enable by default for ISO19110 and ISO19115-3 feature catalogue in all views. The first table is selected by default. A selector can be manually configured using the following: ```xml <section name="gfc:featureType"> <select name="Select a feature type" xpath="/gfc:FC_FeatureCatalogue/gfc:featureType" parameter="featureType" value="*/gfc:typeName/gco:LocalName/text()" layout="dropdown"/> <!--tabs|pills|dropdown--> <section xpath="/gfc:FC_FeatureCatalogue/gfc:featureType[ */gfc:typeName/gco:LocalName = $p2/featureType or (not($p2/featureType) and position() = 1) or ($p3 = 'md.format.html')]" or="featureType" in="/gfc:FC_FeatureCatalogue"/> </section> ``` `$p2` correspond to the variable `request` and `$p3` to the `service` in the XSL template (see `base-variables.xsl` and `evaluate.xsl`). So if there is no `featureType` parameter, the first feature type will be displayed. If the view mode is `md.format.html`, all feature types will be displayed. It has only been tested for feature catalogue but can be probably reuse in other places eg. conformity * Dropdown (default) * Tabs * Pills * Avoid JS error on large forms by using JQuery `empty()` instead of find and remove: ``` RangeError: Maximum call stack size exceeded at Sizzle.select (jquery-2.2.4.js?v=dc93b22fa65aadfbbe3d7ad69b4d5d83601574de:2592:12) at Function.Sizzle [as find] (jquery-2.2.4.js?v=dc93b22fa65aadfbbe3d7ad69b4d5d83601574de:869:9) at jQuery.fn.init.find (jquery-2.2.4.js?v=dc93b22fa65aadfbbe3d7ad69b4d5d83601574de:2792:11) at refreshForm (EditorService.js:324:42) ``` * ISO19110 to ISO19115-3 conversion / Convert cardinality to CharacterString
A feature catalogue can contain one or more feature types description. When describing a model with lots of feature types, then the editor can be quite large (and then can cause issue related to timeout or number of fields) The problem is quite similar to geonetwork#7998 (ie. timeout, number of form fields). To better manage this case, make a list of existing feature types and user can click on it to edit only one feature type at a time. This is enable by default for ISO19110 and ISO19115-3 feature catalogue in all views. The first table is selected by default. A selector can be manually configured using the following: ```xml <section name="gfc:featureType"> <select name="Select a feature type" xpath="/gfc:FC_FeatureCatalogue/gfc:featureType" parameter="featureType" value="*/gfc:typeName/gco:LocalName/text()" layout="dropdown"/> <!--tabs|pills|dropdown--> <section xpath="/gfc:FC_FeatureCatalogue/gfc:featureType[ */gfc:typeName/gco:LocalName = $p2/featureType or (not($p2/featureType) and position() = 1) or ($p3 = 'md.format.html')]" or="featureType" in="/gfc:FC_FeatureCatalogue"/> </section> ``` `$p2` correspond to the variable `request` and `$p3` to the `service` in the XSL template (see `base-variables.xsl` and `evaluate.xsl`). So if there is no `featureType` parameter, the first feature type will be displayed. If the view mode is `md.format.html`, all feature types will be displayed. It has only been tested for feature catalogue but can be probably reuse in other places eg. conformity * Dropdown (default) * Tabs * Pills * Avoid JS error on large forms by using JQuery `empty()` instead of find and remove: ``` RangeError: Maximum call stack size exceeded at Sizzle.select (jquery-2.2.4.js?v=dc93b22fa65aadfbbe3d7ad69b4d5d83601574de:2592:12) at Function.Sizzle [as find] (jquery-2.2.4.js?v=dc93b22fa65aadfbbe3d7ad69b4d5d83601574de:869:9) at jQuery.fn.init.find (jquery-2.2.4.js?v=dc93b22fa65aadfbbe3d7ad69b4d5d83601574de:2792:11) at refreshForm (EditorService.js:324:42) ``` * ISO19110 to ISO19115-3 conversion / Convert cardinality to CharacterString
…types A feature catalogue can contain one or more feature type description. When describing a model with lots of feature types, then the editor can be quite large (and then can cause issue related to timeout or number of fields) The problem is quite similar to geonetwork#7998 To better manage this case, make a list of existing feature types and user can click on it to edit only one feature type at a time. ## Configuration This is enabled by default in all views for ISO19110 and ISO19115-3. The first table is selected by default. A selector can be manually configured using the following: ```xml <section name="gfc:featureType"> <select name="Select a feature type" xpath="/gfc:FC_FeatureCatalogue/gfc:featureType" parameter="featureType" value="*/gfc:typeName/gco:LocalName/text()" layout="dropdown"/> <section xpath="/gfc:FC_FeatureCatalogue/gfc:featureType[ */gfc:typeName/gco:LocalName = $p2/featureType or (not($p2/featureType) and position() = 1) or ($p3 = 'md.format.html')]" or="featureType" in="/gfc:FC_FeatureCatalogue"/> </section> ``` `$p2` correspond to the variable `request` and `$p3` to the `service` in the XSL template (see `base-variables.xsl`). So if there is no `featureType` parameter, the first feature type will be displayed. If the view mode is `md.format.html`, all feature types will be displayed. ## Layout * layout: dropdown ![image (5).png](https://agiv.visualstudio.com/dc849554-199a-495a-86b3-2669ea01f14c/_apis/git/repositories/0a154993-bcec-4021-98e4-034a6161db36/pullRequests/35571/attachments/image%20%285%29.png) ![image.png](https://agiv.visualstudio.com/dc849554-199a-495a-86b3-2669ea01f14c/_apis/git/repositories/0a154993-bcec-4021-98e4-034a6161db36/pullRequests/35571/attachments/image.png) * layout: pills ![image (6).png](https://agiv.visualstudio.com/dc849554-199a-495a-86b3-2669ea01f14c/_apis/git/repositories/0a154993-bcec-4021-98e4-034a6161db36/pullRequests/35571/attachments/image%20%286%29.png) It has only been tested for feature catalogue but can be probably reuse in other places eg. conformity * layout: tabs ![image (4).png](https://agiv.visualstudio.com/dc849554-199a-495a-86b3-2669ea01f14c/_apis/git/repositories/0a154993-bcec-4021-98e4-034a6161db36/pullRequests/35571/attachments/image%20%284%29.png) The formatter API also use the config-editor for rendering xsl-view formatter. http://localhost:8080/geonetwork/srv/dut/catalog.search#/metadata/9b86a7b6-a860-493e-827a-f3012c5d7760/formatters/xsl-view?view=default Related work items: #191055
The list can be used to display a list of contact with only organisation name for example. This can facilitate building simple form hiding the details of ISO elements. In this case, use a contact directory to add new contact makes sense.
This mode can be also more efficient when record contains lots of contacts which in some case can create large HTML form which can take time to build, download and render in the browser (eg. when having more than 100 contacts in a record). If only
label
are used the form will be faster to render.For large XML record, form may trigger error like
Form with too many keys [1001 > 1000]
when submitted. The list mode allows to deal with such situation.eg.
Funded by Ifremer
Checklist
main
branch, backports managed with labelREADME.md
filespom.xml
dependency management. Update build documentation with intended library use and library tutorials or documentation