Skip to content

Commit

Permalink
Add initial config declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
amercader committed Jul 3, 2024
1 parent 568952a commit 4a87afc
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
22 changes: 22 additions & 0 deletions ckanext/dcat/config_declaration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
version: 1
groups:
- annotation: ckanext-dcat configuration options
options:
- key: ckanext.dcat.enable_rdf_endpoints
default: True
description: |
Whether to expose the catalog and dataset endpoints with the RDF DCAT
serializations.
type: bool
- key: ckanext.dcat.catalog_endpoint
default: '/catalog.{_format}'
type: str
description: |
Custom route for the catalog endpoint. It should start with `/` and include the
`{_format}` placeholder.
example: '/dcat/catalog/{_format}'
- key: ckanext.dcat.dataset_per_page
default: 100
type: int
description: |
Default number of datasets returned by the catalog endpoint.
8 changes: 8 additions & 0 deletions ckanext/dcat/plugins/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@
I18N_DIR = os.path.join(HERE, u"../i18n")


def config_declaration(func):
if p.toolkit.check_ckan_version(min_version="2.10.0"):
return p.toolkit.blanket.config_declarations(func)
else:
return func


@config_declaration
class DCATPlugin(p.SingletonPlugin, DefaultTranslation):

p.implements(p.IConfigurer, inherit=True)
Expand Down

0 comments on commit 4a87afc

Please sign in to comment.