source: WAeUP_SRP/trunk/__init__.py @ 2034

Last change on this file since 2034 was 2013, checked in by Henrik Bettermann, 17 years ago

see ticket #102

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