collective.contentalerts


Namecollective.contentalerts JSON
Version 3.2.2 PyPI version JSON
download
home_pagehttps://github.com/collective/collective.contentalerts
SummaryAn add-on for Plone to get alerts about content
upload_time2022-12-26 19:56:04
maintainer
docs_urlNone
authorGil Forcada
requires_python>=3.8
licenseGPL version 2
keywords python plone
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
.. This README is meant for consumption by humans and pypi. Pypi can render rst files so please do not use Sphinx features.
   If you want to learn more about writing documentation, please check out: http://docs.plone.org/about/documentation_styleguide_addons.html
   This text does not appear on pypi or github. It is a comment.

.. image:: https://coveralls.io/repos/collective/collective.contentalerts/badge.svg?branch=master&service=github
    :target: https://coveralls.io/github/collective/collective.contentalerts?branch=master
    :alt: Coveralls

========================
collective.contentalerts
========================
Get alerts whenever a (two custom lists of) word is found on a content object,
be that object of any content type (Dexterity 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 and dexterity 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 (via `collective.taskqueue`_)

Where it searches on
====================
collective.contentalerts searches either on the comments' text or on ``text`` (for Dexterity based content types).

Standalone usage
================
While the main integration within Plone is via a plone.app.contentrules condition,
``collective.contentalerts`` can also be used as a standalone utility.

Use the provided utility (``collective.contentalerts.interfaces.IAlert``).

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
=============

Version 3.0
-----------
This version is meant to be compatible with Plone 5.2 (still on python 2.7).

Version 2.0
-----------
This version only supports Plone 5 and Dexterity,
if you are using Archetypes or Plone 4.3.x stick with version 1.x.

So far only the migration to Plone 5 differs from the last 1.x release.

Keep an eye on `CHANGES.rst <https://github.com/collective/collective.contentalerts/blob/master/CHANGES.rst>`_.

Version 1.0 and below
---------------------
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 <http://docs.plone.org/develop/addons/components/genericsetup.html#upgrade-steps>`_ 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]


Contribute
==========
- Issue Tracker: https://github.com/collective/collective.contentalerts/issues
- Source Code: https://github.com/collective/collective.contentalerts

License
=======
The project is licensed under the GPLv2.

Credits
=======

`der Freitag`_ sponsored the creation of this add-on.


.. _plone.app.contentrules:  https://pypi.python.org/pypi/plone.app.contentrules
.. _der Freitag:  https://www.freitag.de
.. _collective.taskqueue:  https://pypi.python.org/pypi/collective.taskqueue


Contributors
============
- Gil Forcada, gilforcada@gmail.com


Changelog
=========

.. You should *NOT* be adding new change log entries to this file.
   You should create a file in the news directory instead.
   For helpful instructions, please see:
   https://github.com/plone/plone.releaser/blob/master/ADD-A-NEWS-ITEM.rst

.. towncrier release notes start

3.2.1 (2022-12-17)
------------------

Bug fixes:


- Add linting actions via GitHub Actions.
  [gforcada] (#1)
- Add support for Plone 5.2.10.
  [gforcada] (#2)


3.2.0 (2021-03-31)
------------------

- Make it python 3 compatible.
  [gforcada]

3.1.0 (2020-05-07)
------------------

- Make text normalization more thorough (#14).
  [staeff]


3.0.0 (2020-02-11)
------------------

- Nothing changed yet.


3.0.0a0 (2020-02-10)
--------------------

- Add uninstall profile.
  [gforcada]

- Adapt code and tests to Plone 5.2.
  [gforcada]

2.0.0 (2019-02-11)
------------------

- Test against Plone 4.3, 5.0, 5.1 and (experimental) 5.2.


2.0a1 (2016-07-28)
------------------

- Make collective.contentalerts work with Plone 5
  Following adaptions were needed: Remove session_data_manager, use z3c.form instead of
  formlib, access text via IRichText object, several changes in tests.
  [staeff]

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]


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/collective/collective.contentalerts",
    "name": "collective.contentalerts",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "Python Plone",
    "author": "Gil Forcada",
    "author_email": "gilforcada@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/ea/bd/dc98df8f1779fd7487d126a466727ba16c80d514cdee310b9dd939601927/collective.contentalerts-3.2.2.tar.gz",
    "platform": null,
    "description": "\n.. This README is meant for consumption by humans and pypi. Pypi can render rst files so please do not use Sphinx features.\n   If you want to learn more about writing documentation, please check out: http://docs.plone.org/about/documentation_styleguide_addons.html\n   This text does not appear on pypi or github. It is a comment.\n\n.. image:: https://coveralls.io/repos/collective/collective.contentalerts/badge.svg?branch=master&service=github\n    :target: https://coveralls.io/github/collective/collective.contentalerts?branch=master\n    :alt: Coveralls\n\n========================\ncollective.contentalerts\n========================\nGet alerts whenever a (two custom lists of) word is found on a content object,\nbe that object of any content type (Dexterity or comments).\n\nCan be used to:\n\n- moderate: used as a blacklist.\n- highlight: used as a whitelist.\n\nThe main idea is to use the power of `plone.app.contentrules`_ to inspect content being generated by users for certain words.\n\nUpon that, regular `plone.app.contentrules`_ actions can be triggered:\nsend an email, notify the user, apply a workflow transition...\n\nThe 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.\n\nFeatures\n========\n- manage two lists of words that will be used to search (blacklist/whitelist)\n\n  - named ``forbidden_words`` and ``inadequate_words``\n\n- integration with  `plone.app.contentrules`_:\n\n  - conditions to look for stop words (either from any list or from a specific one)\n  - string substitutions to add on emails the snippets where the stop words where found\n    (one for documents and one for comments)\n\n- standalone utility\n\n  - with methods to either look for words on both lists or only on one of them\n\n- provide different word lists if you need them,\n  either two general ones (plone.registry based) or on a per contentrule basis\n- look for stop words on comments and dexterity content types\n- apply a marker interface to objects that are found to have stop words\n- mark objects as reviewed\n- monitor the list of words for changes and search for the new stop words on already reviewed objects\n\n  - if ``[async]`` extra is enable this review will be done via an asynchronous job (via `collective.taskqueue`_)\n\nWhere it searches on\n====================\ncollective.contentalerts searches either on the comments' text or on ``text`` (for Dexterity based content types).\n\nStandalone usage\n================\nWhile the main integration within Plone is via a plone.app.contentrules condition,\n``collective.contentalerts`` can also be used as a standalone utility.\n\nUse the provided utility (``collective.contentalerts.interfaces.IAlert``).\n\nDocumentation\n=============\nFull documentation for end users can be found in the \"docs\" folder.\n\nInstallation\n============\nInstall collective.contentalerts by adding it to your buildout::\n\n   [buildout]\n\n    ...\n\n    eggs =\n        collective.contentalerts\n\n\nand then running \"bin/buildout\"\n\nUpgrade notes\n=============\n\nVersion 3.0\n-----------\nThis version is meant to be compatible with Plone 5.2 (still on python 2.7).\n\nVersion 2.0\n-----------\nThis version only supports Plone 5 and Dexterity,\nif you are using Archetypes or Plone 4.3.x stick with version 1.x.\n\nSo far only the migration to Plone 5 differs from the last 1.x release.\n\nKeep an eye on `CHANGES.rst <https://github.com/collective/collective.contentalerts/blob/master/CHANGES.rst>`_.\n\nVersion 1.0 and below\n---------------------\nIf you are upgrading from 0.7 to any later version there's one manual step that needs to be done.\n\nOn version 1.0 the single list of stop words was split into ``inadequate_words`` and ``forbidden_words``.\n\nAs it can not be guessed which list the former list is supposed to map,\nno automatic migration is provided.\n\nAn `upgrade step <http://docs.plone.org/develop/addons/components/genericsetup.html#upgrade-steps>`_ needs to be written then.\n\nSee below an example on how to migrate the former list to the new ``forbidden_words`` list::\n\n    from plone import api\n    from plone.registry.interfaces import IRegistry\n    from zope.component import getUtility\n\n    # safe the stop words on the old location\n    old_setting = 'collective.contentalerts.interfaces.IStopWords.stop_words'\n    current_forbidden_words = api.portal.get_registry_record(name=old_setting)\n\n    # update registry\n    setup = api.portal.get_tool('portal_setup')\n    setup.runImportStepFromProfile(\n        'profile-collective.contentalerts:default',\n        'plone.app.registry'\n    )\n\n    # set the stop words on the new field\n    api.portal.set_registry_record(\n        name='collective.contentalerts.interfaces.IStopWords.forbidden_words',\n        value=current_forbidden_words\n    )\n\n    # remove the old setting\n    registry = getUtility(IRegistry)\n    del registry.records[old_setting]\n\n\nContribute\n==========\n- Issue Tracker: https://github.com/collective/collective.contentalerts/issues\n- Source Code: https://github.com/collective/collective.contentalerts\n\nLicense\n=======\nThe project is licensed under the GPLv2.\n\nCredits\n=======\n\n`der Freitag`_ sponsored the creation of this add-on.\n\n\n.. _plone.app.contentrules:  https://pypi.python.org/pypi/plone.app.contentrules\n.. _der Freitag:  https://www.freitag.de\n.. _collective.taskqueue:  https://pypi.python.org/pypi/collective.taskqueue\n\n\nContributors\n============\n- Gil Forcada, gilforcada@gmail.com\n\n\nChangelog\n=========\n\n.. You should *NOT* be adding new change log entries to this file.\n   You should create a file in the news directory instead.\n   For helpful instructions, please see:\n   https://github.com/plone/plone.releaser/blob/master/ADD-A-NEWS-ITEM.rst\n\n.. towncrier release notes start\n\n3.2.1 (2022-12-17)\n------------------\n\nBug fixes:\n\n\n- Add linting actions via GitHub Actions.\n  [gforcada] (#1)\n- Add support for Plone 5.2.10.\n  [gforcada] (#2)\n\n\n3.2.0 (2021-03-31)\n------------------\n\n- Make it python 3 compatible.\n  [gforcada]\n\n3.1.0 (2020-05-07)\n------------------\n\n- Make text normalization more thorough (#14).\n  [staeff]\n\n\n3.0.0 (2020-02-11)\n------------------\n\n- Nothing changed yet.\n\n\n3.0.0a0 (2020-02-10)\n--------------------\n\n- Add uninstall profile.\n  [gforcada]\n\n- Adapt code and tests to Plone 5.2.\n  [gforcada]\n\n2.0.0 (2019-02-11)\n------------------\n\n- Test against Plone 4.3, 5.0, 5.1 and (experimental) 5.2.\n\n\n2.0a1 (2016-07-28)\n------------------\n\n- Make collective.contentalerts work with Plone 5\n  Following adaptions were needed: Remove session_data_manager, use z3c.form instead of\n  formlib, access text via IRichText object, several changes in tests.\n  [staeff]\n\n1.1 (2016-03-29)\n----------------\n\n- Be sure to remove the marker interface only when its needed.\n  [gforcada]\n\n1.0.post0 (2016-03-12)\n----------------------\n- Update German translation.\n  [staeff]\n\n1.0 (2016-03-11)\n----------------\n- **Renamed the registry setting**,\n  now two lists are used: ``forbidden_words`` and ``inadequate_words``.\n  See the ``README.rst`` for instructions on how to create an upgrade step to migrate them.\n  [gforcada]\n\n- Updated ``IAlert`` utility to use either both stop words list,\n  or just one if told so (passed as an argument).\n  [gforcada]\n\n- Add a ``has_forbidden_words`` method to ``IAlert`` utility.\n  It allows to check only for forbidden stop words only.\n  [gforcada]\n\n- Make ``@@review-objects`` view more generic by allowing a marker interface and review states to be passed.\n  This allows filtering which elements will be checked for stop words.\n  [gforcada]\n\n- Triple the content rules so one can decide to monitor for any kind of word,\n  only forbidden words or only inadequate ones.\n  [gforcada]\n\n0.7 (2016-01-22)\n----------------\n- Monitor registry setting (stop words) for changes.\n  If changes are found, verify if reviewed objects have those new stop words.\n  [gforcada]\n\n- Round of cleanups, refactorings and coverage fixes.\n  [gforcada]\n\n- Conditionally depend on collective.taskqueue to do mass processing asynchronously.\n  [gforcada]\n\n0.6 (2016-01-20)\n----------------\n- Apply IStopWordsVerified when discarding an alert.\n  [gforcada] [staeff]\n\n- Sort imports, use plone.api and some buildout cleanups.\n  [gforcada]\n\n0.5 (2016-01-19)\n----------------\n- Support Plone 4.3.7\n  [gforcada]\n\n- Make normalize a global function\n  [gforcada] [staeff]\n\n0.4.post1 (2015-08-31)\n----------------------\n- Add German translation.\n  [staeff]\n\n0.4.post0 (2015-08-19)\n----------------------\n- Create wheels as well.\n\n0.4 (2015-08-19)\n----------------\n- Add a browser view to remove the IHasStopWords marker interface on a per object basis.\n  [gforcada]\n\n0.3.1 (2015-08-17)\n------------------\n- Make sure that the ``IHasStopWords`` marker interface is indexed on the catalog.\n  [gforcada]\n\n0.3.post0 (2015-08-15)\n----------------------\n- Fix package URL.\n  [gforcada]\n\n0.3 (2015-08-14)\n----------------\n- Correctly split stop words text so that it takes into account different line endings.\n  [gforcada]\n\n- Ignore empty lines on stop words to not produce unexpected results.\n  [gforcada]\n\n0.2 (2015-08-14)\n----------------\n- Split string subtitutions in two: ``text_alert`` and ``comment_alert``.\n  [gforcada]\n\n0.1 (2015-08-14)\n----------------\n- Initial release.\n  [gforcada]\n\n- Fix package structure:\n\n  - remove unneeded parts\n  - add travis and coveralls badges\n\n  [gforcada]\n\n- Add a ``plone.registry`` to keep the general stop words list.\n  [gforcada]\n\n- Add a control panel configlet to edit the stop words list.\n  [gforcada]\n\n- Add more code analysis checks, dependency tracker and MANIFEST check\n  [gforcada]\n\n- Add utility to search for stop words on a given text\n  [gforcada]\n\n- Add a plone.app.contentrules condition: ``collective.contentalerts.TextAlert``\n  [gforcada]\n\n- Add a string substitution: ``text_alert``. To be used to compose emails on a contentrule\n  [gforcada]\n\n- Apply a marker interface to the objects that are found to have a stop words.\n  [gforcada]\n\n",
    "bugtrack_url": null,
    "license": "GPL version 2",
    "summary": "An add-on for Plone to get alerts about content",
    "version": "3.2.2",
    "project_urls": {
        "Homepage": "https://github.com/collective/collective.contentalerts"
    },
    "split_keywords": [
        "python",
        "plone"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "086888105149ef2969f05f02acd2c5a26c277d9323b717647ef3f78cf6ecbb60",
                "md5": "6878ce9d8fb2d5a55f3f551085314638",
                "sha256": "8c36208fc521097c3de8270db426ed697475063258b6619e8887fe416ca59412"
            },
            "downloads": -1,
            "filename": "collective.contentalerts-3.2.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6878ce9d8fb2d5a55f3f551085314638",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 37599,
            "upload_time": "2022-12-26T19:56:02",
            "upload_time_iso_8601": "2022-12-26T19:56:02.935683Z",
            "url": "https://files.pythonhosted.org/packages/08/68/88105149ef2969f05f02acd2c5a26c277d9323b717647ef3f78cf6ecbb60/collective.contentalerts-3.2.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "eabddc98df8f1779fd7487d126a466727ba16c80d514cdee310b9dd939601927",
                "md5": "d30f7e22baf62b2cd4f32a6c74b7df41",
                "sha256": "6e9c9da8f3bc50dfb737beaab2c537a0cb3bcffa8d7fdcd5ff676d248f255588"
            },
            "downloads": -1,
            "filename": "collective.contentalerts-3.2.2.tar.gz",
            "has_sig": false,
            "md5_digest": "d30f7e22baf62b2cd4f32a6c74b7df41",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 38954,
            "upload_time": "2022-12-26T19:56:04",
            "upload_time_iso_8601": "2022-12-26T19:56:04.777284Z",
            "url": "https://files.pythonhosted.org/packages/ea/bd/dc98df8f1779fd7487d126a466727ba16c80d514cdee310b9dd939601927/collective.contentalerts-3.2.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-12-26 19:56:04",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "collective",
    "github_project": "collective.contentalerts",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "collective.contentalerts"
}
        
Elapsed time: 0.26260s