source: WAeUP_SRP/trunk/__init__.py @ 871

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

patch for default field width in stringWidgets
isClearanceOfficer added

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