source: WAeUP_SRP/trunk/__init__.py @ 1164

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

use last Patch

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