source: WAeUP_SRP/trunk/__init__.py @ 2038

Last change on this file since 2038 was 2013, checked in by Henrik Bettermann, 17 years ago

see ticket #102

  • Property svn:keywords set to Id
File size: 3.3 KB
Line 
1#-*- mode: python; mode: fold -*-
2# $Id: __init__.py 2013 2007-07-12 16:12:23Z henrik $
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     ("Documents",
82        ("DocumentsFolder",
83         "WAeUPDocument",
84        )
85     ),       
86    )
87
88contentClasses = []
89cc = []
90for modu,names in waeup_types:
91    mod = __import__('Products.WAeUP_SRP.%(modu)s' % vars(),
92                globals(),
93                locals(),
94                ['*',]
95                )
96    for name in names:
97        #print name
98        contentClasses.append(getattr(mod,name))
99        cc.append(getattr(mod,"add%(name)s" % vars()))
100contentConstructors = tuple(cc)
101
102fti = [{} for t in range(len(contentConstructors))]
103
104registerDirectory('skins', globals())
105
106def initialize(registrar):
107    ToolInit('WAeUP Tool',
108              tools=tools,
109              icon='tool.gif',
110              ).initialize(registrar)
111    ContentInit('WAeUP Types',
112                content_types = contentClasses,
113                permission = AddPortalContent,
114                extra_constructors = contentConstructors,
115                fti = fti,
116                ).initialize(registrar)
117
118    # Extension profile registration
119    profile_registry.registerProfile(
120        'default',
121        'WAeUP_SRP',
122        "The WestAfrican e-University Project",
123        'profiles/default',
124        'WAeUP_SRP',
125        EXTENSION,
126        for_=ICPSSite)
127
Note: See TracBrowser for help on using the repository browser.