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