source: WAeUP_SRP/trunk/__init__.py @ 1945

Last change on this file since 1945 was 1934, checked in by joachim, 18 years ago

fix for #283

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