source: WAeUP_SRP/trunk/__init__.py @ 1816

Last change on this file since 1816 was 1812, checked in by joachim, 18 years ago

Patch to use AppendOnlyDict? in sessiondata

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