source: WAeUP_SRP/trunk/__init__.py @ 909

Last change on this file since 909 was 898, checked in by joachim, 18 years ago

removed PatchUserfolderWithGroups?

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