source: WAeUP_SRP/trunk/__init__.py @ 1809

Last change on this file since 1809 was 1804, checked in by joachim, 18 years ago

fix for #205, add more widgets for import_data

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