source: WAeUP_SRP/trunk/__init__.py @ 893

Last change on this file since 893 was 881, checked in by joachim, 18 years ago

some fixes and renames

  • Property svn:keywords set to Id
File size: 2.8 KB
Line 
1#-*- mode: python; mode: fold -*-
2# $Id: __init__.py 881 2006-11-16 22:42:08Z 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
16import PatchCPSUserFolderUserFolderWithGroups
17import PatchCPSUserFolderUserFolder
18import PatchBasicWidgetsCPSStringWidget
19# Only for CPS 3.4.1. In 3.4.2 and later this should be fixed.
20import PatchCPSDefaultImportExport
21import Products.WAeUP_SRP.WAeUPPermissions
22import WAeUPTool
23
24import Widgets
25tools = (WAeUPTool.WAeUPTool,)
26
27waeup_types = (
28    ("University",('University',)),
29    ("Academics",
30       ("AcademicsFolder",
31        "Certificate",
32        "CertificateCourse",
33        "Faculty",
34        "Department",
35        "Course",
36        "CertificateCourse",
37        "StudyLevel",
38        )
39     ),
40     ("Accommodation",
41        ("AccoFolder",
42         "AccoHall",
43         )
44     ),
45     ("Students",
46        ("StudentsFolder",
47         "Student",
48         "StudentAccommodation",
49         "StudentStudyCourse",
50         "StudentCourseResult",
51         "StudentApplication",
52         "StudentPume",
53         "StudentClearance",
54         "StudentPersonal",
55         "StudentStudyLevel",
56         #"Semester",
57         "StudentCourseResult",
58         # move to Academics later
59         #"Semester",
60         )
61      ),
62     ("ScratchCards",
63         ("ScratchCardBatch",
64         "ScratchCardBatchesFolder",
65         ),
66     )
67    )
68
69contentClasses = []
70cc = []
71for modu,names in waeup_types:
72    mod = __import__('Products.WAeUP_SRP.%(modu)s' % vars(),
73                globals(),
74                locals(),
75                ['*',]
76                )
77    for name in names:
78        #print name
79        contentClasses.append(getattr(mod,name))
80        cc.append(getattr(mod,"add%(name)s" % vars()))
81contentConstructors = tuple(cc)
82
83fti = [{} for t in range(len(contentConstructors))]
84
85registerDirectory('skins', globals())
86
87def initialize(registrar):
88    ToolInit('WAeUP Tool',
89              tools=tools,
90              icon='tool.gif',
91              ).initialize(registrar)
92    ContentInit('WAeUP Types',
93                content_types = contentClasses,
94                permission = AddPortalContent,
95                extra_constructors = contentConstructors,
96                fti = fti,
97                ).initialize(registrar)
98
99    # Extension profile registration
100    profile_registry.registerProfile(
101        'default',
102        'WAeUP_SRP',
103        "The WestAfrican e-University Project",
104        'profiles/default',
105        'WAeUP_SRP',
106        EXTENSION,
107        for_=ICPSSite)
108
Note: See TracBrowser for help on using the repository browser.