from Globals import InitializeClass from AccessControl import ClassSecurityInfo from Products.CMFCore.utils import getToolByName from Products.CMFCore.permissions import View from Products.CMFCore.permissions import ModifyPortalContent from Products.CPSCore.CPSBase import CPSBase_adder, CPSBaseFolder from Products.CPSCore.CPSBase import CPSBaseDocument as BaseDocument #from Products.CMFCore.PortalContent import PortalContent #from Products.CMFCore.PortalFolder import PortalFolder #from Products.CMFCore.CMFCatalogAware import CMFCatalogAware #from Products.CMFCore.interfaces.Contentish import Contentish as IContentish #from Products.CMFCore.interfaces.Dynamic import DynamicType as IDynamicType from Products.CPSDocument.CPSDocument import CPSDocument factory_type_information = ( {'id': 'Student', 'meta_type': 'Student', 'description': 'The WAeUP Student', 'title': 'WAeUP Student', 'icon': 'student.gif', 'product': 'WAeUP', 'factory': 'addStudent', 'immediate_view': 'student_edit_form', 'filter_content_types': 1, 'allowed_content_types': ('JAMB'), 'allow_discussion': 0, 'actions': ({'id': 'view', 'name': 'View', 'action': 'student_view', 'permissions': (View,)}, {'id': 'addJamb', 'name': 'new JAMB', 'action': 'folder_factories', 'permissions': (ModifyPortalContent,)}, {'id': 'edit', 'name': 'Edit', 'action': 'student_edit_form', 'permissions': (ModifyPortalContent,)}, ), # additionnal cps stuff 'cps_display_as_document_in_listing' : 1, }, ) class Student(BaseDocument): """ WAeUP Student container for the various student data """ ## meta_type = 'Student' ## portal_type = meta_type ## security = ClassSecurityInfo() ## _properties = BaseDocument._properties + ( ## {'id': 'jamb_is_admitted', 'type': 'boolean'}, ## {'id': 'jamb_where_admitted', 'type': 'string'}, ## ) ## allow_discussion = 0 ## jamb_is_admitted = False ## jamb_where_admitted = '' InitializeClass(Student) def addStudent(container, id, REQUEST=None, **kw): """Add a Student.""" ob = Student(id, **kw) return CPSBase_adder(container, ob, REQUEST=REQUEST)