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