source: WAeUP_SRP/trunk/__init__.py @ 482

Last change on this file since 482 was 472, checked in by Henrik Bettermann, 18 years ago

admission renamed, now application

  • Property svn:keywords set to Id
File size: 2.4 KB
RevLine 
[199]1#-*- mode: python; mode: fold -*-
[204]2# $Id: __init__.py 472 2006-09-02 14:51:14Z henrik $
[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 = (
[454]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",
[464]42         "StudentCourseResult",
[472]43         "StudentApplication",
[454]44         "StudentClearance",
45         "StudentPersonal",
46         "ScratchCardBatch",
47         "ScratchCardBatchesFolder",
[464]48         "StudentStudyLevel",
49         "StudentSemester",
[467]50         "StudentCourseResult",
[464]51         # move to Academics later
[458]52         "StudyLevel",
[454]53         "Semester",
54         )
55      ),
[200]56    )
57
[452]58contentClasses = []
59cc = []
[454]60for modu,names in waeup_types:
61    mod = __import__('Products.WAeUP_SRP.%(modu)s' % vars(),
[452]62                globals(),
63                locals(),
[454]64                ['*',]
[452]65                )
[454]66    for name in names:
67        #print name
68        contentClasses.append(getattr(mod,name))
69        cc.append(getattr(mod,"add%(name)s" % vars()))
70contentConstructors = tuple(cc)
[200]71
[440]72fti = [{} for t in range(len(contentConstructors))]
[200]73
[199]74registerDirectory('skins', globals())
[197]75
[199]76def initialize(registrar):
[200]77    ContentInit('WAeUP Types',
78                content_types = contentClasses,
79                permission = AddPortalContent,
80                extra_constructors = contentConstructors,
81                fti = fti,
82                ).initialize(registrar)
83
[199]84    # Extension profile registration
85    profile_registry.registerProfile(
86        'default',
[274]87        'WAeUP_SRP',
[199]88        "The WestAfrican e-University Project",
89        'profiles/default',
[274]90        'WAeUP_SRP',
[199]91        EXTENSION,
92        for_=ICPSSite)
[84]93
Note: See TracBrowser for help on using the repository browser.