- Timestamp:
- 13 Feb 2011, 12:20:24 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/applicants/interfaces.py
r5753 r5758 25 25 import waeup.sirp.browser 26 26 from hurry.file import HurryFile 27 from zc.sourcefactory.basic import BasicSourceFactory 27 28 from zope import schema 28 from zc.sourcefactory.basic import BasicSourceFactory 29 from zope.interface import Interface, Attribute 30 from zope.pluggableauth.interfaces import IPrincipalInfo 31 from zope.security.interfaces import IGroupClosureAwarePrincipal as IPrincipal 29 32 from waeup.sirp.image.schema import ImageFile 30 33 from waeup.sirp.interfaces import IWAeUPObject, SimpleWAeUPVocabulary … … 688 691 required = True, 689 692 ) 693 694 class IApplicantPrincipalInfo(IPrincipalInfo): 695 """Infos about principals that are applicants. 696 """ 697 reg_no = Attribute("The JAMB registration no. of the user") 698 699 access_code = Attribute("The Access Code the user purchased") 700 701 class IApplicantPrincipal(IPrincipal): 702 """A principal that is an applicant. 703 704 This interface extends zope.security.interfaces.IPrincipal and 705 requires also an `id` and other attributes defined there. 706 """ 707 reg_no = schema.TextLine( 708 title = u'Registration number', 709 description = u'The JAMB registration number', 710 required = True, 711 readonly = True) 712 713 access_code = schema.TextLine( 714 title = u'Access Code', 715 description = u'The access code purchased by the user.', 716 required = True, 717 readonly = True) 718 719 class IApplicantsFormChallenger(Interface): 720 """A challenger that uses a browser form to collect applicant 721 credentials. 722 """ 723 loginpagename = schema.TextLine( 724 title = u'Loginpagename', 725 description = u"""Name of the login form used by challenger. 726 727 The form must provide an ``access_code`` input field. 728 """) 729 730 accesscode_field = schema.TextLine( 731 title = u'Access code field', 732 description = u'''Field of the login page which is looked up for 733 access_code''', 734 default = u'access_code', 735 ) 736 737 class IJAMBApplicantsFormChallenger(IApplicantsFormChallenger): 738 """A challenger that uses a browser form to collect applicant 739 credentials for applicants in JAMB process. 740 741 JAMB-screened applicants have to provide an extra registration 742 no. provided by JAMB. 743 """ 744 jamb_reg_no_field = schema.TextLine( 745 title = u'JAMB registration no.', 746 description = u'''Field of the login page which is looked up for 747 the JAMB registration number.''', 748 default = u'jamb_reg_no', 749 ) 750 751 class IApplicantSessionCredentials(Interface): 752 """Interface for storing and accessing applicant credentials in a 753 session. 754 """ 755 756 def __init__(access_code): 757 """Create applicant session credentials.""" 758 759 def getAccessCode(): 760 """Return the access code.""" 761 762 763 class IJAMBApplicantSessionCredentials(IApplicantSessionCredentials): 764 """Interface for storing and accessing JAMB applicant credentials in a 765 session. 766 """ 767 768 def __init__(access_code, jamb_reg_no): 769 """Create credentials for JAMB screened applicants.""" 770 771 def getJAMBRegNo(): 772 """Return the JAMB registration no."""
Note: See TracChangeset for help on using the changeset viewer.