From a77b62c25a55f3810da608cd75f0b299b18d5275 Mon Sep 17 00:00:00 2001 From: Raphael Stolt Date: Mon, 17 Aug 2015 12:11:45 +0200 Subject: [PATCH 1/7] [#103] Include templates_new directory --- MANIFEST.in | 1 + 1 file changed, 1 insertion(+) diff --git a/MANIFEST.in b/MANIFEST.in index 885c4c4..990b70d 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,2 +1,3 @@ recursive-include ckanext/harvest/templates * +recursive-include ckanext/harvest/templates_new * recursive-include ckanext/harvest/public * From 1905caa961b9b90f4dfd03301b62609e607f3fbb Mon Sep 17 00:00:00 2001 From: florianm Date: Wed, 19 Aug 2015 10:25:20 +0800 Subject: [PATCH 2/7] upgrade harvest_source_clear to not delete from authz models removed in migration 078 --- ckanext/harvest/logic/action/update.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ckanext/harvest/logic/action/update.py b/ckanext/harvest/logic/action/update.py index 62e4c08..ae6f431 100644 --- a/ckanext/harvest/logic/action/update.py +++ b/ckanext/harvest/logic/action/update.py @@ -140,14 +140,22 @@ def harvest_source_clear(context,data_dict): delete from resource_group where package_id in (select id from package where state = 'to_delete'); ''' + # CKAN pre-2.5: authz models were removed in migration 078 + if toolkit.check_ckan_version(max_version='2.4'): + sql += ''' + delete from user_object_role where id not in + (select user_object_role_id from package_role) and context = 'Package'; + delete from package_role where package_id in + (select id from package where state = 'to_delete'); + ''' + + sql += ''' delete from harvest_object_error where harvest_object_id in (select id from harvest_object where harvest_source_id = '{harvest_source_id}'); delete from harvest_object_extra where harvest_object_id in (select id from harvest_object where harvest_source_id = '{harvest_source_id}'); delete from harvest_object where harvest_source_id = '{harvest_source_id}'; delete from harvest_gather_error where harvest_job_id in (select id from harvest_job where source_id = '{harvest_source_id}'); delete from harvest_job where source_id = '{harvest_source_id}'; - delete from package_role where package_id in (select id from package where state = 'to_delete' ); - delete from user_object_role where id not in (select user_object_role_id from package_role) and context = 'Package'; delete from package_tag_revision where package_id in (select id from package where state = 'to_delete'); delete from member_revision where table_id in (select id from package where state = 'to_delete'); delete from package_extra_revision where package_id in (select id from package where state = 'to_delete'); From a6cdda0a1480c79e42a8ba27a51350e9f4e36e4c Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Wed, 19 Aug 2015 08:41:42 +0000 Subject: [PATCH 3/7] set max version to 2.4.99 --- ckanext/harvest/logic/action/update.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ckanext/harvest/logic/action/update.py b/ckanext/harvest/logic/action/update.py index ae6f431..7044128 100644 --- a/ckanext/harvest/logic/action/update.py +++ b/ckanext/harvest/logic/action/update.py @@ -141,7 +141,7 @@ def harvest_source_clear(context,data_dict): (select id from package where state = 'to_delete'); ''' # CKAN pre-2.5: authz models were removed in migration 078 - if toolkit.check_ckan_version(max_version='2.4'): + if toolkit.check_ckan_version(max_version='2.4.99'): sql += ''' delete from user_object_role where id not in (select user_object_role_id from package_role) and context = 'Package'; From d9fc9bdfc6ed21f8b90c9b94772749fe08cc1797 Mon Sep 17 00:00:00 2001 From: Raphael Stolt Date: Wed, 19 Aug 2015 14:58:16 +0200 Subject: [PATCH 4/7] [#103] Include fanstatic styles directory --- MANIFEST.in | 1 + 1 file changed, 1 insertion(+) diff --git a/MANIFEST.in b/MANIFEST.in index 990b70d..25e3d8f 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,3 +1,4 @@ recursive-include ckanext/harvest/templates * recursive-include ckanext/harvest/templates_new * +recursive-include ckanext/harvest/fanstatic_library/styles * recursive-include ckanext/harvest/public * From 6360681a8f98ea5ba52a70bc589754c7db52f032 Mon Sep 17 00:00:00 2001 From: David Read Date: Mon, 12 Oct 2015 15:57:27 +0100 Subject: [PATCH 5/7] [#105] Fix order of deletes, as agreed with @florianm. --- ckanext/harvest/logic/action/update.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ckanext/harvest/logic/action/update.py b/ckanext/harvest/logic/action/update.py index 7044128..9e871d9 100644 --- a/ckanext/harvest/logic/action/update.py +++ b/ckanext/harvest/logic/action/update.py @@ -143,10 +143,10 @@ def harvest_source_clear(context,data_dict): # CKAN pre-2.5: authz models were removed in migration 078 if toolkit.check_ckan_version(max_version='2.4.99'): sql += ''' - delete from user_object_role where id not in - (select user_object_role_id from package_role) and context = 'Package'; - delete from package_role where package_id in + delete from package_role where package_id in (select id from package where state = 'to_delete'); + delete from user_object_role where id not in + (select user_object_role_id from package_role) and context = 'Package'; ''' From 1f81fefcbb8fba983e67d4b65fa620eccb1de0d4 Mon Sep 17 00:00:00 2001 From: David Read Date: Wed, 21 Oct 2015 16:11:11 +0000 Subject: [PATCH 6/7] Correct doc error for configuring amqp. --- .gitignore | 2 +- README.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index b678f55..62ff3fd 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,6 @@ build .DS_Store dist development.ini -*.swp +*.sw? *~ node_modules diff --git a/README.rst b/README.rst index f3dadf8..3b1f2d3 100644 --- a/README.rst +++ b/README.rst @@ -29,7 +29,7 @@ Installation On your CKAN configuration file, add:: - ckan.harvest.mq.type = rabbitmq + ckan.harvest.mq.type = amqp 2. Install the extension into your python environment:: From 6fb5728d02d6dc46098dd35f767f9a674cd80d15 Mon Sep 17 00:00:00 2001 From: Mark Winterbottom Date: Wed, 21 Oct 2015 17:48:07 +0100 Subject: [PATCH 7/7] Fixed Typos. --- README.rst | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.rst b/README.rst index f3dadf8..a433009 100644 --- a/README.rst +++ b/README.rst @@ -149,12 +149,12 @@ Authorization ============= Starting from CKAN 2.0, harvest sources behave exactly the same as datasets -(they are actually internally implemented as a dataset type). That means that +(they are actually internally implemented as a dataset type). That means they can be searched and faceted, and that the same authorization rules can be applied to them. The default authorization settings are based on organizations (equivalent to the `publisher profile` found in old versions). -Have a look at the `Authorization `_ +Have a look at the `Authorization `_ documentation on CKAN core to see how to configure your instance depending on your needs. @@ -429,7 +429,7 @@ The ``run`` command not only starts any pending harvesting jobs, but also flags those that are finished, allowing new jobs to be created on that particular source and refreshing the source statistics. That means that you will need to run this command before being able to create a new job on a source that was being -harvested (On a production site you will tipically have a cron job that runs the +harvested (On a production site you will typically have a cron job that runs the command regularly, see next section). @@ -598,4 +598,3 @@ http://www.fsf.org/licensing/licenses/agpl-3.0.html .. _Supervisor: http://supervisord.org -