geonetwork / core-geonetwork

GeoNetwork is a catalog application to manage spatially referenced resources. It provides powerful metadata editing and search functions as well as an interactive web map viewer. It is currently used in numerous Spatial Data Infrastructure initiatives across the world.
http://geonetwork-opensource.org/
GNU General Public License v2.0
416 stars 487 forks source link

text box controls for fields not appearing in tables defined in config-editor.xml #7804

Closed smrgeoinfo closed 6 months ago

smrgeoinfo commented 6 months ago

I've defined a table for displaying the gml:TimeInstant elements in config-editor.xml

<table for="gml:TimeInstant">
      <header>
        <col label="gml:name"/>
        <col label="gml:identifier"/>
        <col label="gml:timePosition"/>
        <col label="frame"/>
      </header>
      <row>
        <col xpath="gml:name"/>
        <col xpath="gml:identifier"/>
        <col xpath="gml:timePosition"/>
        <col xpath="gml:timePosition/@frame"/>
      </row>
    </table>

the data (iso19115-3, validate with mds2.0 schema), in the mri:extent element:

...
<gml:TimePeriod>
      <gml:description>geoTime: Early Proterozoic, Middle Proterozoic, Cambrian, Devonian, Mississippian, Pennsylvanian, Permian, Mesozoic, Paleogene, Neogene, Holocene</gml:description>
      <gml:begin>
            <gml:TimeInstant>
               <gml:identifier codeSpace="International Commission on StratigraphyresourceProvider">http://resource.geosciml.org/classifier/ics/ischart/Paleoproterozoic</gml:identifier>
               <gml:name>Early Proterozoic</gml:name>
               <gml:timePosition frame="Ma before present">1870</gml:timePosition>
            </gml:TimeInstant>
      </gml:begin>
      <gml:end>
              <gml:TimeInstant>
                 <gml:identifier codeSpace="International Commission on Stratigraphy">http://resource.geosciml.org/classifier/ics/ischart/Holocene</gml:identifier>
                 <gml:name>Holocene</gml:name>
                 <gml:timePosition indeterminatePosition="unknown"/>
              </gml:TimeInstant>
      </gml:end>
</gml:TimePeriod>
...

in config-editor.xml,

<tab....>
   <section name="geologicAge" 
            xpath="/*/mdb:identificationInfo/*/mri:extent/*/gex:temporalElement/*/gex:extent//gml:TimePeriod[.//gml:begin]"/>

and that's catching the gml:begin and gml:end, as expected (hoped for...), but only the gml:timePosition field is displaying a text control in the table, no matter what is in the source metadata document. The other columns in the table do not display what is in the metadata, or present an editable field. This is what you see:

geoAgeScreenShot

the field names are all registered in labels.xml. I've seen this same thing in other tables I've added in the config-editor.xml. Is there some trick in the col definition ? should I be using some angular directive?

fxprunayre commented 6 months ago

You should look at the document you're processing during editing - it is not only the XML of the record. It is a metadocument combining the XSD definition and the XML (https://github.com/geonetwork/core-geonetwork/blob/main/schemas/iso19115-3.2018/src/test/resources/metadata-for-editing.xml#L32634).

eg.

