Author: jmorliaguet Date: Wed Dec 7 15:05:20 2005 New Revision: 1977 Added: cpsskins/branches/jmo-perspectives/profiles/default/settings.zcml (contents, props changed) cpsskins/branches/jmo-perspectives/profiles/settings.zcml (contents, props changed) cpsskins/branches/jmo-perspectives/setup/registration.py (contents, props changed) Removed: cpsskins/branches/jmo-perspectives/profiles/configure.zcml cpsskins/branches/jmo-perspectives/profiles/default/configure.zcml Modified: cpsskins/branches/jmo-perspectives/configuration/settings/metaconfigure.py cpsskins/branches/jmo-perspectives/configure.zcml cpsskins/branches/jmo-perspectives/engines/default/formats/style.py cpsskins/branches/jmo-perspectives/setup/configure.zcml Log:
- profiles must be registered during application setup Modified: cpsskins/branches/jmo-perspectives/configuration/settings/metaconfigure.py ============================================================================== --- cpsskins/branches/jmo-perspectives/configuration/settings/metaconfigure.py (original) +++ cpsskins/branches/jmo-perspectives/configuration/settings/metaconfigure.py Wed Dec 7 15:05:20 2005 @@ -21,8 +21,8 @@ from zope.component.interfaces import IFactory from zope.configuration.exceptions import ConfigurationError -from cpsskins.engines.default.formats.style import Resources -from cpsskins.setup.interfaces import ISetting, IResourceImporter +from cpsskins.setup.interfaces import ISetting +from cpsskins.setup.interfaces import IResourceImporter, IResourceManager def setting(_context, name=u'', factory=None, resource=None): @@ -43,8 +43,8 @@ resource_object = factory() IResourceImporter(resource_object).load(xml) - # register the style as a global setting - resources = Resources(resource_object) + # register the resource as a global setting + resources = getUtility(IResourceManager) resources.register(name=name, title=resource_object.title, resource=resource_object) Modified: cpsskins/branches/jmo-perspectives/configure.zcml ============================================================================== --- cpsskins/branches/jmo-perspectives/configure.zcml (original) +++ cpsskins/branches/jmo-perspectives/configure.zcml Wed Dec 7 15:05:20 2005 @@ -92,8 +92,6 @@ <include package=".configuration" /> - <include package=".profiles" /> - <include package=".setup" /> </configure> Modified: cpsskins/branches/jmo-perspectives/engines/default/formats/style.py ============================================================================== --- cpsskins/branches/jmo-perspectives/engines/default/formats/style.py (original) +++ cpsskins/branches/jmo-perspectives/engines/default/formats/style.py Wed Dec 7 15:05:20 2005 @@ -154,11 +154,6 @@ __contains__ = has_key -class Resources(ResourceManager): - """This adapter makes styles usable as resources - """ - resource_type = IStyle - class Exporter(BrowserView): """This adapter makes it possible to export style resources """ Added: cpsskins/branches/jmo-perspectives/profiles/default/settings.zcml ============================================================================== --- (empty file) +++ cpsskins/branches/jmo-perspectives/profiles/default/settings.zcml Wed Dec 7 15:05:20 2005 @@ -0,0 +1,7 @@ +<configure> + + <!-- Perspectives --> + + <include file="perspectives.zcml" /> + +</configure> Added: cpsskins/branches/jmo-perspectives/profiles/settings.zcml ============================================================================== --- (empty file) +++ cpsskins/branches/jmo-perspectives/profiles/settings.zcml Wed Dec 7 15:05:20 2005 @@ -0,0 +1,7 @@ +<configure> + + <!-- Default profile --> + + <include file="default/settings.zcml" /> + +</configure> Modified: cpsskins/branches/jmo-perspectives/setup/configure.zcml ============================================================================== --- cpsskins/branches/jmo-perspectives/setup/configure.zcml (original) +++ cpsskins/branches/jmo-perspectives/setup/configure.zcml Wed Dec 7 15:05:20 2005 @@ -4,23 +4,30 @@ i18n_domain="cpsskins" > - <!-- this adapter makes settings relatable --> + <utility + provides="cpsskins.setup.interfaces.IResourceManager" + factory="cpsskins.setup.manager.ResourceManager" + /> + <!-- this adapter makes settings relatable --> <adapter for=".interfaces.ISetting" factory="cpsskins.setup.adapters.Relatable" provides="cpsskins.relations.interfaces.IRelatable" /> + <!-- this adapter make it possible to extract resource data from settings --> <adapter for="cpsskins.setup.interfaces.ISetting" factory="cpsskins.setup.adapters.Resource" provides="cpsskins.setup.interfaces.IResource" /> - <utility - provides="cpsskins.setup.interfaces.IResourceManager" - factory="cpsskins.setup.manager.ResourceManager" + <!-- register global application settings --> + <subscriber + handler=".registration.registerSettings" + for="zope.app.appsetup.IDatabaseOpenedEvent" /> + </configure> Added: cpsskins/branches/jmo-perspectives/setup/registration.py ============================================================================== --- (empty file) +++ cpsskins/branches/jmo-perspectives/setup/registration.py Wed Dec 7 15:05:20 2005 @@ -0,0 +1,24 @@ +############################################################################## +# +# Copyright (c) 2005 Nuxeo 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. +# +############################################################################## +""" + +$Id$ +""" +__docformat__ = "reStructuredText" + +from zope.configuration import xmlconfig + +def registerSettings(event): + print "Registering settings ..." + # TODO -- http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins