source: WAeUP_SRP/trunk/__init__.py @ 953

Last change on this file since 953 was 933, checked in by joachim, 18 years ago

added a students directory,
students are now put in this directory
all other members remain in members
waeup_stacking_dir handles this

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