| [199] | 1 | #-*- mode: python; mode: fold -*- |
|---|
| [204] | 2 | # $Id: __init__.py 488 2006-09-07 12:34:56Z 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", |
|---|
| [464] | 42 | "StudentCourseResult", |
|---|
| [472] | 43 | "StudentApplication", |
|---|
| [454] | 44 | "StudentClearance", |
|---|
| 45 | "StudentPersonal", |
|---|
| [464] | 46 | "StudentStudyLevel", |
|---|
| 47 | "StudentSemester", |
|---|
| [467] | 48 | "StudentCourseResult", |
|---|
| [464] | 49 | # move to Academics later |
|---|
| [458] | 50 | "StudyLevel", |
|---|
| [454] | 51 | "Semester", |
|---|
| 52 | ) |
|---|
| 53 | ), |
|---|
| [488] | 54 | ("ScratchCards", |
|---|
| 55 | ("ScratchCardBatch", |
|---|
| 56 | "ScratchCardBatchesFolder", |
|---|
| 57 | ), |
|---|
| 58 | ) |
|---|
| [200] | 59 | ) |
|---|
| 60 | |
|---|
| [452] | 61 | contentClasses = [] |
|---|
| 62 | cc = [] |
|---|
| [454] | 63 | for modu,names in waeup_types: |
|---|
| 64 | mod = __import__('Products.WAeUP_SRP.%(modu)s' % vars(), |
|---|
| [452] | 65 | globals(), |
|---|
| 66 | locals(), |
|---|
| [454] | 67 | ['*',] |
|---|
| [452] | 68 | ) |
|---|
| [454] | 69 | for name in names: |
|---|
| 70 | #print name |
|---|
| 71 | contentClasses.append(getattr(mod,name)) |
|---|
| 72 | cc.append(getattr(mod,"add%(name)s" % vars())) |
|---|
| 73 | contentConstructors = tuple(cc) |
|---|
| [200] | 74 | |
|---|
| [440] | 75 | fti = [{} for t in range(len(contentConstructors))] |
|---|
| [200] | 76 | |
|---|
| [199] | 77 | registerDirectory('skins', globals()) |
|---|
| [197] | 78 | |
|---|
| [199] | 79 | def initialize(registrar): |
|---|
| [200] | 80 | ContentInit('WAeUP Types', |
|---|
| 81 | content_types = contentClasses, |
|---|
| 82 | permission = AddPortalContent, |
|---|
| 83 | extra_constructors = contentConstructors, |
|---|
| 84 | fti = fti, |
|---|
| 85 | ).initialize(registrar) |
|---|
| 86 | |
|---|
| [199] | 87 | # Extension profile registration |
|---|
| 88 | profile_registry.registerProfile( |
|---|
| 89 | 'default', |
|---|
| [274] | 90 | 'WAeUP_SRP', |
|---|
| [199] | 91 | "The WestAfrican e-University Project", |
|---|
| 92 | 'profiles/default', |
|---|
| [274] | 93 | 'WAeUP_SRP', |
|---|
| [199] | 94 | EXTENSION, |
|---|
| 95 | for_=ICPSSite) |
|---|
| [84] | 96 | |
|---|