source: WAeUP_SRP/base/__init__.py @ 3703

Last change on this file since 3703 was 3682, checked in by Henrik Bettermann, 16 years ago
  • Implement Student Pastoral Report for secondary schools
  • Property svn:keywords set to Id
File size: 3.4 KB
Line 
1#-*- mode: python; mode: fold -*-
2# $Id: __init__.py 3682 2008-09-21 06:01:55Z henrik $
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
10from Products.GenericSetup import BASE
11
12from Products.CPSCore.interfaces import ICPSSite
13from Products.CPSDirectory.DirectoryTool import DirectoryTypeRegistry
14
15import patches
16
17import Products.WAeUP_SRP.WAeUPPermissions
18import WAeUPTool
19
20import Widgets
21tools = (WAeUPTool.WAeUPTool,)
22
23waeup_types = (
24    ("University",('University',)),
25    ("Academics",
26       ("AcademicsFolder",
27        "Certificate",
28        "CertificateCourse",
29        "Faculty",
30        "Department",
31        "Course",
32        "CertificateCourse",
33        "StudyLevel",
34        )
35     ),
36     ("Accommodation",
37        ("AccoFolder",
38         "AccoHall",
39         )
40     ),
41     ("Payment",
42        ("PaymentsFolder",
43         "Payment",
44         )
45     ),
46     ("Students",
47        ("StudentsFolder",
48         "Student",
49         "StudentAccommodation",
50         "StudentStudyCourse",
51         "StudentCourseResult",
52         "StudentApplication",
53         "StudentPume",
54         "StudentClearance",
55         "StudentPersonal",
56         "StudentStudyLevel",
57         #"Semester",
58         "StudentCourseResult",
59         "StudentPastoralReport",
60         # move to Academics later
61         #"Semester",
62         )
63      ),
64     ("ScratchCards",
65         ("ScratchCardBatch",
66          "ScratchCardBatchesFolder",
67         )
68     ),
69     ("Documents",
70        ("DocumentsFolder",
71         "WAeUPDocument",
72        )
73     ),
74     ("Upload",
75        ("UploadsFolder",
76         "Upload",
77         )
78     ),
79    )
80
81contentClasses = []
82cc = []
83for modu,names in waeup_types:
84    mod = __import__('Products.WAeUP_SRP.%(modu)s' % vars(),
85                globals(),
86                locals(),
87                ['*',]
88                )
89    for name in names:
90        #print name
91        contentClasses.append(getattr(mod,name))
92        cc.append(getattr(mod,"add%(name)s" % vars()))
93contentConstructors = tuple(cc)
94
95fti = [{} for t in range(len(contentConstructors))]
96
97registerDirectory('skins', globals())
98
99def initialize(registrar):
100    ToolInit('WAeUP Tool',
101              tools=tools,
102              icon='tool.gif',
103              ).initialize(registrar)
104    ContentInit('WAeUP Types',
105                content_types = contentClasses,
106                permission = AddPortalContent,
107                extra_constructors = contentConstructors,
108                fti = fti,
109                ).initialize(registrar)
110
111    # Extension profile registration
112    profile_registry.registerProfile(
113        'default',
114        'WAeUP_SRP',
115        "The WestAfrican e-University Project",
116        'profiles/default',
117        'WAeUP_SRP',
118        EXTENSION,
119        for_=ICPSSite)
120##    DirectoryTypeRegistry.register(WAeUPTables.Applicants)
121
122    # Create a faster session container in temp_folder...
123    import Zope
124    from Products.faster.sessiondata import addSessionDataContainer
125    sess_container_name = "faster_session"
126    root = Zope.app()
127    temp = root.unrestrictedTraverse( "/temp_folder", None )
128    if temp is not None and not sess_container_name in temp.objectIds():
129        addSessionDataContainer( temp, sess_container_name, 9600, 4800,
130                  lazy=True, title='Faster session data container')
131
Note: See TracBrowser for help on using the repository browser.