source: WAeUP_SRP/trunk/__init__.py @ 878

Last change on this file since 878 was 867, checked in by joachim, 18 years ago

patch for default field width in stringWidgets
isClearanceOfficer added

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