1 | #-*- mode: python; mode: fold -*- |
---|
2 | # $Id: __init__.py 452 2006-08-30 12:31:46Z 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 | # 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.AcademicsFolder", |
---|
24 | "Academics.Certificate", |
---|
25 | "Academics.CertificateCourse", |
---|
26 | "Academics.Faculty", |
---|
27 | "Academics.Department", |
---|
28 | "Academics.Course", |
---|
29 | "Academics.CourseTicket", |
---|
30 | "Academics.CertificateCourse", |
---|
31 | "Accommodation.AccoFolder", |
---|
32 | "Accommodation.Accommodation", |
---|
33 | "Students.StudentsFolder", |
---|
34 | "Students.Student", |
---|
35 | "Students.StudentStudyCourse", |
---|
36 | "Students.StudentAdmission", |
---|
37 | "Students.StudentClearance", |
---|
38 | "Students.StudentPersonal", |
---|
39 | "Students.ScratchCardBatch", |
---|
40 | "Students.ScratchCardBatchesFolder", |
---|
41 | "Students.StudyLevel", |
---|
42 | "Students.Semester", |
---|
43 | ) |
---|
44 | |
---|
45 | contentClasses = [] |
---|
46 | cc = [] |
---|
47 | for t in waeup_types: |
---|
48 | module,name = t.split('.') |
---|
49 | mod = __import__('Products.WAeUP_SRP.%(module)s' % vars(), |
---|
50 | globals(), |
---|
51 | locals(), |
---|
52 | ["%(name)s" % vars(),"add%(name)s" % vars()] |
---|
53 | ) |
---|
54 | contentClasses.append(getattr(mod,name)) |
---|
55 | cc.append(getattr(mod,"add%(name)s" % vars())) |
---|
56 | contentConstructors = tuple(cc) |
---|
57 | |
---|
58 | fti = [{} for t in range(len(contentConstructors))] |
---|
59 | |
---|
60 | registerDirectory('skins', globals()) |
---|
61 | |
---|
62 | def initialize(registrar): |
---|
63 | ContentInit('WAeUP Types', |
---|
64 | content_types = contentClasses, |
---|
65 | permission = AddPortalContent, |
---|
66 | extra_constructors = contentConstructors, |
---|
67 | fti = fti, |
---|
68 | ).initialize(registrar) |
---|
69 | |
---|
70 | # Extension profile registration |
---|
71 | profile_registry.registerProfile( |
---|
72 | 'default', |
---|
73 | 'WAeUP_SRP', |
---|
74 | "The WestAfrican e-University Project", |
---|
75 | 'profiles/default', |
---|
76 | 'WAeUP_SRP', |
---|
77 | EXTENSION, |
---|
78 | for_=ICPSSite) |
---|
79 | |
---|