[19] | 1 | from Globals import InitializeClass |
---|
| 2 | from AccessControl import ClassSecurityInfo |
---|
| 3 | |
---|
| 4 | from Products.CMFCore.utils import getToolByName |
---|
| 5 | from Products.CMFCore.permissions import View |
---|
| 6 | from Products.CMFCore.permissions import ModifyPortalContent |
---|
| 7 | from Products.CPSCore.CPSBase import CPSBase_adder, CPSBaseFolder |
---|
| 8 | from Products.CPSCore.CPSBase import CPSBaseDocument as BaseDocument |
---|
| 9 | #from Products.CMFCore.PortalContent import PortalContent |
---|
| 10 | #from Products.CMFCore.PortalFolder import PortalFolder |
---|
| 11 | #from Products.CMFCore.CMFCatalogAware import CMFCatalogAware |
---|
| 12 | |
---|
| 13 | #from Products.CMFCore.interfaces.Contentish import Contentish as IContentish |
---|
| 14 | #from Products.CMFCore.interfaces.Dynamic import DynamicType as IDynamicType |
---|
| 15 | from Products.CPSDocument.CPSDocument import CPSDocument |
---|
| 16 | |
---|
| 17 | factory_type_information = ( |
---|
| 18 | {'id': 'Student', |
---|
| 19 | 'meta_type': 'Student', |
---|
| 20 | 'description': 'The WAeUP Student', |
---|
| 21 | 'title': 'WAeUP Student', |
---|
| 22 | 'icon': 'student.gif', |
---|
| 23 | 'product': 'WAeUP', |
---|
| 24 | 'factory': 'addStudent', |
---|
| 25 | 'immediate_view': 'student_edit_form', |
---|
| 26 | 'filter_content_types': 1, |
---|
| 27 | 'allowed_content_types': ('JAMB'), |
---|
| 28 | 'allow_discussion': 0, |
---|
| 29 | 'actions': ({'id': 'view', |
---|
| 30 | 'name': 'View', |
---|
| 31 | 'action': 'student_view', |
---|
| 32 | 'permissions': (View,)}, |
---|
| 33 | {'id': 'addJamb', |
---|
| 34 | 'name': 'new JAMB', |
---|
| 35 | 'action': 'folder_factories', |
---|
| 36 | 'permissions': (ModifyPortalContent,)}, |
---|
| 37 | {'id': 'edit', |
---|
| 38 | 'name': 'Edit', |
---|
| 39 | 'action': 'student_edit_form', |
---|
| 40 | 'permissions': (ModifyPortalContent,)}, |
---|
| 41 | ), |
---|
| 42 | # additionnal cps stuff |
---|
| 43 | 'cps_display_as_document_in_listing' : 1, |
---|
| 44 | }, |
---|
| 45 | ) |
---|
| 46 | |
---|
| 47 | class Student(BaseDocument): |
---|
| 48 | """ |
---|
| 49 | WAeUP Student container for the various student data |
---|
| 50 | """ |
---|
| 51 | ## meta_type = 'Student' |
---|
| 52 | ## portal_type = meta_type |
---|
| 53 | ## security = ClassSecurityInfo() |
---|
| 54 | |
---|
| 55 | ## _properties = BaseDocument._properties + ( |
---|
| 56 | ## {'id': 'jamb_is_admitted', 'type': 'boolean'}, |
---|
| 57 | ## {'id': 'jamb_where_admitted', 'type': 'string'}, |
---|
| 58 | ## ) |
---|
| 59 | |
---|
| 60 | ## allow_discussion = 0 |
---|
| 61 | ## jamb_is_admitted = False |
---|
| 62 | ## jamb_where_admitted = '' |
---|
| 63 | |
---|
| 64 | |
---|
| 65 | InitializeClass(Student) |
---|
| 66 | |
---|
| 67 | def addStudent(container, id, REQUEST=None, **kw): |
---|
| 68 | """Add a Student.""" |
---|
| 69 | ob = Student(id, **kw) |
---|
| 70 | return CPSBase_adder(container, ob, REQUEST=REQUEST) |
---|