[Checkins] SVN: GenericSetup/branches/1.3/ - added
'components_xmlconfig.html' form
Yvo Schubbe
y.2007- at wcm-solutions.de
Thu Jul 26 12:54:38 EDT 2007
Log message for revision 78357:
- added 'components_xmlconfig.html' form
Changed:
U GenericSetup/branches/1.3/CHANGES.txt
A GenericSetup/branches/1.3/browser/components.py
A GenericSetup/branches/1.3/browser/configure.zcml
U GenericSetup/branches/1.3/configure.zcml
U GenericSetup/branches/1.3/context.py
-=-
Modified: GenericSetup/branches/1.3/CHANGES.txt
===================================================================
--- GenericSetup/branches/1.3/CHANGES.txt 2007-07-26 16:34:50 UTC (rev 78356)
+++ GenericSetup/branches/1.3/CHANGES.txt 2007-07-26 16:54:37 UTC (rev 78357)
@@ -1,6 +1,12 @@
GenericSetup Product Changelog
+ GenericSetup 1.3.1 (unreleased)
+
+ - components: Added 'components_xmlconfig.html' form.
+ This view allows to inspect and edit component registrations.
+
+
GenericSetup 1.3 (2007/07/26)
- components: Removed non-functional support for registering objects in
Added: GenericSetup/branches/1.3/browser/components.py
===================================================================
--- GenericSetup/branches/1.3/browser/components.py (rev 0)
+++ GenericSetup/branches/1.3/browser/components.py 2007-07-26 16:54:37 UTC (rev 78357)
@@ -0,0 +1,71 @@
+##############################################################################
+#
+# Copyright (c) 2007 Zope Corporation and Contributors. All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Components setup view.
+
+$Id$
+"""
+
+from Products.Five.component.interfaces import IObjectManagerSite
+from Products.Five.formlib.formbase import PageEditForm
+from zope.component import adapts
+from zope.component import getMultiAdapter
+from zope.formlib import form
+from zope.interface import implements
+from zope.interface import Interface
+from zope.schema import Text
+
+from Products.GenericSetup.context import SetupEnviron
+from Products.GenericSetup.interfaces import IBody
+
+
+class IComponentsSetupSchema(Interface):
+
+ """Schema for components setup views.
+ """
+
+ body = Text(
+ title=u'Settings')
+
+
+class ComponentsSetupSchemaAdapter(object):
+
+ adapts(IObjectManagerSite)
+ implements(IComponentsSetupSchema)
+
+ def __init__(self, context):
+ self.context = context
+
+ def _getBody(self):
+ sm = self.context.aq_inner.getSiteManager()
+ return getMultiAdapter((sm, SetupEnviron()), IBody).body
+
+ def _setBody(self, value):
+ sm = self.context.aq_inner.getSiteManager()
+ getMultiAdapter((sm, SetupEnviron()), IBody).body = value
+
+ body = property(_getBody, _setBody)
+
+
+class ComponentsSetupView(PageEditForm):
+
+ """Components setup view for IObjectManagerSite.
+ """
+
+ label = u'Component Registry: XML Configuration'
+
+ form_fields = form.FormFields(IComponentsSetupSchema)
+
+ def setUpWidgets(self, ignore_request=False):
+ super(ComponentsSetupView,
+ self).setUpWidgets(ignore_request=ignore_request)
+ self.widgets['body'].height = 24
Property changes on: GenericSetup/branches/1.3/browser/components.py
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: GenericSetup/branches/1.3/browser/configure.zcml
===================================================================
--- GenericSetup/branches/1.3/browser/configure.zcml (rev 0)
+++ GenericSetup/branches/1.3/browser/configure.zcml 2007-07-26 16:54:37 UTC (rev 78357)
@@ -0,0 +1,14 @@
+<configure
+ xmlns="http://namespaces.zope.org/zope"
+ xmlns:browser="http://namespaces.zope.org/browser">
+
+ <adapter factory=".components.ComponentsSetupSchemaAdapter"/>
+
+ <browser:page
+ for="Products.Five.component.interfaces.IObjectManagerSite"
+ name="components_xmlconfig.html"
+ class=".components.ComponentsSetupView"
+ permission="five.ManageSite"
+ />
+
+</configure>
Property changes on: GenericSetup/branches/1.3/browser/configure.zcml
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: GenericSetup/branches/1.3/configure.zcml
===================================================================
--- GenericSetup/branches/1.3/configure.zcml 2007-07-26 16:34:50 UTC (rev 78356)
+++ GenericSetup/branches/1.3/configure.zcml 2007-07-26 16:54:37 UTC (rev 78357)
@@ -2,6 +2,8 @@
xmlns="http://namespaces.zope.org/zope"
>
+ <include package=".browser"/>
+
<include package=".MailHost"/>
<include package=".OFSP"/>
Modified: GenericSetup/branches/1.3/context.py
===================================================================
--- GenericSetup/branches/1.3/context.py 2007-07-26 16:34:50 UTC (rev 78356)
+++ GenericSetup/branches/1.3/context.py 2007-07-26 16:54:37 UTC (rev 78357)
@@ -41,6 +41,7 @@
from interfaces import IExportContext
from interfaces import IImportContext
+from interfaces import ISetupEnviron
from interfaces import IWriteLogger
from interfaces import SKIPPED_FILES
from interfaces import SKIPPED_SUFFIXES
@@ -95,10 +96,35 @@
self._logger.log(level, msg, *args, **kwargs)
-class BaseContext( Implicit ):
+class SetupEnviron(Implicit):
+ """Context for body im- and exporter.
+ """
+
+ implements(ISetupEnviron)
+
security = ClassSecurityInfo()
+ def __init__(self):
+ self._should_purge = True
+
+ security.declareProtected(ManagePortal, 'getLogger')
+ def getLogger(self, name):
+ """Get a logger with the specified name, creating it if necessary.
+ """
+ return logging.getLogger('GenericSetup.%s' % name)
+
+ security.declareProtected(ManagePortal, 'shouldPurge')
+ def shouldPurge(self):
+ """When installing, should the existing setup be purged?
+ """
+ return self._should_purge
+
+
+class BaseContext(SetupEnviron):
+
+ security = ClassSecurityInfo()
+
def __init__( self, tool, encoding ):
self._tool = tool
@@ -149,14 +175,7 @@
"""
self._messages[:] = []
- security.declareProtected( ManagePortal, 'shouldPurge' )
- def shouldPurge( self ):
- """ See ISetupContext.
- """
- return self._should_purge
-
-
class DirectoryImportContext( BaseContext ):
implements(IImportContext)
More information about the Checkins
mailing list