Opened 12 years ago

Last modified 12 years ago

#1062 new enhancement

Metadata info: version for update + id/uuid mapping.

Reported by: etj Owned by: geonetwork-devel@…
Priority: major Milestone: v2.6.5
Component: Catalog server Version: v2.6.4
Keywords: version id uuid update Cc: etj

Description

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>

Attachments (1)

metadata.info.patch (7.6 KB ) - added by etj 12 years ago.

Download all attachments as: .zip

Change History (3)

by etj, 12 years ago

Attachment: metadata.info.patch added

comment:1 by fxp, 12 years ago

To get the internal id or uuid, you could use the search service:

comment:2 by ianwallen, 12 years ago

Milestone: v2.6.4v2.6.5
Note: See TracTickets for help on using tickets.