Back to index

plone3  3.1.7
Classes | Functions
CMFPlone.setuphandlers Namespace Reference

Classes

class  HiddenProducts
class  PloneGenerator

Functions

def importSite
def importArchetypes
def importVarious
def importFinalSteps
def importContent
def updateWorkflowRoleMappings
def replace_local_role_manager

Detailed Description

CMFPlone setup handlers.

Function Documentation

Install Archetypes and it's dependencies.

Definition at line 483 of file setuphandlers.py.

00483 
00484 def importArchetypes(context):
00485     """
00486     Install Archetypes and it's dependencies.
00487     """
00488     # Only run step if a flag file is present (e.g. not an extension profile)
00489     if context.readDataFile('plone_archetypes.txt') is None:
00490         return
00491     site = context.getSite()
00492     gen = PloneGenerator()
00493     gen.installArchetypes(site)

Final Plone content import step.

Definition at line 529 of file setuphandlers.py.

00529 
00530 def importContent(context):
00531     """
00532     Final Plone content import step.
00533     """
00534     # Only run step if a flag file is present (e.g. not an extension profile)
00535     if context.readDataFile('plone-content.txt') is None:
00536         return
00537     out = []
00538     site = context.getSite()
00539     gen = PloneGenerator()
00540     gen.setupPortalContent(site)

Final Plone import steps.

Definition at line 511 of file setuphandlers.py.

00511 
00512 def importFinalSteps(context):
00513     """
00514     Final Plone import steps.
00515     """
00516     # Only run step if a flag file is present (e.g. not an extension profile)
00517     if context.readDataFile('plone-final.txt') is None:
00518         return
00519     out = []
00520     site = context.getSite()
00521     pprop = getToolByName(site, 'portal_properties')
00522     pmembership = getToolByName(site, 'portal_membership')
00523     gen = PloneGenerator()
00524     gen.performMigrationActions(site)
00525     gen.enableSyndication(site, out)
00526     gen.assignTitles(site, out)
00527     pmembership.memberareaCreationFlag = False
00528     gen.installDependencies(site)

Here is the call graph for this function:

Import site settings.

Definition at line 474 of file setuphandlers.py.

00474 
00475 def importSite(context):
00476     """
00477     Import site settings.
00478     """
00479     site = context.getSite()
00480     gen = PloneGenerator()
00481     gen.enableSite(site)
00482     setSite(site)

Import various settings.

Provisional handler that does initialization that is not yet taken
care of by other handlers.

Definition at line 494 of file setuphandlers.py.

00494 
00495 def importVarious(context):
00496     """
00497     Import various settings.
00498 
00499     Provisional handler that does initialization that is not yet taken
00500     care of by other handlers.
00501     """
00502     # Only run step if a flag file is present (e.g. not an extension profile)
00503     if context.readDataFile('plone_various.txt') is None:
00504         return
00505     site = context.getSite()
00506     gen = PloneGenerator()
00507     gen.installProducts(site)
00508     gen.addCacheHandlers(site)
00509     gen.addCacheForResourceRegistry(site)
00510     replace_local_role_manager(site, [])

Here is the call graph for this function:

Installs the borg local role manager in place of the standard one from
PlonePAS

Definition at line 551 of file setuphandlers.py.

00551 
00552 def replace_local_role_manager(portal, out):
00553     """Installs the borg local role manager in place of the standard one from
00554     PlonePAS"""
00555     uf = getToolByName(portal, 'acl_users', None)
00556     # Make sure we have a PAS user folder
00557     if uf is not None and hasattr(aq_base(uf), 'plugins'):
00558         # Remove the original plugin if it's there
00559         if 'local_roles' in uf.objectIds():
00560             orig_lr = getattr(uf, 'local_roles')
00561             if isinstance(orig_lr, LocalRolesManager):
00562                 uf.plugins.removePluginById('local_roles')
00563                 out.append("Deactivated original 'local_roles' plugin")
00564         # Install the borg.localrole plugin if it's not already there
00565         out.append(setup_localrole_plugin(portal))

Here is the call graph for this function:

Here is the caller graph for this function:

If an extension profile (such as the testfixture one) switches default,
workflows, this import handler will make sure object security works
properly.

Definition at line 541 of file setuphandlers.py.

00541 
00542 def updateWorkflowRoleMappings(context):
00543     """
00544     If an extension profile (such as the testfixture one) switches default,
00545     workflows, this import handler will make sure object security works
00546     properly.
00547     """
00548     site = context.getSite()
00549     portal_workflow = getToolByName(site, 'portal_workflow')
00550     portal_workflow.updateRoleMappings()

Here is the call graph for this function: