[CMF-checkins] SVN: CMF/trunk/C - switched to global import and
export steps
Yvo Schubbe
y.2007- at wcm-solutions.de
Sat Dec 22 08:59:56 EST 2007
Log message for revision 82392:
- switched to global import and export steps
Changed:
U CMF/trunk/CHANGES.txt
U CMF/trunk/CMFActionIcons/configure.zcml
U CMF/trunk/CMFActionIcons/exportimport.py
D CMF/trunk/CMFActionIcons/profiles/actionicons/export_steps.xml
D CMF/trunk/CMFActionIcons/profiles/actionicons/import_steps.xml
U CMF/trunk/CMFCalendar/configure.zcml
D CMF/trunk/CMFCalendar/profiles/default/import_steps.xml
A CMF/trunk/CMFCalendar/profiles/default/various-calendar.txt
U CMF/trunk/CMFCalendar/setuphandlers.py
U CMF/trunk/CMFDefault/configure.zcml
A CMF/trunk/CMFDefault/exportimport.zcml
D CMF/trunk/CMFDefault/profiles/default/export_steps.xml
D CMF/trunk/CMFDefault/profiles/default/import_steps.xml
A CMF/trunk/CMFDefault/profiles/default/various.txt
U CMF/trunk/CMFDefault/setuphandlers.py
-=-
Modified: CMF/trunk/CHANGES.txt
===================================================================
--- CMF/trunk/CHANGES.txt 2007-12-22 13:30:52 UTC (rev 82391)
+++ CMF/trunk/CHANGES.txt 2007-12-22 13:59:56 UTC (rev 82392)
@@ -2,6 +2,14 @@
New Features
+ - CMFDefault setup handler: Improved 'various' import step.
+ Added flag file check and global registration.
+
+ - CMFCalendar setup handler: Improved 'various-calendar' import step.
+ Added flag file check and global registration.
+
+ - CMFActionIcons setup handler: Registered steps globally.
+
- CMFDefault.Document and CMFDefault.NewsItem: It is now possible to
register a utility (ILinebreakNormalizer) that can normalize line
breaks upon editing or rendering out to FTP.
@@ -19,6 +27,8 @@
Others
+ - profiles: Removed obsolete local import and export step registrations.
+
- CMFUid: Removed redundant and unexpected code to auto-create catalog
index and column for the UID handler tool. The index and column are
already created by the default CMFUid GenericSetup profile.
Modified: CMF/trunk/CMFActionIcons/configure.zcml
===================================================================
--- CMF/trunk/CMFActionIcons/configure.zcml 2007-12-22 13:30:52 UTC (rev 82391)
+++ CMF/trunk/CMFActionIcons/configure.zcml 2007-12-22 13:59:56 UTC (rev 82392)
@@ -8,6 +8,23 @@
<cmf:registerDirectory name="actionicons"/>
+ <!-- exportimport -->
+
+ <genericsetup:importStep
+ name="action-icons"
+ title="Action Icons"
+ description="Import action icon definitions"
+ handler="Products.CMFActionIcons.exportimport.importActionIconsTool">
+ <depends name="componentregistry"/>
+ </genericsetup:importStep>
+
+ <genericsetup:exportStep
+ name="action-icons"
+ title="Action Icons"
+ description="Export action icon definitions"
+ handler="Products.CMFActionIcons.exportimport.exportActionIconsTool"
+ />
+
<!-- profiles -->
<genericsetup:registerProfile
Modified: CMF/trunk/CMFActionIcons/exportimport.py
===================================================================
--- CMF/trunk/CMFActionIcons/exportimport.py 2007-12-22 13:30:52 UTC (rev 82391)
+++ CMF/trunk/CMFActionIcons/exportimport.py 2007-12-22 13:59:56 UTC (rev 82392)
@@ -45,15 +45,19 @@
""" Import action icons tool settings from an XML file.
"""
site = context.getSite()
+ logger = context.getLogger('action-icons')
+
+ body = context.readDataFile(_FILENAME)
+ if body is None:
+ logger.debug('Nothing to import.')
+ return
+
sm = getSiteManager(site)
ait = sm.queryUtility(IActionIconsTool)
if ait is None:
- return 'Action icons: No tool!'
+ logger.warning('No tool!')
+ return
- body = context.readDataFile(_FILENAME)
- if body is None:
- return 'Action icons: Nothing to import.'
-
if context.shouldPurge():
ait.clearActionIcons()
@@ -71,21 +75,26 @@
ait.updateActionIcon(**action_icon)
else:
ait.addActionIcon(**action_icon)
+ logger.info('Action icons tool settings imported.')
- return 'Action icons settings imported.'
-
def exportActionIconsTool(context):
""" Export caching policy manager settings as an XML file.
"""
site = context.getSite()
+ logger = context.getLogger('action-icons')
+
+ tool = getSiteManager(site).queryUtility(IActionIconsTool)
+ if tool is None:
+ logger.debug('Nothing to export.')
+ return
+
mhc = ActionIconsToolExportConfigurator( site ).__of__( site )
text = mhc.generateXML()
context.writeDataFile( _FILENAME, text, 'text/xml' )
+ logger.info('Action icons tool settings exported.')
- return 'Action icons tool settings exported.'
-
class ActionIconsToolExportConfigurator(ExportConfiguratorBase):
""" Synthesize XML description of cc properties.
"""
Deleted: CMF/trunk/CMFActionIcons/profiles/actionicons/export_steps.xml
===================================================================
--- CMF/trunk/CMFActionIcons/profiles/actionicons/export_steps.xml 2007-12-22 13:30:52 UTC (rev 82391)
+++ CMF/trunk/CMFActionIcons/profiles/actionicons/export_steps.xml 2007-12-22 13:59:56 UTC (rev 82392)
@@ -1,8 +0,0 @@
-<?xml version="1.0"?>
-<export-steps>
- <export-step id="action-icons"
- handler="Products.CMFActionIcons.exportimport.exportActionIconsTool"
- title="Action Icons">
- Export action icon definitions
- </export-step>
-</export-steps>
Deleted: CMF/trunk/CMFActionIcons/profiles/actionicons/import_steps.xml
===================================================================
--- CMF/trunk/CMFActionIcons/profiles/actionicons/import_steps.xml 2007-12-22 13:30:52 UTC (rev 82391)
+++ CMF/trunk/CMFActionIcons/profiles/actionicons/import_steps.xml 2007-12-22 13:59:56 UTC (rev 82392)
@@ -1,9 +0,0 @@
-<?xml version="1.0"?>
-<import-steps>
- <import-step id="action-icons" version="20051015-01"
- handler="Products.CMFActionIcons.exportimport.importActionIconsTool"
- title="Action Icons">
- <dependency step="toolset"/>
- Import action icon definitions
- </import-step>
-</import-steps>
Modified: CMF/trunk/CMFCalendar/configure.zcml
===================================================================
--- CMF/trunk/CMFCalendar/configure.zcml 2007-12-22 13:30:52 UTC (rev 82391)
+++ CMF/trunk/CMFCalendar/configure.zcml 2007-12-22 13:59:56 UTC (rev 82392)
@@ -27,6 +27,16 @@
<cmf:registerDirectory name="zpt_calendar"/>
+ <!-- exportimport -->
+
+ <genericsetup:importStep
+ name="various-calendar"
+ title="Various Calendar Settings"
+ description="Import various settings for CMF Calendar."
+ handler="Products.CMFCalendar.setuphandlers.importVarious">
+ <depends name="toolset"/>
+ </genericsetup:importStep>
+
<!-- profiles -->
<genericsetup:registerProfile
Deleted: CMF/trunk/CMFCalendar/profiles/default/import_steps.xml
===================================================================
--- CMF/trunk/CMFCalendar/profiles/default/import_steps.xml 2007-12-22 13:30:52 UTC (rev 82391)
+++ CMF/trunk/CMFCalendar/profiles/default/import_steps.xml 2007-12-22 13:59:56 UTC (rev 82392)
@@ -1,9 +0,0 @@
-<?xml version="1.0"?>
-<import-steps>
- <import-step id="various-calendar" version="20050316-01"
- handler="Products.CMFCalendar.setuphandlers.importVarious"
- title="Various Calendar Settings">
- <dependency step="toolset"/>
- Import various settings for CMF Calendar.
- </import-step>
-</import-steps>
Added: CMF/trunk/CMFCalendar/profiles/default/various-calendar.txt
===================================================================
--- CMF/trunk/CMFCalendar/profiles/default/various-calendar.txt (rev 0)
+++ CMF/trunk/CMFCalendar/profiles/default/various-calendar.txt 2007-12-22 13:59:56 UTC (rev 82392)
@@ -0,0 +1 @@
+Flag file for 'various-calendar' step.
Property changes on: CMF/trunk/CMFCalendar/profiles/default/various-calendar.txt
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: CMF/trunk/CMFCalendar/setuphandlers.py
===================================================================
--- CMF/trunk/CMFCalendar/setuphandlers.py 2007-12-22 13:30:52 UTC (rev 82391)
+++ CMF/trunk/CMFCalendar/setuphandlers.py 2007-12-22 13:59:56 UTC (rev 82392)
@@ -28,6 +28,13 @@
This provisional handler will be removed again as soon as full handlers
are implemented for these steps.
"""
+ logger = context.getLogger('various-calendar')
+
+ # Only run step if a flag file is present
+ if context.readDataFile('various-calendar.txt') is None:
+ logger.debug('Nothing to import.')
+ return
+
site = context.getSite()
mdtool = getUtility(IMetadataTool)
@@ -48,7 +55,6 @@
_('Work'),
),
REQUEST=None)
+ logger.info('MetadataTool element policy for events imported.')
except MetadataError:
- pass
-
- return 'Various settings for CMF Calendar imported.'
+ logger.warning('Importing MetadataTool element policy failed.')
Modified: CMF/trunk/CMFDefault/configure.zcml
===================================================================
--- CMF/trunk/CMFDefault/configure.zcml 2007-12-22 13:30:52 UTC (rev 82391)
+++ CMF/trunk/CMFDefault/configure.zcml 2007-12-22 13:59:56 UTC (rev 82392)
@@ -9,6 +9,8 @@
<include file="content.zcml"/>
+ <include file="exportimport.zcml"/>
+
<include file="profiles.zcml"/>
<include file="directories.zcml"/>
Added: CMF/trunk/CMFDefault/exportimport.zcml
===================================================================
--- CMF/trunk/CMFDefault/exportimport.zcml (rev 0)
+++ CMF/trunk/CMFDefault/exportimport.zcml 2007-12-22 13:59:56 UTC (rev 82392)
@@ -0,0 +1,14 @@
+<configure
+ xmlns="http://namespaces.zope.org/zope"
+ xmlns:genericsetup="http://namespaces.zope.org/genericsetup"
+ i18n_domain="cmf_default">
+
+ <genericsetup:importStep
+ name="various"
+ title="Various Settings"
+ description="Import various settings from PortalGenerator."
+ handler="Products.CMFDefault.setuphandlers.importVarious">
+ <depends name="toolset"/>
+ </genericsetup:importStep>
+
+</configure>
Property changes on: CMF/trunk/CMFDefault/exportimport.zcml
___________________________________________________________________
Name: svn:eol-style
+ native
Deleted: CMF/trunk/CMFDefault/profiles/default/export_steps.xml
===================================================================
--- CMF/trunk/CMFDefault/profiles/default/export_steps.xml 2007-12-22 13:30:52 UTC (rev 82391)
+++ CMF/trunk/CMFDefault/profiles/default/export_steps.xml 2007-12-22 13:59:56 UTC (rev 82392)
@@ -1,53 +0,0 @@
-<?xml version="1.0"?>
-<export-steps>
- <export-step id="actions"
- handler="Products.CMFCore.exportimport.actions.exportActionProviders"
- title="Action Providers">
- Export actions tool's action providers and their actions.
- </export-step>
- <export-step id="caching_policy_mgr"
- handler="Products.CMFCore.exportimport.cachingpolicymgr.exportCachingPolicyManager"
- title="Caching Policies">
- Export caching policy manager's policies.
- </export-step>
- <export-step id="catalog"
- handler="Products.CMFCore.exportimport.catalog.exportCatalogTool"
- title="Catalog Tool">
- Export catalog tool's sub-objects, indexes and columns.
- </export-step>
- <export-step id="content_type_registry"
- handler="Products.CMFCore.exportimport.contenttyperegistry.exportContentTypeRegistry"
- title="Content Type Registry">
- Export content type registry's predicates / bindings.
- </export-step>
- <export-step id="cookieauth"
- handler="Products.CMFCore.exportimport.cookieauth.exportCookieCrumbler"
- title="Cookie Authentication">
- Export cookie crumbler settings
- </export-step>
- <export-step id="mailhost"
- handler="Products.CMFCore.exportimport.mailhost.exportMailHost"
- title="MailHost">
- Export the mailhost's settings and properties
- </export-step>
- <export-step id="properties"
- handler="Products.CMFCore.exportimport.properties.exportSiteProperties"
- title="Site Properties">
- Export site properties.
- </export-step>
- <export-step id="skins"
- handler="Products.CMFCore.exportimport.skins.exportSkinsTool"
- title="Skins Tool">
- Export skins tool's filesystem directory views and skin path definitions.
- </export-step>
- <export-step id="typeinfo"
- handler="Products.CMFCore.exportimport.typeinfo.exportTypesTool"
- title="Types Tool">
- Export types tool's type information objects.
- </export-step>
- <export-step id="workflows"
- handler="Products.CMFCore.exportimport.workflow.exportWorkflowTool"
- title="Workflow Tool">
- Export workflow tool's workflow definitions and supporting scripts.
- </export-step>
-</export-steps>
Deleted: CMF/trunk/CMFDefault/profiles/default/import_steps.xml
===================================================================
--- CMF/trunk/CMFDefault/profiles/default/import_steps.xml 2007-12-22 13:30:52 UTC (rev 82391)
+++ CMF/trunk/CMFDefault/profiles/default/import_steps.xml 2007-12-22 13:59:56 UTC (rev 82392)
@@ -1,70 +0,0 @@
-<?xml version="1.0"?>
-<import-steps>
- <import-step id="actions" version="20040630-01"
- handler="Products.CMFCore.exportimport.actions.importActionProviders"
- title="Action Providers">
- <dependency step="componentregistry"/>
- Import actions tool's action providers and their actions.
- </import-step>
- <import-step id="caching_policy_mgr" version="20051011-01"
- handler="Products.CMFCore.exportimport.cachingpolicymgr.importCachingPolicyManager"
- title="Caching Policies">
- <dependency step="toolset"/>
- Import caching policy manager's policies.
- </import-step>
- <import-step id="catalog" version="20050929-01"
- handler="Products.CMFCore.exportimport.catalog.importCatalogTool"
- title="Catalog Tool">
- <dependency step="toolset"/>
- Import catalog tool's sub-objects, indexes and columns.
- </import-step>
- <import-step id="content_type_registry"
- version="20051013-01"
- handler="Products.CMFCore.exportimport.contenttyperegistry.importContentTypeRegistry"
- title="Content Type Registry">
- <dependency step="componentregistry"/>
- Import content type registry's predicates and bindings.
- </import-step>
- <import-step id="cookie_authentication"
- version="20050903-01"
- handler="Products.CMFCore.exportimport.cookieauth.importCookieCrumbler"
- title="Cookie Authentication">
- <dependency step="toolset"/>
- Import cookie crumbler settings
- </import-step>
- <import-step id="mailhost" version="20050803-01"
- handler="Products.CMFCore.exportimport.mailhost.importMailHost"
- title="MailHost">
- <dependency step="componentregistry"/>
- Import mailhost settings
- </import-step>
- <import-step id="properties" version="20041215-01"
- handler="Products.CMFCore.exportimport.properties.importSiteProperties"
- title="Site Properties">
- Import site properties.
- </import-step>
- <import-step id="skins" version="20040630-01"
- handler="Products.CMFCore.exportimport.skins.importSkinsTool"
- title="Skins Tool">
- <dependency step="componentregistry"/>
- Import skins tool's filesystem directory views and skin path definitions.
- </import-step>
- <import-step id="typeinfo" version="20040630-01"
- handler="Products.CMFCore.exportimport.typeinfo.importTypesTool"
- title="Types Tool">
- <dependency step="toolset"/>
- Import types tool's type information objects.
- </import-step>
- <import-step id="various" version="20041118-01"
- handler="Products.CMFDefault.setuphandlers.importVarious"
- title="Various Settings">
- <dependency step="toolset"/>
- Import various settings from PortalGenerator.
- </import-step>
- <import-step id="workflow" version="20040630-01"
- handler="Products.CMFCore.exportimport.workflow.importWorkflowTool"
- title="Workflow Tool">
- <dependency step="toolset"/>
- Import workflow tool's workflow definitions and supporting scripts.
- </import-step>
-</import-steps>
Added: CMF/trunk/CMFDefault/profiles/default/various.txt
===================================================================
--- CMF/trunk/CMFDefault/profiles/default/various.txt (rev 0)
+++ CMF/trunk/CMFDefault/profiles/default/various.txt 2007-12-22 13:59:56 UTC (rev 82392)
@@ -0,0 +1 @@
+Flag file for 'various' step.
Property changes on: CMF/trunk/CMFDefault/profiles/default/various.txt
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: CMF/trunk/CMFDefault/setuphandlers.py
===================================================================
--- CMF/trunk/CMFDefault/setuphandlers.py 2007-12-22 13:30:52 UTC (rev 82391)
+++ CMF/trunk/CMFDefault/setuphandlers.py 2007-12-22 13:59:56 UTC (rev 82392)
@@ -24,14 +24,22 @@
This provisional handler will be removed again as soon as full handlers
are implemented for these steps.
"""
+ logger = context.getLogger('various')
+
+ # Only run step if a flag file is present
+ if context.readDataFile('various.txt') is None:
+ logger.debug('Nothing to import.')
+ return
+
site = context.getSite()
try:
site.manage_addPortalFolder('Members')
+ site.Members.manage_addProduct['OFSP'].manage_addDTMLMethod(
+ 'index_html', 'Member list', '<dtml-return roster>')
+ logger.info('Members folder imported.')
except BadRequest:
- return 'Various settings: Nothing to import.'
- site.Members.manage_addProduct['OFSP'].manage_addDTMLMethod('index_html',
- 'Member list', '<dtml-return roster>')
+ logger.warning('Importing Members folder failed.')
+
site.acl_users.encrypt_passwords = False
-
- return 'Various settings from PortalGenerator imported.'
+ logger.info('Password encryption disabled.')
More information about the CMF-checkins
mailing list