Skip to content
kgrochow edited this page May 21, 2014 · 16 revisions

A previewer that plugs into CKAN is also included in this project in the cesiumpreview folder.

###To create a CKAN installation

Install a local instance of CKAN per http://docs.ckan.org/en/ckan-2.0/install-from-source.html Follow all the steps :

  • In step 1 install openjdk-7-jdk instead of openjdk-6-jdk
  • in step 2c use requirements.txt instead of pip-requirements.txt
  • In step 3 making 'pass' your password will makes things simpler
  • Set up the optional Solr install as per step 5 (Single Solr instance)
  • Step 6 can take a long time. If it does fail drop the ckan_default database and redo step 3 and try again
  • You do no need to set up the optional DataStore install as per step 7

To add local storage of files

sudo mkdir -p /var/lib/ckan/default
sudo chmod 777 /var/lib/ckan/default

in development.ini under storage settings add

nano /etc/ckan/default/development.ini
ckan.storage_path = /var/lib/ckan/default

And to run the server

. /usr/lib/ckan/default/bin/activate
cd /usr/lib/ckan/default/src/ckan
paster serve /etc/ckan/default/development.ini

To install spatial extension for spatial queries and previewers, see http://docs.ckan.org/projects/ckanext-spatial/en/latest/install.html

###To add Cesium Previewer

Make a virtual link to the viewer in CKAN to the cesiumviewer.

ln -s ~/dev/ausglobe/cesiumpreview ~/dev/ckan/lib/default/src/ckan/ckanext/cesiumpreview

in development.ini under storage settings add the plugin

nano /etc/ckan/default/development.ini
ckan.plugins = cesium_viewer ...

And add the entry point in the CKAN files

nano ~/dev/ckan/lib/default/src/ckan/setup.py

And add the following line under the recline_preview plugin entry (line ~76)

 'cesium_preview = ckanext.reclinepreview.plugin:CesiumPreview',

Then

  gedit ~/dev/ckan/lib/default/src/ckan/ckan.egg-info/entry_points.txt

And add the following line under the recline_preview plugin entry (line ~76)

  cesium_preview = ckanext.cesiumpreview.plugin:CesiumPreview   

And finally update the cesium_previewer path to where ever the cesium based viewer is

  nano ~/ausglobe/cesiumpreview/theme/public/preview_cesium.js

If all went correctly you should be able to start the CKAN server in virtualenv and access the server at http://127.0.0.1:5000/

To test the Cesium Previewer

...