source: WAeUP_SRP/trunk/__init__.py @ 1805

Last change on this file since 1805 was 1804, checked in by joachim, 18 years ago

fix for #205, add more widgets for import_data

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