feat: add customization
update d4science customization on 2.10 plugin
This commit is contained in:
parent
856e36655b
commit
bd6de2882a
|
@ -222,7 +222,7 @@ class SpatialHarvester(HarvesterBase):
|
||||||
|
|
||||||
if 'tags' in iso_values:
|
if 'tags' in iso_values:
|
||||||
do_clean = self.source_config.get('clean_tags')
|
do_clean = self.source_config.get('clean_tags')
|
||||||
tags_val = [munge_tag(tag) if do_clean else tag[:100] for tag in iso_values['tags']]
|
tags_val = [munge_tag(tag) if do_clean else tag[:100] for tag in iso_values['tags']] #this is not in d4science custom
|
||||||
tags = [{'name': tag} for tag in tags_val]
|
tags = [{'name': tag} for tag in tags_val]
|
||||||
|
|
||||||
# Add default_tags from config
|
# Add default_tags from config
|
||||||
|
@ -622,6 +622,12 @@ class SpatialHarvester(HarvesterBase):
|
||||||
try:
|
try:
|
||||||
package_id = p.toolkit.get_action('package_create')(context, package_dict)
|
package_id = p.toolkit.get_action('package_create')(context, package_dict)
|
||||||
log.info('Created new package %s with guid %s', package_id, harvest_object.guid)
|
log.info('Created new package %s with guid %s', package_id, harvest_object.guid)
|
||||||
|
|
||||||
|
#d4science check serchable
|
||||||
|
package_dict = check_searchable(package_dict)
|
||||||
|
new_package = p.toolkit.get_action('package_update')(context, package_dict)
|
||||||
|
log.info('Forced package update for adding searchable = True at %s with guid %s', package_id, harvest_object.guid)
|
||||||
|
|
||||||
except p.toolkit.ValidationError as e:
|
except p.toolkit.ValidationError as e:
|
||||||
self._save_object_error('Validation Error: %s' % six.text_type(e.error_summary), harvest_object, 'Import')
|
self._save_object_error('Validation Error: %s' % six.text_type(e.error_summary), harvest_object, 'Import')
|
||||||
return False
|
return False
|
||||||
|
@ -666,6 +672,7 @@ class SpatialHarvester(HarvesterBase):
|
||||||
|
|
||||||
package_dict['id'] = harvest_object.package_id
|
package_dict['id'] = harvest_object.package_id
|
||||||
try:
|
try:
|
||||||
|
package_dict = check_searchable(package_dict) #added
|
||||||
package_id = p.toolkit.get_action('package_update')(context, package_dict)
|
package_id = p.toolkit.get_action('package_update')(context, package_dict)
|
||||||
log.info('Updated package %s with guid %s', package_id, harvest_object.guid)
|
log.info('Updated package %s with guid %s', package_id, harvest_object.guid)
|
||||||
except p.toolkit.ValidationError as e:
|
except p.toolkit.ValidationError as e:
|
||||||
|
|
|
@ -15,7 +15,8 @@ e.g.
|
||||||
<h2 class="module-heading">
|
<h2 class="module-heading">
|
||||||
<i class="icon-medium icon-globe"></i>
|
<i class="icon-medium icon-globe"></i>
|
||||||
{{ _('Filter by location') }}
|
{{ _('Filter by location') }}
|
||||||
<a href="{{ h.remove_url_param(['ext_bbox','ext_prev_extent', 'ext_location']) }}" class="action">{{ _('Clear') }}</a>
|
{# Changed by Francesco Mangiacrapa, added parameter alternative_url=alternative_url #}
|
||||||
|
<a href="{{ h.remove_url_param(['ext_bbox','ext_prev_extent', 'ext_location'], alternative_url=alternative_url) }}" class="action">{{ _('Clear') }}</a>
|
||||||
</h2>
|
</h2>
|
||||||
{% set map_config = h.get_common_map_config() %}
|
{% set map_config = h.get_common_map_config() %}
|
||||||
<div class="dataset-map" data-module="spatial-query" data-default_extent="{{ default_extent }}" data-module-map_config="{{ h.dump_json(map_config) }}">
|
<div class="dataset-map" data-module="spatial-query" data-default_extent="{{ default_extent }}" data-module-map_config="{{ h.dump_json(map_config) }}">
|
||||||
|
@ -26,5 +27,7 @@ e.g.
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
{% set type = 'asset' if h.ckan_version().split('.')[1] | int >= 9 else 'resource' %}
|
{# prima riga d4science, le altre due spatial #}
|
||||||
{% include 'spatial/snippets/spatial_query_' ~ type ~ '.html' %}
|
{# {% resource 'ckanext-spatial/spatial_query' %} #}
|
||||||
|
{# {% set type = 'asset' if h.ckan_version().split('.')[1] | int >= 9 else 'resource' %} #}
|
||||||
|
{# {% include 'spatial/snippets/spatial_query_' ~ type ~ '.html' %} #}
|
||||||
|
|
Loading…
Reference in New Issue