[GeoNetwork-devel] FGDC "Online Linkage" not editable in Geonetwork?

Fellow Geonetworkers,

We're just getting started here at NOAA/NGDC with Geonetwork. We have a lot of FGDC metadata records, and we have found a problem editing them.

When displaying the metadata, "Online Linkage" is correctly shown as a clickable link. But when editing, it is still shown as a link, not a text input field. So there is no way I can find to change or add an Online Linkage to a record in Geonetwork.

I've got a simple solution to this, and would like to know if this seems right to the more experienced developers here.

======

In geonetwork/xsl/metadata-fgdc-std.xsl, 'onlink' is unconditionally displayed as an HTML anchor tag:

    <xsl:template mode="fgdc-std" match="onlink">
        ...<xsl:apply-templates mode="simpleElement" select=".">
            ...<xsl:with-param name="text">
                <a href="{.}"><xsl:value-of select="."/></a>
                 ...

When I conditionally call the "getElementText" template used for most tags, I can edit the Online Linkage as desired:

    <xsl:template mode="fgdc-std" match="onlink">
        <xsl:param name="schema"/>
        <xsl:param name="edit"/>
               <xsl:apply-templates mode="simpleElement" select=".">
            <xsl:with-param name="schema" select="$schema"/>
            <xsl:with-param name="edit" select="$edit"/>
            <xsl:with-param name="text">
                <xsl:choose>
                    <xsl:when test="$edit=false()">
                        <a href="{.}"><xsl:value-of select="."/></a>
                    </xsl:when>
                    <xsl:otherwise>
                    <xsl:call-template name="getElementText">
                        <xsl:with-param name="schema" select="$schema"/>
                        <xsl:with-param name="edit" select="$edit"/>
                        <xsl:with-param name="rows" select="1"/>
                    </xsl:call-template>
                    </xsl:otherwise>
                </xsl:choose>
            </xsl:with-param>
        </xsl:apply-templates>

Does this seem the right way to do it?

Shall I get Subversion commit rights and submit this, so the fix is available in 2.3?

Thanks much!
--Rich

--

Richard Fozzard, Computer Scientist
  Geospatial Metadata at NGDC: http://www.ngdc.noaa.gov/metadata

Cooperative Institute for Research in Environmental Sciences (CIRES)
Univ. Colorado & NOAA National Geophysical Data Center, Enterprise Data Systems 325 S. Broadway, Skaggs 1B-305, Boulder, CO 80305
Office: 303-497-6487, Cell: 303-579-5615, Email: richard.fozzard@anonymised.com

Hi Richard,

John Kozimor from NOAA reported a bug in fgdc editing of the online linkage a few weeks ago - I fixed that bug and the one you've highlighted below a few days afterwards and copied a response to both John and geonetwork-devel - see rev 1530 and 1531 in the subversion repository. So it should already be there as part of both the trunk and the bugfix branch. Your solution looks good to me!

On another issue: Is anyone at NOAA/NGDC (or elsewhere) interested in having GeoNetwork support DIF? A local DIF guru (not me) has written an xslt to convert DIF to ISO and I'm wondering what interest there is and how far we go with DIF support in GeoNetwork.

Cheers and thanks!
Simon
________________________________________
From: Richard Fozzard [Richard.Fozzard@anonymised.com]
Sent: Thursday, 9 October 2008 11:30 AM
To: geonetwork-devel@lists.sourceforge.net
Subject: [GeoNetwork-devel] FGDC "Online Linkage" not editable in Geonetwork?

Fellow Geonetworkers,

We're just getting started here at NOAA/NGDC with Geonetwork. We have a
lot of FGDC metadata records, and we have found a problem editing them.

When displaying the metadata, "Online Linkage" is correctly shown as a
clickable link. But when editing, it is still shown as a link, not a
text input field. So there is no way I can find to change or add an
Online Linkage to a record in Geonetwork.

I've got a simple solution to this, and would like to know if this seems
right to the more experienced developers here.

======

In geonetwork/xsl/metadata-fgdc-std.xsl, 'onlink' is unconditionally
displayed as an HTML anchor tag:

    <xsl:template mode="fgdc-std" match="onlink">
        ...<xsl:apply-templates mode="simpleElement" select=".">
            ...<xsl:with-param name="text">
                <a href="{.}"><xsl:value-of select="."/></a>
                 ...

When I conditionally call the "getElementText" template used for most
tags, I can edit the Online Linkage as desired:

    <xsl:template mode="fgdc-std" match="onlink">
        <xsl:param name="schema"/>
        <xsl:param name="edit"/>

        <xsl:apply-templates mode="simpleElement" select=".">
            <xsl:with-param name="schema" select="$schema"/>
            <xsl:with-param name="edit" select="$edit"/>
            <xsl:with-param name="text">
                <xsl:choose>
                    <xsl:when test="$edit=false()">
                        <a href="{.}"><xsl:value-of select="."/></a>
                    </xsl:when>
                    <xsl:otherwise>
                    <xsl:call-template name="getElementText">
                        <xsl:with-param name="schema" select="$schema"/>
                        <xsl:with-param name="edit" select="$edit"/>
                        <xsl:with-param name="rows" select="1"/>
                    </xsl:call-template>
                    </xsl:otherwise>
                </xsl:choose>
            </xsl:with-param>
        </xsl:apply-templates>

Does this seem the right way to do it?

Shall I get Subversion commit rights and submit this, so the fix is
available in 2.3?

