thanks for your answer, but i still have problems with the API : all the requests lead to the same result !
thanks in advance for your help.
Ernest.
Hi
In current version there's a mix of "old" services using Jeeves engine (the ones using /srv/) and new API services that use /api/.
Old services are mark in the source code as @Deprecated and will be removed in next versions. Afaik in 3.4.x (next version) will be still available, but when released the following one (3.6 or whatever name it gets) most probably will be removed.
The plan is to migrate all services to the new API.
You can check/test current services in http://localhost:8080/geonetwork/doc/api/
Regards,
Jose García
On Mon, Oct 2, 2017 at 12:12 PM, Chiarello Ernest <Ernest.Chiarello@anonymised.com <mailto:Ernest.Chiarello@anonymised.com>> wrote:
oups, it seems that the string SRV should not be used !
localhost:8080/geonetwork/srv/cswis correct :
>>> urllib2.urlopen("http://localhost:8080/geonetwork/srv/csw
<http://localhost:8080/geonetwork/srv/csw>"\).read()
'<!DOCTYPE html\n SYSTEM "html">\n<html ng-app="gn_login"
lang="eng" id="ng-app">\n <head>\n <meta
http-equiv="Content-Type" content="text/html; <title>My GeoNetwork
catalogue - My organization</title>\n <meta
charset="utf-8">\n <meta name="viewport"
content="initial-scale=1.0, user-scalable=no">\n <meta
name="apple-mobile-web-app-capable" content="yes">\n <meta
name="description" content="">\n <meta name="keywords"
content="">\n <link rel="icon" sizes="16x16 32x32 48x48"
type="image/png" href="../../images/logos/favicon.png">\n <link
href="rss.search?sortBy=changeDate" rel="alternate"
type="application/rss+xml" title="My GeoNetwork catalogue - My
organization">\n <link href="portal.opensearch" rel="search"
type="application/opensearchdescription+xml" title="My GeoNetwork
catalogue - My organization">\n <link
href="/geonetwork/static/gn_login_default.css" rel="stylesheet"
media="screen">\n <link
href="/geonetwork/static/bootstrap-table.min.css" rel="stylesheet"
media="screen">\n <link href="/geonetwork/static/ng-skos.css"
rel="stylesheet" media="screen">\n <link
href="/geonetwork/static/srv_custom_style.css" rel="stylesheet"
media="screen">\n </head>\n <body
data-ng-controller="GnCatController">\n <div class="navbar
navbar-default gn-top-bar" data-ng-hide="layout.hideTopToolBar"
data-ng-include="\'../../catalog/templates/top-toolbar.html\'"></div>\n
<div
data-ng-include="\'../../catalog/templates/signin.html\'"></div>\n
<div
ng-include="\'../../catalog/templates/info.html\'"></div><script
src="/geonetwork/static/lib.js"></script><script
src="/geonetwork/static/gn_login.js"></script><noscript>\n <div
class="alert" data-ng-hide=""><strong></strong> \n </div>\n
</noscript>\n </body>\n</html>'
but localhost:8080/geonetwork/srv/api/0.1/usersis not correct.
>>>
urllib2.urlopen("http://localhost:8080/geonetwork/srv/api/0.1/users
<http://localhost:8080/geonetwork/srv/api/0.1/users>"\).read()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/urllib2.py", line 154, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib/python2.7/urllib2.py", line 435, in open
response = meth(req, response)
File "/usr/lib/python2.7/urllib2.py", line 548, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python2.7/urllib2.py", line 473, in error
return self._call_chain(*args)
File "/usr/lib/python2.7/urllib2.py", line 407, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/urllib2.py", line 556, in
http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 406: Not Acceptable
remove "srv", and it works fine !
>>>
urllib2.urlopen("http://localhost:8080/geonetwork/api/0.1/users
<http://localhost:8080/geonetwork/api/0.1/users>"\).read()
'<!DOCTYPE html\n SYSTEM "html">\n<html ng-app="gn_login"
lang="eng" id="ng-app">\n <head>\n <meta
http-equiv="Content-Type" content="text/html; charset=UTF-8">\n
<title>My GeoNetwork catalogue - My organization</title>\n <meta
charset="utf-8">\n <meta name="viewport"
content="initial-scale=1.0, user-scalable=no">\n <meta
name="apple-mobile-web-app-capable" content="yes">\n <meta
name="description" content="">\n <meta name="keywords"
content="">\n <link rel="icon" sizes="16x16 32x32 48x48"
type="image/png" href="../../images/logos/favicon.png">\n <link
href="rss.search?sortBy=changeDate" rel="alternate"
type="application/rss+xml" title="My GeoNetwork catalogue - My
organization">\n <link href="portal.opensearch" rel="search"
type="application/opensearchdescription+xml" title="My GeoNetwork
catalogue - My organization">\n <link
href="/geonetwork/static/gn_login_default.css" rel="stylesheet"
media="screen">\n <link
href="/geonetwork/static/bootstrap-table.min.css" rel="stylesheet"
media="screen">\n <link href="/geonetwork/static/ng-skos.css"
rel="stylesheet" media="screen">\n <link
href="/geonetwork/static/srv_custom_style.css" rel="stylesheet"
media="screen">\n </head>\n <body
data-ng-controller="GnCatController">\n <div class="navbar
navbar-default gn-top-bar" data-ng-hide="layout.hideTopToolBar"
data-ng-include="\'../../catalog/templates/top-toolbar.html\'"></div>\n
<div
data-ng-include="\'../../catalog/templates/signin.html\'"></div>\n
<div
ng-include="\'../../catalog/templates/info.html\'"></div><script
src="/geonetwork/static/lib.js"></script><script
src="/geonetwork/static/gn_login.js"></script><noscript>\n <div
class="alert" data-ng-hide=""><strong></strong> \n </div>\n
</noscript>\n </body>\n</html>'
sorry for the noise...
Ernest.
Le 02/10/2017 à 10:53, Chiarello Ernest a écrit :
Hello all,
as i do not know yet how to use the geonetwork API, i use the
owslib library in order to send data to geonetwork. but
metadata are not public, and i need to change the acces
permissions with the admin console
https://my_geonetwork_url/geonetwork/srv/fre/catalog.edit#/board
<https://my_geonetwork_url/geonetwork/srv/fre/catalog.edit#/board>
it is also possible to change acces permissions with the
following PostgreSQL queries, observed in the postgresql logs :
LOG: execute S_14: insert into geonetwork.OperationAllowed
(groupId, metadataId, operationId) values ($1, $2, $3)
DETAIL: parameters: $1 = '1', $2 = '410', $3 = '5'
LOG: execute S_14: insert into geonetwork.OperationAllowed
(groupId, metadataId, operationId) values ($1, $2, $3)
DETAIL: parameters: $1 = '1', $2 = '410', $3 = '0'
LOG: execute S_14: insert into geonetwork.OperationAllowed
(groupId, metadataId, operationId) values ($1, $2, $3)
DETAIL: parameters: $1 = '1', $2 = '410', $3 = '1'
my questions :
- is it possible to do that with the REST API of geonetwork ?
- it is possible to send data to geonetwork with its API ?
at the moment, i did not succeed when i tried to use this API.
it is here to find the documentation, for example here :
https://csw-nerc.ceda.ac.uk/geonetwork/doc/api/#!/csw/addVirtualCsw
<https://csw-nerc.ceda.ac.uk/geonetwork/doc/api/#!/csw/addVirtualCsw>
but i only get HTML errors with the HttpRequester plugin of
Mozilla :
GET http://localhost:8080/geonetwork/srv/api/0.1/me
<http://localhost:8080/geonetwork/srv/api/0.1/me> -> error 406
GET http://localhost:8080/geonetwork/srv/api/0.1/search/ping
<http://localhost:8080/geonetwork/srv/api/0.1/search/ping> ->
error 406
any help would be appreciated.
Ernest.
-- Ernest CHIARELLO - Ernest.Chiarello@anonymised.com
<mailto:Ernest.Chiarello@anonymised.com>
UMR6049 ThéMA - Théoriser et Modéliser pour Amé
<https://maps.google.com/?q=éMA+-+Théoriser+et+Modéliser+pour+Amé&entry=gmail&source=g>nager
CNRS / université de Bourgogne Franche-Comté
32 rue Mégevand 25030 BESANÇON Cedex
Tel : 03 81 66 53 66 Mob : 07 82 99 11 08
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
GeoNetwork-users mailing list
GeoNetwork-users@lists.sourceforge.net
<mailto:GeoNetwork-users@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
<https://lists.sourceforge.net/lists/listinfo/geonetwork-users>
GeoNetwork OpenSource is maintained at
http://sourceforge.net/projects/geonetwork
<http://sourceforge.net/projects/geonetwork>
--
***
Vriendelijke groeten / Kind regards,
Jose García
<http://www.geocat.net/>
Veenderweg 13
6721 WD Bennekom
The Netherlands
T: +31 (0)318 416664 <tel:+31318416664>
<https://www.facebook.com/geocatbv><https://twitter.com/geocat_bv><https://plus.google.com/u/1/+GeocatNetbv/posts>
Please consider the environment before printing this email.
***