# -*- coding: utf-8 # Copyright 2005 by Vahur Rebas """ School Portal customization policy for Plone Sites """ __author__ = 'Vahur Rebas' __doc__ = 'Site custimizing policy' from Products.CMFPlone.Portal import addPolicy from Products.CMFPlone.interfaces.CustomizationPolicy import ICustomizationPolicy from Products.CMFPlone.CustomizationPolicy import DefaultCustomizationPolicy from Products.CMFCore.utils import getToolByName from StringIO import StringIO class SchoolSitePolicy(DefaultCustomizationPolicy): """ Customizes a fresh Plone site to out needs """ __implements__ = ICustomizationPolicy availableAtConstruction = 1 def customize(self, portal): #customization code goes here out = StringIO() try: DefaultCustomizationPolicy.customize(self, portal) except KeyError: pass #portal.manage_changeProperties(title="Welcome to School Plone") mi_tool = getToolByName(portal, 'portal_migration') gs = mi_tool._getWidget('School Portal Setup') gs.addItems(gs.available()) return out.getvalue() def register(context, app_state): addPolicy('School Plone', SchoolSitePolicy())