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
Line 
1#-*- mode: python; mode: fold -*-
2# $Id: __init__.py 1812 2007-05-23 17:26:48Z joachim $
3from Products.CMFCore.utils import ContentInit, ToolInit
4from Products.CMFCore.DirectoryView import registerDirectory
5from Products.CMFCore import utils as cmfutils
6from Products.CMFCore.permissions import AddPortalContent
7
8from Products.GenericSetup import profile_registry
9from Products.GenericSetup import EXTENSION
10
11from Products.CPSCore.interfaces import ICPSSite
12
13import PatchCPSWorkflowWorkflowDefinition
14import PatchCatalogToolXMLAdapter
15import PatchCPSSchemasAttributeStorageAdapter
16import PatchCPSSchemasDataModel
17import PatchCPSSchemasVocabulariesTool
18import PatchCPSMembershipTool
19import PatchCPSUserFolderUserFolder
20import PatchCPSStackingDirectoryStorageAdapter
21import PatchBasicWidgetsCPSStringWidget
22import PatchExtendedWidgetsCPSDateTimeWidget
23import PatchBasicWidgetsUnprepare
24import PatchFasterSessionData
25# Only for CPS 3.4.1. In 3.4.2 and later this should be fixed.
26import PatchCPSDefaultImportExport
27import PatchRenderActionIcon
28import Products.WAeUP_SRP.WAeUPPermissions
29import WAeUPTool
30
31import Widgets
32tools = (WAeUPTool.WAeUPTool,)
33
34waeup_types = (
35    ("University",('University',)),
36    ("Academics",
37       ("AcademicsFolder",
38        "Certificate",
39        "CertificateCourse",
40        "Faculty",
41        "Department",
42        "Course",
43        "CertificateCourse",
44        "StudyLevel",
45        )
46     ),
47     ("Accommodation",
48        ("AccoFolder",
49         "AccoHall",
50         )
51     ),
52     ("Payment",
53        ("PaymentsFolder",
54         "Payment",
55         )
56     ),
57     ("Students",
58        ("StudentsFolder",
59         "Student",
60         "StudentAccommodation",
61         "StudentStudyCourse",
62         "StudentCourseResult",
63         "StudentApplication",
64         "StudentPume",
65         "StudentClearance",
66         "StudentPersonal",
67         "StudentStudyLevel",
68         #"Semester",
69         "StudentCourseResult",
70         # move to Academics later
71         #"Semester",
72         )
73      ),
74     ("ScratchCards",
75         ("ScratchCardBatch",
76         "ScratchCardBatchesFolder",
77         ),
78     )
79    )
80
81contentClasses = []
82cc = []
83for modu,names in waeup_types:
84    mod = __import__('Products.WAeUP_SRP.%(modu)s' % vars(),
85                globals(),
86                locals(),
87                ['*',]
88                )
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)
94
95fti = [{} for t in range(len(contentConstructors))]
96
97registerDirectory('skins', globals())
98
99def initialize(registrar):
100    ToolInit('WAeUP Tool',
101              tools=tools,
102              icon='tool.gif',
103              ).initialize(registrar)
104    ContentInit('WAeUP Types',
105                content_types = contentClasses,
106                permission = AddPortalContent,
107                extra_constructors = contentConstructors,
108                fti = fti,
109                ).initialize(registrar)
110
111    # Extension profile registration
112    profile_registry.registerProfile(
113        'default',
114        'WAeUP_SRP',
115        "The WestAfrican e-University Project",
116        'profiles/default',
117        'WAeUP_SRP',
118        EXTENSION,
119        for_=ICPSSite)
120
Note: See TracBrowser for help on using the repository browser.