| 1 | #-*- mode: python; mode: fold -*- |
|---|
| 2 | # $Id: __init__.py 362 2006-08-05 18:24:53Z 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.CMFCorePermissions 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 | # Only for CPS 3.4.1. In 3.4.2 and later this should be fixed. |
|---|
| 14 | import PatchCPSDefaultImportExport |
|---|
| 15 | |
|---|
| 16 | import Products.WAeUP_SRP.WAeUPPermissions |
|---|
| 17 | from Products.WAeUP_SRP.Academics import AcademicsFolder, addAcademicsFolder |
|---|
| 18 | from Products.WAeUP_SRP.University import University, addUniversity |
|---|
| 19 | from Products.WAeUP_SRP.Accommodation import AccoFolder, addAccoFolder |
|---|
| 20 | from Products.WAeUP_SRP.Accommodation import Accommodation, addAccommodation |
|---|
| 21 | from Products.WAeUP_SRP.Academics import Certificate, addCertificate |
|---|
| 22 | from Products.WAeUP_SRP.Academics import CertificateCourse, addCertificateCourse |
|---|
| 23 | from Products.WAeUP_SRP.Academics import Faculty, addFaculty |
|---|
| 24 | from Products.WAeUP_SRP.Academics import Department, addDepartment |
|---|
| 25 | from Products.WAeUP_SRP.Academics import Course, addCourse |
|---|
| 26 | from Products.WAeUP_SRP.Academics import CourseTicket, addCourseTicket |
|---|
| 27 | from Products.WAeUP_SRP.Academics import CertificateCourse, addCertificateCourse |
|---|
| 28 | from Products.WAeUP_SRP.Students import StudentsFolder, addStudentsFolder |
|---|
| 29 | from Products.WAeUP_SRP.Students import Student, addStudent |
|---|
| 30 | from Products.WAeUP_SRP.Students import StudentStudyCourse, addStudentStudyCourse |
|---|
| 31 | from Products.WAeUP_SRP.Students import StudentPersonal, addStudentPersonal |
|---|
| 32 | from Products.WAeUP_SRP.Students import StudentEligibility, addStudentEligibility |
|---|
| 33 | from Products.WAeUP_SRP.Students import StudentDocuments, addStudentDocuments |
|---|
| 34 | from Products.WAeUP_SRP.Students import Jamb, addJamb |
|---|
| 35 | from Products.WAeUP_SRP.Students import StudyLevel, addStudyLevel |
|---|
| 36 | from Products.WAeUP_SRP.Students import Semester, addSemester |
|---|
| 37 | |
|---|
| 38 | |
|---|
| 39 | import Widgets |
|---|
| 40 | |
|---|
| 41 | contentClasses = ( |
|---|
| 42 | University, |
|---|
| 43 | AcademicsFolder, |
|---|
| 44 | Certificate, |
|---|
| 45 | CertificateCourse, |
|---|
| 46 | Faculty, |
|---|
| 47 | Department, |
|---|
| 48 | Course, |
|---|
| 49 | CourseTicket, |
|---|
| 50 | CertificateCourse, |
|---|
| 51 | AccoFolder, |
|---|
| 52 | Accommodation, |
|---|
| 53 | StudentsFolder, |
|---|
| 54 | Student, |
|---|
| 55 | StudentStudyCourse, |
|---|
| 56 | StudentPersonal, |
|---|
| 57 | StudentEligibility, |
|---|
| 58 | StudentDocuments, |
|---|
| 59 | Jamb, |
|---|
| 60 | StudyLevel, |
|---|
| 61 | Semester, |
|---|
| 62 | ) |
|---|
| 63 | |
|---|
| 64 | contentConstructors = ( |
|---|
| 65 | addUniversity, |
|---|
| 66 | addAcademicsFolder, |
|---|
| 67 | addCertificate, |
|---|
| 68 | addCertificateCourse, |
|---|
| 69 | addFaculty, |
|---|
| 70 | addDepartment, |
|---|
| 71 | addCourse, |
|---|
| 72 | addCourseTicket, |
|---|
| 73 | addCertificateCourse, |
|---|
| 74 | addAccoFolder, |
|---|
| 75 | addAccommodation, |
|---|
| 76 | addStudentsFolder, |
|---|
| 77 | addStudent, |
|---|
| 78 | addStudentStudyCourse, |
|---|
| 79 | addStudentPersonal, |
|---|
| 80 | addStudentEligibility, |
|---|
| 81 | addStudentDocuments, |
|---|
| 82 | addJamb, |
|---|
| 83 | addStudyLevel, |
|---|
| 84 | addSemester, |
|---|
| 85 | ) |
|---|
| 86 | |
|---|
| 87 | fti = ( |
|---|
| 88 | {}, # University |
|---|
| 89 | {}, #AcademicsFolder |
|---|
| 90 | {}, #Certificate |
|---|
| 91 | {}, #CertificateCourse |
|---|
| 92 | {}, # Faculty |
|---|
| 93 | {}, # Department |
|---|
| 94 | {}, # Course |
|---|
| 95 | {}, # CourseTicket |
|---|
| 96 | {}, # CertificateCourse |
|---|
| 97 | {}, # AccoFolder |
|---|
| 98 | {}, # Accommodation |
|---|
| 99 | {}, # StudentsFolder, |
|---|
| 100 | {}, # Student, |
|---|
| 101 | {}, # StudentStudyCourse, |
|---|
| 102 | {}, # StudentPersonal, |
|---|
| 103 | {}, # StudentEligibility, |
|---|
| 104 | {}, # StudentDocuments, |
|---|
| 105 | {}, # Jamb, |
|---|
| 106 | {}, # StudyLevel, |
|---|
| 107 | {}, # Semester, |
|---|
| 108 | ) |
|---|
| 109 | |
|---|
| 110 | registerDirectory('skins', globals()) |
|---|
| 111 | |
|---|
| 112 | def initialize(registrar): |
|---|
| 113 | ContentInit('WAeUP Types', |
|---|
| 114 | content_types = contentClasses, |
|---|
| 115 | permission = AddPortalContent, |
|---|
| 116 | extra_constructors = contentConstructors, |
|---|
| 117 | fti = fti, |
|---|
| 118 | ).initialize(registrar) |
|---|
| 119 | |
|---|
| 120 | # Extension profile registration |
|---|
| 121 | profile_registry.registerProfile( |
|---|
| 122 | 'default', |
|---|
| 123 | 'WAeUP_SRP', |
|---|
| 124 | "The WestAfrican e-University Project", |
|---|
| 125 | 'profiles/default', |
|---|
| 126 | 'WAeUP_SRP', |
|---|
| 127 | EXTENSION, |
|---|
| 128 | for_=ICPSSite) |
|---|
| 129 | |
|---|