[GeoNetwork-users] Recommended way to update existing metadata

Hi All,

I'm developing an script to import some metadata to a geonetwork server.
But some metadata already exist on the destination server. In such case,
the following messagem is returned: ERROR: duplicate key value violates
unique constraint "metadata_uuid_key".

I believe, I could delete (using xml.metadata.delete) the metadata and then
import it (using xml.metadata.import).

Since I'm new to geonetwork I don't know whether is it the suitable way to
do it.

Can anyone confirm to me whether is it suitable or is there another better
way to do it?

Thank you,
--
Alex Lopes Pereira

Hi Alex

The xml.metadata.insert accepts the parameter uuidAction with these values:

   - nothing (default value): uses the metadata uuid in the xml file, if
   exists throws an exception as you describe.
   - overwrite: if the uuid exists in the database, overwrites the metadata
   with the inserted one.
   - generateUUID: generates a new uuid for the metadata to be inserted.

Regards,
Jose García

On Fri, Dec 13, 2013 at 8:57 PM, Alex Lopes <alexlopespereira@anonymised.com>wrote:

Hi All,

I'm developing an script to import some metadata to a geonetwork server.
But some metadata already exist on the destination server. In such case,
the following messagem is returned: ERROR: duplicate key value violates
unique constraint "metadata_uuid_key".

I believe, I could delete (using xml.metadata.delete) the metadata and then
import it (using xml.metadata.import).

Since I'm new to geonetwork I don't know whether is it the suitable way to
do it.

Can anyone confirm to me whether is it suitable or is there another better
way to do it?

Thank you,
--
Alex Lopes Pereira

------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT
organizations don't have a clear picture of how application performance
affects their revenue. With AppDynamics, you get 100% visibility into your
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics
Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
GeoNetwork-users mailing list
GeoNetwork-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at
http://sourceforge.net/projects/geonetwork

--

* GeoCat Bridge for ArcGIS allows instant publishing of data and metadata
on GeoServer and GeoNetwork. Visit http://geocat.net
<http://geocat.net/&gt; for details. _________________________Jose
GarcíaGeoCat bvVeenderweg 13 6721 WD BennekomThe
Netherlandshttp://GeoCat.net/> *

Dear Mr. Garcia,

Some time ago you taught me how to import a MEF into geonetwork using its
xml services. Before asking about another support I would like to
contribute with my command line that did it successfully:

curl -v -u admin:admin -F file_type=mef -F uuidAction=overwrite -F
mefFile=@/home/alex/export/mef.export
http://localhost:8080/geonetwork/srv/eng/mef.import

See that I used the mef.import service instead of xml.metadata.insert, but
your instructions about the uuidAction was very usefull.

I'm using this procedure to export from one server and importing into
another. What I realized now is that the import procedure did not changed
the content of the tag gmd:URL from the metada.xml file. Then, the URL
there is pointing to the old server.

I have googled about it but found nothing. Do you know any way to fix it?
It could be at the importing procedure or even after it as a post processin
action.

Thank you very much.
--
Alex Lopes Pereira

2013-12-16 3:44 GMT-04:00 Jose Garcia <jose.garcia@anonymised.com>:

Hi Alex

The xml.metadata.insert accepts the parameter uuidAction with these
values:

   - nothing (default value): uses the metadata uuid in the xml file, if
   exists throws an exception as you describe.
   - overwrite: if the uuid exists in the database, overwrites the
   metadata with the inserted one.
   - generateUUID: generates a new uuid for the metadata to be inserted.

Regards,
Jose García

On Fri, Dec 13, 2013 at 8:57 PM, Alex Lopes <alexlopespereira@anonymised.com>wrote:

Hi All,

I'm developing an script to import some metadata to a geonetwork server.
But some metadata already exist on the destination server. In such case,
the following messagem is returned: ERROR: duplicate key value violates
unique constraint "metadata_uuid_key".

I believe, I could delete (using xml.metadata.delete) the metadata and
then
import it (using xml.metadata.import).

Since I'm new to geonetwork I don't know whether is it the suitable way to
do it.

Can anyone confirm to me whether is it suitable or is there another better
way to do it?

Thank you,
--
Alex Lopes Pereira

------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT
organizations don't have a clear picture of how application performance
affects their revenue. With AppDynamics, you get 100% visibility into your
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics
Pro!

http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
GeoNetwork-users mailing list
GeoNetwork-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at
http://sourceforge.net/projects/geonetwork

--

* GeoCat Bridge for ArcGIS allows instant publishing of data and metadata
on GeoServer and GeoNetwork. Visit http://geocat.net
<http://geocat.net/&gt; for details. _________________________Jose
GarcíaGeoCat bvVeenderweg 13 6721 WD BennekomThe
Netherlandshttp://GeoCat.net/> *

