diff --git a/CHANGELOG.md b/CHANGELOG.md index cfa669fdc3a844530bf9bcd5717dc56fd9bba85c..29b1656aab05a030c4c6b6230df4fa54eb5bf6b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Updated minimum CKAN version requirement from `2.9` to `2.10`. Please run `ckan db upgrade` after updating. - Replaced `is_okd_compliant` with `od_conformance` and `is_osi_compliant` with `osd_conformance` in the [licenses.json](./ckanext/odsh/resources/licenses.json) file. +- Deprecated methods replaced with their respective new versions from plugin interfaces: + - `ckan.plugins.interfaces.IResourceController`: + - Replaced `before_create` with `before_resource_create` + - Replaced `after_create` with `after_resource_create` + - Replaced `before_update` with `before_resource_update` + - Replaced `after_update` with `after_resource_update` + - Replaced `before_delete` with `before_resource_delete` + - Replaced `after_delete` with `after_resource_delete` + - Replaced `before_show` with `before_resource_show` + - `ckan.plugins.interfaces.IPackageController`: + - Replaced `after_create` with `after_dataset_create` + - Replaced `after_update` with `after_dataset_update` + - Replaced `after_delete` with `after_dataset_delete` + - Replaced `after_show` with `after_dataset_show` + - Replaced `before_search` with `before_dataset_search` + - Replaced `after_search` with `after_dataset_search` + - Replaced `before_index` with `before_dataset_index` ## [2.1.0] diff --git a/ckanext/odsh/pdf_to_thumbnail/plugin.py b/ckanext/odsh/pdf_to_thumbnail/plugin.py index 3181c39692850818fc4a00c06206c4bc3ebd6b09..f0c5f4c005e239853720d4d3b737ed49a346a17e 100644 --- a/ckanext/odsh/pdf_to_thumbnail/plugin.py +++ b/ckanext/odsh/pdf_to_thumbnail/plugin.py @@ -20,15 +20,15 @@ class ThumbnailPlugin(plugins.SingletonPlugin): #IResourceController - def after_create(self, context, resource): + def after_resource_create(self, context, resource): resources = thumbnail.resources_of_containing_package(resource) thumbnail.create_thumbnail_if_none_in_package(context, resources) - def after_update(self, context, resource): + def after_resource_update(self, context, resource): resources = thumbnail.resources_of_containing_package(resource) thumbnail.create_thumbnail_if_none_in_package(context, resources) - def after_delete(self, context, resources): + def after_resource_delete(self, context, resources): thumbnail.create_thumbnail_if_none_in_package(context, resources) #IConfigurer diff --git a/ckanext/odsh/plugin.py b/ckanext/odsh/plugin.py index e02d1151c8c820f560faf58faf0e41d8a905f0b2..500edc636882997ab4775ffdac97149fb0effd33 100644 --- a/ckanext/odsh/plugin.py +++ b/ckanext/odsh/plugin.py @@ -252,7 +252,7 @@ class OdshPlugin(plugins.SingletonPlugin, DefaultTranslation, DefaultDatasetForm # IPackageController - def after_show(self, context, pkg_dict): + def after_dataset_show(self, context, pkg_dict): ''' corrects missing relationships in pkg dict adds the following key-value-pairs to pkg_dict: @@ -274,11 +274,11 @@ class OdshPlugin(plugins.SingletonPlugin, DefaultTranslation, DefaultDatasetForm self._update_is_new_in_pkg_dict(pkg_dict) return pkg_dict - def after_create(self, context, resource): + def after_dataset_create(self, context, resource): if resource.get('package_id'): tools.add_attributes_resources(context, resource) - def after_update(self, context, resource): + def after_dataset_update(self, context, resource): if resource.get('package_id'): tools.add_attributes_resources(context, resource) @@ -287,7 +287,7 @@ class OdshPlugin(plugins.SingletonPlugin, DefaultTranslation, DefaultDatasetForm is_new = HelperPgkDict(pkg_dict).is_package_new() pkg_dict.update({'is_new': is_new}) - def before_index(self, dict_pkg): + def before_dataset_index(self, dict_pkg): # make special date fields solr conform fields = ["issued", "temporal_start", "temporal_end"] for field in fields: diff --git a/ckanext/odsh/search.py b/ckanext/odsh/search.py index 8d2a794ddbc20c71e01bf50aaba354629544794c..86894570dce3e93f6630dca7f55308fdfec0fa3b 100644 --- a/ckanext/odsh/search.py +++ b/ckanext/odsh/search.py @@ -1,6 +1,6 @@ import ckanext.odsh.helpers as odsh_helpers -def before_search(search_params): +def before_dataset_search(search_params): _update_facet_mincount(search_params) _update_daterange_query(search_params) return search_params