collective.autopublishing
Overview
Publishes or retracts Plone content items depending on the effective and expiration dates.
This package depends on collective.timedevents to supply zope3-style events with specific intervals.
Setup
The module supplies an event handler. In your own module you have to register this handler for an event, for instance one of the time-based events from collective.timedevents.
Example:
<subscriber
for="collective.timedevents.interfaces.IIntervalTicks15Event"
handler="collective.autopublishing.eventhandler.autopublish_handler"
/>
To enable the event ticks from collective.timedevents you can either use zope clockserver or a cronjob as the trigger. (See the documentation for collective.timedevents to set this up).
The module adds a plone control panel, where initial workflow states for both publishing and retracting has to be set.
In addition, simulating the publishing process is possible with the dry-run setting in the control panel.
The publishing process
All items that are in the workflow states set in the control panel, having an effective date in the past, and no expiration date or an expiration date in the future, are published. (The workflow transition 'publish' are tried).
All items that are in the workflow states set in the control panel, having an expiration date in the past are retracted. (The workflow transition 'retract' are tried).
Dexterity field
The module adds a field enableAutopublishing to Dexterity content types (through a behavior) in the Dates fieldset. This allows to control autopublishing process on content-basis (default: False).
Setting the expiration date on retraction
In some cases, the automatic publication can republish an item that is retracted.
For instance: if private is added to initial publication states, and we have a published content object with a publication date in the past.
If the expiration date is not set, and the item is (manually) retracted, the publication machinery will republish the item unless the editor clears the publication date or turns of autopublishing for the item with the enableAutopublishing option.
To solve that problem an event handler for workflow transitions sets the expiration date, if it is not already set, when withdrawing an item.
There is a control panel setting to allow overwriting the expiration date.
Audit
A very simple form of audit logging can be done: If email addresses are supplied in the control panel a mail will be sent with info about published and retracted items.
Compatibility
Version 2.x supports Plone 6.1 on Python 3.10 to 3.13, and Plone 6.2 on Python 3.10 to 3.14. It works only with Dexterity content types.
For Plone 5.2 and 6.0, use collective.autopublishing 1.1b1. Branch 1.0.x works with Python 2.7 and Archetypes / Dexterity.
Installation
Add collective.autopublishing to the dependencies of your project
(pyproject.toml, or requirements.txt with the Plone constraints), install
it, restart Plone and activate the add-on in Site Setup > Add-ons.
The rules are edited in Site Setup > Autopublishing, and
@@autopublish-report shows what the next run will do.
Development
Requires uv. This installs Plone 6.2.3 in .venv
(use PLONE_VERSION=6.1.6 make install for another version) and the prek
git hook:
make install
make start # Plone on http://localhost:8080 (admin / admin)
Create a Classic UI site from the browser, then activate collective.autopublishing.
Tests
Tests run through tox, as the CI does:
make test # Plone 6.2.3
uvx --with tox-uv tox -e py312-plone61 # one Plone / Python combination
make test-all # lint, every combination, dependencies
Without tox:
.venv/bin/zope-testrunner --test-path=src -s collective.autopublishing
Lint
make check # format then lint (pyupgrade, isort, black, zpretty, flake8...)
Translations
make i18n # rebuild the collective.autopublishing catalog
.editorconfig, .flake8, .gitignore, .pre-commit-config.yaml, tox.ini,
.github/ and the tool sections of pyproject.toml are generated by
plone.meta: change .meta.toml, then run
uvx --from plone.meta config-package --no-commit --branch current ..
Todo
-
What if an object is in the state published, but effective date are in the future? Should we retract, to enforce that the workflow state always mirrors the setting of the dates?
-
What if the effective date is larger that expiration date? Can this happen?
Contribute
- Issue Tracker: https://github.com/collective/collective.autopublishing/issues
- Source Code: https://github.com/collective/collective.autopublishing
License
The project is licensed under the GPLv2 or later.
Contributors
- Mustapha Benali, mustapha@headnet.dk
- Tom Gross, itconsense@gmail.com
Changelog
2.0.0 (2026-11-24)
-
Breaking: replace the
pkg_resourcesnamespace ofcollectivewith a PEP 420 native namespace, and move the package to asrc/layout. Support Plone 6.1 only on Python 3.10 to 3.13, and Plone 6.2 on Python 3.10 to 3.14. Use 1.1b1 for Plone 5.2 and 6.0. [remdub] -
Register the views for
IPloneSiteRootfromplone.baseinstead of the alias Plone 6.2 deprecates. The test layer no longer importsplone.app.contenttypes.testing, which needsplone.app.robotframework. New tests for the control panel and the report view. Drop the superfluousforof the behavior registration. [remdub] -
Make the report view translatable (it used the
eva.contentdomain and had no i18n markup) and translate it in French. Fix the "What actions will be taken" link text. [remdub] -
Configure the package with plone.meta 2.12.0 (test matrix on Plone 6.2.3 and 6.1), move its metadata to
pyproject.toml, convert the documentation to Markdown and run the development environment on Plone 6.2.3 with uv instead of buildout. Drop the buildout configuration and the hand-written GitHub workflow. Require collective.timedevents 2.0.0 or later: 1.1 callspkg_resources, which Plone 6.2 no longer ships. [remdub]
1.1b1 (2022-11-25)
-
Drop Python 2 / Archetypes compatibility [laulaz]
-
Python 3 / Plone 6 compatibility [boulch, laulaz]
-
Fix traceback / improve & harmonize log messages [laulaz]
1.0.3 (2019-07-18)
- Added French translation [laulaz]
1.0.2 (2017-05-23)
- Fix travis and buildout for Plone 5.0 and 5.1 [tomgross]
1.0.1 (2016-02-18)
- Move README to rst [tomgross]
1.0 (2016-02-18)
- Plone 5 compatibility [tomgross]
0.6 (2013-11-05) Unreleased
Features:
-
Added buildout configuration for test this package in plone 4 [macagua]
-
Added bash script for update po file [macagua]
-
Added Spanish translation [macagua]
-
Now it is possible to make time-based transitions of any workflow transition, and for individual content types. Rules are triggered on either the publication date or the retraction date. [sunew]
-
Added initial dexterity support. date_index, date_index_method removed in the branch, needs to be reimplemented to support both dexterity and archetypes. [bosim]
0.5 (2013-10-21) Unreleased
Features:
- Added retracting
- Added modern control panel
- Replaced persistent utility with p.a.registry based settings
- Require event ticks to run as manager
- Depend on collective.timedevents [sunew]
Bugfixes:
- don't make testing other modules fail [sunew]
0.4
- Plone 4 compatibility [kroman0]
0.1
- Initial package [mustap]
Metadata
Release files for collective.autopublishing 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| collective_autopublishing-2.0.0.tar.gz | 35.5 kB | Without provenance | Details for collective_autopublishing-2.0.0.tar.gz |
Release files / collective_autopublishing-2.0.0.tar.gz
| Download URL | collective_autopublishing-2.0.0.tar.gz |
|---|---|
| Size | 35.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5e13ed867895bf0eece4ab6413244aa92348113f46423ee1d2cebbb24c78a3b9
|
|
BLAKE2b-256 checksum How to use checksums |
72cadf68718333533dc008b698cf0a462a37021d804d5989c66ca47e8fdeaef6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.5
|
Security for collective.autopublishing 2.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.