source: WAeUP_SRP/trunk/__init__.py @ 496

Last change on this file since 496 was 488, checked in by joachim, 18 years ago

modified scratch_card_pin widget to include prefix and batch_no
modified schemas and layouts accordingly.

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