Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding schema and improving tests to make it p5 compatible #10

Merged
merged 5 commits into from
Oct 27, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,8 +1,2 @@
[report]
omit =
/home/*/.buildout/eggs/*
/usr/*
bin/test
buildout-cache/eggs/*
eggs/*
parts/*
include = collective/contentrules/mailtogroup/*
6 changes: 2 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@ cache:
directories:
- eggs
env:
- PLONE_VERSION=4.2
- PLONE_VERSION=4.3
- PLONE_VERSION=5.0
- PLONE_VERSION=5.1
matrix:
allow_failures:
- env: PLONE_VERSION=5.0
fast_finish: true
install:
- sed -ie "s#4.3.x.cfg#$PLONE_VERSION.x.cfg#" buildout.cfg
- sed -ie "s#5.0.x.cfg#$PLONE_VERSION.x.cfg#" buildout.cfg
- python bootstrap.py
- bin/buildout annotate
- bin/buildout
Expand Down
7 changes: 5 additions & 2 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
Changelog
=========

1.5.1 (unreleased)
1.6 (unreleased)
-------------------

- Drop support for Plone 4.0 and Plone 4.1.
- Add support for Plone 5.0 and 5.1. On Plone 5.x we use z3c.form instead of formlib.
[fulv]

- Drop support for Plone 4.0, Plone 4.1 and Plone 4.2.
Package may work, but we are no longer testing against these versions as Python 2.6 is no longer supported on code analysis.
[hvelarde]

Expand Down
3 changes: 2 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include *.rst
graft collective
graft docs
include *.rst
global-exclude *.pyc
18 changes: 3 additions & 15 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,34 +23,22 @@ Installation
============

Add collective.contentrules.mailtogroup to your buildout as an egg or
from source. No (generic setup) installation is necessary, the action is
from source. No (generic setup) installation is necessary, the action is
registered using ZCML. So do add the package to the zcml slug list of your
[instance] section.

Usage
=====

Go to the Plone Control Panel, select Content Rules and add a new Rule.
Go to the Plone Control Panel, select Content Rules and add a new Rule.
Under 'actions' you now have a new option: Send email to groups and users.

When searching for users and groups make sure you press the search button. Don't
hit enter. Search results for these items are only shown when you press search.

UberMultiSelectionWidget
========================
This content rule uses the UberMultiSelectionWidget from plone.app.form. This
widget is broken in version 1.1.7 of plone.app.form. Plone 3.3.4 has this version.

As of version 1.1.8 the widget is working again. To use the correct version pin
down plone.app.form:

[versions]
...
plone.app.form = 1.1.8

Credits
=======

Most of this package is directly copies from the plone.app.contenttules.mail
action. The package collective.contentrules.mailtolocalrole was also used as
action. The package collective.contentrules.mailtolocalrole was also used as
an example.
4 changes: 2 additions & 2 deletions buildout.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[buildout]
extends =
https://raw.github.com/collective/buildout.plonetest/master/test-4.3.x.cfg
https://raw.github.com/collective/buildout.plonetest/master/test-5.0.x.cfg
https://raw.github.com/collective/buildout.plonetest/master/qa.cfg

package-name = collective.contentrules.mailtogroup
Expand All @@ -17,7 +17,7 @@ parts +=
recipe = plone.recipe.codeanalysis[recommended]
directory = ${buildout:directory}/collective/contentrules/mailtogroup
clean-lines = True
flake8-ignore = E501
flake8-ignore = E501,P001,T000
multiprocessing = True
pre-commit-hook = True
return-status-codes = False
Expand Down
5 changes: 1 addition & 4 deletions collective/contentrules/mailtogroup/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# -*- coding: UTF-8 -*-
from zope.i18nmessageid import MessageFactory

mailtogroupMessageFactory = MessageFactory('collective.contentrules.mailtogroup')


def initialize(context):
"""Intializer called when used as a Zope 2 product."""
2 changes: 1 addition & 1 deletion collective/contentrules/mailtogroup/actions/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#
# -*- coding: UTF-8 -*-
11 changes: 6 additions & 5 deletions collective/contentrules/mailtogroup/actions/configure.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,23 @@

<include package="plone.contentrules" />
<include package="plone.contentrules" file="meta.zcml" />

<include package="plone.app.contentrules" />
<include package="plone.principalsource" />

<!-- Email action definition -->
<adapter factory=".mail.MailActionExecutor" />

<browser:page
for="plone.app.contentrules.browser.interfaces.IRuleActionAdding"
name="plone.actions.MailGroup"
class=".mail.MailGroupAddForm"
class=".mail.MailGroupAddFormView"
permission="plone.app.contentrules.ManageContentRules"
/>

<browser:page
for="collective.contentrules.mailtogroup.actions.mail.IMailGroupAction"
name="edit"
class=".mail.MailGroupEditForm"
class=".mail.MailGroupEditFormView"
permission="plone.app.contentrules.ManageContentRules"
/>

Expand All @@ -31,11 +32,11 @@
title="Send email to groups and members"
description="Send an email on the triggering object."
for="*"
event="zope.component.interfaces.IObjectEvent"
event="*"
addview="plone.actions.MailGroup"
editview="edit"
schema=".mail.IMailGroupAction"
factory=".mail.MailGroupAction"
/>

</configure>
</configure>
Loading