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