This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Help us improve Python packaging - Donate today!
Project Description

collective.contentalerts

Get alerts whenever a (two custom lists of) word is found on a content object, be that object any content type (Dexterity, Archetypes or comments).

Can be used to:

  • moderate: used as a blacklist.
  • highlight: used as a whitelist.

The main idea is to use the power of plone.app.contentrules to inspect content being generated by users for certain words.

Upon that, regular plone.app.contentrules actions can be triggered: send an email, notify the user, apply a workflow transition…

The secondary idea is to be able to do different actions on the content depending on if the words where found on one or the other list.

Features

  • manage two lists of words that will be used to search (blacklist/whitelist)
    • named forbidden_words and inadequate_words
  • integration with plone.app.contentrules:
    • conditions to look for stop words (either from any list or from a specific one)
    • string substitutions to add on emails the snippets where the stop words where found (one for documents and one for comments)
  • standalone utility
    • with methods to either look for words on both lists or only on one of them
  • provide different word lists if you need them, either two general ones (plone.registry based) or on a per contentrule basis
  • look for stop words on comments, dexterity and archetypes content types
  • apply a marker interface to objects that are found to have stop words
  • mark objects as reviewed
  • monitor the list of words for changes and search for the new stop words on already reviewed objects
    • if [async] extra is enable this review will be done via an asynchronous job (vi collective.taskqueue)

Where it searches on

collective.contentalerts searches either on the comments’ text, on getText() (for Archetypes based content types) or on text (for Dexterity based content types).

Standalone usage

While the main integration within Plone is via a p.a.contentrules condition, collective.contentalerts can also be used as a standalone utility.

Just get the utility (collective.contentalerts.interfaces.IAlert) and use the provided methods.

Documentation

Full documentation for end users can be found in the “docs” folder.

Installation

Install collective.contentalerts by adding it to your buildout:

[buildout]

 ...

 eggs =
     collective.contentalerts

and then running “bin/buildout”

Upgrade notes

If you are upgrading from 0.7 to any later version there’s one manual step that needs to be done.

On version 1.0 the single list of stop words was split into inadequate_words and forbidden_words.

As it can not be guessed which list the former list is supposed to map, no automatic migration is provided.

An upgrade step needs to be written then.

See below an example on how to migrate the former list to the new forbidden_words list:

from plone import api
from plone.registry.interfaces import IRegistry
from zope.component import getUtility

# safe the stop words on the old location
old_setting = 'collective.contentalerts.interfaces.IStopWords.stop_words'
current_forbidden_words = api.portal.get_registry_record(name=old_setting)

# update registry
setup = api.portal.get_tool('portal_setup')
setup.runImportStepFromProfile(
    'profile-collective.contentalerts:default',
    'plone.app.registry'
)

# set the stop words on the new field
api.portal.set_registry_record(
    name='collective.contentalerts.interfaces.IStopWords.forbidden_words',
    value=current_forbidden_words
)

# remove the old setting
registry = getUtility(IRegistry)
del registry.records[old_setting]

License

The project is licensed under the GPLv2.

Credits

der Freitag sponsored the creation of this add-on.

Contributors

Changelog

1.1 (2016-03-29)

  • Be sure to remove the marker interface only when its needed. [gforcada]

1.0.post0 (2016-03-12)

  • Update German translation. [staeff]

1.0 (2016-03-11)

  • Renamed the registry setting, now two lists are used: forbidden_words and inadequate_words. See the README.rst for instructions on how to create an upgrade step to migrate them. [gforcada]
  • Updated IAlert utility to use either both stop words list, or just one if told so (passed as an argument). [gforcada]
  • Add a has_forbidden_words method to IAlert utility. It allows to check only for forbidden stop words only. [gforcada]
  • Make @@review-objects view more generic by allowing a marker interface and review states to be passed. This allows filtering which elements will be checked for stop words. [gforcada]
  • Triple the content rules so one can decide to monitor for any kind of word, only forbidden words or only inadequate ones. [gforcada]

0.7 (2016-01-22)

  • Monitor registry setting (stop words) for changes. If changes are found, verify if reviewed objects have those new stop words. [gforcada]
  • Round of cleanups, refactorings and coverage fixes. [gforcada]
  • Conditionally depend on collective.taskqueue to do mass processing asynchronously. [gforcada]

0.6 (2016-01-20)

  • Apply IStopWordsVerified when discarding an alert. [gforcada] [staeff]
  • Sort imports, use plone.api and some buildout cleanups. [gforcada]

0.5 (2016-01-19)

  • Support Plone 4.3.7 [gforcada]
  • Make normalize a global function [gforcada] [staeff]

0.4.post1 (2015-08-31)

  • Add German translation. [staeff]

0.4.post0 (2015-08-19)

  • Create wheels as well.

0.4 (2015-08-19)

  • Add a browser view to remove the IHasStopWords marker interface on a per object basis. [gforcada]

0.3.1 (2015-08-17)

  • Make sure that the IHasStopWords marker interface is indexed on the catalog. [gforcada]

0.3.post0 (2015-08-15)

  • Fix package URL. [gforcada]

0.3 (2015-08-14)

  • Correctly split stop words text so that it takes into account different line endings. [gforcada]
  • Ignore empty lines on stop words to not produce unexpected results. [gforcada]

0.2 (2015-08-14)

  • Split string subtitutions in two: text_alert and comment_alert. [gforcada]

0.1 (2015-08-14)

  • Initial release. [gforcada]

  • Fix package structure:

    • remove unneeded parts
    • add travis and coveralls badges

    [gforcada]

  • Add a plone.registry to keep the general stop words list. [gforcada]

  • Add a control panel configlet to edit the stop words list. [gforcada]

  • Add more code analysis checks, dependency tracker and MANIFEST check [gforcada]

  • Add utility to search for stop words on a given text [gforcada]

  • Add a plone.app.contentrules condition: collective.contentalerts.TextAlert [gforcada]

  • Add a string substitution: text_alert. To be used to compose emails on a contentrule [gforcada]

  • Apply a marker interface to the objects that are found to have a stop words. [gforcada]

Release History

Release History

2.0a1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.1

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0.post0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.7

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.6

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.5

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.4.post1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.4.post0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.4

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.3.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.3.post0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.3

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
collective.contentalerts-1.1-py2-none-any.whl (40.5 kB) Copy SHA256 Checksum SHA256 py2 Wheel Mar 29, 2016
collective.contentalerts-1.1.tar.gz (36.6 kB) Copy SHA256 Checksum SHA256 Source Mar 29, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting