1 | #-*- mode: python; mode: fold -*- |
---|
2 | # $Id: __init__.py 1929 2007-06-19 04:38:08Z henrik $ |
---|
3 | from Products.CMFCore.utils import ContentInit, ToolInit |
---|
4 | from Products.CMFCore.DirectoryView import registerDirectory |
---|
5 | from Products.CMFCore import utils as cmfutils |
---|
6 | from Products.CMFCore.permissions import AddPortalContent |
---|
7 | |
---|
8 | from Products.GenericSetup import profile_registry |
---|
9 | from Products.GenericSetup import EXTENSION |
---|
10 | |
---|
11 | from Products.CPSCore.interfaces import ICPSSite |
---|
12 | |
---|
13 | import PatchCPSWorkflowWorkflowDefinition |
---|
14 | import PatchCatalogToolXMLAdapter |
---|
15 | import PatchCPSSchemasAttributeStorageAdapter |
---|
16 | import PatchCPSSchemasDataModel |
---|
17 | import PatchCPSSchemasVocabulariesTool |
---|
18 | import PatchCPSMembershipTool |
---|
19 | import PatchCPSUserFolderUserFolder |
---|
20 | import PatchCPSStackingDirectoryStorageAdapter |
---|
21 | import PatchBasicWidgetsCPSStringWidget |
---|
22 | import PatchExtendedWidgetsCPSDateTimeWidget |
---|
23 | import PatchBasicWidgetsUnprepare |
---|
24 | import PatchFasterSessionData |
---|
25 | #import PatchQueueCatalogProcessQueue |
---|
26 | # Only for CPS 3.4.1. In 3.4.2 and later this should be fixed. |
---|
27 | import PatchCPSDefaultImportExport |
---|
28 | import PatchRenderActionIcon |
---|
29 | #import PatchZODBConnectionOpen |
---|
30 | import Products.WAeUP_SRP.WAeUPPermissions |
---|
31 | import WAeUPTool |
---|
32 | |
---|
33 | import Widgets |
---|
34 | tools = (WAeUPTool.WAeUPTool,) |
---|
35 | |
---|
36 | waeup_types = ( |
---|
37 | ("University",('University',)), |
---|
38 | ("Academics", |
---|
39 | ("AcademicsFolder", |
---|
40 | "Certificate", |
---|
41 | "CertificateCourse", |
---|
42 | "Faculty", |
---|
43 | "Department", |
---|
44 | "Course", |
---|
45 | "CertificateCourse", |
---|
46 | "StudyLevel", |
---|
47 | ) |
---|
48 | ), |
---|
49 | ("Accommodation", |
---|
50 | ("AccoFolder", |
---|
51 | "AccoHall", |
---|
52 | ) |
---|
53 | ), |
---|
54 | ("Payment", |
---|
55 | ("PaymentsFolder", |
---|
56 | "Payment", |
---|
57 | ) |
---|
58 | ), |
---|
59 | ("Students", |
---|
60 | ("StudentsFolder", |
---|
61 | "Student", |
---|
62 | "StudentAccommodation", |
---|
63 | "StudentStudyCourse", |
---|
64 | "StudentCourseResult", |
---|
65 | "StudentApplication", |
---|
66 | "StudentPume", |
---|
67 | "StudentClearance", |
---|
68 | "StudentPersonal", |
---|
69 | "StudentStudyLevel", |
---|
70 | #"Semester", |
---|
71 | "StudentCourseResult", |
---|
72 | # move to Academics later |
---|
73 | #"Semester", |
---|
74 | ) |
---|
75 | ), |
---|
76 | ("ScratchCards", |
---|
77 | ("ScratchCardBatch", |
---|
78 | "ScratchCardBatchesFolder", |
---|
79 | ), |
---|
80 | ) |
---|
81 | ) |
---|
82 | |
---|
83 | contentClasses = [] |
---|
84 | cc = [] |
---|
85 | for modu,names in waeup_types: |
---|
86 | mod = __import__('Products.WAeUP_SRP.%(modu)s' % vars(), |
---|
87 | globals(), |
---|
88 | locals(), |
---|
89 | ['*',] |
---|
90 | ) |
---|
91 | for name in names: |
---|
92 | #print name |
---|
93 | contentClasses.append(getattr(mod,name)) |
---|
94 | cc.append(getattr(mod,"add%(name)s" % vars())) |
---|
95 | contentConstructors = tuple(cc) |
---|
96 | |
---|
97 | fti = [{} for t in range(len(contentConstructors))] |
---|
98 | |
---|
99 | registerDirectory('skins', globals()) |
---|
100 | |
---|
101 | def initialize(registrar): |
---|
102 | ToolInit('WAeUP Tool', |
---|
103 | tools=tools, |
---|
104 | icon='tool.gif', |
---|
105 | ).initialize(registrar) |
---|
106 | ContentInit('WAeUP Types', |
---|
107 | content_types = contentClasses, |
---|
108 | permission = AddPortalContent, |
---|
109 | extra_constructors = contentConstructors, |
---|
110 | fti = fti, |
---|
111 | ).initialize(registrar) |
---|
112 | |
---|
113 | # Extension profile registration |
---|
114 | profile_registry.registerProfile( |
---|
115 | 'default', |
---|
116 | 'WAeUP_SRP', |
---|
117 | "The WestAfrican e-University Project", |
---|
118 | 'profiles/default', |
---|
119 | 'WAeUP_SRP', |
---|
120 | EXTENSION, |
---|
121 | for_=ICPSSite) |
---|
122 | |
---|