source: WAeUP_SRP/trunk/__init__.py @ 1280

Last change on this file since 1280 was 1226, checked in by joachim, 18 years ago

modifications

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