<gex:extent>
    <gml:TimePeriod gml:id="d6962e350">
        <gml:TimePeriodTypeGROUP_ELEMENT0>
            <geonet:child name="metaDataProperty" prefix="gml" namespace="http://www.opengis.net/gml/3.2"
                          uuid="child_gml:metaDataProperty_650e9ab1-acee-451e-bd7e-b0f67d067d53"
                          min="0"
                          max="10000"
                          action="replace"/>
            <gml:description>geoTime: Early Proterozoic, Middle Proterozoic, Cambrian, Devonian, Mississippian,
                Pennsylvanian, Permian, Mesozoic, Paleogene, Neogene, Holocene
                <geonet:element ref="130" parent="129"
                                uuid="gml:description_a795c5ea-c51c-4af4-9560-11ae94cd1337"
                                min="0"
                                max="1"
                                del="true"/>
                <geonet:attribute name="xlink:type" add="true">
                    <geonet:default value="simple"/>
                    <geonet:text value="arc"/>
                    <geonet:text value="resource"/>
                    <geonet:text value="simple"/>
                    <geonet:text value="title"/>
                    <geonet:text value="locator"/>
                    <geonet:text value="extended"/>
                </geonet:attribute>
                <geonet:attribute name="xlink:href" add="true"/>
                <geonet:attribute name="xlink:role" add="true"/>
                <geonet:attribute name="xlink:arcrole" add="true"/>
                <geonet:attribute name="xlink:title" add="true"/>
                <geonet:attribute name="xlink:show" add="true">
                    <geonet:text value="new"/>
                    <geonet:text value="other"/>
                    <geonet:text value="replace"/>
                    <geonet:text value="embed"/>
                    <geonet:text value="none"/>
                </geonet:attribute>
                <geonet:attribute name="xlink:actuate" add="true">
                    <geonet:text value="other"/>
                    <geonet:text value="onRequest"/>
                    <geonet:text value="onLoad"/>
                    <geonet:text value="none"/>
                </geonet:attribute>
                <geonet:attribute name="nilReason" add="true">
                    <geonet:text value="template"/>
                    <geonet:text value="missing"/>
                    <geonet:text value="inapplicable"/>
                    <geonet:text value="withheld"/>
                    <geonet:text value="unknown"/>
                </geonet:attribute>
                <geonet:attribute name="gml:remoteSchema" add="true"/>
            </gml:description>
            <geonet:child name="descriptionReference" prefix="gml"
                          namespace="http://www.opengis.net/gml/3.2"
                          uuid="child_gml:descriptionReference_c8548f06-ca31-4414-9bd9-388b4b2eee79"
                          min="0"
                          max="1"
                          action="replace"/>
            <geonet:child name="identifier" prefix="gml" namespace="http://www.opengis.net/gml/3.2"
                          uuid="child_gml:identifier_9b5f4946-fcff-4395-828f-7abedc385f39"
                          min="0"
                          max="1"
                          action="replace"/>
            <geonet:child name="name" prefix="gml" namespace="http://www.opengis.net/gml/3.2"
                          uuid="child_gml:name_df957e54-18ed-4890-8a04-afec6c347d99"
                          min="0"
                          max="10000"
                          action="replace"/>
            <geonet:element ref="129" parent="128"
                            uuid="gml:TimePeriodTypeGROUP_ELEMENT0_817d69c9-74c7-4bb5-896f-8c832c2638e7"
                            min="1"
                            max="1"/>
        </gml:TimePeriodTypeGROUP_ELEMENT0>
        <geonet:child name="relatedTime" prefix="gml" namespace="http://www.opengis.net/gml/3.2"
                      uuid="child_gml:relatedTime_8f1c82c9-f8e2-4a54-87fe-6e92218725f0"
                      min="0"
                      max="10000"
                      action="before">
            <geonet:choose name="gml:TimeInstant"/>
            <geonet:choose name="gml:TimePeriod"/>
            <geonet:choose name="gml:TimeNode"/>
            <geonet:choose name="gml:TimeEdge"/>
        </geonet:child>
        <gml:TimePeriodTypeCHOICE_ELEMENT2>
            <gml:begin>
                <gml:TimeInstant>
                    <gml:TimeInstantTypeGROUP_ELEMENT0>
                        <geonet:child name="metaDataProperty" prefix="gml" namespace="http://www.opengis.net/gml/3.2"
                                      uuid="child_gml:metaDataProperty_e69d2703-046f-4f38-ad1c-38eb756e6181"
                                      min="0"
                                      max="10000"
                                      action="replace"/>
                        <geonet:child name="description" prefix="gml" namespace="http://www.opengis.net/gml/3.2"
                                      uuid="child_gml:description_a8e1158e-0b8e-43e9-9113-661bb75777a0"
                                      min="0"
                                      max="1"
                                      action="replace"/>
                        <geonet:child name="descriptionReference" prefix="gml"
                                      namespace="http://www.opengis.net/gml/3.2"
                                      uuid="child_gml:descriptionReference_56d8e5a6-5a3a-4dda-97ff-54c53e93a9ee"
                                      min="0"
                                      max="1"
                                      action="replace"/>
                        <gml:identifier codeSpace="International Commission on StratigraphyresourceProvider">
                            http://resource.geosciml.org/classifier/ics/ischart/Paleoproterozoic
                            <geonet:element ref="135" parent="134"
                                            uuid="gml:identifier_1320d409-14b4-4aee-b389-06c5792c8af7"
                                            min="0"
                                            max="1"
                                            del="true"/>
                            <geonet:attribute name="codeSpace" del="true"/>
                            <geonet:attribute name="codeSpace"/>
                        </gml:identifier>
                        <gml:name>Early Proterozoic
                            <geonet:element ref="136" parent="134" uuid="gml:name_a79eb2c2-e716-4b7f-9ed8-ec32ffeed89c"
                                            min="0"
                                            max="10000"
                                            del="true"
                                            add="true"/>
                            <geonet:attribute name="codeSpace" add="true"/>
                        </gml:name>
                        <geonet:child name="name" prefix="gml" namespace="http://www.opengis.net/gml/3.2"
                                      uuid="child_gml:name_5b670b6b-6743-483b-9ec3-f45e7df0d672"
                                      min="0"
                                      max="10000"
                                      action="replace"/>
                        <geonet:element ref="134" parent="133"
                                        uuid="gml:TimeInstantTypeGROUP_ELEMENT0_eb970ccd-f81f-4a4c-aad8-7a211c4848da"
                                        min="1"
                                        max="1"/>
                    </gml:TimeInstantTypeGROUP_ELEMENT0>
                    <geonet:child name="relatedTime" prefix="gml" namespace="http://www.opengis.net/gml/3.2"
                                  uuid="child_gml:relatedTime_c487d16a-c7d5-4e72-8a64-700bbc0e1c0d"
                                  min="0"
                                  max="10000"
                                  action="before">
                        <geonet:choose name="gml:TimeInstant"/>
                        <geonet:choose name="gml:TimePeriod"/>
                        <geonet:choose name="gml:TimeNode"/>
                        <geonet:choose name="gml:TimeEdge"/>
                    </geonet:child>
                    <gml:timePosition frame="Ma before present">1870
                        <geonet:element ref="137" parent="133"
                                        uuid="gml:timePosition_635e3abf-1147-4bdc-b1f1-469ce8496a2d"
                                        min="1"
                                        max="1"/>
                        <geonet:attribute name="frame" del="true">
                            <geonet:default value="#ISO-8601"/>
                        </geonet:attribute>
                        <geonet:attribute name="calendarEraName" add="true"/>
                        <geonet:attribute name="indeterminatePosition" add="true">
                            <geonet:text value="before"/>
                            <geonet:text value="now"/>
                            <geonet:text value="after"/>
                            <geonet:text value="unknown"/>
                        </geonet:attribute>
                    </gml:timePosition>
                    <geonet:element ref="133" parent="132"
                                    uuid="gml:TimeInstant_5922f446-158e-478a-8753-b8a3b5c109a9"
                                    min="1"
                                    max="1"/>
                    <geonet:attribute name="gml:id" add="true"/>
                    <geonet:attribute name="frame" add="true">
                        <geonet:default value="#ISO-8601"/>
                    </geonet:attribute>
                </gml:TimeInstant>
                <geonet:element ref="132" parent="131" uuid="gml:begin_1fbde4a5-af20-4aac-97c3-7135afed257a"
                                min="1"
                                max="1"/>
                <geonet:attribute name="xlink:type" add="true">
                    <geonet:default value="simple"/>
                    <geonet:text value="arc"/>
                    <geonet:text value="resource"/>
                    <geonet:text value="simple"/>
                    <geonet:text value="title"/>
                    <geonet:text value="locator"/>
                    <geonet:text value="extended"/>
                </geonet:attribute>
                <geonet:attribute name="xlink:href" add="true"/>
                <geonet:attribute name="xlink:role" add="true"/>
                <geonet:attribute name="xlink:arcrole" add="true"/>
                <geonet:attribute name="xlink:title" add="true"/>
                <geonet:attribute name="xlink:show" add="true">
                    <geonet:text value="new"/>
                    <geonet:text value="other"/>
                    <geonet:text value="replace"/>
                    <geonet:text value="embed"/>
                    <geonet:text value="none"/>
                </geonet:attribute>
                <geonet:attribute name="xlink:actuate" add="true">
                    <geonet:text value="other"/>
                    <geonet:text value="onRequest"/>
                    <geonet:text value="onLoad"/>
                    <geonet:text value="none"/>
                </geonet:attribute>
                <geonet:attribute name="nilReason" add="true">
                    <geonet:text value="template"/>
                    <geonet:text value="missing"/>
                    <geonet:text value="inapplicable"/>
                    <geonet:text value="withheld"/>
                    <geonet:text value="unknown"/>
                </geonet:attribute>
                <geonet:attribute name="gml:remoteSchema" add="true"/>
                <geonet:attribute name="owns" add="true">
                    <geonet:default value="false"/>
                </geonet:attribute>
            </gml:begin>
            <geonet:element ref="131" parent="128"
                            uuid="gml:TimePeriodTypeCHOICE_ELEMENT2_fdd424a5-d013-4392-ab57-3af3bb7b523c"
                            min="1"
                            max="1"/>
        </gml:TimePeriodTypeCHOICE_ELEMENT2>
        <gml:TimePeriodTypeCHOICE_ELEMENT3>
            <gml:end>
                <gml:TimeInstant>
                    <gml:TimeInstantTypeGROUP_ELEMENT0>
                        <geonet:child name="metaDataProperty" prefix="gml" namespace="http://www.opengis.net/gml/3.2"
                                      uuid="child_gml:metaDataProperty_1d5e15cd-85c0-4f6a-82b8-0a89a1152028"
                                      min="0"
                                      max="10000"
                                      action="replace"/>
                        <geonet:child name="description" prefix="gml" namespace="http://www.opengis.net/gml/3.2"
                                      uuid="child_gml:description_dd8e53c6-3976-4fea-bead-f5768682e655"
                                      min="0"
                                      max="1"
                                      action="replace"/>
                        <geonet:child name="descriptionReference" prefix="gml"
                                      namespace="http://www.opengis.net/gml/3.2"
                                      uuid="child_gml:descriptionReference_26e946be-6f99-402b-9cd4-57bff845388d"
                                      min="0"
                                      max="1"
                                      action="replace"/>
                        <gml:identifier codeSpace="International Commission on Stratigraphy">
                            http://resource.geosciml.org/classifier/ics/ischart/Holocene
                            <geonet:element ref="142" parent="141"
                                            uuid="gml:identifier_7ffdbb93-ecd7-41c7-888c-a7fb72b82d62"
                                            min="0"
                                            max="1"
                                            del="true"/>
                            <geonet:attribute name="codeSpace" del="true"/>
                            <geonet:attribute name="codeSpace"/>
                        </gml:identifier>
                        <gml:name>Holocene
                            <geonet:element ref="143" parent="141" uuid="gml:name_536a4d5f-3cc2-49e7-a6e5-4096ebb8c428"
                                            min="0"
                                            max="10000"
                                            del="true"
                                            add="true"/>
                            <geonet:attribute name="codeSpace" add="true"/>
                        </gml:name>
                        <geonet:child name="name" prefix="gml" namespace="http://www.opengis.net/gml/3.2"
                                      uuid="child_gml:name_d4c17dae-f601-41c9-b414-78bf14f16c98"
                                      min="0"
                                      max="10000"
                                      action="replace"/>
                        <geonet:element ref="141" parent="140"
                                        uuid="gml:TimeInstantTypeGROUP_ELEMENT0_a2f5eb8b-d586-42ba-9c19-a7e178a666a5"
                                        min="1"
                                        max="1"/>
                    </gml:TimeInstantTypeGROUP_ELEMENT0>
                    <geonet:child name="relatedTime" prefix="gml" namespace="http://www.opengis.net/gml/3.2"
                                  uuid="child_gml:relatedTime_8ca2eaa7-d4e3-4bd5-99be-fe6f01a48a98"
                                  min="0"
                                  max="10000"
                                  action="before">
                        <geonet:choose name="gml:TimeInstant"/>
                        <geonet:choose name="gml:TimePeriod"/>
                        <geonet:choose name="gml:TimeNode"/>
                        <geonet:choose name="gml:TimeEdge"/>
                    </geonet:child>
                    <gml:timePosition indeterminatePosition="unknown">
                        <geonet:element ref="144" parent="140"
                                        uuid="gml:timePosition_b4db0226-9251-4480-9c33-8f4f86060b30"
                                        min="1"
                                        max="1"/>
                        <geonet:attribute name="frame" add="true">
                            <geonet:default value="#ISO-8601"/>
                        </geonet:attribute>
                        <geonet:attribute name="calendarEraName" add="true"/>
                        <geonet:attribute name="indeterminatePosition" del="true">
                            <geonet:text value="before"/>
                            <geonet:text value="now"/>
                            <geonet:text value="after"/>
                            <geonet:text value="unknown"/>
                        </geonet:attribute>
                    </gml:timePosition>
                    <geonet:element ref="140" parent="139"
                                    uuid="gml:TimeInstant_beb99884-fb29-4317-bc55-0c64c51020d8"
                                    min="1"
                                    max="1"/>
                    <geonet:attribute name="gml:id" add="true"/>
                    <geonet:attribute name="frame" add="true">
                        <geonet:default value="#ISO-8601"/>
                    </geonet:attribute>
                </gml:TimeInstant>
                <geonet:element ref="139" parent="138" uuid="gml:end_e4939267-06a0-4f86-bd5e-d00784bb1483"
                                min="1"
                                max="1"/>
                <geonet:attribute name="xlink:type" add="true">
                    <geonet:default value="simple"/>
                    <geonet:text value="arc"/>
                    <geonet:text value="resource"/>
                    <geonet:text value="simple"/>
                    <geonet:text value="title"/>
                    <geonet:text value="locator"/>
                    <geonet:text value="extended"/>
                </geonet:attribute>
                <geonet:attribute name="xlink:href" add="true"/>
                <geonet:attribute name="xlink:role" add="true"/>
                <geonet:attribute name="xlink:arcrole" add="true"/>
                <geonet:attribute name="xlink:title" add="true"/>
                <geonet:attribute name="xlink:show" add="true">
                    <geonet:text value="new"/>
                    <geonet:text value="other"/>
                    <geonet:text value="replace"/>
                    <geonet:text value="embed"/>
                    <geonet:text value="none"/>
                </geonet:attribute>
                <geonet:attribute name="xlink:actuate" add="true">
                    <geonet:text value="other"/>
                    <geonet:text value="onRequest"/>
                    <geonet:text value="onLoad"/>
                    <geonet:text value="none"/>
                </geonet:attribute>
                <geonet:attribute name="nilReason" add="true">
                    <geonet:text value="template"/>
                    <geonet:text value="missing"/>
                    <geonet:text value="inapplicable"/>
                    <geonet:text value="withheld"/>
                    <geonet:text value="unknown"/>
                </geonet:attribute>
                <geonet:attribute name="gml:remoteSchema" add="true"/>
                <geonet:attribute name="owns" add="true">
                    <geonet:default value="false"/>
                </geonet:attribute>
            </gml:end>
            <geonet:element ref="138" parent="128"
                            uuid="gml:TimePeriodTypeCHOICE_ELEMENT3_db602a80-908d-499c-a2a2-fd825898b920"
                            min="1"
                            max="1"/>
        </gml:TimePeriodTypeCHOICE_ELEMENT3>
        <gml:TimePeriodTypeGROUP_ELEMENT4>
            <geonet:child name="TimePeriodTypeCHOICE_ELEMENT5" prefix="gml"
                          namespace="http://www.opengis.net/gml/3.2"
                          uuid="child_gml:TimePeriodTypeCHOICE_ELEMENT5_8cc7f57d-1f42-4781-b9a8-789f1ec2457f"
                          min="1"
                          max="1"
                          action="replace">
                <geonet:choose name="gml:duration"/>
                <geonet:choose name="gml:timeInterval"/>
            </geonet:child>
            <geonet:element ref="145" parent="128"
                            uuid="gml:TimePeriodTypeGROUP_ELEMENT4_5abcbd77-12ec-4f9a-b7b8-a090db88b535"
                            min="0"
                            max="1"
                            del="true"/>
        </gml:TimePeriodTypeGROUP_ELEMENT4>
        <geonet:element ref="128" parent="127"
                        uuid="gml:TimePeriod_887f9e8d-5131-4619-9c55-9e250c6453ee"
                        min="1"
                        max="1"/>
        <geonet:attribute name="gml:id"/>
        <geonet:attribute name="frame" add="true">
            <geonet:default value="#ISO-8601"/>
        </geonet:attribute>
    </gml:TimePeriod>
    <geonet:element ref="127" parent="126" uuid="gex:extent_75dad52a-39c4-42d7-9e51-53b884371ad2"
                    min="1"
                    max="1"/>
    <geonet:attribute name="gco:nilReason" add="true">
        <geonet:text value="template"/>
        <geonet:text value="missing"/>
        <geonet:text value="inapplicable"/>
        <geonet:text value="withheld"/>
        <geonet:text value="unknown"/>
    </geonet:attribute>
    <geonet:attribute name="xlink:type" add="true">
        <geonet:default value="simple"/>
        <geonet:text value="arc"/>
        <geonet:text value="resource"/>
        <geonet:text value="simple"/>
        <geonet:text value="title"/>
        <geonet:text value="locator"/>
        <geonet:text value="extended"/>
    </geonet:attribute>
    <geonet:attribute name="xlink:href" add="true"/>
    <geonet:attribute name="xlink:role" add="true"/>
    <geonet:attribute name="xlink:arcrole" add="true"/>
    <geonet:attribute name="xlink:title" add="true"/>
    <geonet:attribute name="xlink:show" add="true">
        <geonet:text value="new"/>
        <geonet:text value="other"/>
        <geonet:text value="replace"/>
        <geonet:text value="embed"/>
        <geonet:text value="none"/>
    </geonet:attribute>
    <geonet:attribute name="xlink:actuate" add="true">
        <geonet:text value="other"/>
        <geonet:text value="onRequest"/>
        <geonet:text value="onLoad"/>
        <geonet:text value="none"/>
    </geonet:attribute>
    <geonet:attribute name="uuidref" add="true"/>
