source: WAeUP_SRP/trunk/__init__.py @ 1869

Last change on this file since 1869 was 1847, checked in by joachim, 18 years ago

Patch of searchResults is not neccessary, if permission
"Access inactive portal content" is set for authenticated in uniben-root.

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