Code Monkey home page Code Monkey logo

collective.watcherlist's Introduction

Travis CI badge Coveralls badge

Introduction

collective.watcherlist is a package that enables you to keep a list of people who want to receive emails when an item gets updated. The main use case is something like Products.Poi, which is an issue tracker for Plone. That product lets you create an issue tracker. In this tracker people can add issues. The tracker has managers. Every time a new issue is posted, the managers should receive an email. When a manager responds to an issue, the original poster (and the other managers) should get an email. Anyone interested in following the issue, should be able to add themselves to the list of people who get an email. The functionality for this was in Poi, but has now been factored out into this collective.watcherlist package.

Who should use this package?

This is not a package for end users. Out of the box it does nothing. It is a package for integrators or developers. You need to write some python and zcml in your own package (like Poi now does) to hook collective.watcherlist up in your code.

We gladly use the ZCA (Zope Component Architecture) to allow others to register their own adapters and own email texts, so outside of Zope the package does not make much sense. And we import some code from Plone too, so you will need that. If you want to use it in bare Zope or CMF, contact me: we can probably do some conditional imports instead.

collective.watcherlist might also be usable as a basis for a newsletter product. If you feel Singing and Dancing is overkill for you, or too hard to adapt to your specific needs, you could try writing some code around collective.watcherlist instead.

Basic integration steps

In its simplest form, the integration that is needed, is this:

  • Register an adapter from your content type to collective.watcherlist.interfaces.IWatcherList. In a lot of cases using the default implementation as factory for this adapter is fine: collective.watcherlist.watchers.WatcherList
  • Create an html form where people can add themselves to the watcher list. This could also be PloneFormGen form with a custom script adapter as action.
  • Register a BrowserView for your content type, inheriting from collective.watcherlist.browser.BaseMail and override its properties subject, plain and/or html.
  • Create an event handler or some other code that gets the adapter for your content type and uses that to send an email with the subject and contents defined in the browser view you created.

Events integration

This addons play well with zope's event and plone's contentrules. It triggers a zope event on all basic actions done on the watcherlist:

  • ToggleWatchingEvent
  • RemovedFromWatchingEvent
  • AddedToWatchingEvent

Those events are registered to be usable as content rule trigger so you can create a rule based on it.

It also provides a content rule action so you can create an action that's add or remove the current user to or from the watcherlist attached to the context.

Credits

People

Companies

collective.watcherlist's People

Contributors

ale-rt avatar gagaro avatar hvelarde avatar jean avatar mauritsvanrees avatar skurfer avatar toutpt avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

collective.watcherlist's Issues

list isn’t updated unless watchers is a tuple

In toggle_watching(), if self.watchers is a list, it never gets updated.

The local watchers variable is updated, but the new value is never used to set self.watchers unless it was a tuple.

If the local watchers and self.watchers were referring to the same mutable object, it would work, but they aren't:

>>> watchers is self.watchers
False

Need new tests for modern Plone and Python 3

I've pushed a python3 branch because we are working on an Poi update to Plone 5.2 on Python 3 for a client. I've removed the old PloneTestCase / Doctests which are broken in Python 3. Others may be able to make use of this branch and/or contribute new tests so we eventually get this merged to master.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.