[GeoNetwork-devel] [GeoNetwork opensource Developer website] #1220: Editor / Helper / Conditional helper

#1220: Editor / Helper / Conditional helper
-------------------------+--------------------------------------------------
Reporter: fxp | Owner: geonetwork-devel@…
     Type: enhancement | Status: new
Priority: minor | Milestone: v2.9.0
Component: General | Version: v2.9.0
Keywords: |
-------------------------+--------------------------------------------------
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.

--
Ticket URL: <http://trac.osgeo.org/geonetwork/ticket/1220&gt;
GeoNetwork opensource Developer website <http://sourceforge.net/projects/geonetwork/&gt;
GeoNetwork opensource is a standards based, Free and Open Source catalog application to manage spatially referenced resources through the web. It provides powerful metadata editing and search functions as well as an embedded interactive web map viewer. This website contains information related to the development of the software.

#1220: Editor / Helper / Conditional helper
--------------------------+-------------------------------------------------
  Reporter: fxp | Owner: geonetwork-devel@…
      Type: enhancement | Status: closed
  Priority: minor | Milestone: v2.9.0
Component: General | Version: v2.9.0
Resolution: fixed | Keywords:
--------------------------+-------------------------------------------------
Changes (by fxp):

  * status: new => closed
  * resolution: => fixed

Comment:

master commit db3918bddba10faabf53e509f97b5d935bc714e4

--
Ticket URL: <http://trac.osgeo.org/geonetwork/ticket/1220#comment:1&gt;
GeoNetwork opensource Developer website <http://sourceforge.net/projects/geonetwork/&gt;
GeoNetwork opensource is a standards based, Free and Open Source catalog application to manage spatially referenced resources through the web. It provides powerful metadata editing and search functions as well as an embedded interactive web map viewer. This website contains information related to the development of the software.