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