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