Opened 12 years ago
Closed 12 years ago
#1220 closed enhancement (fixed)
Editor / Helper / Conditional helper
Reported by: | fxp | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | v2.10.0 RC0 |
Component: | General | Version: | v2.9.0 |
Keywords: | Cc: |
Description
Currently helper could be defined by element in labels.xml. Each element could have a context defining a parent element or a complete xpath to customize label, definition, helpers. It may be required to customize list of suggestion according to the content of the metadata. For example, the list of specification in the context of INSPIRE depends on the resource which may be a dataset or a service.
Proposal: add a displayIf attribute which contains an XPath expression which is evaluated relative to the current node in order to get the correct helper.
Example: INSPIRE specification title depending on type of resource:
<element name="gmd:title" context="gmd:MD_Metadata/gmd:dataQualityInfo/gmd:DQ_DataQuality/gmd:report/gmd:DQ_DomainConsistency/gmd:result/gmd:DQ_ConformanceResult/gmd:specification/gmd:CI_Citation/gmd:title"> <label>Titre de la spécification</label> <helper displayIf="$p1/ancestor::node()[name()='gmd:MD_Metadata']/gmd:identificationInfo/gmd:MD_DataIdentification or $p1/ancestor::node()[name()='gmd:MD_Metadata']/gmd:identificationInfo/*[@gco:isoType='gmd:MD_DataIdentification']"> <option value="INSPIRE Data Specification on Administrative Units - Guidelines v3.0.1">Guide INSPIRE sur les unités administratives</option> .... </helper> <helper displayIf="$p1/ancestor::node()[name()='gmd:MD_Metadata']/gmd:identificationInfo/srv:SV_ServiceIdentification"> <option value="Technical Guidance for the implementation of INSPIRE Discovery Services – v.3.1">Guide INSPIRE sur les services de recherche</option> <option value="Technical Guidance for the implementation of INSPIRE View Services - v3.1 – part 4">Guide INSPIRE sur les services de consultation – profil ISO 19128 (WMS)</option> ...
The expression
$p1/ancestor::node()[name()='gmd:MD_Metadata']/gmd:identificationInfo/gmd:MD_DataIdentification
will match a metadata on dataset.
$p1 is the current node. It may not be used in the xpath expression.
Previous helper configuration remains compatible with this change.
master commit db3918bddba10faabf53e509f97b5d935bc714e4