[GeoNetwork-devel] Customising zip file export

Hi List,

How easy is it to add an additional download option for metadata
records? I have a requirement for uploading csv files and creating
metadata for them, and then I'd like to download a zip file containing
both filename.csv and the metadata in the form filename-metadata.json.

It looks as if I should be able to create a formatter that re-enables
the "related records" export option for the current mef, so I think
that covers one part of my problem, but I'm not clear how/if I can
control the output so that it includes the json file rather than the
current xml output.

Any ideas would be gratefully appreciated!

Thanks

Jo

--
Jo Cook
t:+44 7930 524 155/twitter:@archaeogeek
Please note that currently I do not work on Friday afternoons. For
urgent responses at that time, please visit
support.astuntechnology.com or phone our office on 01372 744009

--
--
*Sign up to our mailing list
<https://astuntechnology.com/company/#email-updates&gt; for updates on news,
products, conferences, events and training*
*
*

Astun Technology Ltd, 120
Manor Green Road, Epsom, Surrey, KT19 8LN, UK
t:+44 1372 744 009 w:
astuntechnology.com <http://astuntechnology.com/&gt; twitter:@astuntech
<https://twitter.com/astuntech&gt;

iShare - enterprise geographic
intelligence platform <https://astuntechnology.com/ishare/&gt;
GeoServer,
PostGIS and QGIS training <https://astuntechnology.com/training-courses/&gt;
Helpdesk and customer portal
<https://astuntech.atlassian.net/wiki/spaces/ISHAREHELP/pages/364970043/Astun+Technology+Support+Portal&gt;

Company registration no. 5410695. Registered in England and Wales.
Registered office: 120 Manor Green Road, Epsom, Surrey, KT19 8LN VAT no.
864201149.

Hi Jo

Sorry for the late reply, probably you already solved, the code to add the xml it’s here:

https://github.com/geonetwork/core-geonetwork/blob/63ff3ea4ca01d44745fed4ce0d540f7979809046/core/src/main/java/org/fao/geonet/kernel/mef/MEFExporter.java#L120

In this PR there’s some code to call a formatter from Java code:

https://github.com/fxprunayre/core-geonetwork/blob/19f6b791c49084bc161eaf0abdb67e82592930fb/services/src/main/java/org/fao/geonet/api/records/formatters/cache/FormatterCache.java#L383-L407

An option would be to extend the MEF export to send the metadata formats to output and use the for json / csv a formatter.

Regards,
Jose García

On Tue, Jan 5, 2021 at 11:48 AM Jo Cook <jocook@anonymised.com> wrote:

Hi List,

How easy is it to add an additional download option for metadata
records? I have a requirement for uploading csv files and creating
metadata for them, and then I’d like to download a zip file containing
both filename.csv and the metadata in the form filename-metadata.json.

It looks as if I should be able to create a formatter that re-enables
the “related records” export option for the current mef, so I think
that covers one part of my problem, but I’m not clear how/if I can
control the output so that it includes the json file rather than the
current xml output.

Any ideas would be gratefully appreciated!

Thanks

Jo


Jo Cook
t:+44 7930 524 155/twitter:@archaeogeek
Please note that currently I do not work on Friday afternoons. For
urgent responses at that time, please visit
support.astuntechnology.com or phone our office on 01372 744009

Sign up to our mailing list
<https://astuntechnology.com/company/#email-updates> for updates on news,
products, conferences, events and training

*
*

Astun Technology Ltd, 120
Manor Green Road, Epsom, Surrey, KT19 8LN, UK
t:+44 1372 744 009 w:
astuntechnology.com <http://astuntechnology.com/> twitter:@astuntech
<https://twitter.com/astuntech>

iShare - enterprise geographic
intelligence platform <https://astuntechnology.com/ishare/>
GeoServer,
PostGIS and QGIS training <https://astuntechnology.com/training-courses/>
Helpdesk and customer portal
<https://astuntech.atlassian.net/wiki/spaces/ISHAREHELP/pages/364970043/Astun+Technology+Support+Portal>

Company registration no. 5410695. Registered in England and Wales.
Registered office: 120 Manor Green Road, Epsom, Surrey, KT19 8LN VAT no.
864201149.


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

Vriendelijke groeten / Kind regards,

Jose García


Veenderweg 13
6721 WD Bennekom
The Netherlands
T: +31 (0)318 416664

Please consider the environment before printing this email.