Skip to content
David Leoni edited this page Jul 12, 2016 · 67 revisions

Jackan

Development guidelines

Branches

Testing

Portals to test


Development guidelines

In this wiki we only put information about development of Jackan. For usage information please refer to the project website

For information about CKAN API and DCAT see the right sidebar.

For contributing to Jackan we follow the same guidelines and procedures described in tod-commons wiki

In general we don't aim to cover all ckan api, if there are two ways to obtain the same result we just implement one and make sure it works.

Branches

Snapshots in master and branch-0.* branches are automatically built by Jenkins and deployed to Sonatype. Read further on how to use them.

Stable branch

Current stable branch is branch-0.4, if you wish to try out latest patches or contribute use this branch.

Using latest stable branch

To use latest snapshot jars in Maven, add this to your pom.xml:

  <repositories>
    <repository>
        <id>sonatype-nexus-snapshots</id>
        <name>project</name>
        <url>https://oss.sonatype.org/content/repositories/snapshots/</url>            
    </repository>        
</repositories>

in the dependencies section, add:

    <dependency>
      <groupId>eu.trentorise.opendata</groupId>
      <artifactId>jackan</artifactId>
      <version>0.4.X-SNAPSHOT</version>
    </dependency>

where X represent the latest version

Contributing to stable branch
  1. Fork the repo in github website

  2. Clone your fork on your machine

git clone https://github.com/YOUR_USERNAME/jackan.git
  1. Checkout the stable branch-0.4:
git checkout branch-0.4
  1. Create a local branch for your new feature / bugfix :
git checkout -b my-new-feature
  1. Work on the branch and commit locally

  2. Push to your Github repo:

git push origin my-new-feature

Now you can open a pull request from branch my-new-feature to branch-0.4 in Jackan original repo and wait for review!

Unstable branch

Unstable branch (0.5.x series) is in master

We don't recommend using it as it has unstable, unreleased dependencies.

Snapshot deployment

Snapshot deployment is done on Sonatype: https://oss.sonatype.org/content/repositories/snapshots/eu/trentorise/opendata/jackan/

    mvn clean deploy

Testing

There are normal Junit tests and also integration tests. JUnit tests are run during build process while integration tests are run in the proper Maven integration-test phase. Integration tests all have filenames ending with IT.java

To run the integration tests:


mvn integration-test

In order to tune logging for your needs and for the tests that write into catalogs to work you need to:

  1. Copy *.properties files of the folder src/test/resources_into the folder conf in the root of the project
  2. Edit the file conf/jackan.test.properties with your catalog credentials

Portals to test

As reference portals we take dati.trentino.it and dati.toscana.it . All reading tests must pass for these catalogs. For writing tests, we currently test against demo.ckan.org and dati.trentino.it versions. In the future we might set up some travis build that downloads latest ckan and writes into it.

Further portals we will consider for testing are listed in ckan-instances.txt file.

There is also available a complete report with test runs for all these catalogs made by CkanTestReporter app. The reporter can be run with command:

 mvn exec:java -Dexec.mainClass="eu.trentorise.opendata.jackan.test.ckan.CkanTestReporter"  -Dexec.classpathScope="test"

demo.ckan.org

As a rule of thumb, we keep demo.ckan.org as a reference and make sure most writing tests pass. Because of authorization restrictions, not all of them can pass, though.

As of July 12th 2016:

Restrictions in place:

  • can't create vocabularies - this also makes creating tags problematic
  • can't create users

Status: ( for current one see http://demo.ckan.org/api/3/action/help_show?name=status_show )

ckan_version: "2.5.2",
site_url: "http://demo.ckan.org",
site_description: "",
site_title: "CKAN Demo",
error_emails_to: null,
locale_default: "en",
extensions: [
    "image_view",
    "text_view",
    "recline_view",
    "datastore",
    "datapusher",
    "sentry",
    "s3filestore",
    "envvars",
    "stats",
    "resource_proxy",
    "pdf_view",
    "spatial_metadata",
    "spatial_query",
    "geojson_view",
    "geo_view",
    "disqus",
    "apihelper",
    "recline_map_view",
    "recline_graph_view",
    "recline_grid_view",
    "dcat",
    "demo"
]

Multilingual portals

Switzerland has a pilot CKAN portal:

http://www.opendata.admin.ch

It's interesting because it has multilingual data, for example here you have same dataset description in 4 languages (!): German French English Italian

Multilingual info doesn't seem exposed in the api: (at least Switlerland's 'default' one and '/en' one)

Vanilla CKAN has so called Multilingual extension , but Canadian open data devs say they had to build a new extension from scratch to handle multilinguism properly.