-
-
Notifications
You must be signed in to change notification settings - Fork 490
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature catalogue / Add table of content of feature types (#8041)
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
- Loading branch information
1 parent
408dc79
commit 2432dc9
Showing
33 changed files
with
382 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,10 +22,12 @@ | |
~ Rome - Italy. email: [email protected] | ||
--> | ||
|
||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:gmd="http://www.isotc211.org/2005/gmd" | ||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | ||
xmlns:gmd="http://www.isotc211.org/2005/gmd" | ||
xmlns:gco="http://www.isotc211.org/2005/gco" | ||
xmlns:gmx="http://www.isotc211.org/2005/gmx" | ||
xmlns:gfc="http://www.isotc211.org/2005/gfc" | ||
xmlns:xs="http://www.w3.org/2001/XMLSchema" | ||
xmlns:gn="http://www.fao.org/geonetwork" | ||
xmlns:gn-fn-metadata="http://geonetwork-opensource.org/xsl/functions/metadata" | ||
xmlns:gn-fn-iso19110="http://geonetwork-opensource.org/xsl/functions/profiles/iso19110" | ||
|
@@ -38,7 +40,7 @@ | |
<xsl:include href="layout-custom-fields.xsl"/> | ||
|
||
<!-- Ignore all gn element --> | ||
<xsl:template mode="mode-iso19110" match="gn:*|@gn:*" priority="1000"/> | ||
<xsl:template mode="mode-iso19110" match="gn:*|@gn:*|@id|@uuid" priority="1000"/> | ||
|
||
|
||
<!-- Template to display non existing element ie. geonet:child element | ||
|
@@ -70,6 +72,43 @@ | |
</xsl:template> | ||
|
||
|
||
<xsl:template mode="mode-iso19110" | ||
match="gfc:featureType" | ||
priority="2000"> | ||
|
||
<xsl:variable name="isFirstFeatureType" | ||
select="preceding-sibling::*[1]/name() != 'gfc:featureType'" | ||
as="xs:boolean"/> | ||
|
||
<xsl:if test="$isFirstFeatureType"> | ||
<xsl:variable name="selector" as="node()*"> | ||
<select name="selectFeaturetype" | ||
icon="fa gn-icon-featureCatalog" | ||
xpath="/gfc:FC_FeatureCatalogue/gfc:featureType" | ||
parameter="featureType" | ||
value="*/gfc:typeName/gco:LocalName/text()" | ||
layout="dropdown"/> | ||
</xsl:variable> | ||
<xsl:apply-templates mode="form-builder" | ||
select="$selector"> | ||
<xsl:with-param name="base" select="ancestor::gfc:FC_FeatureCatalogue"/> | ||
</xsl:apply-templates> | ||
</xsl:if> | ||
|
||
<xsl:variable name="isRequestedFeatureType" | ||
select="*/gfc:typeName/gco:LocalName = $request/featureType"/> | ||
|
||
<xsl:variable name="isRequestedFeatureTypeInCurrentRecord" | ||
select="count(../gfc:featureType[*/gfc:typeName/gco:LocalName = $request/featureType]) > 0"/> | ||
|
||
<xsl:if test="$isRequestedFeatureType | ||
or (not($isRequestedFeatureTypeInCurrentRecord) and $isFirstFeatureType) | ||
or ($service = 'md.format.html')"> | ||
<xsl:call-template name="mode-iso19110-fieldset"/> | ||
</xsl:if> | ||
</xsl:template> | ||
|
||
|
||
<!-- Visit all XML tree recursively --> | ||
<xsl:template mode="mode-iso19110" match="gfc:*"> | ||
<xsl:apply-templates mode="mode-iso19110" select="*|@*"/> | ||
|
@@ -85,6 +124,7 @@ | |
|
||
<!-- Boxed element --> | ||
<xsl:template mode="mode-iso19110" priority="200" | ||
name="mode-iso19110-fieldset" | ||
match="gfc:*[gfc:FC_FeatureType]| | ||
gfc:*[gfc:FC_AssociationRole]| | ||
gfc:*[gfc:FC_AssociationOperation]| | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.