source: WAeUP_SRP/trunk/__init__.py @ 1669

Last change on this file since 1669 was 1350, checked in by joachim, 18 years ago

added Patch for VocalbulariesTool?, which fixed the loading of to many objects.

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