<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright (C) 2001-2016 Food and Agriculture Organization of the
  ~ United Nations (FAO-UN), United Nations World Food Programme (WFP)
  ~ and United Nations Environment Programme (UNEP)
  ~
  ~ This program is free software; you can redistribute it and/or modify
  ~ it under the terms of the GNU General Public License as published by
  ~ the Free Software Foundation; either version 2 of the License, or (at
  ~ your option) any later version.
  ~
  ~ This program is distributed in the hope that it will be useful, but
  ~ WITHOUT ANY WARRANTY; without even the implied warranty of
  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  ~ General Public License for more details.
  ~
  ~ You should have received a copy of the GNU General Public License
  ~ along with this program; if not, write to the Free Software
  ~ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  ~
  ~ Contact: Jeroen Ticheler - FAO - Viale delle Terme di Caracalla 2,
  ~ Rome - Italy. email: geonetwork@osgeo.org
  -->

<editor xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="../../../../../../config-editor.xsd">

  <!-- Form field type configuration. Default is text. -->
  <fields>
    <for name="gfc:scope" use="textarea"/>
    <for name="gfc:fieldOfApplication" use="textarea"/>
    <for name="gfc:definition" use="textarea"/>
    <for name="gmx:scope" use="textarea"/>
    <for name="gmx:fieldOfApplication" use="textarea"/>

    <for name="gmx:language" use="data-gn-language-picker"/>
    <for name="gfc:functionalLanguage" use="data-gn-language-picker"/>
    <for name="gmd:languageCode" use="data-gn-language-picker"/>

    <for name="gfc:producer" addDirective="data-gn-directory-entry-selector">
      <directiveAttributes
        data-template-add-action="true"
        data-search-action="true"
        data-popup-action="true"
        data-template-type="contact"
        data-insert-modes=""
        data-variables="gmd:role/gmd:CI_RoleCode/@codeListValue~{role}"/>
    </for>
  </fields>

  <fieldsWithFieldset>
    <name>gfc:producer</name>
    <name>gfc:featureType</name>
    <name>gfc:carrierOfCharacteristics</name>
    <name>gfc:listedValue</name>
    <name>gfc:constrainedBy</name>
    <name>gfc:inheritsFrom</name>
    <name>gfc:inheritsTo</name>
    <name>gco:range</name>
  </fieldsWithFieldset>

  <fieldsWithAnchorOption>
    <name>gfc:code</name>
  </fieldsWithAnchorOption>

  <!-- View configuration -->
  <views>
    <view name="default" default="true"
          class="gn-label-above-input gn-indent-bluescale">
      <sidePanel>
        <directive data-gn-need-help="creating-metadata"/>
        <directive data-gn-associated-resources-panel="gnCurrentEdit.metadata" />
        <directive data-gn-validation-report=""/>
        <directive data-gn-suggestion-list=""/>
      </sidePanel>
      <tab id="default" default="true" mode="flat">
        <section>
          <!-- Preserve gmx:* in editor for backward compatibility. -->
          <field xpath="/gfc:FC_FeatureCatalogue/gmx:name" or="name" in="/gfc:FC_FeatureCatalogue"/>
          <field xpath="/gfc:FC_FeatureCatalogue/gfc:name"/>
          <field xpath="/gfc:FC_FeatureCatalogue/gmx:scope" or="scope" in="/gfc:FC_FeatureCatalogue"
                 ifNotExist="true"/>
          <field xpath="/gfc:FC_FeatureCatalogue/gfc:scope"/>
          <field xpath="/gfc:FC_FeatureCatalogue/gmx:fieldOfApplication" or="fieldOfApplication"
                 in="/gfc:FC_FeatureCatalogue" ifNotExist="true"/>
          <field xpath="/gfc:FC_FeatureCatalogue/gfc:fieldOfApplication"/>
          <field xpath="/gfc:FC_FeatureCatalogue/gmx:versionNumber" or="versionNumber"
                 in="/gfc:FC_FeatureCatalogue"/>
          <field xpath="/gfc:FC_FeatureCatalogue/gfc:versionNumber"/>
          <field xpath="/gfc:FC_FeatureCatalogue/gmx:versionDate"/>
          <field xpath="/gfc:FC_FeatureCatalogue/gfc:producer" or="producer"
                 in="/gfc:FC_FeatureCatalogue"/>
          <field xpath="/gfc:FC_FeatureCatalogue/gfc:functionalLanguage" or="functionalLanguage"
                 in="/gfc:FC_FeatureCatalogue"/>
          <field xpath="/gfc:FC_FeatureCatalogue/gfc:featureType" or="featureType"
                 in="/gfc:FC_FeatureCatalogue"/>

          <action type="suggest"
                  process="add-columns-from-csv"/>
        </section>
      </tab>
      <flatModeExceptions>
        <for name="gfc:code"/>
        <for name="gfc:featureType"/>
        <for name="gfc:carrierOfCharacteristics"/>
        <for name="gfc:listedValue"/>
      </flatModeExceptions>
    </view>
    <view name="advanced"
          class="gn-label-above-input gn-indent-bluescale">
      <sidePanel>
        <directive data-gn-need-help="creating-metadata"/>
        <directive data-gn-validation-report=""/>
        <directive data-gn-suggestion-list=""/>
      </sidePanel>
      <tab id="advanced">
        <section xpath="/gfc:FC_FeatureCatalogue"/>
      </tab>
    </view>
    <view name="xml">
      <sidePanel>
        <directive data-gn-need-help="creating-metadata"/>
        <directive data-gn-validation-report=""/>
        <directive data-gn-suggestion-list=""/>
      </sidePanel>
      <tab id="xml" default="true"/>
    </view>
  </views>
</editor>
