Remove unused harvest patch

- Now the custom harvest panel is derived to ckanext-schemingdcat. Update .env.example and remove patch.
- Remove unused recline_view
This commit is contained in:
mjanez 2024-06-26 10:17:28 +02:00
parent d7ebbf833c
commit f033f6b10c
No known key found for this signature in database
GPG Key ID: 7A62FDE17C5A4929
2 changed files with 2 additions and 146 deletions

View File

@ -119,7 +119,7 @@ CKAN__RESOURCE_PROXY__MAX_FILE_SIZE=50048576
CKAN__RESOURCE_PROXY__CHUNK_SIZE=4096
## Default timeout for fetching proxied items
CKAN__RESOURCE_PROXY__TIMEOUT=10
CKAN__VIEWS__DEFAULT_VIEWS="image_view webpage_view text_view recline_view wmts_view geojson_view geo_view shp_view pdf_view"
CKAN__VIEWS__DEFAULT_VIEWS="image_view webpage_view text_view datatables_view wmts_view geojson_view geo_view shp_view pdf_view"
# Localization
CKAN__LOCALE_DEFAULT="en"
@ -127,7 +127,7 @@ CKAN__LOCALE_ORDER="en es pt_BR ja it cs_CZ ca fr el sv sr sr@latin no sk fi ru
CKAN__LOCALES_OFFERED="en es pt_BR ja it cs_CZ ca fr el sv sr sr@latin no sk fi ru de pl nl bg ko_KR hu sa sl lv"
# Extensions
CKAN__PLUGINS="envvars stats image_view text_view datatables_view webpage_view resourcedictionary datastore xloader harvest spatial_metadata spatial_query spatial_harvest_metadata_api csw_harvester waf_harvester doc_harvester resource_proxy geo_view geojson_view wmts_view shp_view dcat dcat_rdf_harvester dcat_json_harvester dcat_json_interface schemingdcat_datasets schemingdcat_groups schemingdcat_organizations schemingdcat schemingdcat_ckan_harvester schemingdcat_xls_harvester pdf_view pages fluent"
CKAN__PLUGINS="envvars stats image_view text_view datatables_view webpage_view resourcedictionary datastore xloader spatial_metadata spatial_query spatial_harvest_metadata_api csw_harvester waf_harvester doc_harvester resource_proxy geo_view geojson_view wmts_view shp_view dcat dcat_rdf_harvester dcat_json_harvester dcat_json_interface schemingdcat_datasets schemingdcat_groups schemingdcat_organizations schemingdcat schemingdcat_ckan_harvester schemingdcat_xls_harvester harvest pdf_view pages fluent"
# ckanext-harvest
CKAN__HARVEST__MQ__TYPE=redis

View File

