Giter Site home page Giter Site logo

amercader / ckanext-datapub Goto Github PK

View Code? Open in Web Editor NEW

This project forked from datopian/ckanext-datapub

0.0 1.0 0.0 24.5 MB

CKAN extension to integrate your custom DataPub.js based dataset and resource editor

License: GNU Affero General Public License v3.0

Shell 36.87% Python 56.61% HTML 6.53%

ckanext-datapub's Introduction

Enable Datapub apps in your CKAN instance.

Find out about Datapub here - https://github.com/datopian/datapub.

Installation

This extension requires https://github.com/datopian/ckanext-blob-storage to be enabled as it uses storage_service_url for uploading files.

Just follow standard procedure for setting up an extension for the CKAN and add datapub into list of the plugins. Note that this extension was developed and tested using version 2.8.

Setup JS modules:

sh sync.sh

It would:

Note:

  • if you are developing a React app, e.g., custom datapub app, you can use the following attributes passed from the /templates/datapub/snippets/upload_module.html:
<div id="ResourceEditor"
     data-dataset-id="{{ pkg_name }}"
     data-api="{{ base_url }}"
     data-lfs="{{ h.blob_storage_lfs_url() }}"
     data-auth-token="{{ api_key }}"
     data-organization-id="{{ h.blob_storage_organization_name(pkg_name) }}"
     data-resource-id="{{ resource_id }}">
</div>

CKAN >= 2.9 support

CKAN >= 2.9 uses webassets to manage all the bundles and the tag changed from resource to asset.

In order to build an upload_module.html that runs on CKAN >= 2.9 you can pass webassets as third parameter.

Example:

sh sync.sh https://github.com/datopian/datapub master webassets

This will create an upload_module.html like the following one:

{% asset "datapub/datapub-js" %}
{% asset "datapub/datapub-css" %}

<div id="ResourceEditor"
     data-dataset-id="{{ pkg_name }}"
     data-api="{{ base_url }}"
     data-lfs="{{ h.blob_storage_lfs_url() }}"
     data-auth-token="{{ api_key }}"
     data-organization-id="{{ h.blob_storage_organization_name(pkg_name) }}"
     data-resource-id="{{ resource_id }}">
</div>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.