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