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