Monday, April 20, 2009

zope batch undo

here's a quick tip for everyone tired of selecting dozens of checkboxes when trying to undo ZODB changes via the ZMI (or fighting with the batched display of the transactions). i mean, really there should be a "select all" button like in ZMI's folder listing, but until this has been done and released, here's a workaround...

first, and this is only needed once, of course, you bookmark the following javascript-snippet:

javascript:cbs=document.getElementsByName("transaction_info:list");for(n=0;n<cbs.length;++n){cbs[n].checked=true};
then, when you're ready to undo things you get out of the frameset and select a rough number of transactions to undo using a direct link like:
http://localhost:8080/manage_UndoForm?PrincipiaUndoBatchSize:int=200
and afterwards simply click your bookmark to select all checkboxes at once. perhaps you'll still need to unselect the last few or else adjust the number in the link and finally click "undo"...