source: WAeUP_SRP/trunk/__init__.py @ 2048

Last change on this file since 2048 was 2039, checked in by joachim, 17 years ago

fixed bug in Catalog.py to correctly update keyword index metadata

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