#1062: Metadata info: version for update + id/uuid mapping.
------------------------------------+---------------------------------------
Reporter: etj | Owner: geonetwork-devel@…
Type: enhancement | Status: new
Priority: major | Milestone: v2.6.4
Component: Catalog server | Version: v2.6.4
Keywords: version id uuid update |
------------------------------------+---------------------------------------
1) When updating metadata programmatically there is no easy way to get the
'''metadata version number''', used by geonetwork to avoid concurrent
updates.
2) There is no way to retrieve the '''internal id''' of a metadata, given
its uuid. This may be a problem if you need to perform a programmatic
update, and all you have is the uuid.
The attached patch provides two services:
== {{{xml.metadata.info.get}}} ==
A ''guest accessible'' service which takes as query param either "id" or
"uuid", and returns both:
e.g. 1
{{{
http://localhost:8080/geonetwork/srv/it/xml.metadata.info.get?id=15
}}}
{{{
<?xml version="1.0" encoding="UTF-8"?>
<response>
<id>15</id>
<uuid>49509107-abc4-4d0a-9b83-2aa27c9f1cb8</uuid>
</response>
}}}
e.g. 2
{{{
http://localhost:8080/geonetwork/srv/it/xml.metadata.info.get?uuid=49509107-abc4
-4d0a-9b83-2aa27c9f1cb8
}}}
{{{
<?xml version="1.0" encoding="UTF-8"?>
<response>
<id>15</id>
<uuid>49509107-abc4-4d0a-9b83-2aa27c9f1cb8</uuid>
</response>
}}}
== {{{xml.metadata.info.getForUpdate}}} ==
An ''editor-accessible'' service similar to the above one, but that also
increments and return the internal metadata version number:
e.g. 3
{{{
http://localhost:8080/geonetwork/srv/it/xml.metadata.info.getForUpdate?id=15
}}}
{{{
<?xml version="1.0" encoding="UTF-8"?>
<response>
<id>15</id>
<uuid>49509107-abc4-4d0a-9b83-2aa27c9f1cb8</uuid>
<version>5</version>
</response>
}}}
e.g. 4
{{{
http://localhost:8080/geonetwork/srv/it/xml.metadata.info.getForUpdate?uuid=49509107-abc4
-4d0a-9b83-2aa27c9f1cb8
}}}
{{{
<?xml version="1.0" encoding="UTF-8"?>
<response>
<id>15</id>
<uuid>49509107-abc4-4d0a-9b83-2aa27c9f1cb8</uuid>
<version>6</version>
</response>
}}}
--
Ticket URL: <http://trac.osgeo.org/geonetwork/ticket/1062>
GeoNetwork opensource Developer website <http://sourceforge.net/projects/geonetwork/>
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.