source: WAeUP_SRP/trunk/__init__.py @ 2207

Last change on this file since 2207 was 2178, checked in by joachim, 17 years ago

patch to gettext not to translate new messages, waeup_default.po with reduced message-count

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