source: WAeUP_SRP/trunk/__init__.py @ 603

Last change on this file since 603 was 580, checked in by joachim, 18 years ago

backward compatibility for Semester

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