source: WAeUP_SRP/trunk/__init__.py @ 1878

Last change on this file since 1878 was 1847, checked in by joachim, 17 years ago

Patch of searchResults is not neccessary, if permission
"Access inactive portal content" is set for authenticated in uniben-root.

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