[GeoNetwork-devel] [GeoNetwork opensource Developer website] #613: SchemaManager autodetect defaults to defaultSchema

#613: SchemaManager autodetect defaults to defaultSchema
-------------------------+--------------------------------------------------
Reporter: jesseeichar | Owner: geonetwork-devel@…
     Type: defect | Status: new
Priority: major | Milestone: v2.6.5
Component: General | Version: v2.6.3
Keywords: |
-------------------------+--------------------------------------------------
This is a problem in some situations like MEF import because if there 2
metadata files. In my case GM03 and iso19139.che. It does not recognize
GM03 so it uses the default, then an error occurs when it tries to import
GM03.

I have a patch that adds a second parameter that is the default to use.
In all cases the current behaviour is used but MEF import has been changed
so that null is returned if the schema is not auto detected so it is
correctly handled.

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

#613: SchemaManager autodetect defaults to defaultSchema (with patch)
-------------------------+--------------------------------------------------
Reporter: jesseeichar | Owner: geonetwork-devel@…
     Type: defect | Status: new
Priority: major | Milestone: v2.6.5
Component: General | Version: v2.6.3
Keywords: |
-------------------------+--------------------------------------------------

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

#613: SchemaManager autodetect defaults to defaultSchema (with patch)
-------------------------+--------------------------------------------------
Reporter: jesseeichar | Owner: geonetwork-devel@…
     Type: defect | Status: new
Priority: major | Milestone: v2.6.5
Component: General | Version: v2.6.3
Keywords: |
-------------------------+--------------------------------------------------

Comment(by Fxp):

Not sure if this related Jesse, but in config.xml you have
                 <param name="preferredSchema" value="iso19139" />
which in your case should be probably set to
                 <param name="preferredSchema" value="iso19139.che" />

This is used by MEF import to select which XML to load (See
Importer#handleMetadataFiles).

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

#613: SchemaManager autodetect defaults to defaultSchema (with patch)
-------------------------+--------------------------------------------------
Reporter: jesseeichar | Owner: geonetwork-devel@…
     Type: defect | Status: new
Priority: major | Milestone: v2.6.5
Component: General | Version: v2.6.3
Keywords: |
-------------------------+--------------------------------------------------

Comment(by jesseeichar):

Our preferred schema is == to the defaultSchema. and if a file (in my
case GM03) does not have a schema it returns the defaultSchema. And
therefore the system thinks the file is the preferred metadata which is
simply wrong. It should return null. And probably did in a previous
version. But no longer does. My change makes this usecase work again.

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

#613: SchemaManager autodetect defaults to defaultSchema (with patch)
--------------------------+-------------------------------------------------
  Reporter: jesseeichar | Owner: geonetwork-devel@…
      Type: defect | Status: closed
  Priority: major | Milestone: v2.7.0
Component: General | Version: v2.6.3
Resolution: fixed | Keywords:
--------------------------+-------------------------------------------------
Changes (by Fxp):

  * status: new => closed
  * resolution: => fixed
  * milestone: v2.6.5 => v2.7.0

Comment:

It would be better to always return null probably ? If schema detection
failed it could be risky to import an XML with a non matching schema (that
was made long time ago when autodetection was not so flexible). At least,
we could log to warning in that case.

Committed revision 8237 (trunk).

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