[199] | 1 | #-*- mode: python; mode: fold -*- |
---|
[204] | 2 | # $Id: __init__.py 511 2006-09-13 06:47:55Z 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 | |
---|
[511] | 13 | import PatchCPSWorkflowWorkflowDefinition |
---|
| 14 | import PatchCatalogToolXMLAdapter |
---|
[265] | 15 | # Only for CPS 3.4.1. In 3.4.2 and later this should be fixed. |
---|
[263] | 16 | import PatchCPSDefaultImportExport |
---|
| 17 | |
---|
[274] | 18 | import Products.WAeUP_SRP.WAeUPPermissions |
---|
[200] | 19 | |
---|
[59] | 20 | import Widgets |
---|
[19] | 21 | |
---|
[452] | 22 | waeup_types = ( |
---|
[454] | 23 | ("University",('University',)), |
---|
| 24 | ("Academics", |
---|
| 25 | ("AcademicsFolder", |
---|
| 26 | "Certificate", |
---|
| 27 | "CertificateCourse", |
---|
| 28 | "Faculty", |
---|
| 29 | "Department", |
---|
| 30 | "Course", |
---|
| 31 | "CertificateCourse", |
---|
| 32 | ) |
---|
| 33 | ), |
---|
| 34 | ("Accommodation", |
---|
| 35 | ("AccoFolder", |
---|
| 36 | "Accommodation", |
---|
| 37 | ) |
---|
| 38 | ), |
---|
| 39 | ("Students", |
---|
| 40 | ("StudentsFolder", |
---|
| 41 | "Student", |
---|
| 42 | "StudentStudyCourse", |
---|
[464] | 43 | "StudentCourseResult", |
---|
[472] | 44 | "StudentApplication", |
---|
[454] | 45 | "StudentClearance", |
---|
| 46 | "StudentPersonal", |
---|
[464] | 47 | "StudentStudyLevel", |
---|
| 48 | "StudentSemester", |
---|
[467] | 49 | "StudentCourseResult", |
---|
[464] | 50 | # move to Academics later |
---|
[458] | 51 | "StudyLevel", |
---|
[454] | 52 | "Semester", |
---|
| 53 | ) |
---|
| 54 | ), |
---|
[488] | 55 | ("ScratchCards", |
---|
| 56 | ("ScratchCardBatch", |
---|
| 57 | "ScratchCardBatchesFolder", |
---|
| 58 | ), |
---|
| 59 | ) |
---|
[200] | 60 | ) |
---|
| 61 | |
---|
[452] | 62 | contentClasses = [] |
---|
| 63 | cc = [] |
---|
[454] | 64 | for modu,names in waeup_types: |
---|
| 65 | mod = __import__('Products.WAeUP_SRP.%(modu)s' % vars(), |
---|
[452] | 66 | globals(), |
---|
| 67 | locals(), |
---|
[454] | 68 | ['*',] |
---|
[452] | 69 | ) |
---|
[454] | 70 | for name in names: |
---|
| 71 | #print name |
---|
| 72 | contentClasses.append(getattr(mod,name)) |
---|
| 73 | cc.append(getattr(mod,"add%(name)s" % vars())) |
---|
| 74 | contentConstructors = tuple(cc) |
---|
[200] | 75 | |
---|
[440] | 76 | fti = [{} for t in range(len(contentConstructors))] |
---|
[200] | 77 | |
---|
[199] | 78 | registerDirectory('skins', globals()) |
---|
[197] | 79 | |
---|
[199] | 80 | def initialize(registrar): |
---|
[200] | 81 | ContentInit('WAeUP Types', |
---|
| 82 | content_types = contentClasses, |
---|
| 83 | permission = AddPortalContent, |
---|
| 84 | extra_constructors = contentConstructors, |
---|
| 85 | fti = fti, |
---|
| 86 | ).initialize(registrar) |
---|
| 87 | |
---|
[199] | 88 | # Extension profile registration |
---|
| 89 | profile_registry.registerProfile( |
---|
| 90 | 'default', |
---|
[274] | 91 | 'WAeUP_SRP', |
---|
[199] | 92 | "The WestAfrican e-University Project", |
---|
| 93 | 'profiles/default', |
---|
[274] | 94 | 'WAeUP_SRP', |
---|
[199] | 95 | EXTENSION, |
---|
| 96 | for_=ICPSSite) |
---|
[84] | 97 | |
---|