Hi Timo,
On 06/18/2011 04:08 AM, Timo Proescholdt wrote:
Dear all,
it seems that Gn 2.7 trunk still has some issues with the schemaPlugins. I
get nullpointer exceptions when trying to upload a schemaPlugin I created
from the schemaPlugins directory in trunk. (for example the
iso19139.mcp-1.4 or iso19139.mcp). The reason is that there is no
"schemaLocation" in the schemaIdent, but SchemaManager.java:1070 expects
one to be there. (extractSchemaLocation(..)).
Can someone tell if the bug is in GN or the schemaPlugin? Ergo, is a
schemaLocation in schema-ident.xml mandatory and if yes, which value has
to be in there?
Mandatory - should have the official location of the schemas that describe the metadata record. NPE was caused by the lack of validation on the schema-ident.xml file (fixed in svn rev 7862).
I am hesitant to put a custom schemaLocation there, as I do not know the
repercussions.
Repercussions are that the contents of that element will be used whenever a schemaLocation attribute is required to be added to the record. For now that is in:
* metadata.show - replaces old code with hard coded schemaLocation
(and only adds it if the schemaLocation attribute doesn't already
exist in metadata)
* oaipmh - ListMetadataFormats verb (replaces the old code that was
cobbling together a link to the schema.xsd in the GeoNetwork
instance but you can still get that behaviour if you want it by
putting that link into the schemaLocation element in the
schema-ident.xml file for your schema)
The plan is to send the schemaLocation through to the updated-fixed-info.xsl file for those that want to fix this attribute in metadata records created and edited in GeoNetwork (easy but not done yet). Also, at present GeoNetwork requires the XSDs to be physically present for editing, it may be that we could read the schemas from the schemaLocation instead of distributing them with GeoNetwork.
Simon's great work on the schemaPlugins has finally made it possible to
create a WMO core profile for GN. I would very much appreciate some
comments on the following points I want to implement.
1) different XML schema
It seems I could just replace the schema.xsd and schema/ . But is this
also possible if I create a profile of iso19139, say iso19139.wmocp?
Simon's slides say that parts of the iso19139 schema can be overwritten in
a profile, so I am not sure if replacing the whole schema will work.
The major work in defining a schema for use in GeoNetwork is the presentation of the elements in XSLT. With XSLT and profiles in mind (particularly iso19139), it seemed more sensible to keep the work for the iso19139 schema presentation in the iso19139 base schema, separate from the additional elements/behaviour required by a profile (although the profile presentation can be processed in the same mode as iso19139 - see mcp for example). So the idea is that you would separate the iso19139.wmocp profile from iso19139 for ease of maintenance reasons as well as giving it an identity that indicates that it isn't iso19139.
2) make fileIdentifier editable
If I modify update-fixed-info.xsl and metadata-iso19139.xsl, removing the
sections that insert the uuid as fileIdentifier and make it impossible to
edit it respectively, I can modify the fileIdentifier, using the normal
editor. Is there any problem with this approach I might have overseen?
Unfortunately there seems to be no way to also edit the uuid (which is the
base for e.G the OAI-PMH id).
We've also had this problem come up down here. The suggestion here was that you could move the GeoNetwork uuid to a uuid attribute attached to the gmd:MD_Metadata element. This would need changes to the relevant templates of set-uuid.xsl, extract-uuid.xsl and update-fixed-info.xsl for the schema/profile - which sounds similar to what you've done but won't automatically provide the ability to refer to the record by the fileIdentifier in OAIPMH or any other method.
(On a related note I thought perhaps we could also define a new class to handle uuid generation - default behaviour would be the existing one ie. generate a type 4 random uuid. This behaviour could then be replaced/overridden with other behaviour (eg. we have a requirement to support type 1 uuids) maybe on a per schema basis as part of a plugin. Presumably this could also be implemented to use whatever process is used to generate a unique identifier for gmd:fileIdentifier in your schema?).
3) schematron.
In the MCP I see schematron rules, so I assume that support for them is
now there. Is there any documentation on how they work / can be changed /
are shown in the userinterface?
Not sure on the documentation front - can't see anything by searching the doco on but the plan is to evolve the skeletal slides on schemaPlugins into a section in the developers documentation describing plugin schemas, how they work and what is required - this would include schematrons. For the moment, you could look at the mcp schematrons which are in the schemaPlugins/trunk/schematrons and follow the same path?
4) custom templates
I would like to provide custom templates for the different WMO datatypes.
While importing templates works ok when I add a file to the normal
iso19139 templates/ directory, this seems not to work with custom
profiles.
For quick testing I copied the whole iso19139 directory, renamed it to
iso19139-wmo, changed the<name> in schema-ident.xml and
present/metadata-iso19139-wmo.xsl (also the "match" xsl values in it) and
tried to import the templates. While the UI did not show any errors and
the log showed that the files were sucessfully loaded, I was not able to
create a new MD record, because no templates were available.
<response status="true">
<iso19139-wmo>
<template name="deegree_fragment_tester.xml" status="loaded" />
<template name="geoserver_fragment_tester.xml" status="loaded" />
[..]
</iso19139-wmo>
</response>
I investigated, and saw that applying "xsl/portal-present.xsl"
Get.java:88, List list = Xml.transform(..) returns no templates, although
some were found in the search above.
Any ideas where the error might be found?
I think the templates have probably been assigned to the iso19139 schema rather than iso19139.wmo - probably because they go through the schema determining code before they get added - you'd need to make sure they identify as iso19139.wmo instead of iso19139. I know why it happens (because it's consistent with the path that all metadata passing into GeoNetwork takes) but I think perhaps this should be reported to the user so that we don't violate the 'principle of least astonishment'?
GN would get quite a lot of new users if we can create a profile for WMO
metadata, any help would thus be very much appreciated.
Let's work some more on this to make sure that we can make it happen for 2.8!
Cheers and thanks,
Simon