Extension Dataset and data request commenting system


Extension Basics

Title
Dataset and data request commenting system
Name
ckanext-ytp-comments
Type
Public extension
Description
Adds commenting functionality on datasets and data requests with email notifications and profanity filtering
CKAN versions
Download-Url (zip)
Download-Url commit date
2020-01-01
Url to repo
Category
Content Management


Background Infos

Description (long)
Show details

This extension provides a comprehensive commenting system for CKAN datasets and data requests, originally developed for Data.Qld. Features include: commenting on datasets and data requests with threaded replies, opt-in comment notification system via email, follow/mute functionality at content item or thread level, profanity filtering using profanityfilter module with customizable blacklist/whitelist, email notifications for authors and organization admins, user preference management for comment notifications, comment_notification_recipient database table for tracking follow/mute preferences, blacklist words from bad_words.txt (configurable), whitelist words from good_words.txt to allow specific terms (configurable), optional tab page display for dataset comments instead of below additional info, BDD testing with Behave/Behaving/Splinter frameworks, Docker-based local development with Pygmy/Ahoy, GitHub Actions CI/CD integration, Python 2.7 compatible (production stable). Includes paster commands: initdb, updatedb, init_notifications_db. For Data.Qld deployment.

Version
0.0
Version release date
2020-01-01
Contact name
Digital Applications
Contakt email
Contact Url
(not set)


Installation Guide

Configuration hints

Install via pip:

pip install -e git+https://github.com/qld-gov-au/ckanext-ytp-comments.git#egg=ckanext-ytp-comments

pip install -r requirements.txt

Initialize database tables:

cd /usr/lib/ckan/default/src/ckanext-ytp-comments

paster initdb -c /etc/ckan/default/development.ini

paster updatedb -c /etc/ckan/default/development.ini

paster init_notifications_db -c /etc/ckan/default/development.ini

Note: May need to run python setup.py develop first for paster commands.

Enable the plugin:

ckan.plugins = ytp_comments

Configuration options:

Enable follow/mute functionality

ckan.comments.follow_mute_enabled = True

Custom blacklist words file (optional)

ckan.comments.bad_words_file = /path/to/blacklist_words.txt

Custom whitelist words file (optional)

ckan.comments.good_words_file = /path/to/whitelist_words.txt

Display comments on tab page instead of below dataset info

ckan.comments.show_comments_tab_page = True # Default: False

Profanity filtering: - Uses profanityfilter Python module - Built-in blacklist plus custom bad_words.txt - Whitelist via good_words.txt to allow specific terms - Comments with profanity are blocked

Local development (Docker):

pygmy up

ahoy build

ahoy up

Login: admin/password

Available ahoy commands: - build, clean, cli, doctor, down, flush-redis - info, install-site, lint, logs, pull, reset - restart, start, stop, test-bdd, test-unit, up

Testing:

ahoy test-unit # Run unit tests

ahoy test-bdd # Run BDD tests with Behave

Environment variables: - ALLOW_LINT_FAIL=1 to allow lint failures - ALLOW_UNIT_FAIL=1 to allow unit test failures - ALLOW_BDD_FAIL=1 to allow BDD test failures

Database: Creates comment_notification_recipient table for user preferences.

Notifications: - Opt-in system (must follow to receive) - Authors/org admins always notified - Email sent on new comments/replies

Plugins to configure (ckan.ini)
ytp_comments
CKAN Settings (ckan.ini)
# ckan.comments.follow_mute_enabled = True # ckan.comments.bad_words_file = /path/to/blacklist_words.txt # ckan.comments.good_words_file = /path/to/whitelist_words.txt # ckan.comments.show_comments_tab_page = True # Defaults to False
DB migration to be executed
ytp-comments
<< back to Extensions