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