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