Back to index

plone3  3.1.7
Functions | Variables
wicked.atcontent.zope2 Namespace Reference

Functions

def initialize

Variables

string PROJECTNAME = 'wicked.atcontent'

Function Documentation

load up content types

Definition at line 9 of file zope2.py.

00009 
00010 def initialize(context):
00011     """load up content types"""
00012     from Products.CMFCore import utils as cmf_utils
00013     #app = context._ProductContext__app
00014     #patch_listDefaultTypeInformation(app)
00015     
00016     from ironicwiki import IronicWiki
00017     try:
00018         from wickeddoc import WickedDoc
00019     except ImportError: # no ATCT
00020         pass
00021 
00022     types = atapi.listTypes(PROJECTNAME)
00023     content_types, constructors, ftis = atapi.process_types( types,
00024                                                              PROJECTNAME)
00025     permissions = {}
00026     types = atapi.listTypes(PROJECTNAME)
00027 
00028     for atype in  types:
00029         permission = "%s: Add %s" % (PROJECTNAME, atype['portal_type'])
00030         permissions[atype['portal_type']] = permission
00031 
00032         # Assign default roles
00033         setDefaultRoles(permission, ('Manager', 'Owner'))
00034     
00035     allTypes = zip(content_types, constructors)
00036     for atype, constructor in allTypes:
00037         kind = "%s: %s" % (PROJECTNAME, atype.archetype_name)
00038         cmf_utils.ContentInit(
00039             kind,
00040             content_types      = (atype,),
00041             permission         = permissions[atype.portal_type],
00042             extra_constructors = (constructor,),
00043             fti                = ftis,
00044             ).initialize(context)

Here is the call graph for this function:


Variable Documentation

string wicked.atcontent.zope2.PROJECTNAME = 'wicked.atcontent'

Definition at line 5 of file zope2.py.