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