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