Add further notes on extending ckan harvester

This commit is contained in:
amercader 2019-08-26 13:48:09 +02:00
parent 30f19713fa
commit 819706ae5d
1 changed files with 15 additions and 1 deletions

View File

@ -437,7 +437,7 @@ This is a simple example::
from ckanext.harvester.harvesters.ckanharvester import CKANHarvester
class MyCustomCKANHarvester(CKANHarvester):
class MySiteCKANHarvester(CKANHarvester):
def modify_package_dict(self, package_dict, harvest_object):
@ -450,6 +450,20 @@ This is a simple example::
return package_dict
Remember to register your custom harvester plugin in your extension ``setup.py`` file, and load the plugin in the config in file afterwards::
# setup.py
entry_points='''
[ckan.plugins]
my_site=ckanext.my_site.plugin:MySitePlugin
my_site_ckan_harvester=ckanext.my_site.harvesters:MySiteCKANHarvester
'''
# ini file
ckan.plugins = ... my_site my_site_ckan_harvester
The harvesting interface
========================