source: WAeUP_SRP/trunk/__init__.py @ 1075

Last change on this file since 1075 was 1065, checked in by joachim, 18 years ago

improved search, modify studycourse, patchfor attribute error

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