source: WAeUP_SRP/trunk/__init__.py @ 453

Last change on this file since 453 was 452, checked in by joachim, 18 years ago

fixed course result import,
and semester default_view for students

  • Property svn:keywords set to Id
File size: 2.3 KB
Line 
1#-*- mode: python; mode: fold -*-
2# $Id: __init__.py 452 2006-08-30 12:31:46Z joachim $
3from Products.CMFCore.utils import ContentInit, ToolInit
4from Products.CMFCore.DirectoryView import registerDirectory
5from Products.CMFCore import utils as cmfutils
6from Products.CMFCore.permissions import AddPortalContent
7
8from Products.GenericSetup import profile_registry
9from Products.GenericSetup import EXTENSION
10
11from Products.CPSCore.interfaces import ICPSSite
12
13# Only for CPS 3.4.1. In 3.4.2 and later this should be fixed.
14import PatchCPSDefaultImportExport
15import PatchCatalogToolXMLAdapter
16
17import Products.WAeUP_SRP.WAeUPPermissions
18
19import Widgets
20
21waeup_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
45contentClasses = []
46cc = []
47for 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
58fti = [{} for t in range(len(contentConstructors))]
59
60registerDirectory('skins', globals())
61
62def 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
Note: See TracBrowser for help on using the repository browser.