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