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