source: WAeUP_SRP/trunk/__init__.py @ 2106

Last change on this file since 2106 was 2094, checked in by joachim, 17 years ago

add applicants_catalog

  • Property svn:keywords set to Id
File size: 3.5 KB
RevLine 
[199]1#-*- mode: python; mode: fold -*-
[204]2# $Id: __init__.py 2094 2007-08-13 12:01:11Z 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
[274]32import Products.WAeUP_SRP.WAeUPPermissions
[828]33import WAeUPTool
[200]34
[59]35import Widgets
[828]36tools = (WAeUPTool.WAeUPTool,)
[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",
[2013]80          "ScratchCardBatchesFolder",
81         )
82     ),
83     ("Documents",
84        ("DocumentsFolder",
85         "WAeUPDocument",
86        )
87     ),       
[200]88    )
89
[452]90contentClasses = []
91cc = []
[454]92for modu,names in waeup_types:
93    mod = __import__('Products.WAeUP_SRP.%(modu)s' % vars(),
[452]94                globals(),
95                locals(),
[454]96                ['*',]
[452]97                )
[454]98    for name in names:
99        #print name
100        contentClasses.append(getattr(mod,name))
101        cc.append(getattr(mod,"add%(name)s" % vars()))
102contentConstructors = tuple(cc)
[200]103
[440]104fti = [{} for t in range(len(contentConstructors))]
[200]105
[199]106registerDirectory('skins', globals())
[197]107
[199]108def initialize(registrar):
[828]109    ToolInit('WAeUP Tool',
110              tools=tools,
111              icon='tool.gif',
112              ).initialize(registrar)
[200]113    ContentInit('WAeUP Types',
114                content_types = contentClasses,
115                permission = AddPortalContent,
116                extra_constructors = contentConstructors,
117                fti = fti,
118                ).initialize(registrar)
119
[199]120    # Extension profile registration
121    profile_registry.registerProfile(
122        'default',
[274]123        'WAeUP_SRP',
[199]124        "The WestAfrican e-University Project",
125        'profiles/default',
[274]126        'WAeUP_SRP',
[199]127        EXTENSION,
128        for_=ICPSSite)
[2094]129##    DirectoryTypeRegistry.register(WAeUPTables.Applicants)
[84]130
Note: See TracBrowser for help on using the repository browser.