Thanks much!
--Rich

--

Richard Fozzard, Computer Scientist
  Geospatial Metadata at NGDC: http://www.ngdc.noaa.gov/metadata

Cooperative Institute for Research in Environmental Sciences (CIRES)
Univ. Colorado & NOAA National Geophysical Data Center, Enterprise Data Systems
325 S. Broadway, Skaggs 1B-305, Boulder, CO 80305
Office: 303-497-6487, Cell: 303-579-5615, Email: richard.fozzard@anonymised.com

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
GeoNetwork-devel mailing list
GeoNetwork-devel@lists.sourceforge.net

GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork

Simon.Pigot@anonymised.com said the following on 10/08/2008 07:32 PM:

Hi Richard,

John Kozimor from NOAA reported a bug in fgdc editing of the online linkage a few weeks ago - I fixed that bug and the one you've highlighted below a few days afterwards and copied a response to both John and geonetwork-devel - see rev 1530 and 1531 in the subversion repository. So it should already be there as part of both the trunk and the bugfix branch. Your solution looks good to me!
  

The bug John Kozimor reported was somewhat different from the one I'm reporting: If a record had <onlink> child elements within <metextns>, the Edit page would generate a ClassCastException.

Once we got past that (we fixed it ourselves before seeing your fix), we saw that Online Linkage was not an editable field; it was simply displayed as link. This is true regardless of where the <onlink> element appears, i.e. also within a Citation.

Now, after looking at the Subversion revision you mention, I see that you fixed my bug, too, in pretty much the same way I did. (I saw your response to John, but that didn't mention this second bug.)

Nice work! If only my car mechanic would work like this, fixing even more than I asked for. :slight_smile:

On another issue: Is anyone at NOAA/NGDC (or elsewhere) interested in having GeoNetwork support DIF? A local DIF guru (not me) has written an xslt to convert DIF to ISO and I'm wondering what interest there is and how far we go with DIF support in GeoNetwork.
  

We at NOAA/NGDC worked with NASA to write an FGDC to DIF xslt that we might be able to contribute (I'm not sure about the legalities involved.) An ISO to DIF xslt might be similar, and might be useful for exporting to DIF.

But I'm guessing that the better way to support DIF is to provide a complete "schema" to include in the xml/schemas/ directory. We don't generate DIF here (except for harvesting to NASA GCMD), so don't have a need for this ourselves. We have gotten more familiar with Geonetwork schemas while adding FGDC RSE extensions (hence our <metextns> issue!), and might be able to help if someone does want a DIF schema.

Thanks for the help!
--Rich

Cheers and thanks!
Simon
________________________________________
From: Richard Fozzard [Richard.Fozzard@anonymised.com]
Sent: Thursday, 9 October 2008 11:30 AM
To: geonetwork-devel@lists.sourceforge.net
Subject: [GeoNetwork-devel] FGDC "Online Linkage" not editable in Geonetwork?

Fellow Geonetworkers,

We're just getting started here at NOAA/NGDC with Geonetwork. We have a
lot of FGDC metadata records, and we have found a problem editing them.

When displaying the metadata, "Online Linkage" is correctly shown as a
clickable link. But when editing, it is still shown as a link, not a
text input field. So there is no way I can find to change or add an
Online Linkage to a record in Geonetwork.

I've got a simple solution to this, and would like to know if this seems
right to the more experienced developers here.

======

In geonetwork/xsl/metadata-fgdc-std.xsl, 'onlink' is unconditionally
displayed as an HTML anchor tag:

    <xsl:template mode="fgdc-std" match="onlink">
        ...<xsl:apply-templates mode="simpleElement" select=".">
            ...<xsl:with-param name="text">
                <a href="{.}"><xsl:value-of select="."/></a>
                 ...

When I conditionally call the "getElementText" template used for most
tags, I can edit the Online Linkage as desired:

    <xsl:template mode="fgdc-std" match="onlink">
        <xsl:param name="schema"/>
        <xsl:param name="edit"/>

        <xsl:apply-templates mode="simpleElement" select=".">
            <xsl:with-param name="schema" select="$schema"/>
            <xsl:with-param name="edit" select="$edit"/>
            <xsl:with-param name="text">
                <xsl:choose>
                    <xsl:when test="$edit=false()">
                        <a href="{.}"><xsl:value-of select="."/></a>
                    </xsl:when>
                    <xsl:otherwise>
                    <xsl:call-template name="getElementText">
                        <xsl:with-param name="schema" select="$schema"/>
                        <xsl:with-param name="edit" select="$edit"/>
                        <xsl:with-param name="rows" select="1"/>
                    </xsl:call-template>
                    </xsl:otherwise>
                </xsl:choose>
            </xsl:with-param>
        </xsl:apply-templates>

Does this seem the right way to do it?

Shall I get Subversion commit rights and submit this, so the fix is
available in 2.3?

Thanks much!
--Rich

--

Richard Fozzard, Computer Scientist
  Geospatial Metadata at NGDC: http://www.ngdc.noaa.gov/metadata

Cooperative Institute for Research in Environmental Sciences (CIRES)
Univ. Colorado & NOAA National Geophysical Data Center, Enterprise Data Systems
325 S. Broadway, Skaggs 1B-305, Boulder, CO 80305
Office: 303-497-6487, Cell: 303-579-5615, Email: richard.fozzard@anonymised.com

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
GeoNetwork-devel mailing list
GeoNetwork-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-devel
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork