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