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