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