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