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