Hi Wolfgang,
Hmm - a little bit involved but you will be getting uuids of the records inserted back from you the csw transaction insert. You are also going to have to record the session cookie that comes back from the xml.user.login service. With the session cookie added to your requests you could then:
1. use the service portal.search.present with uuid parameter to return info on the inserted record. You would need to extract the integer id (which comes from metadata table) of the metadata perhaps using the xpath //geonet:info/id from the xml returned by this service
2. having previously used xml.info?type=groups to get a list of groups and xml.info?type=operations to get a list of operations from GeoNetwork, use the service metadata.admin to set groups and operations on/off:
eg. http://localhost:8080/geonetwork/srv/en/metadata.admin?id=27&_1_0=off&_1_1=on
slightly arcane but in this example the numbers _1_0 decode as group id 1, operation 0 (=publish) and id=27 is metadata in the metadata table with id of 27 (see step 1).
Alternatively you could ignore the csw transaction stuff and upload your metadata by building a mef zip archive and then uploading the mef zip archive to the service mef.import - the mef zip archive has a metadata.xml file in it (the metadata) and an info.xml file which has things like permissions in it. This seems to be the only path that can be used if you are uploading/inserting metadata with thumbnails or file based online resources.
I think we should open a ticket on all services to accept a uuid or an internal integer id - saves having to shuffle between uuids and internal ids in the client.
If you only have a few different permissions permutations to set then perhaps you could do it by inserting them all, doing a search, selecting all relevant records and then using the 'Update privileges' action from the 'Actions on selected set' dropdown in the search results to set permissions/privileges on all selected records.
Cheers,
Simon
________________________________________
From: Wolfgang Grunberg [wgrunberg@anonymised.com]
Sent: Wednesday, 28 October 2009 4:34 AM
To: geonetwork-devel@lists.sourceforge.net
Subject: Re: [GeoNetwork-devel] Automatic GeoNetwork privilege assignments to CSW insert transactions?
Hi Sarah,
I am submitting CSW insert transactions (XML) through HTTP Posts to GN's CSW service as part of our metadata extract and transform pipeline (Python and XSLT). Through this listserv's help, we figured out how to login to GN through a Post but I don't know how to set permissions for the inserted metadata records.
I could load the data into an other metadata server (deegree) and then have GN harvest from it but I rather not
Ciao, Wolfgang
_______________________________
Wolfgang Grunberg
Arizona Geological Survey
wgrunberg@anonymised.com<mailto:wgrunberg@anonymised.com>
520-770-3500
Sarah_S wrote:
Hi,
perhaps I misunderstood but you can set privilegs to different groups at the
harvesting management.
best regards
Sarah
wgrunberg wrote:
How can I automatically assign GeoNetwork privileges for metadata
entered through CSW insert transactions?
I am loading our metadata (thousands of records) on GeoNetwork 2.4.2
through CSW insert transactions at the end of our ETL chain. By default,
nobody but the admin has access to the new metadata records and I have
to go in and assign permission manually.
Ciao, Wolfgang
--
_______________________________
Wolfgang Grunberg
Arizona Geological Survey
wgrunberg@anonymised.com<mailto:wgrunberg@anonymised.com>
520-770-3500
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
_______________________________________________
GeoNetwork-devel mailing list
GeoNetwork-devel@lists.sourceforge.net<mailto:GeoNetwork-devel@anonymised.comforge.net>
GeoNetwork OpenSource is maintained at