# -*- coding: utf-8 # Copyright 2005-2006 by Meelis Mets __doc__ = """ E-Portfolio """ __version__ = "0.4" 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 # Permissions from Permissions import MODIFY_CONTENT import akismet # Our own content types import Eportfolio import Profile import Blog import Drawer import TaskManager import BaseTask import StructuredTask import ReflectionTask import StructuredTemplate import AnswerTask import Competence import Report import QCL import Groups import GroupData import GroupNote, GroupForum, GroupPhoto, GroupReference import SchoolDataBase import Help import Dashboard import Photoalbum import Link # Our own configuration stuff from ConfigurationMethods import EportfolioSetup import EportfolioWorkflow import CalendarTool import CachingTool tools = (CalendarTool.CalendarTool, CachingTool.CachingTool) # HOOK: Anything executed here will be executed any time the product is refreshed # or Zope is restarted. # 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.""" # Add our setup widgets into MigrationTool MigrationTool.registerSetupWidget(EportfolioSetup) # making config accessible from python scripts. from AccessControl import allow_module, ModuleSecurityInfo #ModuleSecurityInfo('config').declarePublic() allow_module('Products.Eportfolio.Validators') # Register our extension profile / customization policy if PLONE25: try: profile_registry.registerProfile(name='Eportfolio', title='Eportfolio3 Legacy Site', description="Eportfolio is a heavily customized Plone for special use, and can't be converted to a normal Plone very easily.", path='profiles/legacy', product='Eportfolio', profile_type=EXTENSION, for_=IPloneSiteRoot) except KeyError: # Already done - ignore pass addPolicy('Eportfolio Site',EportfolioCustomizationPolicy()) # Register our set of portal tools utils.ToolInit(PROJECT_NAME + ' Tools', tools=tools, icon='skins/eportfolio/tool.gif',).initialize(context) # Process all imported content types into nice lists content_types, constructors, ftis = process_types( listTypes(PROJECT_NAME), PROJECT_NAME) # Register our set of content types utils.ContentInit( PROJECT_NAME + ' Content', content_types = content_types, permission = MODIFY_CONTENT, extra_constructors = constructors, fti = ftis, ).initialize(context) class EportfolioCustomizationPolicy(DefaultCustomizationPolicy): """Customization policy for the Eportfolio 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('Eportfolio Setup') # Add and execute all configuration methods that it lists as being available widget.addItems(widget.available())