source: WAeUP_SRP/trunk/__init__.py @ 997

Last change on this file since 997 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
RevLine 
[199]1#-*- mode: python; mode: fold -*-
[204]2# $Id: __init__.py 933 2006-11-24 16:04:52Z joachim $
[206]3from Products.CMFCore.utils import ContentInit, ToolInit
[19]4from Products.CMFCore.DirectoryView import registerDirectory
5from Products.CMFCore import utils as cmfutils
[452]6from Products.CMFCore.permissions import AddPortalContent
[19]7
[199]8from Products.GenericSetup import profile_registry
9from Products.GenericSetup import EXTENSION
[19]10
[199]11from Products.CPSCore.interfaces import ICPSSite
12
[511]13import PatchCPSWorkflowWorkflowDefinition
14import PatchCatalogToolXMLAdapter
[537]15import PatchCPSSchemasAttributeStorageAdapter
[918]16import PatchCPSMembershipTool
[881]17import PatchCPSUserFolderUserFolder
[933]18import PatchCPSStackingDirectoryStorageAdapter
[867]19import PatchBasicWidgetsCPSStringWidget
[265]20# Only for CPS 3.4.1. In 3.4.2 and later this should be fixed.
[263]21import PatchCPSDefaultImportExport
[274]22import Products.WAeUP_SRP.WAeUPPermissions
[828]23import WAeUPTool
[200]24
[59]25import Widgets
[828]26tools = (WAeUPTool.WAeUPTool,)
[19]27
[452]28waeup_types = (
[454]29    ("University",('University',)),
30    ("Academics",
31       ("AcademicsFolder",
32        "Certificate",
33        "CertificateCourse",
34        "Faculty",
35        "Department",
36        "Course",
37        "CertificateCourse",
[565]38        "StudyLevel",
[454]39        )
40     ),
41     ("Accommodation",
42        ("AccoFolder",
[622]43         "AccoHall",
[454]44         )
45     ),
46     ("Students",
47        ("StudentsFolder",
48         "Student",
[639]49         "StudentAccommodation",
[454]50         "StudentStudyCourse",
[464]51         "StudentCourseResult",
[472]52         "StudentApplication",
[758]53         "StudentPume",
[454]54         "StudentClearance",
55         "StudentPersonal",
[464]56         "StudentStudyLevel",
[760]57         #"Semester",
[467]58         "StudentCourseResult",
[464]59         # move to Academics later
[565]60         #"Semester",
[454]61         )
62      ),
[488]63     ("ScratchCards",
64         ("ScratchCardBatch",
65         "ScratchCardBatchesFolder",
66         ),
67     )
[200]68    )
69
[452]70contentClasses = []
71cc = []
[454]72for modu,names in waeup_types:
73    mod = __import__('Products.WAeUP_SRP.%(modu)s' % vars(),
[452]74                globals(),
75                locals(),
[454]76                ['*',]
[452]77                )
[454]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)
[200]83
[440]84fti = [{} for t in range(len(contentConstructors))]
[200]85
[199]86registerDirectory('skins', globals())
[197]87
[199]88def initialize(registrar):
[828]89    ToolInit('WAeUP Tool',
90              tools=tools,
91              icon='tool.gif',
92              ).initialize(registrar)
[200]93    ContentInit('WAeUP Types',
94                content_types = contentClasses,
95                permission = AddPortalContent,
96                extra_constructors = contentConstructors,
97                fti = fti,
98                ).initialize(registrar)
99
[199]100    # Extension profile registration
101    profile_registry.registerProfile(
102        'default',
[274]103        'WAeUP_SRP',
[199]104        "The WestAfrican e-University Project",
105        'profiles/default',
[274]106        'WAeUP_SRP',
[199]107        EXTENSION,
108        for_=ICPSSite)
[84]109
Note: See TracBrowser for help on using the repository browser.