Release Notes for ReplaceSupport
This product has been tested with Zope 2.7.0 and is expected to work with all versions of Zope from 2.3.3 upwards. Please also see the Installation Instructions.
What it does
Carlos de la Guardia has written a patch that adds a replace tab to a Folder's management screen and allows to search & replace strings in Zope objects. His patch is against Zope 2.2.0 and can not be applied as-is to more recent (or older) Versions of Zope. You're risking to inadvertedly break or downgrade your Folder class. I decided to give it a try and convert the patch into a simple Zope Product that can be used with all versions of Zope.
Version 0.3.2 adds a handler machinery that allows for easy extension to other Zope object types. Handlers for the following object types are included by default:
DTML Documents
DTML Methods
Python Scripts
ZSQL Methods
Page Templates (ZPT)
Please see the HANDLERS.txt
file included in the tarball on how to add your own handlers.
Version 0.4.4 adds permission checking to the core code. ReplaceSupport will now only operate on objects the user has the appropriate change permission for. This allows to safely expose ReplaceSupport to non-Managers!
Note: Should you have created you own handlers, you will want to upgrade them to
support the new permission-checking feature. See file ReplaceHandler.py
for changes to the handler base class.
New: Version 1.0.0 adds an unrestricted _ZopeReplace
method,
some interface polishing, and unit tests.
How it works
The product works by monkey patching the Folder class at Product initialization time. This is close to perfect. Some Folder derived classes though play nasty and refuse to be patched like that...
ZPatterns
ZPattern's "Folder w/Customizer Support" beeing a prominent example. If you have any Folder derived objects that will not show the replace tab, you will have to resort to the "Advanced" installation method which hooks into the initialization at an earlier stage.
ZClasses
Only those OFS:Folder derived ZClasses that are created (the ZClasses, not the Instances) after ReplaceSupport has been installed, will have a replace tab.
Permissions
ReplaceSupport adds the permission "Search & replace in objects". Your role must have this permission for the replace tab to show.
From version 0.4.4 the ZopeReplace
method verifies the appropriate change permission before performing
a replace operation. You will, for example, not be able to replace text in a Page Template
without also having the "Change Page Templates" permission. Version 1.0.0 introduces an unrestricted
_ZopeReplace
method that allows to bypass these checks in non-TTW code.
Undo
A search & replace operation can be undone by selecting the corresponding call to
manage_replaceResult
in the undo view.