[199] | 1 | #-*- mode: python; mode: fold -*- |
---|
[204] | 2 | # $Id: __init__.py 452 2006-08-30 12:31:46Z 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 |
---|
[452] | 6 | from Products.CMFCore.permissions import AddPortalContent |
---|
[19] | 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 |
---|
[200] | 18 | |
---|
[59] | 19 | import Widgets |
---|
[19] | 20 | |
---|
[452] | 21 | waeup_types = ( |
---|
| 22 | "University.University", |
---|
| 23 | "Academics.AcademicsFolder", |
---|
| 24 | "Academics.Certificate", |
---|
| 25 | "Academics.CertificateCourse", |
---|
| 26 | "Academics.Faculty", |
---|
| 27 | "Academics.Department", |
---|
| 28 | "Academics.Course", |
---|
| 29 | "Academics.CourseTicket", |
---|
| 30 | "Academics.CertificateCourse", |
---|
| 31 | "Accommodation.AccoFolder", |
---|
| 32 | "Accommodation.Accommodation", |
---|
| 33 | "Students.StudentsFolder", |
---|
| 34 | "Students.Student", |
---|
| 35 | "Students.StudentStudyCourse", |
---|
| 36 | "Students.StudentAdmission", |
---|
| 37 | "Students.StudentClearance", |
---|
| 38 | "Students.StudentPersonal", |
---|
| 39 | "Students.ScratchCardBatch", |
---|
| 40 | "Students.ScratchCardBatchesFolder", |
---|
| 41 | "Students.StudyLevel", |
---|
| 42 | "Students.Semester", |
---|
[200] | 43 | ) |
---|
| 44 | |
---|
[452] | 45 | contentClasses = [] |
---|
| 46 | cc = [] |
---|
| 47 | for t in waeup_types: |
---|
| 48 | module,name = t.split('.') |
---|
| 49 | mod = __import__('Products.WAeUP_SRP.%(module)s' % vars(), |
---|
| 50 | globals(), |
---|
| 51 | locals(), |
---|
| 52 | ["%(name)s" % vars(),"add%(name)s" % vars()] |
---|
| 53 | ) |
---|
| 54 | contentClasses.append(getattr(mod,name)) |
---|
| 55 | cc.append(getattr(mod,"add%(name)s" % vars())) |
---|
| 56 | contentConstructors = tuple(cc) |
---|
[200] | 57 | |
---|
[440] | 58 | fti = [{} for t in range(len(contentConstructors))] |
---|
[200] | 59 | |
---|
[199] | 60 | registerDirectory('skins', globals()) |
---|
[197] | 61 | |
---|
[199] | 62 | def initialize(registrar): |
---|
[200] | 63 | ContentInit('WAeUP Types', |
---|
| 64 | content_types = contentClasses, |
---|
| 65 | permission = AddPortalContent, |
---|
| 66 | extra_constructors = contentConstructors, |
---|
| 67 | fti = fti, |
---|
| 68 | ).initialize(registrar) |
---|
| 69 | |
---|
[199] | 70 | # Extension profile registration |
---|
| 71 | profile_registry.registerProfile( |
---|
| 72 | 'default', |
---|
[274] | 73 | 'WAeUP_SRP', |
---|
[199] | 74 | "The WestAfrican e-University Project", |
---|
| 75 | 'profiles/default', |
---|
[274] | 76 | 'WAeUP_SRP', |
---|
[199] | 77 | EXTENSION, |
---|
| 78 | for_=ICPSSite) |
---|
[84] | 79 | |
---|