[GeoNetwork-devel] Migrating the MCP-1.4 plugin to GN3.6

Hi,

We are in the process of updating the MCP-1.4 metadata plugin to work in GN
3.6. We are a long way there but are having a difficult time getting a deep
understanding of how the metadata plugins should be properly structured.

We have the plugin now harvesting, editing and creating metadata in the
19139.mcp-1.4 profile. The remaining major issue is that the "Full"
(advanced) view is not portraying the metadata properly. We want this to
display similar to a standard 19139 record with tabs and such. But it
displays as a flat view and many of the element names are not localised.

Any pointers on how we should proceed?

Cheers,
Byron Cochrane
OpenWork Ltd
Nelson NZ

--
Sent from: http://osgeo-org.1560.x6.nabble.com/GeoNetwork-developer-f3874395.html

Hi Bryon,

First, a caveat - my experience is mostly with GN 3.4, so I might be slightly off base on some of these - but a quick glance appears to indicate the core pieces are still correct.

In my recollection, getting the metadata ‘full’ view working requires changing the plugin’s default java packages (https://github.com/geonetwork/core-geonetwork/tree/3.6.x/schemas/iso19139/src/main/java/org/fao/geonet/schema/iso19139), the config-spring-geonetwork file (https://github.com/geonetwork/core-geonetwork/blob/3.6.x/schemas/iso19139/src/main/resources/config-spring-geonetwork.xml), and the groovy files (https://github.com/geonetwork/core-geonetwork/tree/3.6.x/schemas/iso19139/src/main/plugin/iso19139/formatter/groovy/iso19139).

In the packages, add a declaration for your mcp namespace (and any other custom namespaces), and change any lingering references to gmd namespace elements that were moved to mcp. Also change the package name to reduce confusion. The package name cannot contain any periods, as it has to be a canonical java package name. So you would probably want to use something like 19139_mcp_v1_4 or 19139mcp14 instead.

In the config-spring-geonetwork file change the bean class to point to your new package.

In the groovy files, change references to things that are supposed to be in the mcp namespace (e.g., in Handlers, make sure to change the RootEl). If any of your fields contain custom data ‘types’ beyond the core gco ones, you’ll need to add a new Handler (or modify an existing one) for them. For example, when I was working on a Darwin Core plugin, the fact that Darwin Core text fields don’t use gco:CharacterString to package text led to me adding a new Handler. From a glance at the mcp1.4 schema I don’t think this is the case, but I figured I should warn you anyways.

As to the localization issue - you probably already have your labels.xml file updated? If so, I suspect that updating the java packge info might help here as well. Also check your logs to make sure the language is being detected correctly - usually there’s a warning when a language code can’t be read.

Hope this helps!

Kim

···

From: ByronCinNZ <byron@…1263…>
Sent: 09 May 2019 23:50
To: geonetwork-devel@lists.sourceforge.net
Subject: [GeoNetwork-devel] Migrating the MCP-1.4 plugin to GN3.6

Hi,

We are in the process of updating the MCP-1.4 metadata plugin to work in GN
3.6. We are a long way there but are having a difficult time getting a deep
understanding of how the metadata plugins should be properly structured.

We have the plugin now harvesting, editing and creating metadata in the
19139.mcp-1.4 profile. The remaining major issue is that the “Full”
(advanced) view is not portraying the metadata properly. We want this to
display similar to a standard 19139 record with tabs and such. But it
displays as a flat view and many of the element names are not localised.

Any pointers on how we should proceed?

Cheers,
Byron Cochrane
OpenWork Ltd
Nelson NZ


Sent from: http://osgeo-org.1560.x6.nabble.com/GeoNetwork-developer-f3874395.html


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

Thanks Kim,

I think this is getting me somewhere, but the full view with tabs (like in
iso19139) is still not displaying correctly. I am still only getting a
single page list of elements. I fear that I am bypassing the calls to do
this correctly. Perhaps you could share some of the files you mentioned for
Darwin Core example. Here is what I did for the java files you mentioned:

ISO19139mcp14Namespaces.java
<http://osgeo-org.1560.x6.nabble.com/file/t191267/ISO19139mcp14Namespaces.java&gt;
ISO19139mcp14SchemaPlugin.java
<http://osgeo-org.1560.x6.nabble.com/file/t191267/ISO19139mcp14SchemaPlugin.java&gt;

Thanks again for your help.

Cheers,
Byron

--
Sent from: http://osgeo-org.1560.x6.nabble.com/GeoNetwork-developer-f3874395.html

Hi Byron,

Sorry for getting your name wrong last time. I’m way too used to “Brian” and that sort of thing…

We’re not quite ready for public release (of our schema, plugin, etc.) yet - when we are, we’ll have a public GitLab repository where all the files will be visible. At that time I’ll be able to send you some of our files to view. Your java files look good to me, from comparing them to ours, however.

Have you updated the groovy files? If so, my next suggestion would be to try and update elements in the plugin/iso19139_mcp/present/ folder (https://github.com/geonetwork/core-geonetwork/tree/master/schemas/iso19139/src/main/plugin/iso19139/present) or the view.xsl file (in /formatter/xsl-view/ - https://github.com/geonetwork/core-geonetwork/blob/master/schemas/iso19139/src/main/plugin/iso19139/formatter/xsl-view/view.xsl). Unfortunately I don’t remember which was more effective in getting the viewer working correctly.

Hope these suggestions help somewhat. Sorry again for getting your name wrong,

Kim

···

From: ByronCinNZ byron@anonymised.com
Sent: 13 May 2019 04:05
To: geonetwork-devel@lists.sourceforge.net
Subject: Re: [GeoNetwork-devel] Migrating the MCP-1.4 plugin to GN3.6

Thanks Kim,

I think this is getting me somewhere, but the full view with tabs (like in
iso19139) is still not displaying correctly. I am still only getting a
single page list of elements. I fear that I am bypassing the calls to do
this correctly. Perhaps you could share some of the files you mentioned for
Darwin Core example. Here is what I did for the java files you mentioned:

ISO19139mcp14Namespaces.java
<http://osgeo-org.1560.x6.nabble.com/file/t191267/ISO19139mcp14Namespaces.java>
ISO19139mcp14SchemaPlugin.java
<http://osgeo-org.1560.x6.nabble.com/file/t191267/ISO19139mcp14SchemaPlugin.java>

Thanks again for your help.

Cheers,
Byron


Sent from: http://osgeo-org.1560.x6.nabble.com/GeoNetwork-developer-f3874395.html


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

Thanks Kim for all the help.

Here are my Groovy files:
Functions.groovy
<http://osgeo-org.1560.x6.nabble.com/file/t191267/Functions.groovy&gt;
Handlers.groovy
<http://osgeo-org.1560.x6.nabble.com/file/t191267/Handlers.groovy&gt;
Matchers.groovy
<http://osgeo-org.1560.x6.nabble.com/file/t191267/Matchers.groovy&gt;
SummaryFactory.groovy
<http://osgeo-org.1560.x6.nabble.com/file/t191267/SummaryFactory.groovy&gt;

I only did minimal changes for now.
Please let me know if you think I overlooked anything.

Cheers,
Byron

--
Sent from: http://osgeo-org.1560.x6.nabble.com/GeoNetwork-developer-f3874395.html

Hi Byron,

I’m not seeing any issues in your .groovy files compared to ours. Have you updated the full_view/view.groovy file to point to iso19139mcp14 as well?

I guess the next step is to look in the /present/ folder and the view.xsl file. Both (by default) make references to gmd:MD_Metadata, which would need to be updated for your plugin. Sorry I can’t be more specific at this time - I don’t yet have a full understanding of which file is relevant for which view - my gut reaction is that view.xsl is for the editor more than the viewer.

Good luck,

Kim

···

From: ByronCinNZ <byron@…1263…>
Sent: 14 May 2019 01:20
To: geonetwork-devel@lists.sourceforge.net
Subject: Re: [GeoNetwork-devel] Migrating the MCP-1.4 plugin to GN3.6

Thanks Kim for all the help.

Here are my Groovy files:
Functions.groovy
<http://osgeo-org.1560.x6.nabble.com/file/t191267/Functions.groovy>
Handlers.groovy
<http://osgeo-org.1560.x6.nabble.com/file/t191267/Handlers.groovy>
Matchers.groovy
<http://osgeo-org.1560.x6.nabble.com/file/t191267/Matchers.groovy>
SummaryFactory.groovy
<http://osgeo-org.1560.x6.nabble.com/file/t191267/SummaryFactory.groovy>

I only did minimal changes for now.
Please let me know if you think I overlooked anything.

Cheers,
Byron


Sent from: http://osgeo-org.1560.x6.nabble.com/GeoNetwork-developer-f3874395.html


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

Things are running more smoothly now - but still not much joy with the Full
view.
This is what I am getting in full view:
<http://osgeo-org.1560.x6.nabble.com/file/t191267/NIWAFullview.png&gt;

I have reviewed and modified several of the files you suggested but still
nothing changes with the Full view. I did have some issues with the
directory names that my groovy code was in. I changed the path
formatter/groovy/iso19139 to formatter/groovy/iso19139mcp14 on the
assumption that this needed to match my java package name. You can view my
code for this plugin at
https://git.nzoss.org.nz/openwork/Metadata101/iso19139.mcp-1.4

Looking forward to seeing your work. We will likely have a need for it.
After this MCP-1.4 plugin, I plan on getting a eml-gbif plugin working.

Cheers,
Byron

--
Sent from: http://osgeo-org.1560.x6.nabble.com/GeoNetwork-developer-f3874395.html