Merge branch 'master' into migration-states
This commit is contained in:
commit
501edffe2d
|
@ -8,6 +8,6 @@ build
|
||||||
.DS_Store
|
.DS_Store
|
||||||
dist
|
dist
|
||||||
development.ini
|
development.ini
|
||||||
*.swp
|
*.sw?
|
||||||
*~
|
*~
|
||||||
node_modules
|
node_modules
|
||||||
|
|
|
@ -1,2 +1,4 @@
|
||||||
recursive-include ckanext/harvest/templates *
|
recursive-include ckanext/harvest/templates *
|
||||||
|
recursive-include ckanext/harvest/templates_new *
|
||||||
|
recursive-include ckanext/harvest/fanstatic_library/styles *
|
||||||
recursive-include ckanext/harvest/public *
|
recursive-include ckanext/harvest/public *
|
||||||
|
|
|
@ -29,7 +29,7 @@ Installation
|
||||||
|
|
||||||
On your CKAN configuration file, add::
|
On your CKAN configuration file, add::
|
||||||
|
|
||||||
ckan.harvest.mq.type = rabbitmq
|
ckan.harvest.mq.type = amqp
|
||||||
|
|
||||||
|
|
||||||
2. Install the extension into your python environment::
|
2. Install the extension into your python environment::
|
||||||
|
@ -149,12 +149,12 @@ Authorization
|
||||||
=============
|
=============
|
||||||
|
|
||||||
Starting from CKAN 2.0, harvest sources behave exactly the same as datasets
|
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
|
can be searched and faceted, and that the same authorization rules can be
|
||||||
applied to them. The default authorization settings are based on organizations
|
applied to them. The default authorization settings are based on organizations
|
||||||
(equivalent to the `publisher profile` found in old versions).
|
(equivalent to the `publisher profile` found in old versions).
|
||||||
|
|
||||||
Have a look at the `Authorization <http://docs.ckan.org/en/latest/authorization.html>`_
|
Have a look at the `Authorization <http://docs.ckan.org/en/latest/authorization.html>`_
|
||||||
documentation on CKAN core to see how to configure your instance depending on
|
documentation on CKAN core to see how to configure your instance depending on
|
||||||
your needs.
|
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
|
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
|
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
|
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).
|
command regularly, see next section).
|
||||||
|
|
||||||
|
|
||||||
|
@ -598,4 +598,3 @@ http://www.fsf.org/licensing/licenses/agpl-3.0.html
|
||||||
|
|
||||||
|
|
||||||
.. _Supervisor: http://supervisord.org
|
.. _Supervisor: http://supervisord.org
|
||||||
|
|
||||||
|
|
|
@ -140,14 +140,22 @@ def harvest_source_clear(context,data_dict):
|
||||||
delete from resource_group where package_id in
|
delete from resource_group where package_id in
|
||||||
(select id from package where state = 'to_delete');
|
(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.99'):
|
||||||
|
sql += '''
|
||||||
|
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';
|
||||||
|
'''
|
||||||
|
|
||||||
|
|
||||||
sql += '''
|
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_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_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_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_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 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 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 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');
|
delete from package_extra_revision where package_id in (select id from package where state = 'to_delete');
|
||||||
|
|
Loading…
Reference in New Issue