source: WAeUP_SRP/trunk/__init__.py @ 828

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

reenabled waeup_tool,
reserve accommodation fixed

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