├── ckanext ├── privatedatasets │ ├── parsers │ │ ├── __init__.py │ │ └── fiware.py │ ├── tests │ │ ├── __init__.py │ │ ├── test_db.py │ │ ├── test_views.py │ │ ├── test_fiware_parser.py │ │ ├── test_helpers.py │ │ ├── test_converters_validators.py │ │ ├── test_auth.py │ │ ├── test_actions.py │ │ ├── test_plugin.py │ │ └── test_selenium.py │ ├── fanstatic │ │ ├── custom.css │ │ └── allowed_users.js │ ├── templates │ │ ├── snippets │ │ │ ├── acquire_button.html │ │ │ └── package_item.html │ │ ├── user │ │ │ ├── dashboard_acquired.html │ │ │ └── dashboard.html │ │ └── package │ │ │ └── snippets │ │ │ └── package_basic_fields.html │ ├── templates_2.8 │ │ ├── snippets │ │ │ ├── acquire_button.html │ │ │ └── package_item.html │ │ ├── user │ │ │ ├── dashboard_acquired.html │ │ │ └── dashboard.html │ │ └── package │ │ │ └── snippets │ │ │ └── package_basic_fields.html │ ├── __init__.py │ ├── constants.py │ ├── db.py │ ├── views.py │ ├── helpers.py │ ├── converters_validators.py │ ├── auth.py │ ├── actions.py │ └── plugin.py └── __init__.py ├── bin ├── travis-run.sh └── travis-build.bash ├── MANIFEST.in ├── setup.cfg ├── .gitignore ├── .travis.yml ├── test.ini ├── setup.py └── README.md /ckanext/privatedatasets/parsers/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ckanext/privatedatasets/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /bin/travis-run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | echo "Starting Jetty" 4 | sudo service jetty8 restart 5 | 6 | sudo netstat -ntlp 7 | 8 | python setup.py nosetests -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | recursive-include ckanext/privatedatasets/templates * 2 | recursive-include ckanext/privatedatasets/templates_2.8 * 3 | recursive-include ckanext/privatedatasets/fanstatic * 4 | -------------------------------------------------------------------------------- /ckanext/privatedatasets/fanstatic/custom.css: -------------------------------------------------------------------------------- 1 | .label-acquired { 2 | background-color: #55a1ce; 3 | } 4 | 5 | .label-owner { 6 | background-color: #e0051e; 7 | } 8 | 9 | .divider { 10 | margin-left:10px; 11 | height:auto; 12 | display:inline-block; 13 | } -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- 1 | [bdist_wheel] 2 | universal = 1 3 | 4 | [flake8] 5 | ignore=E501 6 | 7 | [metadata] 8 | description-file = README.md 9 | 10 | [nosetests] 11 | ckan=1 12 | with-pylons=test.ini 13 | with-xunit=1 14 | with-coverage=1 15 | cover-package=ckanext.privatedatasets 16 | cover-inclusive=1 17 | cover-erase=1 18 | cover-xml=1 19 | 20 | [pep8] 21 | ignore=E501 22 | -------------------------------------------------------------------------------- /ckanext/privatedatasets/templates/snippets/acquire_button.html: -------------------------------------------------------------------------------- 1 | {# 2 | 3 | Displays a Get Access button to request access to a private dataset. 4 | 5 | ulr_dest - target url 6 | 7 | Example: 8 | 9 | {% snippet 'snippets/acquire_button.html', url_dest=url %} 10 | 11 | #} 12 | 13 | 14 | {{ _('Acquire') }} 15 | 16 | -------------------------------------------------------------------------------- /ckanext/privatedatasets/templates_2.8/snippets/acquire_button.html: -------------------------------------------------------------------------------- 1 | {# 2 | 3 | Displays a Get Access button to request access to a private dataset. 4 | 5 | ulr_dest - target url 6 | 7 | Example: 8 | 9 | {% snippet 'snippets/acquire_button.html', url_dest=url %} 10 | 11 | #} 12 | 13 | 14 | {{ _('Acquire') }} 15 | 16 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | 5 | # C extensions 6 | *.so 7 | 8 | # Distribution / packaging 9 | .Python 10 | env/ 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | eggs/ 15 | lib/ 16 | lib64/ 17 | parts/ 18 | sdist/ 19 | var/ 20 | *.egg-info/ 21 | .installed.cfg 22 | *.egg 23 | .eggs 24 | # Installer logs 25 | pip-log.txt 26 | pip-delete-this-directory.txt 27 | 28 | # Unit test / coverage reports 29 | htmlcov/ 30 | .tox/ 31 | .coverage 32 | .cache 33 | nosetests.xml 34 | coverage.xml 35 | 36 | # Translations 37 | *.mo 38 | 39 | # Mr Developer 40 | .mr.developer.cfg 41 | .project 42 | .pydevproject 43 | 44 | # Rope 45 | .ropeproject 46 | 47 | # Django stuff: 48 | *.log 49 | *.pot 50 | 51 | # Sphinx documentation 52 | docs/_build/ 53 | 54 | .idea 55 | venv -------------------------------------------------------------------------------- /ckanext/privatedatasets/templates/user/dashboard_acquired.html: -------------------------------------------------------------------------------- 1 | {% extends "user/dashboard.html" %} 2 | 3 | {% block dashboard_activity_stream_context %}{% endblock %} 4 | 5 | {% block page_primary_action %} 6 | {% link_for _('Acquire Dataset'), controller='package', action='search', class_="btn btn-primary", icon="shopping-cart" %} 7 | {% endblock %} 8 | 9 | {% block primary_content_inner %} 10 |
15 | {{ _('You haven\'t acquired any datasets.') }} 16 | {% link_for _('Acquire one now?'), controller='package', action='search' %} 17 |
18 | {% endif %} 19 | {% endblock %} 20 | -------------------------------------------------------------------------------- /ckanext/privatedatasets/templates_2.8/user/dashboard_acquired.html: -------------------------------------------------------------------------------- 1 | {% extends "user/dashboard.html" %} 2 | 3 | {% block dashboard_activity_stream_context %}{% endblock %} 4 | 5 | {% block page_primary_action %} 6 | {% link_for _('Acquire Dataset'), controller='package', action='search', class_="btn btn-primary", icon="shopping-cart" %} 7 | {% endblock %} 8 | 9 | {% block primary_content_inner %} 10 |15 | {{ _('You haven\'t acquired any datasets.') }} 16 | {% link_for _('Acquire one now?'), controller='package', action='search' %} 17 |
18 | {% endif %} 19 | {% endblock %} 20 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: required 2 | language: python 3 | python: 4 | - "2.7" 5 | env: 6 | - CKANVERSION=2.7.3 7 | - CKANVERSION=2.8.1 8 | - CKANVERSION=2.8.2 9 | services: 10 | - redis-server 11 | - postgresql 12 | - xvfb 13 | addons: 14 | firefox: "60.1.0esr" 15 | before_install: 16 | - wget https://github.com/mozilla/geckodriver/releases/download/v0.21.0/geckodriver-v0.21.0-linux64.tar.gz 17 | - mkdir geckodriver 18 | - tar -xzf geckodriver-v0.21.0-linux64.tar.gz -C geckodriver 19 | - export PATH=$PATH:$PWD/geckodriver 20 | install: 21 | - bash bin/travis-build.bash 22 | before_script: 23 | - "export DISPLAY=:99.0" 24 | - sleep 3 # give xvfb some time to start 25 | script: 26 | - sh bin/travis-run.sh 27 | after_success: coveralls 28 | branches: 29 | only: 30 | - master 31 | -------------------------------------------------------------------------------- /ckanext/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Copyright (c) 2014 CoNWeT Lab., Universidad Politécnica de Madrid 4 | 5 | # This file is part of CKAN Private Dataset Extension. 6 | 7 | # CKAN Private Dataset Extension is free software: you can redistribute it and/or 8 | # modify it under the terms of the GNU Affero General Public License as published by 9 | # the Free Software Foundation, either version 3 of the License, or 10 | # (at your option) any later version. 11 | 12 | # CKAN Private Dataset Extension is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU Affero General Public License for more details. 16 | 17 | # You should have received a copy of the GNU Affero General Public License 18 | # along with CKAN Private Dataset Extension. If not, see