source: WAeUP_SRP/trunk/__init__.py @ 1076

Last change on this file since 1076 was 1065, checked in by joachim, 18 years ago

improved search, modify studycourse, patchfor attribute error

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