[GeoNetwork-devel] [GeoNetwork opensource Developer website] #1229: Geopublish button inactive if md title contains a crlf

#1229: Geopublish button inactive if md title contains a crlf
---------------------+------------------------------------------------------
Reporter: landry | Owner: geonetwork-devel@…
     Type: defect | Status: new
Priority: major | Milestone: v2.9.0
Component: General | Version: v2.8.0RC2
Keywords: |
---------------------+------------------------------------------------------
I have a metadata which title contains a crlf, ie
{{{
Espaces Naturels Sensibles -
Département du Cantal - 2013
}}}

This makes the Geopublish button inactive in the widgets edit view, and
the console prints a message such as

{{{
Timestamp: 02/26/13 16:50:45
Error: SyntaxError: unterminated string literal
Source File: http://ids-dev.craig.fr/geocat/apps/search/index_debug.html
Line: 1, Column: 60
Source Code:
', 'a6a5a793-b9d1-4351-974a-fffd20644614', 'Espaces
Naturels Sensibles -
}}}

I suppose this is because the xsl in iso19139/present/metadata-
iso19139-edit.xsl only calls escapeXMLEntities (from utils.xsl) for title

{{{
2623 <xsl:variable name="title">
2624 <xsl:apply-templates mode="escapeXMLEntities"
select="/root/gmd:MD_Metadata/gmd:identificationInfo/*/gmd:citation/gmd:CI_Citation/gmd:title/gco:CharacterString"/>
2625 </xsl:variable>
}}}

which doesnt escape/purge/removes eventual crlfs. For some reason this
blows the returned xml/javascript called when hitting the geopublish
button ? I'm trying to add the abstract/keyword to the things passed to
GeoPublisherPanel so a way to escape/fix purge crlfs and other control
codes would be appreciated.

--
Ticket URL: <http://trac.osgeo.org/geonetwork/ticket/1229&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.

#1229: Geopublish button inactive if md title contains a crlf
---------------------+------------------------------------------------------
Reporter: landry | Owner: geonetwork-devel@…
     Type: defect | Status: new
Priority: major | Milestone: v2.9.0
Component: General | Version: v2.8.0RC2
Keywords: |
---------------------+------------------------------------------------------

Comment(by landry):

A workaround is to add the following template to xsl/utils.xsl in the
escapeXMLEntities template :

{{{
                           <xsl:call-template name="replaceString">
                                   <xsl:with-param name="expr"
select="$e4"/>
                                   <xsl:with-param name="pattern"
select="'&#10;'"/>
                                   <xsl:with-param name="replacement"
select="'\\n'"/>
                           </xsl:call-template>

}}}
With that, the title string is properly passed to the GeoPublishPanel.

That's quite a hack - but anyway, the title needs to be sanitized from
control chars.

--
Ticket URL: <http://trac.osgeo.org/geonetwork/ticket/1229#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.

#1229: Geopublish button inactive if md title contains a crlf
---------------------+------------------------------------------------------
Reporter: landry | Owner: geonetwork-devel@…
     Type: defect | Status: new
Priority: major | Milestone: v2.8.1
Component: General | Version: v2.8.0RC2
Keywords: |
---------------------+------------------------------------------------------
Changes (by ianwallen):

  * milestone: v2.9.0 => v2.8.1

Comment:

Commit in master 0df3a20946e75ff3122a870c8f82d680884cf4fe

Ticket #1232 depends on this request - it still needs to be cherry picked
to the 2.8 branch before closing the ticket.

--
Ticket URL: <http://trac.osgeo.org/geonetwork/ticket/1229#comment:2&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.

#1229: Geopublish button inactive if md title contains a crlf
----------------------+-----------------------------------------------------
  Reporter: landry | Owner: geonetwork-devel@…
      Type: defect | Status: closed
  Priority: major | Milestone: v2.8.1
Component: General | Version: v2.8.0RC2
Resolution: fixed | Keywords:
----------------------+-----------------------------------------------------
Changes (by ianwallen):

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

Comment:

Commit in 2.8 branch 64b8042bbbcc0c1a97b293b7b55e85bcea7c7fb5

--
Ticket URL: <http://trac.osgeo.org/geonetwork/ticket/1229#comment:3&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.