source: WAeUP_SRP/trunk/__init__.py @ 575

Last change on this file since 575 was 565, checked in by joachim, 18 years ago

removed Semester-type and semester-schema,
move StudyLevel? from Students.py to Academics.py
all Academics content has to be deleted before installing this !!!

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