</gex:extent>

The following

    <table for="gml:TimeInstant">
      <header>
        <col label="gml:name"/>
        <col label="gml:identifier"/>
        <col label="gml:timePosition"/>
        <col label="frame"/>
      </header>
      <row>
        <col xpath=".//gml:name"/>
        <col xpath=".//gml:identifier"/>
        <col xpath="gml:timePosition"/>
        <col xpath="gml:timePosition/@frame"/>
      </row>
    </table>

will display name and identifier. About @frame, not sure, maybe we never had to display attributes in table so it may not be supported. Need more check

smrgeoinfo commented 6 months ago

Thanks! that is helpful and it worked. ...But leads to more questions-- ?how do I see the xml document that's actually being processed--the one with all the geonet: elements and other stuff inserted? How is this document generated?

fxprunayre commented 6 months ago

how do I see the xml document that's actually being processed--the one with all the geonet: elements and other stuff inserted?

You've to dump it somewhere. eg https://github.com/geonetwork/core-geonetwork/blob/main/web/src/main/webapp/xslt/ui-metadata/edit/edit.xsl#L84

<xsl:message><xsl:copy-of select="."/></xsl:message>

How is this document generated?

It is created by the Java code which parse the XSDs on startup and build the metadocument when needed.

smrgeoinfo commented 6 months ago

thanks- that works to see the mdb: metadata that's being processed. Helps alot to understand what the field defs in config-editor are workign against. Doesn't look like there's a way to access content in an attribute directly...