source: WAeUP_SRP/branches/regebro-noskins/__init__.py @ 17945

Last change on this file since 17945 was 1350, checked in by joachim, 18 years ago

added Patch for VocalbulariesTool?, which fixed the loading of to many objects.

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