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