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