source: WAeUP_SRP/trunk/__init__.py @ 2127

Last change on this file since 2127 was 2094, checked in by joachim, 17 years ago

add applicants_catalog

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