source: WAeUP_SRP/branches/joachim-azax-branch/__init__.py @ 1996

Last change on this file since 1996 was 1988, checked in by joachim, 17 years ago

merged r1979:r1987 from trunk

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