1 | #-*- mode: python; mode: fold -*- |
---|
2 | from Products.CMFCore.utils import ContentInit, ToolInit |
---|
3 | from Products.CMFCore.DirectoryView import registerDirectory |
---|
4 | from Products.CMFCore import utils as cmfutils |
---|
5 | from Products.CMFCore.CMFCorePermissions import AddPortalContent |
---|
6 | |
---|
7 | from Products.GenericSetup import profile_registry |
---|
8 | from Products.GenericSetup import EXTENSION |
---|
9 | |
---|
10 | from Products.CPSCore.interfaces import ICPSSite |
---|
11 | |
---|
12 | from Products.WAeUP.University import University, addUniversity |
---|
13 | from Products.WAeUP.Accommodation import AccoFolder, addAccoFolder |
---|
14 | from Products.WAeUP.Accommodation import Accommodation, addAccommodation |
---|
15 | from Products.WAeUP.Faculty import Faculty, addFaculty |
---|
16 | from Products.WAeUP.Faculty import Department, addDepartment |
---|
17 | from Products.WAeUP.Faculty import Course, addCourse |
---|
18 | from Products.WAeUP.Faculty import CourseTicket, addCourseTicket |
---|
19 | from Products.WAeUP.Students import Student, addStudent |
---|
20 | from Products.WAeUP.Students import StudentPersonal, addStudentPersonal |
---|
21 | from Products.WAeUP.Students import StudentEligibility, addStudentEligibility |
---|
22 | from Products.WAeUP.Students import StudentDocuments, addStudentDocuments |
---|
23 | from Products.WAeUP.Students import Jamb, addJamb |
---|
24 | from Products.WAeUP.Students import StudyLevel, addStudyLevel |
---|
25 | from Products.WAeUP.Students import Semester, addSemester |
---|
26 | |
---|
27 | |
---|
28 | |
---|
29 | import Widgets |
---|
30 | |
---|
31 | #registerDirectory('skins/waeup_default', globals()) |
---|
32 | |
---|
33 | contentClasses = ( |
---|
34 | University, |
---|
35 | Faculty, |
---|
36 | Department, |
---|
37 | Course, |
---|
38 | CourseTicket, |
---|
39 | AccoFolder, |
---|
40 | Accommodation, |
---|
41 | Student, |
---|
42 | StudentPersonal, |
---|
43 | StudentEligibility, |
---|
44 | StudentDocuments, |
---|
45 | Jamb, |
---|
46 | StudyLevel, |
---|
47 | Semester, |
---|
48 | ) |
---|
49 | |
---|
50 | contentConstructors = ( |
---|
51 | addUniversity, |
---|
52 | addFaculty, |
---|
53 | addDepartment, |
---|
54 | addCourse, |
---|
55 | addCourseTicket, |
---|
56 | addAccoFolder, |
---|
57 | addAccommodation, |
---|
58 | addStudent, |
---|
59 | addStudentPersonal, |
---|
60 | addStudentEligibility, |
---|
61 | addStudentDocuments, |
---|
62 | addJamb, |
---|
63 | addStudyLevel, |
---|
64 | addSemester, |
---|
65 | ) |
---|
66 | |
---|
67 | fti = ( |
---|
68 | {}, # University |
---|
69 | {}, # Faculty |
---|
70 | {}, # Department |
---|
71 | {}, # Course |
---|
72 | {}, # CourseTicket |
---|
73 | {}, # AccoFolder |
---|
74 | {}, # Accommodation |
---|
75 | {}, # Student, |
---|
76 | {}, # StudentPersonal, |
---|
77 | {}, # StudentEligibility, |
---|
78 | {}, # StudentDocuments, |
---|
79 | {}, # Jamb, |
---|
80 | {}, # StudyLevel, |
---|
81 | {}, # Semester, |
---|
82 | ) |
---|
83 | |
---|
84 | registerDirectory('skins', globals()) |
---|
85 | |
---|
86 | def initialize(registrar): |
---|
87 | ContentInit('WAeUP Types', |
---|
88 | content_types = contentClasses, |
---|
89 | permission = AddPortalContent, |
---|
90 | extra_constructors = contentConstructors, |
---|
91 | fti = fti, |
---|
92 | ).initialize(registrar) |
---|
93 | |
---|
94 | # Extension profile registration |
---|
95 | profile_registry.registerProfile( |
---|
96 | 'default', |
---|
97 | 'WAeUP', |
---|
98 | "The WestAfrican e-University Project", |
---|
99 | 'profiles/default', |
---|
100 | 'WAeUP', |
---|
101 | EXTENSION, |
---|
102 | for_=ICPSSite) |
---|
103 | |
---|
104 | |
---|
105 | ##import University ###( |
---|
106 | ##import Students |
---|
107 | ##import Accommodation |
---|
108 | ##import Faculty |
---|
109 | ##import Widgets |
---|
110 | ##import WAeUPPermissions |
---|
111 | ##import WAeUPTool |
---|
112 | ## |
---|
113 | ##tools = ( |
---|
114 | ## WAeUPTool.WAeUPTool, |
---|
115 | ##) |
---|
116 | ## |
---|
117 | ##fti = (Students.student_fti, |
---|
118 | ## Students.studentdocuments_fti, |
---|
119 | ## Students.studentpersonal_fti, |
---|
120 | ## Students.studenteligibility_fti, |
---|
121 | ## Students.jamb_fti, |
---|
122 | ## Students.study_level_fti, |
---|
123 | ## Students.semester_fti, |
---|
124 | ## Accommodation.accofolder_fti, |
---|
125 | ## Accommodation.accommodation_fti, |
---|
126 | ## Faculty.faculty_fti, |
---|
127 | ## Faculty.department_fti, |
---|
128 | ## Faculty.course_fti, |
---|
129 | ## Faculty.course_ticket_fti, |
---|
130 | ## ) |
---|
131 | ## |
---|
132 | ##contentClasses = (University.University, |
---|
133 | ## Students.StudentsFolder, |
---|
134 | ## Students.Student, |
---|
135 | ## Students.StudentDocuments, |
---|
136 | ## Students.StudentPersonal, |
---|
137 | ## Students.StudentEligibility, |
---|
138 | ## Students.Jamb, |
---|
139 | ## Students.StudyLevel, |
---|
140 | ## Students.Semester, |
---|
141 | ## Accommodation.AccoFolder, |
---|
142 | ## Accommodation.Accommodation, |
---|
143 | ## Faculty.Faculty, |
---|
144 | ## Faculty.Department, |
---|
145 | ## Faculty.Course, |
---|
146 | ## Faculty.CourseTicket, |
---|
147 | ## ) |
---|
148 | ## |
---|
149 | ##contentConstructors = (University.addUniversity, |
---|
150 | ## Students.addStudentsFolder, |
---|
151 | ## Students.addStudent, |
---|
152 | ## Students.addStudentDocuments, |
---|
153 | ## Students.addStudentPersonal, |
---|
154 | ## Students.addStudentEligibility, |
---|
155 | ## Students.addJamb, |
---|
156 | ## Students.addStudyLevel, |
---|
157 | ## Students.addSemester, |
---|
158 | ## Accommodation.addAccommodation, |
---|
159 | ## Accommodation.addAccoFolder, |
---|
160 | ## Faculty.addFaculty, |
---|
161 | ## Faculty.addDepartment, |
---|
162 | ## Faculty.addCourse, |
---|
163 | ## Faculty.addCourseTicket, |
---|
164 | ## ) |
---|
165 | ## |
---|
166 | ##def initialize(context): |
---|
167 | ## ToolInit( |
---|
168 | ## 'WAeUP Tool', |
---|
169 | ## tools = tools, |
---|
170 | ## icon = 'tool.png', |
---|
171 | ## ).initialize(context) |
---|
172 | ## |
---|
173 | ## ContentInit( |
---|
174 | ## 'WAeUP Contenttypes', |
---|
175 | ## content_types=contentClasses, |
---|
176 | ## permission=AddPortalContent, |
---|
177 | ## extra_constructors=contentConstructors, |
---|
178 | ## fti=fti, |
---|
179 | ## |
---|
180 | ## ).initialize(context) |
---|
181 | ## |
---|
182 | ## context.registerClass(WAeUPTool.WAeUPTool, |
---|
183 | ## constructors=(WAeUPTool.addWAeUPToolForm, |
---|
184 | ## WAeUPTool.addWAeUPTool,)) |
---|
185 | |
---|
186 | ###) |
---|
187 | |
---|