source: waeup_product/trunk/Faculty.py @ 213

Last change on this file since 213 was 200, checked in by joachim, 19 years ago

=removed files not necessary

  • Property svn:keywords set to Id
File size: 3.3 KB
RevLine 
[68]1#-*- mode: python; mode: fold -*-
2from Globals import InitializeClass
3from AccessControl import ClassSecurityInfo
4
5from Products.CMFCore.utils import UniqueObject, getToolByName
6from Products.CMFCore.permissions import View
7from Products.CMFCore.permissions import ModifyPortalContent
8from Products.CPSCore.CPSBase import CPSBase_adder, CPSBaseFolder
9#from Products.CPSCore.CPSBase import CPSBaseDocument as BaseDocument
10from Products.CPSDocument.CPSDocument import CPSDocument
[200]11#from Products.CPSCore.CPSBase import CPSBaseBTreeFolder as BaseBTreeFolder
12#from Products.CPSCore.CPSBase import CPSBaseBTreeDocument as BaseBTreeDocument
13#from Products.CMFCore.DirectoryView import registerDirectory
[68]14
[200]15#registerDirectory('skins', globals())
16#registerDirectory('skins/waeup_default', globals())
17#registerDirectory('skins/waeup_faculty', globals())
[68]18
19class Faculty(CPSDocument): ###(
20    """
21    WAeUP Faculty containing Departments
22    """
23    meta_type = 'Faculty'
24    portal_type = meta_type
25    security = ClassSecurityInfo()
26   
[200]27    def __init__(self, id, **kw):
28        CPSDocument.__init__(self, id, **kw)
[173]29
[200]30    security.declareProtected(View,"Title")
31    def Title(self):
32        """compose title"""
33        return "Faculty of %s" % (self.title)
34
[68]35InitializeClass(Faculty)
36
37def addFaculty(container, id, REQUEST=None, **kw):
38    """Add a Faculty."""
39    ob = Faculty(id, **kw)
40    return CPSBase_adder(container, ob, REQUEST=REQUEST)
41
42###)
43
[200]44
[68]45class Department(CPSDocument): ###(
46    """
47    WAeUP Department containing the courses and students
48    """
49    meta_type = 'Department'
50    portal_type = meta_type
51    security = ClassSecurityInfo()
[173]52
[176]53##    security.declareProtected(View,"Title")
54##    def Title(self):
55##        """compose title"""
56##        reg_nr = self.getId()[1:]
57##        return "Department of %s" % (self.title)
[173]58
[68]59InitializeClass(Department)
60
61def addDepartment(container, id, REQUEST=None, **kw):
62    """Add a Department."""
63    ob = Department(id, **kw)
64    return CPSBase_adder(container, ob, REQUEST=REQUEST)
65###)
66
[200]67##course_fti = { ###(
68##    'title': 'WAeUP Course',
69##    'description': '',
70##    'content_icon': '',
71##    'content_meta_type': 'Course',
72##    'factory': 'addCourse',
73##    'immediate_view': 'cpsdocument_view',
74##    'global_allow': True,
75##    'filter_content_types': True,
76##    'allowed_content_types': (),
77##    'allow_discussion': False,
78##}
79#####)
[68]80
81class Course(CPSDocument): ###(
82    """
83    WAeUP Course 
84    """
85    meta_type = 'Course'
86    portal_type = meta_type
87    security = ClassSecurityInfo()
[152]88
89    security.declareProtected(View,"Title")
90    def Title(self):
91        """compose title"""
92        content = self.getContent()
93        heading = getattr(content,'heading',None)
94        if heading is None:
95            return self.title
96        return heading
[68]97   
98InitializeClass(Course)
99
100def addCourse(container, id, REQUEST=None, **kw):
101    """Add a Course."""
102    ob = Course(id, **kw)
103    return CPSBase_adder(container, ob, REQUEST=REQUEST)
104###)
[139]105
106class CourseTicket(CPSDocument): ###(
107    """
108    WAeUP CourseTicket 
109    """
110    meta_type = 'CourseTicket'
111    portal_type = meta_type
112    security = ClassSecurityInfo()
113   
114InitializeClass(CourseTicket)
115
116def addCourseTicket(container, id, REQUEST=None, **kw):
117    """Add a CourseTicket."""
118    ob = CourseTicket(id, **kw)
119    return CPSBase_adder(container, ob, REQUEST=REQUEST)
120###)
Note: See TracBrowser for help on using the repository browser.