@ -1,144 +0,0 @@
diff --git a/ckanext/harvest/logic/action/update.py b/ckanext/harvest/logic/action/update.py
index 7dce1f5..ac4db4f 100644
--- a/ckanext/harvest/logic/action/update.py
+++ b/ckanext/harvest/logic/action/update.py
@@ -706,7 +706,7 @@ def harvest_jobs_run(context, data_dict):
notify_all = toolkit.asbool(config.get('ckan.harvest.status_mail.all'))
notify_errors = toolkit.asbool(config.get('ckan.harvest.status_mail.errored'))
last_job_errors = status['last_job']['stats'].get('errored', 0)
- log.debug('Notifications: All:{} On error:{} Errors:{}'.format(notify_all, notify_errors, last_job_errors))
+ log.debug('Notifications: All:{} On error:{} Errors:{} Errordict:{}'.format(notify_all, notify_errors, last_job_errors, status['last_job']['stats']))
if last_job_errors > 0 and (notify_all or notify_errors):
send_error_email(context, job_obj.source.id, status)
diff --git a/ckanext/harvest/templates/snippets/source_item.html b/ckanext/harvest/templates/snippets/source_item.html
index a8ba26f..3f50bdb 100644
--- a/ckanext/harvest/templates/snippets/source_item.html
+++ b/ckanext/harvest/templates/snippets/source_item.html
@@ -48,6 +48,7 @@ Example:
{% endif %}
{% if not within_organization and source.organization %}
&mdash; {{ _('Organization') }}: {{ h.link_to(source.organization.title or source.organization.name, h.url_for('organization.read', id=source.organization.name)) }}</a>
+ &mdash; {{ _('Datasets') }}: {{ h.link_to(h.schemingdcat_package_count_for_source(source.id), url) }}</a>
{% endif %}
</p>
diff --git a/ckanext/harvest/templates/source/new.html b/ckanext/harvest/templates/source/new.html
index b7feb3d..b1fe472 100644
--- a/ckanext/harvest/templates/source/new.html
+++ b/ckanext/harvest/templates/source/new.html
@@ -24,12 +24,18 @@
<div class="module-content">
<p>
{% trans %}
- Harvest sources allow importing remote metadata into this catalog.
- Remote sources can be other catalogs such as other CKAN instances, CSW
- servers or Web Accessible Folders (WAF) (depending on the actual
- harvesters enabled for this instance).
+ Harvest sources allow importing remote metadata into this catalog. Remote sources can be other catalogs such as other CKAN instances, CSW servers, XML metadata files, XLSX with metadata records or Web Accessible Folder (WAF).
{% endtrans %}
</p>
+
+ <p>
+ {{ _('Depending on the actual harvesters enabled for this instance. eg: ') }}
+ <ul>
+ <li><a href="https://github.com/mjanez/ckanext-schemingdcat?tab=readme-ov-file#harvesters" target="_blank">ckanext-schemingdcat</a></li>
+ <li><a href="https://github.com/ckan/ckanext-dcat?tab=readme-ov-file#rdf-dcat-harvester" target="_blank">ckanext-dcat</a></li>
+ <li><a href="https://docs.ckan.org/projects/ckanext-spatial/en/latest/harvesters.html" target="_blank">ckanext-scheming_spatial</a></li>
+ </ul>
+ </p>
</div>
</section>
{% endblock %}
diff --git a/ckanext/harvest/templates/source/new_source_form.html b/ckanext/harvest/templates/source/new_source_form.html
index 324d012..37358fc 100644
--- a/ckanext/harvest/templates/source/new_source_form.html
+++ b/ckanext/harvest/templates/source/new_source_form.html
@@ -8,7 +8,7 @@
{% call form.input('url', id='field-url', label=_('URL'), value=data.url, error=errors.url, classes=['control-full', 'control-large']) %}
<span class="info-block">
- {{ _('This should include the http:// part of the URL') }}
+ <i class="fa fa-exclamation-triangle"></i> {{ _('This should include the http:// part of the URL') }}
</span>
{% endcall %}
@@ -26,7 +26,7 @@
{{ form.markdown('notes', id='field-notes', label=_('Description'), value=data.notes, error=errors.notes) }}
<div class="harvest-types form-group control-group">
- <label class="control-label">Source type</label>
+ <label class="control-label">{{ _('Source type') }}</label>
<div class="controls">
{% for harvester in h.harvesters_info() %}
{% set checked = False %}
@@ -46,7 +46,11 @@
{{ form.select('frequency', id='field-frequency', label=_('Update frequency'), options=h.harvest_frequencies(), selected=data.frequency, error=errors.frequency) }}
{% block extra_config %}
- {{ form.textarea('config', id='field-config', label=_('Configuration'), value=data.config, error=errors.config) }}
+ {% call form.textarea('config', id='field-config', label=_('Configuration'), value=data.config, error=errors.config) %}
+ <span class="info-block">
+ <i class="fa fa-info-circle"></i> {{ _('You can validate the JSON at: ') }} <a href="{{ h.url_for_static_or_external("https://jsonlint.com/") }}" target="_blank" rel="noreferrer">{{ _('JSONLint') }}</a>
+ </span>
+ {% endcall %}
{% endblock extra_config %}
{# if we have a default group then this wants remembering #}
diff --git a/ckanext/harvest/templates/source/read.html b/ckanext/harvest/templates/source/read.html
index e016e55..e60a18c 100644
--- a/ckanext/harvest/templates/source/read.html
+++ b/ckanext/harvest/templates/source/read.html
@@ -3,6 +3,6 @@
{% block primary_content_inner %}
<section class="module-content">
<h1 class="hide-heading">{{ _('Datasets') }}</h1>
- {{ h.package_list_for_source(harvest_source.id) }}
+ {{ h.schemingdcat_package_list_for_source(harvest_source.id) }}
</section>
{% endblock %}
diff --git a/ckanext/harvest/templates/source/read_base.html b/ckanext/harvest/templates/source/read_base.html
index 5126e25..3191c38 100644
--- a/ckanext/harvest/templates/source/read_base.html
+++ b/ckanext/harvest/templates/source/read_base.html
@@ -15,7 +15,7 @@
<div class="nums">
<dl>
<dt>{{ _('Datasets') }}</dt>
- <dd>{{ h.package_count_for_source(harvest_source.id) }}</dd>
+ <dd>{{ h.schemingdcat_package_count_for_source(harvest_source.id) }}</dd>
</dl>
</div>
</section>
diff --git a/ckanext/harvest/templates/source/search.html b/ckanext/harvest/templates/source/search.html
index d9ceeea..f44a0cb 100644
--- a/ckanext/harvest/templates/source/search.html
+++ b/ckanext/harvest/templates/source/search.html
@@ -44,7 +44,26 @@
-{% block secondary_content %}
+ {% block secondary_content %}
+ <section class="module module-narrow">
+ <h2 class="module-heading"><i class="fa fa-lg fa-info-circle icon-large icon-info-sign"></i> {{ _('Harvest sources') }}</h2>
+ <div class="module-content">
+ <p>
+ {% trans %}
+ Harvest sources allow importing remote metadata into this catalog. Remote sources can be other catalogs such as other CKAN instances, CSW servers, XML metadata files, XLSX with metadata records or Web Accessible Folder (WAF).
+ {% endtrans %}
+ </p>
+
+ <p>
+ {{ _('Depending on the actual harvesters enabled for this instance. eg: ') }}
+ <ul>
+ <li><a href="https://github.com/mjanez/ckanext-schemingdcat?tab=readme-ov-file#harvesters" target="_blank">ckanext-schemingdcat</a></li>
+ <li><a href="https://github.com/ckan/ckanext-dcat?tab=readme-ov-file#rdf-dcat-harvester" target="_blank">ckanext-dcat</a></li>
+ <li><a href="https://docs.ckan.org/projects/ckanext-spatial/en/latest/harvesters.html" target="_blank">ckanext-scheming_spatial</a></li>
+ </ul>
+ </p>
+ </div>
+ </section>
{% for facet in c.facet_titles %}
{{ h.snippet('snippets/facet_list.html', title=c.facet_titles[facet], name=facet, alternative_url=h.url_for('{0}.search'.format(c.dataset_type))) }}
{% endfor %}