source: WAeUP_SRP/trunk/__init__.py @ 773

Last change on this file since 773 was 765, checked in by joachim, 18 years ago

pume import addopted
searchStudents-results now sorted by student_id

  • Property svn:keywords set to Id
File size: 2.6 KB
Line 
1#-*- mode: python; mode: fold -*-
2# $Id: __init__.py 765 2006-10-27 11:34:06Z 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
15import PatchCPSSchemasAttributeStorageAdapter
16# Only for CPS 3.4.1. In 3.4.2 and later this should be fixed.
17import PatchCPSDefaultImportExport
18
19import Products.WAeUP_SRP.WAeUPPermissions
20
21import Widgets
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     ("Students",
42        ("StudentsFolder",
43         "Student",
44         "StudentAccommodation",
45         "StudentStudyCourse",
46         "StudentCourseResult",
47         "StudentApplication",
48         "StudentPume",
49         "StudentClearance",
50         "StudentPersonal",
51         "StudentStudyLevel",
52         #"Semester",
53         "StudentCourseResult",
54         # move to Academics later
55         #"Semester",
56         )
57      ),
58     ("ScratchCards",
59         ("ScratchCardBatch",
60         "ScratchCardBatchesFolder",
61         ),
62     )
63    )
64
65contentClasses = []
66cc = []
67for modu,names in waeup_types:
68    mod = __import__('Products.WAeUP_SRP.%(modu)s' % vars(),
69                globals(),
70                locals(),
71                ['*',]
72                )
73    for name in names:
74        #print name
75        contentClasses.append(getattr(mod,name))
76        cc.append(getattr(mod,"add%(name)s" % vars()))
77contentConstructors = tuple(cc)
78
79fti = [{} for t in range(len(contentConstructors))]
80
81registerDirectory('skins', globals())
82
83def initialize(registrar):
84    ContentInit('WAeUP Types',
85                content_types = contentClasses,
86                permission = AddPortalContent,
87                extra_constructors = contentConstructors,
88                fti = fti,
89                ).initialize(registrar)
90
91    # Extension profile registration
92    profile_registry.registerProfile(
93        'default',
94        'WAeUP_SRP',
95        "The WestAfrican e-University Project",
96        'profiles/default',
97        'WAeUP_SRP',
98        EXTENSION,
99        for_=ICPSSite)
100
Note: See TracBrowser for help on using the repository browser.