Changeset 947 for trunk/__init__.py


Ignore:
Timestamp:
10/27/06 18:29:10 (13 years ago)
Author:
tarmo
Message:

Added separate SetupWidget?, Customization Policy
and Extension Profile for Toolbox. Closes #881, spent 1h.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/__init__.py

    r720 r947  
    5353 
    5454# Our own configuration stuff 
    55 from ConfigurationMethods import LeMillSetup 
     55from ConfigurationMethods import LeMillSetup, ToolboxSetup 
    5656import LeMillWorkflow 
    5757 
     
    6767    # Add our setup widgets into MigrationTool 
    6868    MigrationTool.registerSetupWidget(LeMillSetup) 
     69    MigrationTool.registerSetupWidget(ToolboxSetup) 
    6970 
    7071    # making config accessible from python scripts. 
     
    7879        try: 
    7980            profile_registry.registerProfile(name='LeMill', 
    80                                              title='LeMill Legacy Site', 
     81                                             title='LeMill Site', 
    8182                                             description="LeMill is a heavily customized Plone for special use, and can't be converted to a normal Plone very easily.", 
    8283                                             path='profiles/legacy', 
     
    8788            # Already done - ignore 
    8889            pass 
     90        try: 
     91            profile_registry.registerProfile(name='Toolbox', 
     92                                             title='Calibrate Toolbox Site', 
     93                                             description="Toolbox is a variation of LeMill", 
     94                                             path='profiles/toolbox', 
     95                                             product='LeMill', 
     96                                             profile_type=EXTENSION, 
     97                                             for_=IPloneSiteRoot) 
     98        except KeyError: 
     99            # Already done - ignore 
     100            pass 
    89101                                          
    90102    addPolicy('LeMill Site',LeMillCustomizationPolicy()) 
     103    addPolicy('Toolbox Site',ToolboxCustomizationPolicy()) 
    91104 
    92105    # Register our set of portal tools 
     
    128141        # Add and execute all configuration methods that it lists as being available 
    129142        widget.addItems(widget.available()) 
     143 
     144class ToolboxCustomizationPolicy(DefaultCustomizationPolicy): 
     145    """Customization policy for the Toolbox site.""" 
     146    __implements__ = ICustomizationPolicy 
     147 
     148    # Yes, this can be used when creating a new Plone instance 
     149    availableAtConstruction=True 
     150 
     151    def customize(self,portal): 
     152        """This method is called when a Plone portal is created with this 
     153        customization policy.""" 
     154         
     155        # Call super class, just in case they do something intelligent 
     156        DefaultCustomizationPolicy.customize(self,portal) 
     157         
     158        # Locate our migration widget 
     159        widget = portal.portal_migration._getWidget('Toolbox Setup') 
     160         
     161        # Add and execute all configuration methods that it lists as being available 
     162        widget.addItems(widget.available()) 
Note: See TracChangeset for help on using the changeset viewer.