source: WAeUP_SRP/base/__init__.py @ 3281

Last change on this file since 3281 was 3277, checked in by joachim, 17 years ago

implemented new Upload functionallity

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