source: WAeUP_SRP/trunk/__init__.py @ 1845

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

modifications to use QueueCatalog?

  • Property svn:keywords set to Id
File size: 3.2 KB
Line 
1#-*- mode: python; mode: fold -*-
2# $Id: __init__.py 1845 2007-06-02 11:01:49Z 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
14#import PatchCatalogToolSearchResults
15import PatchCatalogToolXMLAdapter
16import PatchCPSSchemasAttributeStorageAdapter
17import PatchCPSSchemasDataModel
18import PatchCPSSchemasVocabulariesTool
19import PatchCPSMembershipTool
20import PatchCPSUserFolderUserFolder
21import PatchCPSStackingDirectoryStorageAdapter
22import PatchBasicWidgetsCPSStringWidget
23import PatchExtendedWidgetsCPSDateTimeWidget
24import PatchBasicWidgetsUnprepare
25import PatchFasterSessionData
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.