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