source: WAeUP_SRP/trunk/__init__.py @ 534

Last change on this file since 534 was 511, checked in by joachim, 18 years ago

pin checking and login for JAMB students

  • Property svn:keywords set to Id
File size: 2.5 KB
RevLine 
[199]1#-*- mode: python; mode: fold -*-
[204]2# $Id: __init__.py 511 2006-09-13 06:47:55Z 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
[511]13import PatchCPSWorkflowWorkflowDefinition
14import PatchCatalogToolXMLAdapter
[265]15# Only for CPS 3.4.1. In 3.4.2 and later this should be fixed.
[263]16import PatchCPSDefaultImportExport
17
[274]18import Products.WAeUP_SRP.WAeUPPermissions
[200]19
[59]20import Widgets
[19]21
[452]22waeup_types = (
[454]23    ("University",('University',)),
24    ("Academics",
25       ("AcademicsFolder",
26        "Certificate",
27        "CertificateCourse",
28        "Faculty",
29        "Department",
30        "Course",
31        "CertificateCourse",
32        )
33     ),
34     ("Accommodation",
35        ("AccoFolder",
36         "Accommodation",
37         )
38     ),
39     ("Students",
40        ("StudentsFolder",
41         "Student",
42         "StudentStudyCourse",
[464]43         "StudentCourseResult",
[472]44         "StudentApplication",
[454]45         "StudentClearance",
46         "StudentPersonal",
[464]47         "StudentStudyLevel",
48         "StudentSemester",
[467]49         "StudentCourseResult",
[464]50         # move to Academics later
[458]51         "StudyLevel",
[454]52         "Semester",
53         )
54      ),
[488]55     ("ScratchCards",
56         ("ScratchCardBatch",
57         "ScratchCardBatchesFolder",
58         ),
59     )
[200]60    )
61
[452]62contentClasses = []
63cc = []
[454]64for modu,names in waeup_types:
65    mod = __import__('Products.WAeUP_SRP.%(modu)s' % vars(),
[452]66                globals(),
67                locals(),
[454]68                ['*',]
[452]69                )
[454]70    for name in names:
71        #print name
72        contentClasses.append(getattr(mod,name))
73        cc.append(getattr(mod,"add%(name)s" % vars()))
74contentConstructors = tuple(cc)
[200]75
[440]76fti = [{} for t in range(len(contentConstructors))]
[200]77
[199]78registerDirectory('skins', globals())
[197]79
[199]80def initialize(registrar):
[200]81    ContentInit('WAeUP Types',
82                content_types = contentClasses,
83                permission = AddPortalContent,
84                extra_constructors = contentConstructors,
85                fti = fti,
86                ).initialize(registrar)
87
[199]88    # Extension profile registration
89    profile_registry.registerProfile(
90        'default',
[274]91        'WAeUP_SRP',
[199]92        "The WestAfrican e-University Project",
93        'profiles/default',
[274]94        'WAeUP_SRP',
[199]95        EXTENSION,
96        for_=ICPSSite)
[84]97
Note: See TracBrowser for help on using the repository browser.