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