[ckan-dev] ckanext-spatial harvest transform_to_iso hook
Chris MacDermaid - NOAA Affiliate
chris.macdermaid at noaa.gov
Tue May 9 03:23:51 UTC 2017
I'm trying to use the ckanext-spatial transform_to_iso hook to use my own
process to transform FGDC documents to ISO. I created my own CKAN extension
and added the extension to my .ini plugins configuration, but I can't seem
to get the harvest to call my function. I'm not sure what I'm missing.
Below is the the plugin.py from the extension I created.
----------------------plugin.py-----------------------------------------
import ckan.plugins as plugins
import ckan.plugins.toolkit as toolkit
from ckanext.spatial.interfaces import ISpatialHarvester
import logging
class MyPlugin(plugins.SingletonPlugin):
plugins.implements(plugins.IConfigurer)
plugins.implements(ISpatialHarvester, inherit=True)
# IConfigurer
def update_config(self, config_):
toolkit.add_template_directory(config_, 'templates')
toolkit.add_public_directory(config_, 'public')
toolkit.add_resource('fanstatic', 'noaa')
def transform_to_iso(self, original_document, original_format,
harvest_object):
log = logging.getLogger(__name__ + '.my.transform')
log.debug('My transform to ISO stage for object')
return None
-------------------------------------------------------------------------------
----------------------plugin.py-----------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20170508/62663c4f/attachment-0002.html>
More information about the ckan-dev
mailing list