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