Back to index

plone3  3.1.7
Functions | Variables
CMFPlone.PloneInitialize Namespace Reference

Functions

def create

Variables

list factory = app.manage_addProduct['CMFPlone']
 if user: getattr(app, eid).changeOwnership(user)
tuple plone = getattr(app, pid)
 if user: getattr(app, pid).changeOwnership(user, recursive=1)
 qit = plone.portal_quickinstaller
 if user: getattr(plone, sid).changeOwnership(user)
list products_to_install = ["kupu",]
list ids = [ x['id'] for x in qit.listInstallableProducts(skipInstalled=1) ]

Function Documentation

def CMFPlone.PloneInitialize.create (   app,
  admin_username = 'admin' 
)

Definition at line 9 of file PloneInitialize.py.

00009 
00010 def create(app, admin_username='admin'):
00011     out = []
00012     oids = app.objectIds()
00013 
00014     # these are the two set elements...
00015     # (accessRule.py external method and SiteRoot)
00016     eid = 'accessRule.py'
00017     pid = 'Plone'
00018     emod = 'CMFPlone.accessRule'
00019     efn = 'accessRule'
00020     sid = 'SiteRoot'
00021 
00022     if pid in oids:
00023         out.append("A Plone site already exists")
00024         return out
00025 
00026     # 1 .get the admin user (dont bother making it, it's done before you
00027     #                        get a chance)
00028 
00029     acl_users = app.acl_users
00030 #    info = User.readUserAccessFile('inituser')
00031 #    if info:
00032 #        acl_users._doAddUser(info[0], info[1], ('manage',), [])
00033 
00034     user = acl_users.getUser(admin_username)
00035     if user:
00036         user = user.__of__(acl_users)
00037         newSecurityManager(None, user)
00038         out.append("Retrieved the admin user")
00039     else:
00040         out.append("Retrieving admin user failed")
00041 
00042     # 2. create the access rule external method
00043     if eid not in oids:
00044         # this is the actual access rule
00045         manage_addExternalMethod(app,
00046                                  eid,
00047                                  'Plone Access Rule',
00048                                  emod,
00049                                  efn)
00050         out.append("Added external method")
00051         # this sets the access rule
00052         manage_addAccessRule(app, eid)
        out.append("Set an access rule")

Variable Documentation

list CMFPlone.PloneInitialize.factory = app.manage_addProduct['CMFPlone']

if user: getattr(app, eid).changeOwnership(user)

Definition at line 58 of file PloneInitialize.py.

list CMFPlone.PloneInitialize.ids = [ x['id'] for x in qit.listInstallableProducts(skipInstalled=1) ]

Definition at line 76 of file PloneInitialize.py.

tuple CMFPlone.PloneInitialize.plone = getattr(app, pid)

if user: getattr(app, pid).changeOwnership(user, recursive=1)

Definition at line 65 of file PloneInitialize.py.

Definition at line 75 of file PloneInitialize.py.

CMFPlone.PloneInitialize.qit = plone.portal_quickinstaller

if user: getattr(plone, sid).changeOwnership(user)

Definition at line 73 of file PloneInitialize.py.