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
RevLine 
[199]1#-*- mode: python; mode: fold -*-
[204]2# $Id: __init__.py 452 2006-08-30 12:31:46Z joachim $
[206]3from Products.CMFCore.utils import ContentInit, ToolInit
[19]4from Products.CMFCore.DirectoryView import registerDirectory
5from Products.CMFCore import utils as cmfutils
[452]6from Products.CMFCore.permissions import AddPortalContent
[19]7
[199]8from Products.GenericSetup import profile_registry
9from Products.GenericSetup import EXTENSION
[19]10
[199]11from Products.CPSCore.interfaces import ICPSSite
12
[265]13# Only for CPS 3.4.1. In 3.4.2 and later this should be fixed.
[263]14import PatchCPSDefaultImportExport
[445]15import PatchCatalogToolXMLAdapter
[263]16
[274]17import Products.WAeUP_SRP.WAeUPPermissions
[200]18
[59]19import Widgets
[19]20
[452]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",
[200]43    )
44
[452]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)
[200]57
[440]58fti = [{} for t in range(len(contentConstructors))]
[200]59
[199]60registerDirectory('skins', globals())
[197]61
[199]62def initialize(registrar):
[200]63    ContentInit('WAeUP Types',
64                content_types = contentClasses,
65                permission = AddPortalContent,
66                extra_constructors = contentConstructors,
67                fti = fti,
68                ).initialize(registrar)
69
[199]70    # Extension profile registration
71    profile_registry.registerProfile(
72        'default',
[274]73        'WAeUP_SRP',
[199]74        "The WestAfrican e-University Project",
75        'profiles/default',
[274]76        'WAeUP_SRP',
[199]77        EXTENSION,
78        for_=ICPSSite)
[84]79
Note: See TracBrowser for help on using the repository browser.