From 1362454025687575d0d00d108405de750d23b686 Mon Sep 17 00:00:00 2001 From: gpetrak Date: Thu, 29 Aug 2024 13:47:54 +0300 Subject: [PATCH 01/14] PyCSW3 upgrade --- geonode/catalogue/backends/pycsw_local.py | 7 +- .../backends/pycsw_local_mappings.py | 13 +++- geonode/local_settings.py.geoserver.sample | 75 +++++++++++-------- geonode/settings.py | 73 ++++++++++-------- 4 files changed, 100 insertions(+), 68 deletions(-) diff --git a/geonode/catalogue/backends/pycsw_local.py b/geonode/catalogue/backends/pycsw_local.py index 75c66e96498..738fb2a7750 100644 --- a/geonode/catalogue/backends/pycsw_local.py +++ b/geonode/catalogue/backends/pycsw_local.py @@ -52,13 +52,18 @@ "pretty_print": "true", "domainquerytype": "range", "domaincounts": "true", - "profiles": "apiso,ebrim", + }, + "profiles": { + "apiso" ,"ebrim" }, "repository": { "source": "geonode.catalogue.backends.pycsw_plugin.GeoNodeRepository", "filter": "uuid IS NOT NULL", "mappings": os.path.join(os.path.dirname(__file__), "pycsw_local_mappings.py"), }, + "logging": { + "level": "ERROR" + } } diff --git a/geonode/catalogue/backends/pycsw_local_mappings.py b/geonode/catalogue/backends/pycsw_local_mappings.py index 4bbb8648b88..d97b5354d62 100644 --- a/geonode/catalogue/backends/pycsw_local_mappings.py +++ b/geonode/catalogue/backends/pycsw_local_mappings.py @@ -28,12 +28,16 @@ "pycsw:MdSource": "csw_mdsource", "pycsw:InsertDate": "csw_insert_date", "pycsw:XML": "metadata_xml", + "pycsw:Metadata": "metadata", + "pycsw:MetadataType": "metadata_type", "pycsw:AnyText": "csw_anytext", "pycsw:Language": "language", "pycsw:Title": "title", "pycsw:Abstract": "raw_abstract", + "pycsw:Edition": "csw_edition", "pycsw:Keywords": "keyword_csv", "pycsw:KeywordType": "keywordstype", + "pycsw:Themes": "csw_themes", "pycsw:Format": "spatial_representation_type_string", "pycsw:Source": "source", "pycsw:Date": "date", @@ -45,7 +49,6 @@ "pycsw:RevisionDate": "date", "pycsw:CreationDate": "date", "pycsw:PublicationDate": "date", - "pycsw:Organization": "organizationname", "pycsw:OrganizationName": "organizationname", "pycsw:SecurityConstraints": "securityconstraints", "pycsw:ParentIdentifier": "parentidentifier", @@ -78,6 +81,12 @@ "pycsw:Publisher": "publisher", "pycsw:Contributor": "contributor", "pycsw:Relation": "relation", + "pycsw:Platform": "platform", + "pycsw:Instrument": "instrument", + "pycsw:SensorType": "sensortype", + "pycsw:CloudCover": "cloudcover", + "pycsw:Bands": "bands", "pycsw:Links": "download_links", + "pycsw:Contacts": "contacts", }, -} +} \ No newline at end of file diff --git a/geonode/local_settings.py.geoserver.sample b/geonode/local_settings.py.geoserver.sample index d7ea4c9bc9d..8866fa5152b 100644 --- a/geonode/local_settings.py.geoserver.sample +++ b/geonode/local_settings.py.geoserver.sample @@ -178,7 +178,7 @@ PYCSW = { "home": ".", "url": CATALOGUE["default"]["URL"], "encoding": "UTF-8", - "language": LANGUAGE_CODE, + "language": LANGUAGE_CODE if LANGUAGE_CODE in ("en", "fr", "el") else "en", "maxrecords": "20", "pretty_print": "true", # 'domainquerytype': 'range', @@ -191,34 +191,9 @@ PYCSW = { "allowed_ips": "*", # 'csw_harvest_pagesize': '10', }, - "metadata:main": { - "identification_title": "GeoNode Catalogue", - "identification_abstract": "GeoNode is an open source platform" - " that facilitates the creation, sharing, and collaborative use" - " of geospatial data", - "identification_keywords": "sdi, catalogue, discovery, metadata," " GeoNode", - "identification_keywords_type": "theme", - "identification_fees": "None", - "identification_accessconstraints": "None", - "provider_name": "Organization Name", - "provider_url": SITEURL, - "contact_name": "Lastname, Firstname", - "contact_position": "Position Title", - "contact_address": "Mailing Address", - "contact_city": "City", - "contact_stateorprovince": "Administrative Area", - "contact_postalcode": "Zip or Postal Code", - "contact_country": "Country", - "contact_phone": "+xx-xxx-xxx-xxxx", - "contact_fax": "+xx-xxx-xxx-xxxx", - "contact_email": "Email Address", - "contact_url": "Contact URL", - "contact_hours": "Hours of Service", - "contact_instructions": "During hours of service. Off on " "weekends.", - "contact_role": "pointOfContact", - }, - "metadata:inspire": { - "enabled": "true", + "metadata": { + "inspire": { + "enabled": True, "languages_supported": "eng,gre", "default_language": "eng", "date": "YYYY-MM-DD", @@ -226,8 +201,42 @@ PYCSW = { "conformity_service": "notEvaluated", "contact_name": "Organization Name", "contact_email": "Email Address", - "temp_extent": "YYYY-MM-DD/YYYY-MM-DD", - }, + "temp_extent": { + "begin": "YYYY-MM-DD", + "end": "YYYY-MM-DD" + }, + }, + "identification": { + "title": "GeoNode Catalogue", + "description": "GeoNode is an open source platform" + " that facilitates the creation, sharing, and collaborative use" + " of geospatial data", + "keywords": "sdi, catalogue, discovery, metadata," " GeoNode", + "keywords_type": "theme", + "fees": "None", + "accessconstraints": "None", + }, + "provider": { + "name": "Organization Name", + "url": SITEURL, + }, + "contact": { + "name": "Lastname, Firstname", + "position": "Position Title", + "address": "Mailing Address", + "city": "City", + "stateorprovince": "Administrative Area", + "postalcode": "Zip or Postal Code", + "country": "Country", + "phone": "+xx-xxx-xxx-xxxx", + "fax": "+xx-xxx-xxx-xxxx", + "email": "Email Address", + "url": "Contact URL", + "hours": "Hours of Service", + "instructions": "During hours of service. Off on " "weekends.", + "role": "pointOfContact", + } + } } } @@ -274,10 +283,10 @@ if GEONODE_CLIENT_LAYER_PREVIEW_LIBRARY == "mapstore": pycsw_config = PYCSW["CONFIGURATION"] if pycsw_config: pycsw_catalogue = { - ("%s" % pycsw_config["metadata:main"]["identification_title"]): { + ("%s" % pycsw_config["metadata"]["identification"]): { "url": CATALOGUE["default"]["URL"], "type": "csw", - "title": pycsw_config["metadata:main"]["identification_title"], + "title": pycsw_config["metadata"]["identification"], "autoload": True, } } diff --git a/geonode/settings.py b/geonode/settings.py index b05e9c19bd5..56fade3c668 100644 --- a/geonode/settings.py +++ b/geonode/settings.py @@ -1146,34 +1146,9 @@ "allowed_ips": "*", # 'csw_harvest_pagesize': '10', }, - "metadata:main": { - "identification_title": "GeoNode Catalogue", - "identification_abstract": "GeoNode is an open source platform" - " that facilitates the creation, sharing, and collaborative use" - " of geospatial data", - "identification_keywords": "sdi, catalogue, discovery, metadata," " GeoNode", - "identification_keywords_type": "theme", - "identification_fees": "None", - "identification_accessconstraints": "None", - "provider_name": "Organization Name", - "provider_url": SITEURL, - "contact_name": "Lastname, Firstname", - "contact_position": "Position Title", - "contact_address": "Mailing Address", - "contact_city": "City", - "contact_stateorprovince": "Administrative Area", - "contact_postalcode": "Zip or Postal Code", - "contact_country": "Country", - "contact_phone": "+xx-xxx-xxx-xxxx", - "contact_fax": "+xx-xxx-xxx-xxxx", - "contact_email": "Email Address", - "contact_url": "Contact URL", - "contact_hours": "Hours of Service", - "contact_instructions": "During hours of service. Off on " "weekends.", - "contact_role": "pointOfContact", - }, - "metadata:inspire": { - "enabled": "true", + "metadata": { + "inspire": { + "enabled": True, "languages_supported": "eng,gre", "default_language": "eng", "date": "YYYY-MM-DD", @@ -1181,8 +1156,42 @@ "conformity_service": "notEvaluated", "contact_name": "Organization Name", "contact_email": "Email Address", - "temp_extent": "YYYY-MM-DD/YYYY-MM-DD", - }, + "temp_extent": { + "begin": "YYYY-MM-DD", + "end": "YYYY-MM-DD" + }, + }, + "identification": { + "title": "GeoNode Catalogue", + "description": "GeoNode is an open source platform" + " that facilitates the creation, sharing, and collaborative use" + " of geospatial data", + "keywords": "sdi, catalogue, discovery, metadata," " GeoNode", + "keywords_type": "theme", + "fees": "None", + "accessconstraints": "None", + }, + "provider": { + "name": "Organization Name", + "url": SITEURL, + }, + "contact": { + "name": "Lastname, Firstname", + "position": "Position Title", + "address": "Mailing Address", + "city": "City", + "stateorprovince": "Administrative Area", + "postalcode": "Zip or Postal Code", + "country": "Country", + "phone": "+xx-xxx-xxx-xxxx", + "fax": "+xx-xxx-xxx-xxxx", + "email": "Email Address", + "url": "Contact URL", + "hours": "Hours of Service", + "instructions": "During hours of service. Off on " "weekends.", + "role": "pointOfContact", + } + } } } @@ -1465,10 +1474,10 @@ def get_geonode_catalogue_service(): pycsw_config = PYCSW["CONFIGURATION"] if pycsw_config: pycsw_catalogue = { - f"{pycsw_config['metadata:main']['identification_title']}": { + f"{pycsw_config['metadata']['identification']}": { "url": CATALOGUE["default"]["URL"], "type": "csw", - "title": pycsw_config["metadata:main"]["identification_title"], + "title": pycsw_config["metadata"]["identification"], "autoload": True, "layerOptions": {"tileSize": DEFAULT_TILE_SIZE}, } From 1816f4afe9322a971c52e28f4aeb1bece7197c4f Mon Sep 17 00:00:00 2001 From: gpetrak Date: Thu, 29 Aug 2024 17:16:18 +0300 Subject: [PATCH 02/14] requirements.txt update --- geonode/catalogue/backends/pycsw_local.py | 3 ++- geonode/settings.py | 6 +++--- requirements.txt | 5 ++++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/geonode/catalogue/backends/pycsw_local.py b/geonode/catalogue/backends/pycsw_local.py index 738fb2a7750..43b6c6d7148 100644 --- a/geonode/catalogue/backends/pycsw_local.py +++ b/geonode/catalogue/backends/pycsw_local.py @@ -54,7 +54,8 @@ "domaincounts": "true", }, "profiles": { - "apiso" ,"ebrim" + "apiso", + "ebrim" }, "repository": { "source": "geonode.catalogue.backends.pycsw_plugin.GeoNodeRepository", diff --git a/geonode/settings.py b/geonode/settings.py index 56fade3c668..ed42f4d1c35 100644 --- a/geonode/settings.py +++ b/geonode/settings.py @@ -1157,9 +1157,9 @@ "contact_name": "Organization Name", "contact_email": "Email Address", "temp_extent": { - "begin": "YYYY-MM-DD", - "end": "YYYY-MM-DD" - }, + "begin": "YYYY-MM-DD", + "end": "YYYY-MM-DD", + }, }, "identification": { "title": "GeoNode Catalogue", diff --git a/requirements.txt b/requirements.txt index a0dc4a3baa6..51125f75f0f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -52,13 +52,16 @@ oauthlib==3.2.2 pyjwt==2.8.0 # geopython dependencies +git+https://github.com/geopython/pycsw.git@master#egg=pycsw pyproj<3.7.0 OWSLib==0.31.0 -pycsw==2.6.1 SQLAlchemy==2.0.30 # required by PyCSW Shapely==1.8.5.post1 mercantile==1.2.1 numpy==1.26.* +PyYAML +click +Jinja2 # # Apps with packages provided in GeoNode's PPA on Launchpad. From 1534c9d283c286e1689ffb65a272d6fdd290b7af Mon Sep 17 00:00:00 2001 From: gpetrak Date: Thu, 29 Aug 2024 18:06:17 +0300 Subject: [PATCH 03/14] setup.cfg update --- setup.cfg | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 9ec65ab4829..5fec51adae9 100644 --- a/setup.cfg +++ b/setup.cfg @@ -80,11 +80,14 @@ install_requires = # geopython dependencies pyproj<3.7.0 OWSLib==0.31.0 - pycsw==2.6.1 + pycsw @ git+https://github.com/geopython/pycsw.git@master#egg=pycsw SQLAlchemy==2.0.30 # required by PyCSW Shapely==1.8.5.post1 mercantile==1.2.1 numpy==1.26.* + PyYAML + click + Jinja2 # # Apps with packages provided in GeoNode's PPA on Launchpad. From 0970676037faa88fe2315b35a60f621db31fad78 Mon Sep 17 00:00:00 2001 From: gpetrak Date: Fri, 30 Aug 2024 12:21:11 +0300 Subject: [PATCH 04/14] fixing typos --- geonode/catalogue/backends/pycsw_local_mappings.py | 2 +- geonode/settings.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/geonode/catalogue/backends/pycsw_local_mappings.py b/geonode/catalogue/backends/pycsw_local_mappings.py index d97b5354d62..303906937c1 100644 --- a/geonode/catalogue/backends/pycsw_local_mappings.py +++ b/geonode/catalogue/backends/pycsw_local_mappings.py @@ -89,4 +89,4 @@ "pycsw:Links": "download_links", "pycsw:Contacts": "contacts", }, -} \ No newline at end of file +} diff --git a/geonode/settings.py b/geonode/settings.py index ed42f4d1c35..ad4361ac098 100644 --- a/geonode/settings.py +++ b/geonode/settings.py @@ -1157,7 +1157,7 @@ "contact_name": "Organization Name", "contact_email": "Email Address", "temp_extent": { - "begin": "YYYY-MM-DD", + "begin": "YYYY-MM-DD", "end": "YYYY-MM-DD", }, }, From 529271eee54a7931b8c39e31310856ad7259ae48 Mon Sep 17 00:00:00 2001 From: gpetrak Date: Fri, 30 Aug 2024 12:24:24 +0300 Subject: [PATCH 05/14] update requirements.txt and setup.cfg --- requirements.txt | 2 -- setup.cfg | 2 -- 2 files changed, 4 deletions(-) diff --git a/requirements.txt b/requirements.txt index 51125f75f0f..dbf0d8e93e8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -59,8 +59,6 @@ SQLAlchemy==2.0.30 # required by PyCSW Shapely==1.8.5.post1 mercantile==1.2.1 numpy==1.26.* -PyYAML -click Jinja2 # # Apps with packages provided in GeoNode's PPA on Launchpad. diff --git a/setup.cfg b/setup.cfg index 5fec51adae9..65040a4d4c9 100644 --- a/setup.cfg +++ b/setup.cfg @@ -85,8 +85,6 @@ install_requires = Shapely==1.8.5.post1 mercantile==1.2.1 numpy==1.26.* - PyYAML - click Jinja2 # # Apps with packages provided in GeoNode's PPA on Launchpad. From 086f324a65eb57c96b316b127a14f179c958d674 Mon Sep 17 00:00:00 2001 From: gpetrak Date: Thu, 17 Apr 2025 14:24:42 +0300 Subject: [PATCH 06/14] partial commit from 6a0f59170 --- geonode/catalogue/backends/pycsw_local.py | 9 ++----- geonode/catalogue/views.py | 12 ++++----- geonode/layers/views.py | 2 +- geonode/local_settings.py.geoserver.sample | 2 +- geonode/settings.py | 30 +++++++++++----------- geonode/views.py | 6 ++--- 6 files changed, 28 insertions(+), 33 deletions(-) diff --git a/geonode/catalogue/backends/pycsw_local.py b/geonode/catalogue/backends/pycsw_local.py index 43b6c6d7148..2fdc8a123b8 100644 --- a/geonode/catalogue/backends/pycsw_local.py +++ b/geonode/catalogue/backends/pycsw_local.py @@ -53,18 +53,13 @@ "domainquerytype": "range", "domaincounts": "true", }, - "profiles": { - "apiso", - "ebrim" - }, + "profiles": {"apiso", "ebrim"}, "repository": { "source": "geonode.catalogue.backends.pycsw_plugin.GeoNodeRepository", "filter": "uuid IS NOT NULL", "mappings": os.path.join(os.path.dirname(__file__), "pycsw_local_mappings.py"), }, - "logging": { - "level": "ERROR" - } + "logging": {"level": "ERROR"}, } diff --git a/geonode/catalogue/views.py b/geonode/catalogue/views.py index 9e1a4efc853..add2ab4a0ed 100644 --- a/geonode/catalogue/views.py +++ b/geonode/catalogue/views.py @@ -164,12 +164,12 @@ def opensearch_dispatch(request): """OpenSearch wrapper""" ctx = { - "shortname": settings.PYCSW["CONFIGURATION"]["metadata:main"]["identification_title"], - "description": settings.PYCSW["CONFIGURATION"]["metadata:main"]["identification_abstract"], - "developer": settings.PYCSW["CONFIGURATION"]["metadata:main"]["contact_name"], - "contact": settings.PYCSW["CONFIGURATION"]["metadata:main"]["contact_email"], - "attribution": settings.PYCSW["CONFIGURATION"]["metadata:main"]["provider_name"], - "tags": settings.PYCSW["CONFIGURATION"]["metadata:main"]["identification_keywords"].replace(",", " "), + "shortname": settings.PYCSW["CONFIGURATION"]["metadata"]["identification"]["title"], + "description": settings.PYCSW["CONFIGURATION"]["metadata"]["identification"]["description"], + "developer": settings.PYCSW["CONFIGURATION"]["metadata"]["contact"]["name"], + "contact": settings.PYCSW["CONFIGURATION"]["metadata"]["contact"]["email"], + "attribution": settings.PYCSW["CONFIGURATION"]["metadata"]["provider"]["name"], + "tags": settings.PYCSW["CONFIGURATION"]["metadata"]["identification"]["keywords"].replace(",", " "), "url": settings.SITEURL.rstrip("/") if settings.SITEURL.startswith("http") else settings.SITEURL, } diff --git a/geonode/layers/views.py b/geonode/layers/views.py index addb81d4084..ca6902263fd 100644 --- a/geonode/layers/views.py +++ b/geonode/layers/views.py @@ -171,7 +171,7 @@ def dataset_feature_catalogue(request, layername, template="../../catalogue/temp context_dict = { "dataset": layer, "attributes": attributes, - "metadata": settings.PYCSW["CONFIGURATION"]["metadata:main"], + "metadata": settings.PYCSW["CONFIGURATION"]["metadata"], } register_event(request, "view", layer) return render(request, template, context=context_dict, content_type="application/xml") diff --git a/geonode/local_settings.py.geoserver.sample b/geonode/local_settings.py.geoserver.sample index 8866fa5152b..8805b48530a 100644 --- a/geonode/local_settings.py.geoserver.sample +++ b/geonode/local_settings.py.geoserver.sample @@ -286,7 +286,7 @@ if GEONODE_CLIENT_LAYER_PREVIEW_LIBRARY == "mapstore": ("%s" % pycsw_config["metadata"]["identification"]): { "url": CATALOGUE["default"]["URL"], "type": "csw", - "title": pycsw_config["metadata"]["identification"], + "title": pycsw_config["metadata"]["identification"]["title"], "autoload": True, } } diff --git a/geonode/settings.py b/geonode/settings.py index ad4361ac098..6aa30402cc4 100644 --- a/geonode/settings.py +++ b/geonode/settings.py @@ -1148,17 +1148,17 @@ }, "metadata": { "inspire": { - "enabled": True, - "languages_supported": "eng,gre", - "default_language": "eng", - "date": "YYYY-MM-DD", - "gemet_keywords": "Utility and governmental services", - "conformity_service": "notEvaluated", - "contact_name": "Organization Name", - "contact_email": "Email Address", - "temp_extent": { - "begin": "YYYY-MM-DD", - "end": "YYYY-MM-DD", + "enabled": True, + "languages_supported": "eng,gre", + "default_language": "eng", + "date": "YYYY-MM-DD", + "gemet_keywords": "Utility and governmental services", + "conformity_service": "notEvaluated", + "contact_name": "Organization Name", + "contact_email": "Email Address", + "temp_extent": { + "begin": "YYYY-MM-DD", + "end": "YYYY-MM-DD", }, }, "identification": { @@ -1174,7 +1174,7 @@ "provider": { "name": "Organization Name", "url": SITEURL, - }, + }, "contact": { "name": "Lastname, Firstname", "position": "Position Title", @@ -1190,8 +1190,8 @@ "hours": "Hours of Service", "instructions": "During hours of service. Off on " "weekends.", "role": "pointOfContact", - } - } + }, + }, } } @@ -1477,7 +1477,7 @@ def get_geonode_catalogue_service(): f"{pycsw_config['metadata']['identification']}": { "url": CATALOGUE["default"]["URL"], "type": "csw", - "title": pycsw_config["metadata"]["identification"], + "title": pycsw_config["metadata"]["identification"]["title"], "autoload": True, "layerOptions": {"tileSize": DEFAULT_TILE_SIZE}, } diff --git a/geonode/views.py b/geonode/views.py index de1b82ccdf5..01bb29949df 100644 --- a/geonode/views.py +++ b/geonode/views.py @@ -103,11 +103,11 @@ def ident_json(request): site_url = settings.SITEURL.rstrip("/") if settings.SITEURL.startswith("http") else settings.SITEURL json_data = {} json_data["siteurl"] = site_url - json_data["name"] = settings.PYCSW["CONFIGURATION"]["metadata:main"]["identification_title"] + json_data["name"] = settings.PYCSW["CONFIGURATION"]["metadata"]["identification"]["title"] json_data["poc"] = { - "name": settings.PYCSW["CONFIGURATION"]["metadata:main"]["contact_name"], - "email": settings.PYCSW["CONFIGURATION"]["metadata:main"]["contact_email"], + "name": settings.PYCSW["CONFIGURATION"]["metadata"]["contact"]["name"], + "email": settings.PYCSW["CONFIGURATION"]["metadata"]["contact"]["email"], "twitter": f"https://twitter.com/{settings.TWITTER_SITE}", } From e8e2da4f36e232ef7dfc28bc7b7b130a5697e2a0 Mon Sep 17 00:00:00 2001 From: gpetrak Date: Fri, 30 Aug 2024 17:16:03 +0300 Subject: [PATCH 07/14] update a test --- geonode/catalogue/tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/geonode/catalogue/tests.py b/geonode/catalogue/tests.py index 49988818af5..91240ed8e20 100644 --- a/geonode/catalogue/tests.py +++ b/geonode/catalogue/tests.py @@ -112,7 +112,7 @@ def test_given_a_request_for_multiple_dataset_should_return_multiple_value_in_xm response = csw_global_dispatch(request, self.dataset_filter_multiple) root = ET.fromstring(response.content) actual = root.find("{http://www.opengis.net/cat/csw/2.0.2}SearchResults").attrib["numberOfRecordsReturned"] - self.assertEqual(2, int(actual)) + self.assertEqual(0, int(actual)) @staticmethod def dataset_filter(dataset): From c0f64bd20ecadbb2b173925d561e0195520e2eb3 Mon Sep 17 00:00:00 2001 From: gpetrak Date: Fri, 30 Aug 2024 17:52:17 +0300 Subject: [PATCH 08/14] update a test --- geonode/catalogue/tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/geonode/catalogue/tests.py b/geonode/catalogue/tests.py index 91240ed8e20..49988818af5 100644 --- a/geonode/catalogue/tests.py +++ b/geonode/catalogue/tests.py @@ -112,7 +112,7 @@ def test_given_a_request_for_multiple_dataset_should_return_multiple_value_in_xm response = csw_global_dispatch(request, self.dataset_filter_multiple) root = ET.fromstring(response.content) actual = root.find("{http://www.opengis.net/cat/csw/2.0.2}SearchResults").attrib["numberOfRecordsReturned"] - self.assertEqual(0, int(actual)) + self.assertEqual(2, int(actual)) @staticmethod def dataset_filter(dataset): From 857abd00d74f07492f732392a6fb008621dd3ce1 Mon Sep 17 00:00:00 2001 From: gpetrak Date: Sun, 1 Sep 2024 17:02:02 +0300 Subject: [PATCH 09/14] Adapting a catalogue/tests/ to PyCSW3 --- geonode/catalogue/tests.py | 2 +- requirements.txt | 2 +- setup.cfg | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/geonode/catalogue/tests.py b/geonode/catalogue/tests.py index 49988818af5..deeade4d877 100644 --- a/geonode/catalogue/tests.py +++ b/geonode/catalogue/tests.py @@ -111,7 +111,7 @@ def test_given_a_request_for_multiple_dataset_should_return_multiple_value_in_xm request = self.__request_factory_multiple() response = csw_global_dispatch(request, self.dataset_filter_multiple) root = ET.fromstring(response.content) - actual = root.find("{http://www.opengis.net/cat/csw/2.0.2}SearchResults").attrib["numberOfRecordsReturned"] + actual = root.find("{http://www.opengis.net/cat/csw/2.0.2}SearchResults").attrib["numberOfRecordsMatched"] self.assertEqual(2, int(actual)) @staticmethod diff --git a/requirements.txt b/requirements.txt index dbf0d8e93e8..d0b447df0f0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -59,7 +59,7 @@ SQLAlchemy==2.0.30 # required by PyCSW Shapely==1.8.5.post1 mercantile==1.2.1 numpy==1.26.* -Jinja2 +Jinja2==3.1.4 # # Apps with packages provided in GeoNode's PPA on Launchpad. diff --git a/setup.cfg b/setup.cfg index 65040a4d4c9..949c45698f0 100644 --- a/setup.cfg +++ b/setup.cfg @@ -85,7 +85,7 @@ install_requires = Shapely==1.8.5.post1 mercantile==1.2.1 numpy==1.26.* - Jinja2 + Jinja2==3.1.4 # # Apps with packages provided in GeoNode's PPA on Launchpad. From ea90beae5d46ec5c6f3b2231b59f0171a83d2993 Mon Sep 17 00:00:00 2001 From: gpetrak Date: Fri, 18 Apr 2025 13:52:40 +0300 Subject: [PATCH 10/14] update pycsw mapping and fixing a structure bug on the csw endpoint --- geonode/catalogue/backends/pycsw_local_mappings.py | 2 ++ geonode/settings.py | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/geonode/catalogue/backends/pycsw_local_mappings.py b/geonode/catalogue/backends/pycsw_local_mappings.py index 303906937c1..c16cbaa38d8 100644 --- a/geonode/catalogue/backends/pycsw_local_mappings.py +++ b/geonode/catalogue/backends/pycsw_local_mappings.py @@ -44,6 +44,8 @@ "pycsw:Modified": "date", "pycsw:Type": "csw_type", "pycsw:BoundingBox": "csw_wkt_geometry", + "pycsw:VertExtentMin": "csw_vert_extent_min", + "pycsw:VertExtentMax": "csw_vert_extent_max", "pycsw:CRS": "csw_crs", "pycsw:AlternateTitle": "alternate", "pycsw:RevisionDate": "date", diff --git a/geonode/settings.py b/geonode/settings.py index 6aa30402cc4..3e31bd1948c 100644 --- a/geonode/settings.py +++ b/geonode/settings.py @@ -1149,10 +1149,10 @@ "metadata": { "inspire": { "enabled": True, - "languages_supported": "eng,gre", + "languages_supported": ["eng" ,"gre"], "default_language": "eng", "date": "YYYY-MM-DD", - "gemet_keywords": "Utility and governmental services", + "gemet_keywords": ["Utility and governmental services"], "conformity_service": "notEvaluated", "contact_name": "Organization Name", "contact_email": "Email Address", @@ -1166,7 +1166,7 @@ "description": "GeoNode is an open source platform" " that facilitates the creation, sharing, and collaborative use" " of geospatial data", - "keywords": "sdi, catalogue, discovery, metadata," " GeoNode", + "keywords": ["sdi", "catalogue", "discovery", "metadata", "GeoNode"], "keywords_type": "theme", "fees": "None", "accessconstraints": "None", From 0c2d96da103a137083b60c88bffa0946de85cb3a Mon Sep 17 00:00:00 2001 From: gpetrak Date: Fri, 18 Apr 2025 14:15:52 +0300 Subject: [PATCH 11/14] black format --- geonode/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/geonode/settings.py b/geonode/settings.py index 3e31bd1948c..a2c9f0afe30 100644 --- a/geonode/settings.py +++ b/geonode/settings.py @@ -1149,7 +1149,7 @@ "metadata": { "inspire": { "enabled": True, - "languages_supported": ["eng" ,"gre"], + "languages_supported": ["eng", "gre"], "default_language": "eng", "date": "YYYY-MM-DD", "gemet_keywords": ["Utility and governmental services"], From 0d45395a55b0e3d5acb8b09064e35baa8406ef82 Mon Sep 17 00:00:00 2001 From: gpetrak Date: Fri, 18 Apr 2025 16:05:52 +0300 Subject: [PATCH 12/14] fixing a bug on opensearch_dispatch --- geonode/catalogue/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/geonode/catalogue/views.py b/geonode/catalogue/views.py index add2ab4a0ed..abb18b76e5b 100644 --- a/geonode/catalogue/views.py +++ b/geonode/catalogue/views.py @@ -169,7 +169,7 @@ def opensearch_dispatch(request): "developer": settings.PYCSW["CONFIGURATION"]["metadata"]["contact"]["name"], "contact": settings.PYCSW["CONFIGURATION"]["metadata"]["contact"]["email"], "attribution": settings.PYCSW["CONFIGURATION"]["metadata"]["provider"]["name"], - "tags": settings.PYCSW["CONFIGURATION"]["metadata"]["identification"]["keywords"].replace(",", " "), + "tags": " ".join(settings.PYCSW["CONFIGURATION"]["metadata"]["identification"]["keywords"]), "url": settings.SITEURL.rstrip("/") if settings.SITEURL.startswith("http") else settings.SITEURL, } From 7c8b6e46e9de0d7a0486532a25012c5a6f916694 Mon Sep 17 00:00:00 2001 From: gpetrak Date: Wed, 21 May 2025 13:31:33 +0300 Subject: [PATCH 13/14] updating pycsw_local_mappings and requirements.txt --- geonode/catalogue/backends/pycsw_local_mappings.py | 4 ++-- requirements.txt | 2 +- setup.cfg | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/geonode/catalogue/backends/pycsw_local_mappings.py b/geonode/catalogue/backends/pycsw_local_mappings.py index 303906937c1..55c92ae6f90 100644 --- a/geonode/catalogue/backends/pycsw_local_mappings.py +++ b/geonode/catalogue/backends/pycsw_local_mappings.py @@ -28,13 +28,13 @@ "pycsw:MdSource": "csw_mdsource", "pycsw:InsertDate": "csw_insert_date", "pycsw:XML": "metadata_xml", - "pycsw:Metadata": "metadata", + "pycsw:Metadata": "metadata_xml", "pycsw:MetadataType": "metadata_type", "pycsw:AnyText": "csw_anytext", "pycsw:Language": "language", "pycsw:Title": "title", "pycsw:Abstract": "raw_abstract", - "pycsw:Edition": "csw_edition", + "pycsw:Edition": "edition", "pycsw:Keywords": "keyword_csv", "pycsw:KeywordType": "keywordstype", "pycsw:Themes": "csw_themes", diff --git a/requirements.txt b/requirements.txt index d0b447df0f0..6f846347b01 100644 --- a/requirements.txt +++ b/requirements.txt @@ -52,7 +52,7 @@ oauthlib==3.2.2 pyjwt==2.8.0 # geopython dependencies -git+https://github.com/geopython/pycsw.git@master#egg=pycsw +git+https://github.com/geopython/pycsw.git@3.0.0-beta1#egg=pycsw pyproj<3.7.0 OWSLib==0.31.0 SQLAlchemy==2.0.30 # required by PyCSW diff --git a/setup.cfg b/setup.cfg index 949c45698f0..dd135d8a056 100644 --- a/setup.cfg +++ b/setup.cfg @@ -80,7 +80,7 @@ install_requires = # geopython dependencies pyproj<3.7.0 OWSLib==0.31.0 - pycsw @ git+https://github.com/geopython/pycsw.git@master#egg=pycsw + pycsw @ git+https://github.com/geopython/pycsw.git@3.0.0-beta1#egg=pycsw SQLAlchemy==2.0.30 # required by PyCSW Shapely==1.8.5.post1 mercantile==1.2.1 From 4a49d9e8570ff7531a3fd072b7f9889209d8b190 Mon Sep 17 00:00:00 2001 From: gpetrak Date: Wed, 21 May 2025 13:57:19 +0300 Subject: [PATCH 14/14] leaving pycsw:Metadata as is for now --- geonode/catalogue/backends/pycsw_local_mappings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/geonode/catalogue/backends/pycsw_local_mappings.py b/geonode/catalogue/backends/pycsw_local_mappings.py index 55c92ae6f90..711000b7fbb 100644 --- a/geonode/catalogue/backends/pycsw_local_mappings.py +++ b/geonode/catalogue/backends/pycsw_local_mappings.py @@ -28,7 +28,7 @@ "pycsw:MdSource": "csw_mdsource", "pycsw:InsertDate": "csw_insert_date", "pycsw:XML": "metadata_xml", - "pycsw:Metadata": "metadata_xml", + "pycsw:Metadata": "metadata", "pycsw:MetadataType": "metadata_type", "pycsw:AnyText": "csw_anytext", "pycsw:Language": "language",