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