forked from collective/wildcard.readonly
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.txt
executable file
·90 lines (62 loc) · 2.04 KB
/
README.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
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 wildcard.recipe.insertinto
recipe::
[readonly-insertinto]
recipe = wildcard.recipe.insertinto
client1 = ${client1:location}/etc/zope.conf insert-before "</zeoclient>" "\n\tread-only true\n"
Lastly, make sure to disable product installation in your client configuration,
otherwise you'll get errors on startup::
[client1]
recipe = plone.recipe.zope2instance
...
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" />
...