Puppet Class: ckan::ext::geoview
- Defined in:
- manifests/ext/geoview.pp
Summary
Installs the geoview extension.Overview
Requirements:
In order for this module to update the default_views parameter,
it MUST be declared before the ckan module in the manifests.
This will allow all of the variables to be evaulated.
Also, ensure that resource_proxy plugin has been enabled.
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
# File 'manifests/ext/geoview.pp', line 40
class ckan::ext::geoview (
Boolean $openlayers_viewer_enable = true,
String $openlayers_formats = 'wms geojson',
Boolean $openlayers_hide_overlays = false,
Boolean $openlayers_hoveron = true,
Optional[String] $openlayers_google_api_key = undef,
Boolean $leaflet_geojson_viewer_enable = true,
Boolean $leaflet_wmts_viewer_enable = true,
) {
## == openlayers viewer == ##
if $openlayers_viewer_enable {
# set the view
$openlayers_view = ['geo_view']
$openlayers_plugin = ['geo_view']
# add additional configuration to main config file
ckan::conf::setting { 'ckanext.geoview.ol_viewer.formats':
value => $openlayers_formats,
require => Ckan::Ext['geoview'],
}
ckan::conf::setting { 'ckanext.geoview.gapi_key':
value => $openlayers_google_api_key,
require => Ckan::Ext['geoview'],
}
ckan::conf::setting { 'ckanext.geoview.ol_viewer.hide_overlays':
value => $openlayers_hide_overlays,
require => Ckan::Ext['geoview'],
}
ckan::conf::setting { 'ckanext.geoview.ol_viewer.default_feature_hoveron':
value => $openlayers_hoveron,
require => Ckan::Ext['geoview'],
}
} else {
$openlayers_view = []
$openlayers_plugin = []
}
## == geojson == ##
if $leaflet_geojson_viewer_enable {
$geojson_view = ['geojson_view']
$geojson_plugin = ['geojson_view']
} else {
$geojson_view = []
$geojson_plugin = []
}
## == wmts == ##
if $leaflet_wmts_viewer_enable {
$wmts_view = ['wmts_view']
$wmts_plugin = ['wmts_view']
} else {
$wmts_view = []
$wmts_plugin = []
}
# collect variables
$default_views = $openlayers_view + $geojson_view + $wmts_view
$plugins = $openlayers_plugin + $geojson_plugin + $wmts_plugin
# TODO, default_views should be an ARRAY NOT A STRING!!!!!!
ckan::ext { 'geoview':
plugin => $plugins,
views => $default_views,
revision => 'master',
}
}
|