Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Easily setup readonly zeo clients

Project Description

Introduction

This package provides a mechanism to easily have clients set to work with readonly.

This is mostly useful for preventing ReadOnlyError from cropping up from write on read operations for a public read only site.

Warning

Also make sure to set your zeo client zope.conf read-only true setting:

<zodb_db main>
    <zeoclient>
    ...
    read-only true
    ...
    </zeoclient>
</zodb_db>

To make this work along with buildout, use the read-only recipe config option. Also, make sure to disable product installation in your client configuration, otherwise you’ll get errors on startup. Make sure to use plone.app.zeoclient >= 4.2.12 as it includes the read-only config option:

[client1]
recipe = plone.recipe.zope2instance
...
read-only = true
enable-product-installation = off
...

Usage

Abort all transactions

Aborts transaction on IPubBeforeCommit event.

Add this to the zcml-additional option for your client:

[client1]
recipe = plone.recipe.zope2instance
...
zcml-additional =
    <include package="wildcard.readonly" file="readonly.zcml" />
...

Doom all transactions

Dooms the transaction on the IPubAfterTraversal event.

Add this to the zcml-additional option for your client:

[client1]
recipe = plone.recipe.zope2instance
...
zcml-additional =
    <include package="wildcard.readonly" file="readonly-doom.zcml" />
...

Conditionally abort transactions

Useful when aborting all transactions prevents emails from getting sent out. For instance, if you’re using PloneFormGen in your setup, dooming and aborting will prevent mail from getting sent.

Add this to the zcml-additional option for your client:

[client1]
recipe = plone.recipe.zope2instance
...
zcml-additional =
    <include package="wildcard.readonly" file="readonly-conditional.zcml" />
...

Handling sending mail

Since mail is tied to transaction management, aborting all transactions will also prevent sending mail on the site.

Add this to the zcml-additional option for your client:

[client1]
recipe = plone.recipe.zope2instance
...
zcml-additional =
    <include package="wildcard.readonly" file="mail.zcml" />
...

Changelog

1.0 (2014-02-26)

  • be able to patch mail host to still send out emails

1.0a2 (2012-07-29)

  • fix packaging

1.0a1 (2012-06-14)

  • Initial release
Release History

Release History

This version
History Node

1.0

History Node

1.0a2

History Node

1.0a1

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
wildcard.readonly-1.0.zip (20.0 kB) Copy SHA256 Checksum SHA256 Source Feb 27, 2014

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting