source: WAeUP_SRP/trunk/__init__.py @ 921

Last change on this file since 921 was 918, checked in by joachim, 18 years ago

=manage_local_roles Patch

  • Property svn:keywords set to Id
File size: 2.8 KB
RevLine 
[199]1#-*- mode: python; mode: fold -*-
[204]2# $Id: __init__.py 918 2006-11-21 18:38:20Z joachim $
[206]3from Products.CMFCore.utils import ContentInit, ToolInit
[19]4from Products.CMFCore.DirectoryView import registerDirectory
5from Products.CMFCore import utils as cmfutils
[452]6from Products.CMFCore.permissions import AddPortalContent
[19]7
[199]8from Products.GenericSetup import profile_registry
9from Products.GenericSetup import EXTENSION
[19]10
[199]11from Products.CPSCore.interfaces import ICPSSite
12
[511]13import PatchCPSWorkflowWorkflowDefinition
14import PatchCatalogToolXMLAdapter
[537]15import PatchCPSSchemasAttributeStorageAdapter
[918]16import PatchCPSMembershipTool
[881]17import PatchCPSUserFolderUserFolder
[867]18import PatchBasicWidgetsCPSStringWidget
[265]19# Only for CPS 3.4.1. In 3.4.2 and later this should be fixed.
[263]20import PatchCPSDefaultImportExport
[274]21import Products.WAeUP_SRP.WAeUPPermissions
[828]22import WAeUPTool
[200]23
[59]24import Widgets
[828]25tools = (WAeUPTool.WAeUPTool,)
[19]26
[452]27waeup_types = (
[454]28    ("University",('University',)),
29    ("Academics",
30       ("AcademicsFolder",
31        "Certificate",
32        "CertificateCourse",
33        "Faculty",
34        "Department",
35        "Course",
36        "CertificateCourse",
[565]37        "StudyLevel",
[454]38        )
39     ),
40     ("Accommodation",
41        ("AccoFolder",
[622]42         "AccoHall",
[454]43         )
44     ),
45     ("Students",
46        ("StudentsFolder",
47         "Student",
[639]48         "StudentAccommodation",
[454]49         "StudentStudyCourse",
[464]50         "StudentCourseResult",
[472]51         "StudentApplication",
[758]52         "StudentPume",
[454]53         "StudentClearance",
54         "StudentPersonal",
[464]55         "StudentStudyLevel",
[760]56         #"Semester",
[467]57         "StudentCourseResult",
[464]58         # move to Academics later
[565]59         #"Semester",
[454]60         )
61      ),
[488]62     ("ScratchCards",
63         ("ScratchCardBatch",
64         "ScratchCardBatchesFolder",
65         ),
66     )
[200]67    )
68
[452]69contentClasses = []
70cc = []
[454]71for modu,names in waeup_types:
72    mod = __import__('Products.WAeUP_SRP.%(modu)s' % vars(),
[452]73                globals(),
74                locals(),
[454]75                ['*',]
[452]76                )
[454]77    for name in names:
78        #print name
79        contentClasses.append(getattr(mod,name))
80        cc.append(getattr(mod,"add%(name)s" % vars()))
81contentConstructors = tuple(cc)
[200]82
[440]83fti = [{} for t in range(len(contentConstructors))]
[200]84
[199]85registerDirectory('skins', globals())
[197]86
[199]87def initialize(registrar):
[828]88    ToolInit('WAeUP Tool',
89              tools=tools,
90              icon='tool.gif',
91              ).initialize(registrar)
[200]92    ContentInit('WAeUP Types',
93                content_types = contentClasses,
94                permission = AddPortalContent,
95                extra_constructors = contentConstructors,
96                fti = fti,
97                ).initialize(registrar)
98
[199]99    # Extension profile registration
100    profile_registry.registerProfile(
101        'default',
[274]102        'WAeUP_SRP',
[199]103        "The WestAfrican e-University Project",
104        'profiles/default',
[274]105        'WAeUP_SRP',
[199]106        EXTENSION,
107        for_=ICPSSite)
[84]108
Note: See TracBrowser for help on using the repository browser.