source: WAeUP_SRP/trunk/__init__.py @ 762

Last change on this file since 762 was 760, checked in by Henrik Bettermann, 18 years ago

Module Semester removed

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