source: WAeUP_SRP/trunk/__init__.py @ 531

Last change on this file since 531 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
Line 
1#-*- mode: python; mode: fold -*-
2# $Id: __init__.py 511 2006-09-13 06:47:55Z 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
13import PatchCPSWorkflowWorkflowDefinition
14import PatchCatalogToolXMLAdapter
15# Only for CPS 3.4.1. In 3.4.2 and later this should be fixed.
16import PatchCPSDefaultImportExport
17
18import Products.WAeUP_SRP.WAeUPPermissions
19
20import Widgets
21
22waeup_types = (
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",
43         "StudentCourseResult",
44         "StudentApplication",
45         "StudentClearance",
46         "StudentPersonal",
47         "StudentStudyLevel",
48         "StudentSemester",
49         "StudentCourseResult",
50         # move to Academics later
51         "StudyLevel",
52         "Semester",
53         )
54      ),
55     ("ScratchCards",
56         ("ScratchCardBatch",
57         "ScratchCardBatchesFolder",
58         ),
59     )
60    )
61
62contentClasses = []
63cc = []
64for modu,names in waeup_types:
65    mod = __import__('Products.WAeUP_SRP.%(modu)s' % vars(),
66                globals(),
67                locals(),
68                ['*',]
69                )
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)
75
76fti = [{} for t in range(len(contentConstructors))]
77
78registerDirectory('skins', globals())
79
80def initialize(registrar):
81    ContentInit('WAeUP Types',
82                content_types = contentClasses,
83                permission = AddPortalContent,
84                extra_constructors = contentConstructors,
85                fti = fti,
86                ).initialize(registrar)
87
88    # Extension profile registration
89    profile_registry.registerProfile(
90        'default',
91        'WAeUP_SRP',
92        "The WestAfrican e-University Project",
93        'profiles/default',
94        'WAeUP_SRP',
95        EXTENSION,
96        for_=ICPSSite)
97
Note: See TracBrowser for help on using the repository browser.