source: WAeUP_SRP/trunk/__init__.py @ 2183

Last change on this file since 2183 was 2178, checked in by joachim, 17 years ago

patch to gettext not to translate new messages, waeup_default.po with reduced message-count

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