Back to index

plone3  3.1.7
Functions | Variables
CMFDefault.factory Namespace Reference

Functions

def addConfiguredSiteForm
def addConfiguredSite

Variables

string _TOOL_ID = 'portal_setup'

Function Documentation

def CMFDefault.factory.addConfiguredSite (   dispatcher,
  site_id,
  profile_id,
  snapshot = True,
  RESPONSE = None,
  extension_ids = () 
)
Add a CMFSite to 'dispatcher', configured according to 'profile_id'.

Definition at line 51 of file factory.py.

00051 
00052                       RESPONSE=None, extension_ids=()):
00053     """ Add a CMFSite to 'dispatcher', configured according to 'profile_id'.
00054     """
00055     site = CMFSite( site_id )
00056     dispatcher._setObject( site_id, site )
00057     site = dispatcher._getOb( site_id )
00058     setSite(site)
00059 
00060     site._setObject(_TOOL_ID, SetupTool(_TOOL_ID))
00061     setup_tool = getToolByName(site, _TOOL_ID)
00062 
00063     setup_tool.setBaselineContext('profile-%s' % profile_id)
00064     setup_tool.runAllImportStepsFromProfile('profile-%s' % profile_id)
00065     for extension_id in extension_ids:
00066         setup_tool.runAllImportStepsFromProfile('profile-%s' % extension_id)
00067 
00068     if snapshot is True:
00069         setup_tool.createSnapshot( 'initial_configuration' )
00070 
00071     if RESPONSE is not None:
00072         RESPONSE.redirect( '%s/%s/manage_main?update_menu=1'
00073                          % (dispatcher.absolute_url(), site_id) )

Here is the call graph for this function:

Here is the caller graph for this function:

Wrap the PTF in 'dispatcher', including 'profile_registry' in options.

Definition at line 33 of file factory.py.

00033 
00034 def addConfiguredSiteForm(dispatcher):
00035     """ Wrap the PTF in 'dispatcher', including 'profile_registry' in options.
00036     """
00037     wrapped = PageTemplateFile( 'siteAddForm', _wwwdir ).__of__( dispatcher )
00038 
00039     base_profiles = []
00040     extension_profiles = []
00041 
00042     for info in profile_registry.listProfileInfo(for_=ISiteRoot):
00043         if info.get('type') == EXTENSION:
00044             extension_profiles.append(info)
00045         else:
00046             base_profiles.append(info)
00047 
00048     return wrapped( base_profiles=tuple(base_profiles),
00049                     extension_profiles =tuple(extension_profiles) )

Here is the call graph for this function:


Variable Documentation

string CMFDefault.factory._TOOL_ID = 'portal_setup'

Definition at line 30 of file factory.py.