forked from ckan/ckan-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
playing around with scheming extension
- Loading branch information
Martin
committed
Mar 23, 2023
1 parent
6c9c6de
commit aa1735d
Showing
4 changed files
with
168 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,4 +14,44 @@ RUN if ! [ /usr/share/zoneinfo/${TZ} -ef /etc/localtime ]; then \ | |
|
||
# Copy ckan.ini and images to container | ||
COPY ckan.ini /srv/app/ckan.ini | ||
COPY images/muc_2.png /srv/app/src/ckan/ckan/public/base/images/muc_2.png | ||
COPY images/muc_2.png /srv/app/src/ckan/ckan/public/base/images/muc_2.png | ||
|
||
|
||
|
||
# Install any extensions needed by your CKAN instance | ||
# - Make sure to add the plugins to CKAN__PLUGINS in the .env file | ||
# - Also make sure all extra configuration options are added to the CKAN config file (ckan.ini) | ||
# This can be done by creating an overriding start_ckan_dev_development.sh file: | ||
# (https://github.com/ckan/ckan-docker-base/blob/main/ckan-2.9/dev/setup/start_ckan_development.sh) ie: updating the 'ckan config-tool' lines | ||
# For more on config-tool please see https://docs.ckan.org/en/latest/maintaining/cli.html#config-tool-tool-for-editing-options-in-a-ckan-config-file | ||
# or using Crudini (https://github.com/pixelb/crudini) | ||
# | ||
# For instance: | ||
# | ||
### XLoader ### | ||
#RUN pip3 install -e 'git+https://github.com/ckan/ckanext-xloader.git@master#egg=ckanext-xloader' && \ | ||
# pip3 install -r ${APP_DIR}/src/ckanext-xloader/requirements.txt && \ | ||
# pip3 install -U requests[security] | ||
|
||
### Harvester ### | ||
#RUN pip3 install -e 'git+https://github.com/ckan/ckanext-harvest.git@master#egg=ckanext-harvest' && \ | ||
# pip3 install -r ${APP_DIR}/src/ckanext-harvest/pip-requirements.txt | ||
# will also require gather_consumer and fetch_consumer processes running (please see https://github.com/ckan/ckanext-harvest) | ||
|
||
### Scheming ### | ||
#RUN pip3 install -e 'git+https://github.com/ckan/ckanext-scheming.git@master#egg=ckanext-scheming' | ||
RUN pip3 install -e 'git+https://github.com/ckan/ckanext-scheming.git@master#egg=ckanext-scheming' | ||
COPY extensions/camel_photos.yaml /srv/app/src/ckanext-scheming/ckanext/scheming/camel_photos.yaml | ||
COPY extensions/add_dataset.html /srv/app/src/ckan/ckan/templates/snippets/add_dataset.html | ||
### Pages ### | ||
#RUN pip3 install -e git+https://github.com/ckan/ckanext-pages.git#egg=ckanext-pages | ||
|
||
### DCAT ### | ||
#RUN pip3 install -e git+https://github.com/ckan/[email protected]#egg=ckanext-dcat && \ | ||
# pip3 install -r https://raw.githubusercontent.com/ckan/ckanext-dcat/v0.0.6/requirements.txt | ||
|
||
# Clone the extension(s) your are writing for your own project in the `src` folder | ||
# to get them mounted in this image at runtime | ||
|
||
# Apply any patches needed to CKAN core or any of the built extensions (not the | ||
# runtime mounted ones) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{# Adds 'Add Dataset' button #} | ||
|
||
{% set dataset_type = dataset_type if dataset_type else h.default_package_type() %} | ||
{% set link_label = h.humanize_entity_type('package', dataset_type, 'add link') or _("Add Dataset Standard") %} | ||
{% set route_name = dataset_type ~ '.new' %} | ||
|
||
{% if group %} | ||
{% link_for link_label, named_route=route_name, group=group, class_='btn btn-primary', icon='plus-square' %} | ||
{% else %} | ||
{% link_for link_label, named_route=route_name, class_='btn btn-primary', icon='plus-square' %} | ||
{% endif %} | ||
|
||
|
||
{# Adds 'Add Camel-Photo' button #} | ||
|
||
{% set dataset_type = dataset_type if dataset_type else h.default_package_type() %} | ||
{% set link_label = h.humanize_entity_type('package', dataset_type, 'add link') or _("Add Dataset Camel") %} | ||
{% set route_name = "camel-photos" ~ '.new' %} | ||
|
||
{% if group %} | ||
{% link_for link_label, named_route=route_name, group=group, class_='btn btn-primary', icon='plus-square' %} | ||
{% else %} | ||
{% link_for link_label, named_route=route_name, class_='btn btn-primary', icon='plus-square' %} | ||
{% endif %} | ||
|
||
|
||
{# Adds 'Add ckan_formpages' button #} | ||
|
||
{% set dataset_type = dataset_type if dataset_type else h.default_package_type() %} | ||
{% set link_label = h.humanize_entity_type('package', dataset_type, 'add link') or _("Add Dataset Formpages") %} | ||
{% set route_name = "formpages" ~ '.new' %} | ||
|
||
{% if group %} | ||
{% link_for link_label, named_route=route_name, group=group, class_='btn btn-primary', icon='plus-square' %} | ||
{% else %} | ||
{% link_for link_label, named_route=route_name, class_='btn btn-primary', icon='plus-square' %} | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
scheming_version: 2 | ||
dataset_type: camel-photos | ||
about_url: http://example.com/the-camel-photos-schema | ||
|
||
|
||
dataset_fields: | ||
|
||
- field_name: title | ||
label: Title | ||
preset: title | ||
form_placeholder: eg. Larry, Peter, Susan | ||
|
||
- field_name: name | ||
label: URL | ||
preset: dataset_slug | ||
form_placeholder: eg. camel-no-5 | ||
|
||
- field_name: humps | ||
label: Humps | ||
validators: ignore_missing int_validator | ||
form_placeholder: eg. 2 | ||
|
||
- field_name: category | ||
label: Category | ||
help_text: Make and model | ||
help_inline: true | ||
preset: select | ||
choices: | ||
- value: bactrian | ||
label: Bactrian Camel | ||
- value: hybrid | ||
label: Hybrid Camel | ||
- value: f2hybrid | ||
label: F2 Hybrid Camel | ||
- value: snowwhite | ||
label: Snow-white Dromedary | ||
- value: black | ||
label: Black Camel | ||
|
||
- field_name: personality | ||
label: Personality | ||
preset: multiple_checkbox | ||
choices: | ||
- value: friendly | ||
label: Often friendly | ||
- value: jealous | ||
label: Jealous of others | ||
- value: spits | ||
label: Tends to spit | ||
|
||
- field_name: other | ||
label: | ||
en: Other information | ||
output_validators: ignore_missing | ||
|
||
- field_name: owner_org | ||
label: Organization | ||
preset: dataset_organization | ||
|
||
|
||
resource_fields: | ||
|
||
- field_name: url | ||
label: Photo | ||
preset: resource_url_upload | ||
form_placeholder: http://example.com/my-camel-photo.jpg | ||
upload_label: Photo | ||
|
||
- field_name: camels_in_photo | ||
label: Camels in Photo | ||
validators: ignore_missing int_validator | ||
form_placeholder: eg. 2 | ||
|
||
- field_name: others_in_photo | ||
label: Other Thing in Photo | ||
output_validators: ignore_missing | ||
|
||
- field_name: datetime | ||
label: Date Taken | ||
label_time: Time Taken | ||
preset: datetime |