source: WAeUP_SRP/trunk/__init__.py @ 1963

Last change on this file since 1963 was 1934, checked in by joachim, 18 years ago

fix for #283

  • Property svn:keywords set to Id
File size: 3.2 KB
RevLine 
[199]1#-*- mode: python; mode: fold -*-
[204]2# $Id: __init__.py 1934 2007-06-19 06:20: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
[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",
78         "ScratchCardBatchesFolder",
79         ),
80     )
[200]81    )
82
[452]83contentClasses = []
84cc = []
[454]85for modu,names in waeup_types:
86    mod = __import__('Products.WAeUP_SRP.%(modu)s' % vars(),
[452]87                globals(),
88                locals(),
[454]89                ['*',]
[452]90                )
[454]91    for name in names:
92        #print name
93        contentClasses.append(getattr(mod,name))
94        cc.append(getattr(mod,"add%(name)s" % vars()))
95contentConstructors = tuple(cc)
[200]96
[440]97fti = [{} for t in range(len(contentConstructors))]
[200]98
[199]99registerDirectory('skins', globals())
[197]100
[199]101def initialize(registrar):
[828]102    ToolInit('WAeUP Tool',
103              tools=tools,
104              icon='tool.gif',
105              ).initialize(registrar)
[200]106    ContentInit('WAeUP Types',
107                content_types = contentClasses,
108                permission = AddPortalContent,
109                extra_constructors = contentConstructors,
110                fti = fti,
111                ).initialize(registrar)
112
[199]113    # Extension profile registration
114    profile_registry.registerProfile(
115        'default',
[274]116        'WAeUP_SRP',
[199]117        "The WestAfrican e-University Project",
118        'profiles/default',
[274]119        'WAeUP_SRP',
[199]120        EXTENSION,
121        for_=ICPSSite)
[84]122
Note: See TracBrowser for help on using the repository browser.