| [199] | 1 | #-*- mode: python; mode: fold -*- |
|---|
| [204] | 2 | # $Id: __init__.py 1997 2007-07-08 09:16:21Z 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 |
|---|
| [1080] | 16 | import PatchCPSSchemasDataModel |
|---|
| [1350] | 17 | import PatchCPSSchemasVocabulariesTool |
|---|
| [918] | 18 | import PatchCPSMembershipTool |
|---|
| [881] | 19 | import PatchCPSUserFolderUserFolder |
|---|
| [933] | 20 | import PatchCPSStackingDirectoryStorageAdapter |
|---|
| [867] | 21 | import PatchBasicWidgetsCPSStringWidget |
|---|
| [1804] | 22 | import PatchExtendedWidgetsCPSDateTimeWidget |
|---|
| [1065] | 23 | import PatchBasicWidgetsUnprepare |
|---|
| [1812] | 24 | import PatchFasterSessionData |
|---|
| [1934] | 25 | import PatchQueueCatalogProcessQueue |
|---|
| [265] | 26 | # Only for CPS 3.4.1. In 3.4.2 and later this should be fixed. |
|---|
| [263] | 27 | import PatchCPSDefaultImportExport |
|---|
| [1737] | 28 | import PatchRenderActionIcon |
|---|
| [1845] | 29 | #import PatchZODBConnectionOpen |
|---|
| [274] | 30 | import Products.WAeUP_SRP.WAeUPPermissions |
|---|
| [828] | 31 | import WAeUPTool |
|---|
| [200] | 32 | |
|---|
| [59] | 33 | import Widgets |
|---|
| [1988] | 34 | tools = (WAeUPTool.WAeUPTool, |
|---|
| [1997] | 35 | ) |
|---|
| [19] | 36 | |
|---|
| [452] | 37 | waeup_types = ( |
|---|
| [454] | 38 | ("University",('University',)), |
|---|
| 39 | ("Academics", |
|---|
| 40 | ("AcademicsFolder", |
|---|
| 41 | "Certificate", |
|---|
| 42 | "CertificateCourse", |
|---|
| 43 | "Faculty", |
|---|
| 44 | "Department", |
|---|
| 45 | "Course", |
|---|
| 46 | "CertificateCourse", |
|---|
| [565] | 47 | "StudyLevel", |
|---|
| [454] | 48 | ) |
|---|
| 49 | ), |
|---|
| 50 | ("Accommodation", |
|---|
| 51 | ("AccoFolder", |
|---|
| [622] | 52 | "AccoHall", |
|---|
| [454] | 53 | ) |
|---|
| 54 | ), |
|---|
| [1226] | 55 | ("Payment", |
|---|
| 56 | ("PaymentsFolder", |
|---|
| 57 | "Payment", |
|---|
| 58 | ) |
|---|
| 59 | ), |
|---|
| [454] | 60 | ("Students", |
|---|
| 61 | ("StudentsFolder", |
|---|
| 62 | "Student", |
|---|
| [639] | 63 | "StudentAccommodation", |
|---|
| [454] | 64 | "StudentStudyCourse", |
|---|
| [464] | 65 | "StudentCourseResult", |
|---|
| [472] | 66 | "StudentApplication", |
|---|
| [758] | 67 | "StudentPume", |
|---|
| [454] | 68 | "StudentClearance", |
|---|
| 69 | "StudentPersonal", |
|---|
| [464] | 70 | "StudentStudyLevel", |
|---|
| [760] | 71 | #"Semester", |
|---|
| [467] | 72 | "StudentCourseResult", |
|---|
| [464] | 73 | # move to Academics later |
|---|
| [565] | 74 | #"Semester", |
|---|
| [454] | 75 | ) |
|---|
| 76 | ), |
|---|
| [488] | 77 | ("ScratchCards", |
|---|
| 78 | ("ScratchCardBatch", |
|---|
| 79 | "ScratchCardBatchesFolder", |
|---|
| 80 | ), |
|---|
| 81 | ) |
|---|
| [200] | 82 | ) |
|---|
| 83 | |
|---|
| [452] | 84 | contentClasses = [] |
|---|
| 85 | cc = [] |
|---|
| [454] | 86 | for modu,names in waeup_types: |
|---|
| 87 | mod = __import__('Products.WAeUP_SRP.%(modu)s' % vars(), |
|---|
| [452] | 88 | globals(), |
|---|
| 89 | locals(), |
|---|
| [454] | 90 | ['*',] |
|---|
| [452] | 91 | ) |
|---|
| [454] | 92 | for name in names: |
|---|
| 93 | #print name |
|---|
| 94 | contentClasses.append(getattr(mod,name)) |
|---|
| 95 | cc.append(getattr(mod,"add%(name)s" % vars())) |
|---|
| 96 | contentConstructors = tuple(cc) |
|---|
| [200] | 97 | |
|---|
| [440] | 98 | fti = [{} for t in range(len(contentConstructors))] |
|---|
| [200] | 99 | |
|---|
| [199] | 100 | registerDirectory('skins', globals()) |
|---|
| [197] | 101 | |
|---|
| [199] | 102 | def initialize(registrar): |
|---|
| [1988] | 103 | ToolInit('WAeUP Tools', |
|---|
| [828] | 104 | tools=tools, |
|---|
| 105 | icon='tool.gif', |
|---|
| 106 | ).initialize(registrar) |
|---|
| [200] | 107 | ContentInit('WAeUP Types', |
|---|
| 108 | content_types = contentClasses, |
|---|
| 109 | permission = AddPortalContent, |
|---|
| 110 | extra_constructors = contentConstructors, |
|---|
| 111 | fti = fti, |
|---|
| 112 | ).initialize(registrar) |
|---|
| 113 | |
|---|
| [199] | 114 | # Extension profile registration |
|---|
| 115 | profile_registry.registerProfile( |
|---|
| 116 | 'default', |
|---|
| [274] | 117 | 'WAeUP_SRP', |
|---|
| [199] | 118 | "The WestAfrican e-University Project", |
|---|
| 119 | 'profiles/default', |
|---|
| [274] | 120 | 'WAeUP_SRP', |
|---|
| [199] | 121 | EXTENSION, |
|---|
| 122 | for_=ICPSSite) |
|---|
| [84] | 123 | |
|---|