[199] | 1 | #-*- mode: python; mode: fold -*- |
---|
[204] | 2 | # $Id: __init__.py 445 2006-08-29 16:50:07Z joachim $ |
---|
[206] | 3 | from Products.CMFCore.utils import ContentInit, ToolInit |
---|
[19] | 4 | from Products.CMFCore.DirectoryView import registerDirectory |
---|
| 5 | from Products.CMFCore import utils as cmfutils |
---|
| 6 | from Products.CMFCore.CMFCorePermissions import AddPortalContent |
---|
| 7 | |
---|
[199] | 8 | from Products.GenericSetup import profile_registry |
---|
| 9 | from Products.GenericSetup import EXTENSION |
---|
[19] | 10 | |
---|
[199] | 11 | from Products.CPSCore.interfaces import ICPSSite |
---|
| 12 | |
---|
[265] | 13 | # Only for CPS 3.4.1. In 3.4.2 and later this should be fixed. |
---|
[263] | 14 | import PatchCPSDefaultImportExport |
---|
[445] | 15 | import PatchCatalogToolXMLAdapter |
---|
[263] | 16 | |
---|
[274] | 17 | import Products.WAeUP_SRP.WAeUPPermissions |
---|
[278] | 18 | from Products.WAeUP_SRP.Academics import AcademicsFolder, addAcademicsFolder |
---|
[274] | 19 | from Products.WAeUP_SRP.University import University, addUniversity |
---|
| 20 | from Products.WAeUP_SRP.Accommodation import AccoFolder, addAccoFolder |
---|
| 21 | from Products.WAeUP_SRP.Accommodation import Accommodation, addAccommodation |
---|
| 22 | from Products.WAeUP_SRP.Academics import Certificate, addCertificate |
---|
| 23 | from Products.WAeUP_SRP.Academics import CertificateCourse, addCertificateCourse |
---|
| 24 | from Products.WAeUP_SRP.Academics import Faculty, addFaculty |
---|
| 25 | from Products.WAeUP_SRP.Academics import Department, addDepartment |
---|
| 26 | from Products.WAeUP_SRP.Academics import Course, addCourse |
---|
| 27 | from Products.WAeUP_SRP.Academics import CourseTicket, addCourseTicket |
---|
| 28 | from Products.WAeUP_SRP.Academics import CertificateCourse, addCertificateCourse |
---|
[361] | 29 | from Products.WAeUP_SRP.Students import StudentsFolder, addStudentsFolder |
---|
[274] | 30 | from Products.WAeUP_SRP.Students import Student, addStudent |
---|
[362] | 31 | from Products.WAeUP_SRP.Students import StudentStudyCourse, addStudentStudyCourse |
---|
[423] | 32 | from Products.WAeUP_SRP.Students import StudentAdmission, addStudentAdmission |
---|
| 33 | from Products.WAeUP_SRP.Students import StudentClearance, addStudentClearance |
---|
[274] | 34 | from Products.WAeUP_SRP.Students import StudentPersonal, addStudentPersonal |
---|
[440] | 35 | from Products.WAeUP_SRP.Students import ScratchCardBatch, addScratchCardBatch |
---|
| 36 | from Products.WAeUP_SRP.Students import ScratchCardBatchesFolder, addScratchCardBatchesFolder |
---|
[274] | 37 | from Products.WAeUP_SRP.Students import StudyLevel, addStudyLevel |
---|
| 38 | from Products.WAeUP_SRP.Students import Semester, addSemester |
---|
[200] | 39 | |
---|
| 40 | |
---|
[59] | 41 | import Widgets |
---|
[19] | 42 | |
---|
[200] | 43 | contentClasses = ( |
---|
| 44 | University, |
---|
[278] | 45 | AcademicsFolder, |
---|
[256] | 46 | Certificate, |
---|
| 47 | CertificateCourse, |
---|
[200] | 48 | Faculty, |
---|
| 49 | Department, |
---|
| 50 | Course, |
---|
| 51 | CourseTicket, |
---|
[256] | 52 | CertificateCourse, |
---|
[200] | 53 | AccoFolder, |
---|
| 54 | Accommodation, |
---|
[361] | 55 | StudentsFolder, |
---|
[200] | 56 | Student, |
---|
[362] | 57 | StudentStudyCourse, |
---|
[423] | 58 | StudentAdmission, |
---|
| 59 | StudentClearance, |
---|
[200] | 60 | StudentPersonal, |
---|
[440] | 61 | ScratchCardBatch, |
---|
| 62 | ScratchCardBatchesFolder, |
---|
[200] | 63 | StudyLevel, |
---|
| 64 | Semester, |
---|
| 65 | ) |
---|
| 66 | |
---|
| 67 | contentConstructors = ( |
---|
| 68 | addUniversity, |
---|
[278] | 69 | addAcademicsFolder, |
---|
[256] | 70 | addCertificate, |
---|
| 71 | addCertificateCourse, |
---|
[200] | 72 | addFaculty, |
---|
| 73 | addDepartment, |
---|
| 74 | addCourse, |
---|
| 75 | addCourseTicket, |
---|
[256] | 76 | addCertificateCourse, |
---|
[200] | 77 | addAccoFolder, |
---|
| 78 | addAccommodation, |
---|
[361] | 79 | addStudentsFolder, |
---|
[200] | 80 | addStudent, |
---|
[362] | 81 | addStudentStudyCourse, |
---|
[423] | 82 | addStudentAdmission, |
---|
| 83 | addStudentClearance, |
---|
[200] | 84 | addStudentPersonal, |
---|
[440] | 85 | addScratchCardBatch, |
---|
| 86 | addScratchCardBatchesFolder, |
---|
[200] | 87 | addStudyLevel, |
---|
| 88 | addSemester, |
---|
| 89 | ) |
---|
| 90 | |
---|
[440] | 91 | fti = [{} for t in range(len(contentConstructors))] |
---|
| 92 | ##fti = ( |
---|
| 93 | ## {}, # University |
---|
| 94 | ## {}, #AcademicsFolder |
---|
| 95 | ## {}, #Certificate |
---|
| 96 | ## {}, #CertificateCourse |
---|
| 97 | ## {}, # Faculty |
---|
| 98 | ## {}, # Department |
---|
| 99 | ## {}, # Course |
---|
| 100 | ## {}, # CourseTicket |
---|
| 101 | ## {}, # CertificateCourse |
---|
| 102 | ## {}, # AccoFolder |
---|
| 103 | ## {}, # Accommodation |
---|
| 104 | ## {}, # StudentsFolder, |
---|
| 105 | ## {}, # Student, |
---|
| 106 | ## {}, # StudentStudyCourse, |
---|
| 107 | ## {}, # StudentAdmission, |
---|
| 108 | ## {}, # StudentClearance, |
---|
| 109 | ## {}, # StudentAdmission, |
---|
| 110 | ## {}, # StudentClearance, |
---|
| 111 | ## {}, # StudentPersonal, |
---|
| 112 | ## {}, # ScratchCardBatch, |
---|
| 113 | ## {}, # ScratchCardBatchesFolder, |
---|
| 114 | ## {}, # StudyLevel, |
---|
| 115 | ## {}, # Semester, |
---|
| 116 | ## ) |
---|
[200] | 117 | |
---|
[199] | 118 | registerDirectory('skins', globals()) |
---|
[197] | 119 | |
---|
[199] | 120 | def initialize(registrar): |
---|
[200] | 121 | ContentInit('WAeUP Types', |
---|
| 122 | content_types = contentClasses, |
---|
| 123 | permission = AddPortalContent, |
---|
| 124 | extra_constructors = contentConstructors, |
---|
| 125 | fti = fti, |
---|
| 126 | ).initialize(registrar) |
---|
| 127 | |
---|
[199] | 128 | # Extension profile registration |
---|
| 129 | profile_registry.registerProfile( |
---|
| 130 | 'default', |
---|
[274] | 131 | 'WAeUP_SRP', |
---|
[199] | 132 | "The WestAfrican e-University Project", |
---|
| 133 | 'profiles/default', |
---|
[274] | 134 | 'WAeUP_SRP', |
---|
[199] | 135 | EXTENSION, |
---|
| 136 | for_=ICPSSite) |
---|
[84] | 137 | |
---|