Project description

Introduction

The ftw.publisher packages provide tools for publishing plone contents from
one instance to another.

By providing a simple mechanism to invoke the publishing, it’s possible to
set up the publisher in a variety of ways, such as workflow bound, manually
invoked or automated publication.

The ftw.publisher package library also provides a variety of surveillance
and analysis tools for making maintenance confortable.

Staging

The ftw.publisher is meant to be used in a environment where there are two
seperate plone-sites which do not share their database. The editors work on
a editorial site and the contents are published to a public site when
they are ready. Setting up such an environment with ftw.publisher let you
have a powerful staging solution with completly isolated instances.

Network security

Using an environment with two isolated installations makes it possible to
protect the editorial site with firewalls or to put it even in a private
company network. This way the editorial site is completly protected from
the internet, which is in some use cases mandatory for protecting other -
unpublished - contents (for example when publishing the internet contents
from the intranet).

Component support

Archetypes objects

Standard Archetypes field types

Topics: criterias are published automatically when topic is published

Backreferences - references are added automatically as soon both objects
are published

Additional interfaces added on /manage_interfaces or by other products

Contextual portlets

Properties

With the publisher adapter structure it is as easy as creating another
adapter to support other components. For instance annotations are not supported
by design, because you may not wan’t to publish all annotations but only
certain ones. Therefore it is easyer to implement custom adapters for
those annotations which need to be published.

Installation & Usage

Override realm configuration with ZCML

The realms are by default configured in the database through the control panel.
When copying the database from a production environment to a staging environment
the realm configuration is copied too, which could result in publishing from
the staging editorial site to the production public site, which is very bad.

For solving this issue it is possible to override the realm configuration with
ZCML, so that it can be configured also using the zcml-additional option of
the buildout.

Use asynchronous task queue for extraction

When creating a lot of publishing jobs in one single request,
the extracting of the content (JSON serializing) may take a lot of time.
In order to reduce the feedback time the user has an optional taskqueue
based on collective.taskqueue may be configured.
By default the extraction is done blocking.

Example buildout configuration:

zope-conf-additional +=

%import collective.taskqueue
<taskqueue />
<taskqueue-server />

environment-vars +=

PUBLISHER_TASKQUEUE true

Configure workflows to publish

The ftw.publisher can be used with workflows. For using it with workflows
you need to configure your workflow to use publisher actions and you need
to provide a configuration for your workflow, telling the publisher what each
state and transition means.

Defining a publisher configuration

A publisher configuration is a simple IWorkflowConfiguration adapter, which
could look like this:

The named-adapter is then registered with some ZCML, where the name
of the adapter is the ID of the workflow in portal_workflow.

<adapterfactory=".config.MyWorkflowConfiguration"name="my-workflow"/>

Lawgiver-Workflows

ftw.lawgiver is a tool for
writing workflows. If you are using the lawgiver, you can use
LawgiverWorkflowConfiguration as a base class, which allows you to define
the states and transitions by name / statement instead of ID:

Transition validation (constraints)

When a user publishes a content and its container is not yet published it
will fail on the remote system, because the container is missing.

The publisher provides workflow constraints for prohibiting bad transitions
and for warning when something should be done (e.g. references should also
be published).

You should enable those constraints for your workflow by changing the
transition action URL (“Display in actions box” -> “URL (formatted)”) to
the format %(content_url)s/publisher-modify-status?transition=TRANSITION
(replace TRANSITION) with the transition ID.
The default Plone URL is
%(content_url)s/content_status_modify?workflow_action=TRANSITION.

Disable creating publisher jobs

fromftw.publisher.sender.nojobsimportpublisher_jobs_disabledwithpublisher_jobs_disabled():pass# no publisher jobs created here.

FormGen integration

The FormGen integration allows it to download the data entered on a published site. If the content is published it will get the data from from the public site. If it isn’t published it will use the local data. The reason for this distinction is that we support internal forms, which are never published at all. In this case the internally collected data should be downloaded.

Links

The main project package is ftw.publisher.sender since it contains all the
configuration panels and the most tools - but without the other mandatory
packages it will not work.
Here are some additional links:

2.7.7 (2017-06-09)

2.7.6 (2017-06-08)

2.7.5 (2017-05-16)

Get the FormGen data from public site if Form Folder is published.
[tschanzt]

2.7.4 (2017-04-27)

No longer move simplelayout blocks instantly. [jone]

2.7.3 (2017-03-20)

Fix a bug where an old version was published. [jone]

Close connection after publishing. [jone]

2.7.2 (2016-09-06)

Make moving to worker queue more robust. [jone]

2.7.1 (2016-08-30)

Fix edge-case, if the published object is removed before the async worker collects the data from the object.
[mathias.leimgruber]

2.7.0 (2016-08-16)

Add IPreventPublishing marker interface. [jone]

Fix removeJob method, which always tried to remove the job from the worker queue.
[mathias.leimgruber]

2.6.0 (2016-07-29)

Add second worker queue, which is used by the worker to perform the actual
job. Also remove the batch feature, was disabled for ages.
[mathias.leimgruber]

Do not add delete jobs to the task queue. It’s quite certain that object will no longer exists if the
extractor tries to get some data of the delete obj.
[mathias.leimgruber]

2.5.0 (2016-07-27)

Deferred extraction using collective.taskqueue. [jone]

Migrate queue storage to zc.queue. [jone]

Speedup enqueuing by logging less. [jone]

Support dexterity relations. [mbaechtold]

Add context manager for disabling job creation. [jone]

2.4.0 (2016-05-20)

Workflow context state: skip parents without workflow when looking for
parent state.
This adds support for nested containers without workflows. [jone]

2.3.1 (2015-12-23)

Use base class WorkflowConfigTest for TestWorkflowConfig test.
If we don’t, we’ll get builder registrations conflict errors after
importing the test class into another project. There are also problems
while imoprting the test class directly on a project without ftw.simplelayout
but ftw.contentpage.
[elioschmutz]

2.1.0 (2013-06-13)

Add separate permission for accessing the publisher settings in the
control panel.
By default, the permission is granted to Manager and Site Administrator.
The permission is “ftw.publisher.sender: Change Publisher Configuration”
[jone]

2.0.1 (2013-05-24)

Execute queue view: add batch size argument.
[jone]

2.0 (2013-05-24)

Make status messages transaction aware, so that it works with integrity check rollbacks.
[jone]