File: CustomizationPolicy.py

package info (click to toggle)
zope-cmfplone 2.0.4-3sarge1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 4,992 kB
  • ctags: 2,558
  • sloc: python: 12,755; makefile: 102; sh: 67
file content (24 lines) | stat: -rw-r--r-- 854 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#These CustomizationPolicies *are not* persisted!!
from Products.CMFPlone.Portal import addPolicy, PloneGenerator
from Products.CMFPlone.interfaces.CustomizationPolicy import ICustomizationPolicy

class DefaultCustomizationPolicy:
    """ Customizes various actions on CMF tools """
    __implements__ = ICustomizationPolicy

    availableAtConstruction=1

    def customize(self, portal):
        # run all the methods in the misc class
        # this will change to use a config file hopefully
        mi_tool = portal.portal_migration
        gs = mi_tool._getWidget('General Setup')
        gs.addItems(gs.available())

    def getPloneGenerator(self):
        ''' returns a PloneGenerator, can be overloaded '''
        return PloneGenerator()
        

def register(context, app_state):
    addPolicy('Default Plone', DefaultCustomizationPolicy())