collective.dancing blueprints for collective.transmogrifier pipelines by Makina Corpus
This package contains several blueprints for collective.transmogrifier pipelines, dedicated to the Plone product collective.dancing.
When you’re reading this you have probably already run easy_install collective.blueprint.dancing. Find out how to install setuptools (and EasyInstall) here: http://peak.telecommunity.com/DevCenter/EasyInstall
Create a file called collective.blueprint.dancing-configure.zcml in the /path/to/instance/etc/package-includes directory. The file should only contain this:<include package="collective.blueprint.dancing" />
Alternatively, if you are using zc.buildout and the plone.recipe.zope2instance recipe to manage your project, you can do this:
Add collective.blueprint.dancing to the list of eggs to install, e.g.:[buildout] ... eggs = ... collective.blueprint.dancing
Tell the plone.recipe.zope2instance recipe to install a ZCML slug:[instance] recipe = plone.recipe.zope2instance ... zcml = collective.blueprint.dancing
Re-run buildout, e.g. with:$ ./bin/buildout
You can skip the ZCML slug if you are going to explicitly include the package from another package’s configure.zcml file.
A ImportSubscriber section allows you to add subscribers to a collective.dancing channel.
The ImportSubscriber blueprint name is collective.blueprint.dancing.importsubscriber.
To determine the subscriber informations, the ImportSubscriber section inspects each item and looks for the keys email, channel-id and composer-id, as described below. Any item missing the email keys will be skipped.
If the key channel-id is missing, the ImportSubscriber section looks for the option default-channel-id. This option defaults to default-channel.
If the key composer-id is missing, the ImportSubscriber section looks for the option default-composer-id. This option defaults to html.
For each key, the corresponding information will be found among the following:
where [sectionname] is replaced with the name given to the current section, and [key] is replaced by email, channel-id or composer-id. This allows you to target the right section precisely if needed.
Alternatively, you can specify what key to use for each information by specifying the``[key]-key`` option, which should be a list of keys to try (one key per line; use a re: or regexp: prefix to specify regular expressions).
>>> import pprint>>> importsubscriber = """ ... [transmogrifier] ... pipeline = ... source ... importsubscriber ... importsubscriber2 ... printer ... ... [source] ... blueprint = collective.blueprint.dancing.tests.importsubscribersource ... ... [importsubscriber] ... blueprint = collective.blueprint.dancing.importsubscriber ... ... [importsubscriber2] ... blueprint = collective.blueprint.dancing.importsubscriber ... default-channel-id=mychannel ... default-composer-id=mycomposer ... ... [printer] ... blueprint = collective.transmogrifier.sections.tests.pprinter ... """ >>> registerConfig(u'collective.blueprint.dancing.tests.importsubscriber', ... importsubscriber)>>> transmogrifier(u'collective.blueprint.dancing.tests.importsubscriber') [('_email', 'email@example.com')] [('_email', 'firstname.lastname@example.org')] [('_email', 'email@example.com')]>>> pprint.pprint(plone.subscribers) (firstname.lastname@example.org -channel:default-channel - composer:html', email@example.com -channel:mychannel - composer:mycomposer', firstname.lastname@example.org -channel:default-channel - composer:html', email@example.com -channel:mychannel - composer:mycomposer')
(name of developer listed in brackets)
- Added ImportSubscriber section. See importsubscriber.txt. [sylvainb]