| 1 | #-*- mode: python; mode: fold -*- |
|---|
| 2 | # $Id: __init__.py 2305 2007-10-03 15:12:26Z joachim $ |
|---|
| 3 | from Products.CMFCore.utils import ContentInit, ToolInit |
|---|
| 4 | from Products.CMFCore.DirectoryView import registerDirectory |
|---|
| 5 | from Products.CMFCore import utils as cmfutils |
|---|
| 6 | from Products.CMFCore.permissions import AddPortalContent |
|---|
| 7 | |
|---|
| 8 | from Products.GenericSetup import profile_registry |
|---|
| 9 | from Products.GenericSetup import EXTENSION |
|---|
| 10 | |
|---|
| 11 | from Products.CPSCore.interfaces import ICPSSite |
|---|
| 12 | from Products.CPSDirectory.DirectoryTool import DirectoryTypeRegistry |
|---|
| 13 | |
|---|
| 14 | import PatchCPSWorkflowWorkflowDefinition |
|---|
| 15 | import PatchCatalogToolSearchResults |
|---|
| 16 | import PatchCatalogToolXMLAdapter |
|---|
| 17 | import PatchCPSSchemasAttributeStorageAdapter |
|---|
| 18 | import PatchCPSSchemasDataModel |
|---|
| 19 | import PatchCPSSchemasVocabulariesTool |
|---|
| 20 | import PatchCPSMembershipTool |
|---|
| 21 | import PatchCPSUserFolderUserFolder |
|---|
| 22 | import PatchCPSStackingDirectoryStorageAdapter |
|---|
| 23 | import PatchBasicWidgetsCPSStringWidget |
|---|
| 24 | import PatchExtendedWidgetsCPSDateTimeWidget |
|---|
| 25 | import PatchBasicWidgetsUnprepare |
|---|
| 26 | import PatchFasterSessionData |
|---|
| 27 | import PatchQueueCatalogProcessQueue |
|---|
| 28 | import PatchZCatalogCatalogUpdateMetadata |
|---|
| 29 | # Only for CPS 3.4.1. In 3.4.2 and later this should be fixed. |
|---|
| 30 | import PatchCPSDefaultImportExport |
|---|
| 31 | import PatchRenderActionIcon |
|---|
| 32 | #import PatchZODBConnectionOpen |
|---|
| 33 | import PatchLocalizerMessageCatalog_gettext |
|---|
| 34 | import Products.WAeUP_SRP.WAeUPPermissions |
|---|
| 35 | import WAeUPTool |
|---|
| 36 | |
|---|
| 37 | import Widgets |
|---|
| 38 | tools = (WAeUPTool.WAeUPTool,) |
|---|
| 39 | |
|---|
| 40 | waeup_types = ( |
|---|
| 41 | ("University",('University',)), |
|---|
| 42 | ("Academics", |
|---|
| 43 | ("AcademicsFolder", |
|---|
| 44 | "Certificate", |
|---|
| 45 | "CertificateCourse", |
|---|
| 46 | "Faculty", |
|---|
| 47 | "Department", |
|---|
| 48 | "Course", |
|---|
| 49 | "CertificateCourse", |
|---|
| 50 | "StudyLevel", |
|---|
| 51 | ) |
|---|
| 52 | ), |
|---|
| 53 | ("Accommodation", |
|---|
| 54 | ("AccoFolder", |
|---|
| 55 | "AccoHall", |
|---|
| 56 | ) |
|---|
| 57 | ), |
|---|
| 58 | ("Payment", |
|---|
| 59 | ("PaymentsFolder", |
|---|
| 60 | "Payment", |
|---|
| 61 | ) |
|---|
| 62 | ), |
|---|
| 63 | ("Students", |
|---|
| 64 | ("StudentsFolder", |
|---|
| 65 | "Student", |
|---|
| 66 | "StudentAccommodation", |
|---|
| 67 | "StudentStudyCourse", |
|---|
| 68 | "StudentCourseResult", |
|---|
| 69 | "StudentApplication", |
|---|
| 70 | "StudentPume", |
|---|
| 71 | "StudentClearance", |
|---|
| 72 | "StudentPersonal", |
|---|
| 73 | "StudentStudyLevel", |
|---|
| 74 | #"Semester", |
|---|
| 75 | "StudentCourseResult", |
|---|
| 76 | # move to Academics later |
|---|
| 77 | #"Semester", |
|---|
| 78 | ) |
|---|
| 79 | ), |
|---|
| 80 | ("ScratchCards", |
|---|
| 81 | ("ScratchCardBatch", |
|---|
| 82 | "ScratchCardBatchesFolder", |
|---|
| 83 | ) |
|---|
| 84 | ), |
|---|
| 85 | ("Documents", |
|---|
| 86 | ("DocumentsFolder", |
|---|
| 87 | "WAeUPDocument", |
|---|
| 88 | ) |
|---|
| 89 | ), |
|---|
| 90 | ) |
|---|
| 91 | |
|---|
| 92 | contentClasses = [] |
|---|
| 93 | cc = [] |
|---|
| 94 | for modu,names in waeup_types: |
|---|
| 95 | mod = __import__('Products.WAeUP_SRP.%(modu)s' % vars(), |
|---|
| 96 | globals(), |
|---|
| 97 | locals(), |
|---|
| 98 | ['*',] |
|---|
| 99 | ) |
|---|
| 100 | for name in names: |
|---|
| 101 | #print name |
|---|
| 102 | contentClasses.append(getattr(mod,name)) |
|---|
| 103 | cc.append(getattr(mod,"add%(name)s" % vars())) |
|---|
| 104 | contentConstructors = tuple(cc) |
|---|
| 105 | |
|---|
| 106 | fti = [{} for t in range(len(contentConstructors))] |
|---|
| 107 | |
|---|
| 108 | registerDirectory('skins', globals()) |
|---|
| 109 | |
|---|
| 110 | def initialize(registrar): |
|---|
| 111 | ToolInit('WAeUP Tool', |
|---|
| 112 | tools=tools, |
|---|
| 113 | icon='tool.gif', |
|---|
| 114 | ).initialize(registrar) |
|---|
| 115 | ContentInit('WAeUP Types', |
|---|
| 116 | content_types = contentClasses, |
|---|
| 117 | permission = AddPortalContent, |
|---|
| 118 | extra_constructors = contentConstructors, |
|---|
| 119 | fti = fti, |
|---|
| 120 | ).initialize(registrar) |
|---|
| 121 | |
|---|
| 122 | # Extension profile registration |
|---|
| 123 | profile_registry.registerProfile( |
|---|
| 124 | 'default', |
|---|
| 125 | 'WAeUP_SRP', |
|---|
| 126 | "The WestAfrican e-University Project", |
|---|
| 127 | 'profiles/default', |
|---|
| 128 | 'WAeUP_SRP', |
|---|
| 129 | EXTENSION, |
|---|
| 130 | for_=ICPSSite) |
|---|
| 131 | ## DirectoryTypeRegistry.register(WAeUPTables.Applicants) |
|---|
| 132 | |
|---|