Hi Alex

Check this:

https://github.com/geonetwork/core-geonetwork/blob/2.10.x/web/src/main/webapp/WEB-INF/data/config/schema_plugins/iso19139/process/thumbnails-host-url-relocator.xsl

It's an xslt process that can be invoked to update the url prefix for the
gmd:URL elements. The header of the file contains an example of invocation,
you need to select in the search UI the metadata you want to process with
this process and invoke it from other browser window.

Regards,
Jose García

On Tue, May 6, 2014 at 10:00 PM, Alex Lopes <alexlopespereira@anonymised.com>wrote:

Dear Mr. Garcia,

Some time ago you taught me how to import a MEF into geonetwork using its
xml services. Before asking about another support I would like to
contribute with my command line that did it successfully:

curl -v -u admin:admin -F file_type=mef -F uuidAction=overwrite -F
mefFile=@/home/alex/export/mef.export
http://localhost:8080/geonetwork/srv/eng/mef.import

See that I used the mef.import service instead of xml.metadata.insert, but
your instructions about the uuidAction was very usefull.

I'm using this procedure to export from one server and importing into
another. What I realized now is that the import procedure did not changed
the content of the tag gmd:URL from the metada.xml file. Then, the URL
there is pointing to the old server.

I have googled about it but found nothing. Do you know any way to fix it?
It could be at the importing procedure or even after it as a post processin
action.

Thank you very much.
--
Alex Lopes Pereira

2013-12-16 3:44 GMT-04:00 Jose Garcia <jose.garcia@anonymised.com>:

Hi Alex

The xml.metadata.insert accepts the parameter uuidAction with these
values:

   - nothing (default value): uses the metadata uuid in the xml file, if
   exists throws an exception as you describe.
   - overwrite: if the uuid exists in the database, overwrites the
   metadata with the inserted one.
   - generateUUID: generates a new uuid for the metadata to be inserted.

Regards,
Jose García

On Fri, Dec 13, 2013 at 8:57 PM, Alex Lopes <alexlopespereira@anonymised.com>wrote:

Hi All,

I'm developing an script to import some metadata to a geonetwork server.
But some metadata already exist on the destination server. In such case,
the following messagem is returned: ERROR: duplicate key value violates
unique constraint "metadata_uuid_key".

I believe, I could delete (using xml.metadata.delete) the metadata and
then
import it (using xml.metadata.import).

Since I'm new to geonetwork I don't know whether is it the suitable way
to
do it.

Can anyone confirm to me whether is it suitable or is there another
better
way to do it?

Thank you,
--
Alex Lopes Pereira

------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT
organizations don't have a clear picture of how application performance
affects their revenue. With AppDynamics, you get 100% visibility into
your
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of
AppDynamics Pro!

http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
GeoNetwork-users mailing list
GeoNetwork-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at
http://sourceforge.net/projects/geonetwork

--

* GeoCat Bridge for ArcGIS allows instant publishing of data and metadata
on GeoServer and GeoNetwork. Visit http://geocat.net
<http://geocat.net/&gt; for details. _________________________Jose
GarcíaGeoCat bvVeenderweg 13 6721 WD BennekomThe
Netherlandshttp://GeoCat.net/> *

--

* GeoCat Bridge for ArcGIS allows instant publishing of data and metadata
on GeoServer and GeoNetwork. Visit http://geocat.net
<http://geocat.net/&gt; for details. _________________________Jose
GarcíaGeoCat bvVeenderweg 13 6721 WD BennekomThe
Netherlandshttp://GeoCat.net/> *

2014-05-07 2:42 GMT-04:00 Jose Garcia <jose.garcia@anonymised.com>:

to select in the search UI the metadata you want to process with this
process and invoke it from other browser window.

I'll try it and post the result here. Thank you very much. I'll ask my
employer to thank you too... :slight_smile:

Dear Mr. Garcia,

I'd like to share what I've done. I used the xsl template you suggested but
instead of using it within a browser I used with saxonb-xslt (available on
ubuntu packages) change the URL on a local MEF file.

Briefly, I unzipped the MEF file, used saxon-xslt to change the URL and
zipped back the files.

Here is the code for processing the file. The rest is easy and the import
procedure you taught me at the previous email.

saxonb-xslt -ext:on -s:/home/user/tmp/metadata.xml -xsl:/home/use/sync.xml

/home/user/tmp/meta.xml

Thank you very much.

Alex

2014-05-07 2:49 GMT-04:00 Alex Lopes <alexlopespereira@anonymised.com>:

2014-05-07 2:42 GMT-04:00 Jose Garcia <jose.garcia@anonymised.com>:

to select in the search UI the metadata you want to process with this

process and invoke it from other browser window.

I'll try it and post the result here. Thank you very much. I'll ask my
employer to thank you too... :slight_smile: