[CMF-checkins] CVS: Products/CMFDefault - setuphandlers.py:1.2.2.1
__init__.py:1.24.2.1
Yvo Schubbe
y.2004_ at wcm-solutions.de
Sun Nov 28 15:06:25 EST 2004
Update of /cvs-repository/Products/CMFDefault
In directory cvs.zope.org:/tmp/cvs-serv15502/CMFDefault
Modified Files:
Tag: CMF-1_5-branch
__init__.py
Added Files:
Tag: CMF-1_5-branch
setuphandlers.py
Log Message:
backported changes from HEAD:
- added importVarious setup handler
- moved 'default' profile to CMFDefault
- added 'various' step to import_steps.xml
=== Added File Products/CMFDefault/setuphandlers.py ===
##############################################################################
#
# Copyright (c) 2004 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.
#
##############################################################################
""" CMFDefault setup handlers.
$Id: setuphandlers.py,v 1.2.2.1 2004/11/28 20:05:54 yuppie Exp $
"""
from Products.CMFCore.utils import getToolByName
from Portal import PortalGenerator
def importVarious(context):
""" Import various settings from PortalGenerator.
This provisional handler will be removed again as soon as full handlers
are implemented for these steps.
"""
site = context.getSite()
# try to install CMFUid without raising exceptions if not available
try:
addCMFUidTool = site.manage_addProduct['CMFUid'].manage_addTool
except AttributeError:
pass
else:
addCMFUidTool('Unique Id Annotation Tool', None)
addCMFUidTool('Unique Id Generator Tool', None)
addCMFUidTool('Unique Id Handler Tool', None)
# add custom skin folder
stool = getToolByName(site, 'portal_skins')
stool.manage_addProduct['OFSP'].manage_addFolder(id='custom')
gen = PortalGenerator()
gen.setupMailHost(site)
gen.setupUserFolder(site)
gen.setupCookieAuth(site)
gen.setupMembersFolder(site)
gen.setupMimetypes(site)
gen.setupDefaultProperties(site, title='Portal', description='',
email_from_address='postmaster at localhost',
email_from_name='Portal Administrator',
validate_email=0, default_charset='')
return 'Various settings from PortalGenerator imported.'
=== Products/CMFDefault/__init__.py 1.24 => 1.24.2.1 ===
--- Products/CMFDefault/__init__.py:1.24 Thu Aug 12 11:07:40 2004
+++ Products/CMFDefault/__init__.py Sun Nov 28 15:05:54 2004
@@ -21,10 +21,15 @@
from Products.CMFCore.utils import ToolInit
from Products.CMFCore.utils import ContentInit
from Products.CMFCore.utils import registerIcon
+try:
+ from Products.CMFSetup import profile_registry
+ has_profile_registry = True
+except ImportError:
+ has_profile_registry = False
import utils
from permissions import AddPortalContent
-
+
import Portal
import Document
import Link
@@ -86,7 +91,6 @@
, SkinnedFolder.SkinnedFolder
)
-
contentConstructors = ( Document.addDocument
, File.addFile
, Image.addImage
@@ -140,6 +144,13 @@
, extra_constructors=contentConstructors
, fti=Portal.factory_type_information
).initialize( context )
+
+ if has_profile_registry:
+ profile_registry.registerProfile('default',
+ 'CMFDefault Site',
+ 'Profile for a default CMFSite.',
+ 'profiles/default',
+ 'CMFDefault')
context.registerClass( Portal.CMFSite
, constructors=( Portal.manage_addCMFSiteForm
More information about the CMF-checkins
mailing list