diff --git a/ckanext/odsh/controller.py b/ckanext/odsh/controller.py index 34b7eeeb94a532f25f6d5eac69257318fa00449f..288c2392a017a1cc60c89cd5061608775fde9e97 100644 --- a/ckanext/odsh/controller.py +++ b/ckanext/odsh/controller.py @@ -19,6 +19,7 @@ from ckanext.dcat.controllers import DCATController abort = base.abort log = logging.getLogger(__name__) + class OdshRouteController(HomeController): def info_page(self): h.redirect_to('http://www.schleswig-holstein.de/odpinfo') @@ -27,6 +28,7 @@ class OdshRouteController(HomeController): def not_found(self): abort(404) + class OdshUserController(UserController): def me(self, locale=None): if not c.user: @@ -63,9 +65,11 @@ class OdshUserController(UserController): abort(404) return super(OdshUserController,self).activity(id, offset) + class OdshPackageController(PackageController): pass + class OdshApiController(ApiController): def action(self, logic_function, ver=None): try: @@ -90,12 +94,14 @@ class OdshApiController(ApiController): log.error(e) return ApiController.action(self, logic_function, ver) - + + class OdshDCATController(DCATController): def read_catalog(self, _format): matomo.create_matomo_request() return DCATController.read_catalog(self,_format) + class OdshFeedController(FeedController): def custom(self): matomo.create_matomo_request() @@ -153,3 +159,8 @@ class OdshFeedController(FeedController): feed_guid=_create_atom_id(atom_url), feed_url=feed_url, navigation_urls=navigation_urls) + + +class OdshAutocompleteController(ApiController): + def autocomplete(self): + base.response.body_file.write("Hello World") diff --git a/ckanext/odsh/plugin.py b/ckanext/odsh/plugin.py index 0e511035c0e9f16253678cad0c79386e6a8e1dbc..e2eb198cfbe66193f37612d6c856c6287a60eea8 100644 --- a/ckanext/odsh/plugin.py +++ b/ckanext/odsh/plugin.py @@ -76,12 +76,22 @@ def remove_route(map,routename): map._routenames.pop(route.name) break + class OdshIcapPlugin(plugins.SingletonPlugin): plugins.implements(plugins.IUploader, inherit=True) def get_resource_uploader(self, data_dict): return ODSHResourceUpload(data_dict) + +class OdshAutocompletePlugin(plugins.SingletonPlugin): + plugins.implements(plugins.IRoutes, inherit=True) + + def before_map(self, map): + controller = 'ckanext.odsh.controller:OdshAutocompleteController' + map.connect('/autocomplete', controller=controller, action='autocomplete') + + class OdshPlugin(plugins.SingletonPlugin, DefaultTranslation, DefaultDatasetForm): plugins.implements(plugins.IConfigurer) plugins.implements(plugins.ITemplateHelpers)