Skip to main content

Publishes and retracts on effective or expired dates.

Project description

Overview

https://travis-ci.org/collective/collective.autopublishing.svg?branch=master

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 intitial 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).

Archetypes field

The module adds a field enableAutopublishing to Archetypes content types, with default set to True.

When am autopublishing event happens to an item, this is set to False, to mark that autopublishing has run.

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.

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?

Contributors

Changes

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]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

collective.autopublishing-1.0.3.tar.gz (27.0 kB view details)

Uploaded Source

File details

Details for the file collective.autopublishing-1.0.3.tar.gz.

File metadata

  • Download URL: collective.autopublishing-1.0.3.tar.gz
  • Upload date:
  • Size: 27.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/2.7.15

File hashes

Hashes for collective.autopublishing-1.0.3.tar.gz
Algorithm Hash digest
SHA256 27de4be73b731f33229dfc10a864ecc40574aaad83d33c5394a33de1aaba9824
MD5 e1d484b92edaade49320d467dec381d7
BLAKE2b-256 6874377e7e6b86e92b183614a5bd5085ce2834339ce6d1a9ebbe7cb71ac78df8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page