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