source: WAeUP_SRP/trunk/__init__.py @ 441

Last change on this file since 441 was 440, checked in by joachim, 19 years ago

levels can be created
keyerror elective fixed
check for blanks in Id's checked

  • Property svn:keywords set to Id
File size: 4.2 KB
RevLine 
[199]1#-*- mode: python; mode: fold -*-
[204]2# $Id: __init__.py 440 2006-08-29 11:56:53Z joachim $
[206]3from Products.CMFCore.utils import ContentInit, ToolInit
[19]4from Products.CMFCore.DirectoryView import registerDirectory
5from Products.CMFCore import utils as cmfutils
6from Products.CMFCore.CMFCorePermissions import AddPortalContent
7
[199]8from Products.GenericSetup import profile_registry
9from Products.GenericSetup import EXTENSION
[19]10
[199]11from Products.CPSCore.interfaces import ICPSSite
12
[265]13# Only for CPS 3.4.1. In 3.4.2 and later this should be fixed.
[263]14import PatchCPSDefaultImportExport
15
[274]16import Products.WAeUP_SRP.WAeUPPermissions
[278]17from Products.WAeUP_SRP.Academics import AcademicsFolder, addAcademicsFolder
[274]18from Products.WAeUP_SRP.University import University, addUniversity
19from Products.WAeUP_SRP.Accommodation import AccoFolder, addAccoFolder
20from Products.WAeUP_SRP.Accommodation import Accommodation, addAccommodation
21from Products.WAeUP_SRP.Academics import Certificate, addCertificate
22from Products.WAeUP_SRP.Academics import CertificateCourse, addCertificateCourse
23from Products.WAeUP_SRP.Academics import Faculty, addFaculty
24from Products.WAeUP_SRP.Academics import Department, addDepartment
25from Products.WAeUP_SRP.Academics import Course, addCourse
26from Products.WAeUP_SRP.Academics import CourseTicket, addCourseTicket
27from Products.WAeUP_SRP.Academics import CertificateCourse, addCertificateCourse
[361]28from Products.WAeUP_SRP.Students import StudentsFolder, addStudentsFolder
[274]29from Products.WAeUP_SRP.Students import Student, addStudent
[362]30from Products.WAeUP_SRP.Students import StudentStudyCourse, addStudentStudyCourse
[423]31from Products.WAeUP_SRP.Students import StudentAdmission, addStudentAdmission
32from Products.WAeUP_SRP.Students import StudentClearance, addStudentClearance
[274]33from Products.WAeUP_SRP.Students import StudentPersonal, addStudentPersonal
[440]34from Products.WAeUP_SRP.Students import ScratchCardBatch, addScratchCardBatch
35from Products.WAeUP_SRP.Students import ScratchCardBatchesFolder, addScratchCardBatchesFolder
[274]36from Products.WAeUP_SRP.Students import StudyLevel, addStudyLevel
37from Products.WAeUP_SRP.Students import Semester, addSemester
[200]38
39
[59]40import Widgets
[19]41
[200]42contentClasses = (
43    University,
[278]44    AcademicsFolder,
[256]45    Certificate,
46    CertificateCourse,
[200]47    Faculty,
48    Department,
49    Course,
50    CourseTicket,
[256]51    CertificateCourse,
[200]52    AccoFolder,
53    Accommodation,
[361]54    StudentsFolder,
[200]55    Student,
[362]56    StudentStudyCourse,
[423]57    StudentAdmission,
58    StudentClearance,
[200]59    StudentPersonal,
[440]60    ScratchCardBatch,
61    ScratchCardBatchesFolder,
[200]62    StudyLevel,
63    Semester,
64    )
65
66contentConstructors = (
67    addUniversity,
[278]68    addAcademicsFolder,
[256]69    addCertificate,
70    addCertificateCourse,
[200]71    addFaculty,
72    addDepartment,
73    addCourse,
74    addCourseTicket,
[256]75    addCertificateCourse,
[200]76    addAccoFolder,
77    addAccommodation,
[361]78    addStudentsFolder,
[200]79    addStudent,
[362]80    addStudentStudyCourse,
[423]81    addStudentAdmission,
82    addStudentClearance,
[200]83    addStudentPersonal,
[440]84    addScratchCardBatch,
85    addScratchCardBatchesFolder,
[200]86    addStudyLevel,
87    addSemester,
88    )
89
[440]90fti = [{} for t in range(len(contentConstructors))]
91##fti = (
92##    {}, # University
93##    {}, #AcademicsFolder
94##    {}, #Certificate
95##    {}, #CertificateCourse
96##    {}, # Faculty
97##    {}, # Department
98##    {}, # Course
99##    {}, # CourseTicket
100##    {}, # CertificateCourse
101##    {}, # AccoFolder
102##    {}, # Accommodation
103##    {}, # StudentsFolder,
104##    {}, # Student,
105##    {}, # StudentStudyCourse,
106##    {}, # StudentAdmission,
107##    {}, # StudentClearance,
108##    {}, # StudentAdmission,
109##    {}, # StudentClearance,
110##    {}, # StudentPersonal,
111##    {}, # ScratchCardBatch,
112##    {}, # ScratchCardBatchesFolder,
113##    {}, # StudyLevel,
114##    {}, # Semester,
115##    )
[200]116
[199]117registerDirectory('skins', globals())
[197]118
[199]119def initialize(registrar):
[200]120    ContentInit('WAeUP Types',
121                content_types = contentClasses,
122                permission = AddPortalContent,
123                extra_constructors = contentConstructors,
124                fti = fti,
125                ).initialize(registrar)
126
[199]127    # Extension profile registration
128    profile_registry.registerProfile(
129        'default',
[274]130        'WAeUP_SRP',
[199]131        "The WestAfrican e-University Project",
132        'profiles/default',
[274]133        'WAeUP_SRP',
[199]134        EXTENSION,
135        for_=ICPSSite)
[84]136
Note: See TracBrowser for help on using the repository browser.