source: WAeUP_SRP/branches/joachim-azax-branch/__init__.py @ 1996

Last change on this file since 1996 was 1988, checked in by joachim, 17 years ago

merged r1979:r1987 from trunk

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