Commit 41c8944d authored by Hanno Schlichting's avatar Hanno Schlichting

Drop ZopeUndo dependency and move undo management to the control panel.

parent c4c1b4ac
......@@ -28,6 +28,8 @@ Features Added
Restructuring
+++++++++++++
- Drop ZopeUndo dependency and move undo management to the control panel.
- Simplify ZMI control panel and globally available management screens.
- Move ZServer related testing support into ZServer.Testing.
......
......@@ -64,7 +64,6 @@ eggs =
# tests with DateTime being available
RestrictedPython
zExceptions
ZopeUndo
# Test optional dependencies.
Missing
Products.BTreeFolder2
......
......@@ -61,7 +61,6 @@ setup(
'RestrictedPython',
'ZConfig >= 2.9.2',
'ZODB',
'ZopeUndo',
'five.globalrequest',
'repoze.retry',
'setuptools',
......
......@@ -15,7 +15,6 @@ MultiMapping = git ${remotes:github}/MultiMapping pushurl=${remotes:github_push}
Persistence = git ${remotes:github}/Persistence pushurl=${remotes:github_push}/Persistence
zExceptions = git ${remotes:github}/zExceptions pushurl=${remotes:github_push}/zExceptions
zope.globalrequest = git ${remotes:github}/zope.globalrequest pushurl=${remotes:github_push}/zope.globalrequest
ZopeUndo = git ${remotes:github}/ZopeUndo pushurl=${remotes:github_push}/ZopeUndo
# Optional dependencies
initgroups = git ${remotes:github}/initgroups pushurl=${remotes:github_push}/initgroups
......@@ -33,6 +32,7 @@ Products.ZCTextIndex = git ${remotes:github}/Products.ZCTextIndex pushurl=${remo
Record = git ${remotes:github}/Record pushurl=${remotes:github_push}/Record
tempstorage = git ${remotes:github}/tempstorage pushurl=${remotes:github_push}/tempstorage
zLOG = git ${remotes:github}/zLOG pushurl=${remotes:github_push}/zLOG
ZopeUndo = git ${remotes:github}/ZopeUndo pushurl=${remotes:github_push}/ZopeUndo
ZServer = git ${remotes:github}/ZServer pushurl=${remotes:github_push}/ZServer
# ZTK
......
......@@ -21,6 +21,7 @@ from Acquisition import Implicit
from App.config import getConfiguration
from App.Management import Tabs
from App.special_dtml import DTMLFile
from App.Undo import UndoSupport
from App.version_txt import version_txt
from OFS.Traversable import Traversable
from Products.PageTemplates.PageTemplateFile import PageTemplateFile
......@@ -123,7 +124,7 @@ class ApplicationManager(Tabs, Traversable, Implicit):
return getConfiguration().clienthome
class AltDatabaseManager(Tabs, Implicit):
class AltDatabaseManager(Traversable, UndoSupport):
""" Database management DBTab-style
"""
id = 'DatabaseManagement'
......@@ -132,11 +133,11 @@ class AltDatabaseManager(Tabs, Implicit):
manage = manage_main = DTMLFile('dtml/dbMain', globals())
manage_main._setName('manage_main')
manage_options = ((
manage_options = (
{'label': 'Control Panel', 'action': '../../manage_main'},
{'label': 'Databases', 'action': '../manage_main'},
{'label': 'Database', 'action': 'manage_main'},
))
) + UndoSupport.manage_options
MANAGE_TABS_NO_BANNER = True
def _getDB(self):
......
......@@ -15,24 +15,18 @@
import binascii
from Acquisition import aq_inner
from Acquisition import aq_parent
from AccessControl import getSecurityManager
from Acquisition import Implicit
from AccessControl import ClassSecurityInfo
from AccessControl.class_init import InitializeClass
from AccessControl.Permissions import undo_changes
from App.interfaces import IUndoSupport
from App.special_dtml import DTMLFile
from DateTime.DateTime import DateTime
import ExtensionClass
import transaction
from ZopeUndo.Prefix import Prefix
from zope.interface import implements
from App.Management import Tabs
from App.special_dtml import DTMLFile
class UndoSupport(ExtensionClass.Base):
implements(IUndoSupport)
class UndoSupport(Tabs, Implicit):
security = ClassSecurityInfo()
......@@ -85,33 +79,7 @@ class UndoSupport(ExtensionClass.Base):
'last_transaction',
first_transaction + PrincipiaUndoBatchSize)
spec = {}
# A user is allowed to undo transactions that were initiated
# by any member of a user folder in the place where the user
# is defined.
user = getSecurityManager().getUser()
user_parent = aq_parent(user)
if user_parent is not None:
path = '/'.join(user_parent.getPhysicalPath()[1:-1])
else:
path = ''
if path:
spec['user_name'] = Prefix(path)
if getattr(aq_parent(aq_inner(self)), '_p_jar', None) == self._p_jar:
# We only want to undo things done here (and not in mounted
# databases)
opath = '/'.join(self.getPhysicalPath())
else:
# Special case: at the root of a database,
# allow undo of any path.
opath = None
if opath:
spec['description'] = Prefix(opath)
r = self._p_jar.db().undoInfo(
first_transaction, last_transaction, spec)
r = self._p_jar.db().undoInfo(first_transaction, last_transaction)
for d in r:
d['time'] = t = DateTime(d['time'])
......
......@@ -22,7 +22,6 @@ modified objects that were modified by a selected transaction.
<dtml-call "REQUEST.set('first_transaction', _.None)">
</dtml-unless>
<a name="t_list" />
<table width="100%" cellspacing="0" cellpadding="2" border="0">
<tr class="list-header">
<td align="left" valign="top">
......
......@@ -17,11 +17,7 @@ from zope.interface import Attribute
from zope.interface import Interface
# XXX: might contain non-API methods and outdated comments;
# not synced with ZopeBook API Reference;
# based on App.Management.Navigation
class INavigation(Interface):
"""Basic navigation UI support"""
manage = Attribute(""" """)
......@@ -34,21 +30,3 @@ class INavigation(Interface):
"""Logout current user"""
INavigation.setTaggedValue('manage_page_style.css', Attribute(""" """))
# XXX: might contain non-API methods and outdated comments;
# not synced with ZopeBook API Reference;
# based on App.Undo.UndoSupport
class IUndoSupport(Interface):
manage_UndoForm = Attribute("""Manage Undo form""")
def undoable_transactions(first_transaction=None,
last_transaction=None,
PrincipiaUndoBatchSize=None):
"""
"""
def manage_undo_transactions(transaction_info=(), REQUEST=None):
"""
"""
import unittest
class TestUndoSupport(unittest.TestCase):
def test_interfaces(self):
from App.interfaces import IUndoSupport
from App.Undo import UndoSupport
from zope.interface.verify import verifyClass
verifyClass(IUndoSupport, UndoSupport)
......@@ -40,7 +40,6 @@ from Acquisition import Implicit
from App.Management import Tabs
from App.special_dtml import HTML
from App.special_dtml import DTMLFile
from App.Undo import UndoSupport
from ComputedAttribute import ComputedAttribute
from DateTime import DateTime
from DocumentTemplate.html_quote import html_quote
......@@ -75,9 +74,7 @@ class Item(Base,
CopySource,
Tabs,
Traversable,
Owned,
UndoSupport,
):
Owned):
"""A common base class for simple, non-container objects."""
implements(IItem)
......@@ -126,11 +123,6 @@ class Item(Base,
# Default propertysheet info:
__propsets__ = ()
manage_options = (
UndoSupport.manage_options +
Owned.manage_options
)
# Attributes that must be acquired
REQUEST = Acquired
......
......@@ -25,7 +25,6 @@ from AccessControl.interfaces import IOwned
from AccessControl.interfaces import IRoleManager
from Acquisition.interfaces import IAcquirer
from App.interfaces import INavigation
from App.interfaces import IUndoSupport
from persistent.interfaces import IPersistent
......@@ -522,7 +521,7 @@ class ILockItem(Interface):
# not synced with ZopeBook API Reference;
# based on OFS.SimpleItem.Item
class IItem(IZopeObject, IManageable, IFTPAccess,
ICopySource, ITraversable, IOwned, IUndoSupport):
ICopySource, ITraversable, IOwned):
__name__ = BytesLine(
title=u"Name"
......
......@@ -45,6 +45,7 @@ zExceptions = 3.3
zLOG = 3.0
ZODB = 4.4.2
zodbpickle = 0.6.0
ZopeUndo = 4.1
zope.annotation = 4.4.1
zope.browser = 2.1.0
zope.browsermenu = 4.1.1
......@@ -90,5 +91,4 @@ zope.testing = 4.5.0
zope.testrunner = 4.5.1
zope.traversing = 4.0.0
zope.viewlet = 4.0.0
ZopeUndo = 4.1
ZServer =
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment