# Copyright 2006 by the LeMill Team (see AUTHORS) # # This file is part of LeMill. # # LeMill is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # LeMill is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with LeMill; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA from config import * import config # CMF imports from Products.CMFCore import utils from Products.CMFCore.DirectoryView import registerDirectory from Products.CMFPlone import MigrationTool # BEGIN: PLONE 2.1 portion from Products.CMFPlone.Portal import addPolicy from Products.CMFPlone.interfaces.CustomizationPolicy import ICustomizationPolicy from Products.CMFPlone.CustomizationPolicy import DefaultCustomizationPolicy # END: PLONE 2.1 portion if PLONE25: from Products.CMFPlone.interfaces import IPloneSiteRoot from Products.GenericSetup import profile_registry, BASE, EXTENSION # Archetypes imports from Products.Archetypes.public import process_types, listTypes # Our own content types # Widgets # Our own portal tools #import LeMillSearchTool, LeMillTool, LeMillUserTool # Make a list of portal tools tools = () # Our own configuration stuff from ConfigurationMethods import KoolieluSetup #import LeMillWorkflow # Add the skins folder to the registry of viewable folders registerDirectory(SKINS_DIR,GLOBALS) def initialize(context): """This method is called when this product is initialized upon Zope startup.""" # Register our extension profile / customization policy MigrationTool.registerSetupWidget(KoolieluSetup) if PLONE25: try: profile_registry.registerProfile(name='Koolielu', title='Koolielu Site', description="Koolielu.", path='profiles/legacy', product='Koolielu', profile_type=EXTENSION, for_=IPloneSiteRoot) except KeyError: # Already done - ignore pass addPolicy('Koolielu Site', KoolieluCustomizationPolicy()) # Register our set of portal tools utils.ToolInit(PROJECTNAME + ' Tools', tools=tools, icon='',).initialize(context) # Process all imported content types into nice lists content_types, constructors, ftis = process_types( listTypes(PROJECTNAME), PROJECTNAME) # Register our set of content types utils.ContentInit( PROJECTNAME + ' Content', content_types = content_types, permission = ADD_CONTENT_PERMISSION, extra_constructors = constructors, fti = ftis, ).initialize(context) class KoolieluCustomizationPolicy(DefaultCustomizationPolicy): """Customization policy for the Koolielu site.""" __implements__ = ICustomizationPolicy # Yes, this can be used when creating a new Plone instance availableAtConstruction=True def customize(self,portal): """This method is called when a Plone portal is created with this customization policy.""" # Call super class, just in case they do something intelligent DefaultCustomizationPolicy.customize(self,portal) # Locate our migration widget widget = portal.portal_migration._getWidget('Koolielu Setup') # Add and execute all configuration methods that it lists as being available widget.addItems(widget.available())