source: WAeUP_SRP/trunk/__init__.py @ 909

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

removed PatchUserfolderWithGroups?

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