[GeoNetwork-devel] [GeoNetwork opensource Developer website] #1026: Supplied Configuration Override files do not work on Windows

#1026: Supplied Configuration Override files do not work on Windows
---------------------+------------------------------------------------------
Reporter: murrayh | Owner: geonetwork-devel@…
     Type: defect | Status: new
Priority: major | Milestone: v2.9.0
Component: General | Version: v2.8.0RC0
Keywords: |
---------------------+------------------------------------------------------
Hello,

The regular expressions used in included configuration override files
(also a problem in ANZMEST) do not match Windows paths.

So, when GeoNetwork/ANZMEST is deployed on Windows, the configuration
overrides will not take effect.

This problem can be fixed by changing '/' directory separator characters
to the '[/\\]' character set in the regular expressions in the override
files themselves.

Cheers,
Murray

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

#1026: Supplied Configuration Override files do not work on Windows
---------------------+------------------------------------------------------
Reporter: murrayh | Owner: geonetwork-devel@…
     Type: defect | Status: new
Priority: major | Milestone: v2.9.0
Component: General | Version: v2.8.0RC0
Keywords: |
---------------------+------------------------------------------------------

Comment(by awalsh):

Hello Murray,

I have been testing Geonetwork/ANZMEST in Windows XP environment too.

I assume you are talking about the web/geonetwork/WEB-INF/anzmest-config-
overides.xml file.

When geonetwork starts up it looks like the config. overrides are being
applied OK to files userprofiles.xml, config-lucene.xml and config-
summary.xml i.e geonetwork.log says:

2012-08-27 15:25:25,593 INFO [jeeves] - Overrides being applied to
configuration file: .*WEB-INF/user-profiles\.xml

2012-08-27 15:25:25,593 INFO [jeeves] - Adding xml elements to
profile[@name='Editor']
2012-08-27 15:25:25,609 DEBUG [jeeves] - Elements added are:<toAdd>
   <allow service="metadata.creativecommons.form" />
   <allow service="metadata.creativecommons.set" />
.....

2012-08-27 15:25:25,625 INFO [jeeves.apphand] - Overriding mime-mappings
property (was set to ..\web\geonetwork\WEB-INF\mime-types.properties)
2012-08-27 15:25:25,625 INFO [jeeves.apphand] - mime-mappings property
set to C:\ANZMEST_SVN9275\web\geonetwork\WEB-INF\mime-types.properties

......

2012-08-27 15:25:29,890 INFO [jeeves] - Overrides being applied to
configuration file: .*WEB-INF/config-lucene\.xml

2012-08-27 15:25:29,890 INFO [jeeves] - Adding xml elements to
fieldSpecificAnalyzer
2012-08-27 15:25:29,906 DEBUG [jeeves] - Elements added are:<toAdd>
   <Field name="taxon"
analyzer="org.fao.geonet.kernel.search.GeoNetworkAnalyzer" />
   <Field name="credit"
analyzer="org.fao.geonet.kernel.search.GeoNetworkAnalyzer" />
   <Field name="dataparam"
analyzer="org.fao.geonet.kernel.search.GeoNetworkAnalyzer" />
</toAdd>

....
2012-08-27 15:25:30,265 INFO [jeeves] - Overrides being applied to
configuration file: .*WEB-INF/config-summary\.xml

2012-08-27 15:25:30,265 INFO [jeeves] - Adding xml elements to def
2012-08-27 15:25:30,265 DEBUG [jeeves] - Elements added are:<toAdd>
   <dataparams>
     <item name="dataparam" plural="dataparams" indexKey="dataparam"
order="freq" type="string" max="100" />
   </dataparams>
   <taxon>
     <item name="taxon" plural="taxons" indexKey="taxon" order="freq"
type="string" max="100" />
   </taxon>

I thought the UNIX style forward slash '/' path seperators worked
OK Windows and we don't need to change them to windows style
back-slash '\' Am I missing something here?

This makes me wonder is this issue causing some ANZMEST specific services
to
not work e.g as I reported in ticket
http://trac.osgeo.org/geonetwork/ticket/1014
(xml_iso19139.mcp and xml_iso19139.mcp-1.4 services not working).

Simon,

Any thoughts on this?

Regards,

Andrew

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

#1026: Supplied Configuration Override files do not work on Windows
---------------------+------------------------------------------------------
Reporter: murrayh | Owner: geonetwork-devel@…
     Type: defect | Status: new
Priority: major | Milestone: v2.9.0
Component: General | Version: v2.8.0RC0
Keywords: |
---------------------+------------------------------------------------------

Comment(by murrayh):

Hi Andrew,

It's not that forward-slash separators don't work OK in Java running on
Windows (they do).

When you enable DEBUG logging, there is a line that says something like:

Loading : C:\geonetwork\WEB-INF\config.xml

So, in the Java code, the configuration filename variable is a complete
path that contains back-slash characters. The regular rexpression:

.*WEB-INF/config\.xml

does not match against that configuration filename variable. So the
override specified by that regular expression does not get applied.

One possible fix is to change the regular expression to:

.*WEB-INF[\\/]config\.xml

(which is what I did).

Cheers,
Murray

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