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