Changeset 13124


Ignore:
Timestamp:
1 Jul 2015, 16:24:58 (10 years ago)
Author:
Henrik Bettermann
Message:

More docs.

Location:
main/waeup.kofa/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/CHANGES.txt

    r13123 r13124  
    55=======================
    66
    7 * Do not create special application payment tickets with Zero amount.
     7* Do not create special application payment tickets with zero amount.
    88
    99* Remove manual clearance lock. Replace `clearance_locked` field by
  • main/waeup.kofa/trunk/docs/source/userdocs/browsing.rst

    r13118 r13124  
    5757
    5858
    59 .. _manage_edit_pages:
     59.. _views_pages:
    6060
    6161Views, Pages and Form Pages
  • main/waeup.kofa/trunk/docs/source/userdocs/customization.rst

    r13121 r13124  
    4949localization. Translation is done via ``po`` text files which are
    5050located in the ``locales`` folder of a package. Each language has
    51 its own subfolder. Localized English Kofa terms, for intance, can be
     51its own subfolder. Localized English Kofa terms, for instance, can be
    5252found in ``locales/en/LC_MESSAGES/waeup.kofa.po``. A single
    5353entry/message consists of two lines.
     
    7171===============
    7272
     73Adding further schema field attributes to content components can be
     74done by inheriting Zope interfaces from the base package and adding
     75new schema fields to these custom interfaces, see :ref:`note
     76<kofa_interfaces>`. This sounds simple, but it isn't. There are many
     77things to think about, when customizing interfaces:
     78
     791. A customized interface alone doesn't have any effect, beause the
     80   content classes still implement the original interfaces. Thus, also
     81   all content classes, which are supposed to implement the extended
     82   interfaces, must be customized, and must be registered instead of
     83   the orginal classes which they inherit from. Drawback is, that this
     84   must be done before the first start-up of the portal. Otherwise,
     85   instances of the original content classes might have been created
     86   which cannot be changed afterwards.
     87
     882. Also the forms which are being auto-generated by
     89   `grok.AutoFields` (see :ref:`views_pages`), must be customized and
     90   use the new and extended interfaces. Otherwise added fields won't
     91   appear on form pages.
     92
     933. The same holds for exporters and importers. They also consider
     94   the fields from interfaces when processing the data. If we forget to
     95   customize exporter or batch processor classes, only the fields from
     96   the original interfaces will be exported or reimported.
     97
     98
    7399Zope Utilities
    74100==============
    75101
    76 Zope utilities are dedicated to customization by overriding their methods in custom packages.
     102Kofa's global utilities are perfectly suited for customization.
     103Their attributes and methods can be easily overridden in custom
     104packages.
    77105
    78106Kofa Utils
    79107----------
    80108
     109The central `KofaUtils` utility contains not only most dictionaries
     110used for sources (see
     111:py:class:`API <waeup.kofa.utils.utils.KofaUtils>`) but also attributes
     112like `PORTAL_LANGUAGE` and `tzinfo`. The first defines the default
     113language, which is used for pdf slips. The second defines the time
     114zone where the institution is located.
     115
     116Customizable utility methods are:
     117
     118.. automethod:: waeup.kofa.utils.utils.KofaUtils.sendContactForm()
     119   :noindex:
     120
     121.. automethod:: waeup.kofa.utils.utils.KofaUtils.fullname()
     122   :noindex:
     123
     124.. automethod:: waeup.kofa.utils.utils.KofaUtils.genPassword()
     125   :noindex:
     126
     127.. automethod:: waeup.kofa.utils.utils.KofaUtils.sendCredentials()
     128   :noindex:
     129
     130.. automethod:: waeup.kofa.utils.utils.KofaUtils.getPaymentItem()
     131   :noindex:
     132
    81133Students Utils
    82134--------------
     135
     136Customizable utility methods are:
     137
     138.. automethod:: waeup.kofa.students.utils.StudentsUtils.getReturningData()
     139   :noindex:
     140
     141.. automethod:: waeup.kofa.students.utils.StudentsUtils.setReturningData()
     142   :noindex:
     143
     144.. automethod:: waeup.kofa.students.utils.StudentsUtils.setPaymentDetails()
     145   :noindex:
     146
     147.. automethod:: waeup.kofa.students.utils.StudentsUtils.setBalanceDetails()
     148   :noindex:
     149
     150.. automethod:: waeup.kofa.students.utils.StudentsUtils.increaseMatricInteger()
     151   :noindex:
     152
     153.. automethod:: waeup.kofa.students.utils.StudentsUtils.constructMatricNumber()
     154   :noindex:
     155
     156.. automethod:: waeup.kofa.students.utils.StudentsUtils.setMatricNumber()
     157   :noindex:
     158
     159.. automethod:: waeup.kofa.students.utils.StudentsUtils.getAccommodationDetails()
     160   :noindex:
     161
     162.. automethod:: waeup.kofa.students.utils.StudentsUtils.selectBed()
     163   :noindex:
     164
     165.. automethod:: waeup.kofa.students.utils.StudentsUtils.renderPDFAdmissionLetter()
     166   :noindex:
     167
     168.. automethod:: waeup.kofa.students.utils.StudentsUtils.getPDFCreator()
     169   :noindex:
     170
     171.. automethod:: waeup.kofa.students.utils.StudentsUtils.renderPDF()
     172   :noindex:
     173
     174.. automethod:: waeup.kofa.students.utils.StudentsUtils.renderPDFTranscript()
     175   :noindex:
     176
     177.. automethod:: waeup.kofa.students.utils.StudentsUtils.maxCredits()
     178   :noindex:
     179
     180.. automethod:: waeup.kofa.students.utils.StudentsUtils.getBedCoordinates()
     181   :noindex:
     182
     183
     184
    83185
    84186Applicants Utils
  • main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py

    r13076 r13124  
    323323        """ Define what happens after school fee payment
    324324        depending on the student's senate verdict.
    325 
    326325        In the base configuration current level is always increased
    327326        by 100 no matter which verdict has been assigned.
     
    334333        """ Define what happens after school fee payment
    335334        depending on the student's senate verdict.
    336 
    337         This method folllows the same algorithm as getReturningData but
     335        This method folllows the same algorithm as `getReturningData` but
    338336        it also sets the new values.
    339337        """
     
    376374    def setPaymentDetails(self, category, student,
    377375            previous_session, previous_level):
    378         """Create a payment ticket object and set the payment data of a
     376        """Create a payment ticket and set the payment data of a
    379377        student for the payment category specified.
    380378        """
     
    491489    def setBalanceDetails(self, category, student,
    492490            balance_session, balance_level, balance_amount):
    493         """Create Payment object and set the payment data of a student for.
    494 
     491        """Create a balance payment ticket and set the payment data
     492        as selected by the student.
    495493        """
    496494        p_item = u'Balance'
     
    519517    def increaseMatricInteger(self, student):
    520518        """Increase counter for matric numbers.
    521 
    522519        This counter can be a centrally stored attribute or an attribute of
    523520        faculties, departments or certificates. In the base package the counter
    524         is as an attribute of the site configuration object.
     521        is as an attribute of the site configuration container.
    525522        """
    526523        grok.getSite()['configuration'].next_matric_integer += 1
     
    530527        """Fetch the matric number counter which fits the student and
    531528        construct the new matric number of the student.
    532 
    533529        In the base package the counter is returned which is as an attribute
    534         of the site configuration object.
     530        of the site configuration container.
    535531        """
    536532        next_integer = grok.getSite()['configuration'].next_matric_integer
     
    540536
    541537    def setMatricNumber(self, student):
    542         """Set matriculation number of student.
    543 
    544         If the student's matric number is unset a new matric number is
     538        """Set matriculation number of student. If the student's matric number
     539        is unset a new matric number is
    545540        constructed according to the matriculation number construction rules
    546         defined in the constructMatricNumber method. The new matric number is
     541        defined in the `constructMatricNumber` method. The new matric number is
    547542        set, the students catalog updated. The corresponding matric number
    548543        counter is increased by one.
     
    550545        This method is tested but not used in the base package. It can
    551546        be used in custom packages by adding respective views
    552         and by customizing increaseMatricInteger and constructMatricNumber
     547        and by customizing `increaseMatricInteger` and `constructMatricNumber`
    553548        according to the university's matriculation number construction rules.
    554549
     
    607602    def selectBed(self, available_beds):
    608603        """Select a bed from a list of available beds.
    609 
    610604        In the base configuration we select the first bed found,
    611605        but can also randomize the selection if we like.
     
    680674    def getPDFCreator(self, context):
    681675        """Get a pdf creator suitable for `context`.
    682 
    683676        The default implementation always returns the default creator.
    684677        """
     
    800793                  omit_fields=(),
    801794                  tableheader=None):
    802         """Render pdf slips for transcript.
     795        """Render pdf slips for transcripts.
    803796        """
    804797        portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE
     
    905898    def maxCredits(self, studylevel):
    906899        """Return maximum credits.
    907 
    908         In some universities maximum credits is not constant, it
    909         depends on the student's study level. Set maxCredits None or 0
     900        At some universities maximum credits is not constant, it
     901        depends on the student's study level. Set `maxCredits` None or 0
    910902        in order to deactivate the limitation.
    911903        """
     
    921913    def getBedCoordinates(self, bedticket):
    922914        """Return bed coordinates.
    923 
    924         This method can be used to customize the display_coordinates
     915        This method can be used to customize the `display_coordinates`
    925916        property method.
    926917        """
  • main/waeup.kofa/trunk/src/waeup/kofa/utils/utils.py

    r13031 r13124  
    8080class KofaUtils(grok.GlobalUtility):
    8181    """A collection of parameters and methods subject to customization.
    82 
    8382    """
    8483    grok.implements(IKofaUtils)
     
    242241    @property
    243242    def tzinfo(self):
     243        """Time zone of the university.
     244        """
    244245        # For Nigeria: pytz.timezone('Africa/Lagos')
    245246        # For Germany: pytz.timezone('Europe/Berlin')
     
    247248
    248249    def fullname(self, firstname, lastname, middlename=None):
    249         """Full name constructor.
     250        """Construct fullname.
    250251        """
    251252        # We do not necessarily have the middlename attribute
     
    263264
    264265    def sendCredentials(self, user, password=None, url_info=None, msg=None):
    265         """Send credentials as email.
    266 
    267         Input is the applicant for which credentials are sent and the
    268         password.
    269 
    270         Returns True or False to indicate successful operation.
     266        """Send credentials as email. Input is the user for which credentials
     267        are sent and the password. Method returns True or False to indicate
     268        successful operation.
    271269        """
    272270        subject = 'Your Kofa credentials'
     
    308306
    309307    def getPaymentItem(self, payment):
    310         """Return payment item.
    311 
    312         This method can be used to customize the display_item property method.
     308        """Return payment item. This method can be used to customize the
     309        `display_item` property attribute, e.g. in order to hide bed coordinates
     310        if maintenance fee is not paid.
    313311        """
    314312        return payment.p_item
     
    316314    def expensive_actions_allowed(self, type=None, request=None):
    317315        """Tell, whether expensive actions are currently allowed.
    318 
    319316        Check system load/health (or other external circumstances) and
    320317        locally set values to see, whether expensive actions should be
    321318        allowed (`True`) or better avoided (`False`).
    322 
    323319        Use this to allow or forbid exports, report generations, or
    324320        similar actions.
Note: See TracChangeset for help on using the changeset viewer.