Changeset 12862 for main


Ignore:
Timestamp:
19 Apr 2015, 05:32:19 (10 years ago)
Author:
Henrik Bettermann
Message:

Finalize exporter documentation.

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

Legend:

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

    r12854 r12862  
    7373* Add new dependency: `psutil` (required to check system state).
    7474
    75 * Show flash message on general search page for the academics section.
     75* Show flash message on general search page for the academic section.
    7676
    7777* Fix CertificateCourseProcessor. Mandatory is not a required field
  • main/waeup.kofa/trunk/docs/source/userdocs/datacenter.rst

    r12861 r12862  
    3232.. note::
    3333
    34   The list of exported columns usually underlies heavy customizations. In the Kofa base package only very fiew columns are being exported. In some Kofa custom packages tons of data are being gathered from applicants and students and the number of columns increase accordingly.
     34  The list of exported columns usually underlies heavy customizations. In the Kofa base package only very few columns are being exported. In some Kofa custom packages tons of data are being gathered from applicants and students and the number of columns increase accordingly.
    3535
    3636The `title` attribute unveils the name of the exporter under which this exporter will be displayed in the user interface. The `mangle_value()` method shows how some of fields are being dynamically computed.
     
    159159  .. automethod:: waeup.kofa.students.export.CourseTicketExporter.mangle_value()
    160160
     161.. autoclass:: waeup.kofa.students.export.StudentPaymentsExporter()
     162  :noindex:
     163
     164  .. autoattribute:: waeup.kofa.students.export.StudentPaymentsExporter.fields
     165  .. autoattribute:: waeup.kofa.students.export.StudentPaymentsExporter.title
     166  .. automethod:: waeup.kofa.students.export.StudentPaymentsExporter.mangle_value()
     167
     168.. autoclass:: waeup.kofa.students.export.BedTicketsExporter()
     169  :noindex:
     170
     171  .. autoattribute:: waeup.kofa.students.export.BedTicketsExporter.fields
     172  .. autoattribute:: waeup.kofa.students.export.BedTicketsExporter.title
     173  .. automethod:: waeup.kofa.students.export.BedTicketsExporter.mangle_value()
     174
     175The above exporters refer to a specific content type (object class). They export all attributes of these objects and a few additional parameters derived from the parent objects. These exporters can be used for reimport, or more precisely for backing up and restoring data. The following 'special' exporters are made on request of some universities to collect and compose student data for analysis and postprocessing by the university.
     176
     177.. autoclass:: waeup.kofa.students.export.DataForBursaryExporter()
     178  :noindex:
     179
     180  .. autoattribute:: waeup.kofa.students.export.DataForBursaryExporter.fields
     181  .. autoattribute:: waeup.kofa.students.export.DataForBursaryExporter.title
     182  .. automethod:: waeup.kofa.students.export.DataForBursaryExporter.mangle_value()
     183
     184.. autoclass:: waeup.kofa.students.export.StudentPaymentsOverviewExporter()
     185  :noindex:
     186
     187  .. autoattribute:: waeup.kofa.students.export.StudentPaymentsOverviewExporter.fields
     188  .. autoattribute:: waeup.kofa.students.export.StudentPaymentsOverviewExporter.title
     189  .. autoattribute:: waeup.kofa.students.export.StudentPaymentsOverviewExporter.curr_year
     190  .. automethod:: waeup.kofa.students.export.StudentPaymentsOverviewExporter.mangle_value()
     191
     192.. autoclass:: waeup.kofa.students.export.StudentStudyLevelsOverviewExporter()
     193  :noindex:
     194
     195  .. autoattribute:: waeup.kofa.students.export.StudentStudyLevelsOverviewExporter.fields
     196  .. autoattribute:: waeup.kofa.students.export.StudentStudyLevelsOverviewExporter.title
     197  .. automethod:: waeup.kofa.students.export.StudentStudyLevelsOverviewExporter.mangle_value()
     198
     199.. autoclass:: waeup.kofa.students.export.ComboCardDataExporter()
     200  :noindex:
     201
     202  .. autoattribute:: waeup.kofa.students.export.ComboCardDataExporter.fields
     203  .. autoattribute:: waeup.kofa.students.export.ComboCardDataExporter.title
     204  .. automethod:: waeup.kofa.students.export.ComboCardDataExporter.mangle_value()
     205
    161206Data Import
    162207===========
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/export.py

    r12861 r12862  
    6565class ApplicantExporter(grok.GlobalUtility, ExporterBase):
    6666    """The Applicant Exporter exports application records (= applicants)
    67     stored in the database. In contrast to the exporters in the academics
     67    stored in the database. In contrast to the exporters in the academic
    6868    section this exporter does not iterate over the items of containers
    6969    but searches the :class:`ApplicantsCatalog` instead.
  • main/waeup.kofa/trunk/src/waeup/kofa/browser/pages.py

    r12840 r12862  
    741741
    742742class SearchPage(KofaPage):
    743     """General search page for the academics section.
     743    """General search page for the academic section.
    744744    """
    745745    grok.context(IFacultiesContainer)
  • main/waeup.kofa/trunk/src/waeup/kofa/permissions.py

    r12847 r12862  
    377377class AcademicsOfficer(grok.Role):
    378378    """An Academics Officer can view but not edit data in the
    379     Academics Section.
     379    academic section.
    380380
    381381    This is the default role which is automatically assigned to all
     
    389389class AcademicsManager(grok.Role):
    390390    """An Academics Manager can view and edit all data in the
    391     Academics Section, i.e. access all manage pages
     391    scademic section, i.e. access all manage pages
    392392    at faculty, department, course, certificate and certificate course level.
    393393    """
  • main/waeup.kofa/trunk/src/waeup/kofa/students/export.py

    r12861 r12862  
    290290    """The Student Study Level Exporter first filters the set of students
    291291    by searching the students catalog. Then it exports the data of the student's
    292     study level containers but not their content (course tickets).
     292    study level container data but not their content (course tickets).
    293293    The exporter iterates over all objects in the students' ``studycourse``
    294294    containers.
     
    325325    exports those course tickets which belong to the given course code and
    326326    also meet level and level_session passed through at the same time.
    327     This happens if the exporter is called at course level in the academics
     327    This happens if the exporter is called at course level in the academic
    328328    section.
    329329    """
     
    351351
    352352class StudentPaymentsExporter(grok.GlobalUtility, StudentExporterBase):
    353     """Exporter for OnlinePayment instances.
     353    """The Student Payments Exporter first filters the set of students
     354    by searching the students catalog. Then it exports student payment
     355    tickets by iterating over the items of the student's ``payments``
     356    container. If the payment period is given only tickets, which were
     357    paid in payment period, are considered for export.
    354358    """
    355359    grok.name('studentpayments')
    356360
    357     #: Fieldnames considered by this exporter
    358361    fields = tuple(
    359362        sorted(iface_names(
     
    361364            omit=['display_item']))) + (
    362365            'student_id','state','current_session')
    363 
    364     #: The title under which this exporter will be displayed
    365366    title = _(u'Student Payments')
    366367
     
    369370
    370371    def mangle_value(self, value, name, context=None):
    371         """Treat location values special.
     372        """The mangler determines the student's id, registration
     373        state and current session.
    372374        """
    373375        if context is not None:
     
    381383
    382384class DataForBursaryExporter(StudentPaymentsExporter):
    383     """Exporter for OnlinePayment instances.
     385    """The DataForBursary Exporter works just like the Student Payments Exporter
     386    but it exports much more information about the student. It combines
     387    payment and student data in one table in order to spare postprocessing of
     388    two seperate export files. The exporter is primarily used by bursary
     389    officers who have exclusively access to this exporter.
    384390    """
    385391    grok.name('bursary')
     
    388394        return get_payments(x, paid=True, **kw)
    389395
    390     #: Fieldnames considered by this exporter
    391396    fields = tuple(
    392397        sorted(iface_names(
     
    398403            'entry_session', 'entry_mode',
    399404            'faccode', 'depcode','certcode')
    400 
    401     #: The title under which this exporter will be displayed
    402405    title = _(u'Payment Data for Bursary')
    403406
    404407    def mangle_value(self, value, name, context=None):
    405         """Treat location values special.
     408        """The mangler fetches the student data.
    406409        """
    407410        if context is not None:
     
    419422
    420423class BedTicketsExporter(grok.GlobalUtility, StudentExporterBase):
    421     """Exporter for BedTicket instances.
     424    """The Bed Tickets Exporter first filters the set of students
     425    by searching the students catalog. Then it exports bed
     426    tickets by iterating over the items of the student's ``accommodation``
     427    container.
    422428    """
    423429    grok.name('bedtickets')
    424430
    425     #: Fieldnames considered by this exporter
    426431    fields = tuple(
    427432        sorted(iface_names(
     
    429434            omit=['display_coordinates']))) + (
    430435            'student_id', 'actual_bed_type')
    431 
    432     #: The title under which this exporter will be displayed
    433436    title = _(u'Bed Tickets')
    434437
     
    437440
    438441    def mangle_value(self, value, name, context=None):
    439         """Treat location values and others special.
     442        """The mangler determines the student id and the type of the bed
     443        which has been booked in the ticket.
    440444        """
    441445        if context is not None:
     
    452456
    453457class StudentPaymentsOverviewExporter(StudentExporter):
    454     """Exporter for students with payment overview.
     458    """The Student Payments Overview Exporter first filters the set of students
     459    by searching the students catalog. Then it exports some student base data
     460    together with the total school fee amount paid in each year over a
     461    predefined year range (current year - 9, ... , current year + 1).
    455462    """
    456463    grok.name('paymentsoverview')
     
    460467    year_range_tuple = tuple([str(year) for year in year_range])
    461468
    462     #: Fieldnames considered by this exporter
    463469    fields = ('student_id', 'matric_number', 'display_fullname',
    464470        'state', 'certcode', 'faccode', 'depcode', 'is_postgrad',
    465471        'current_level', 'current_session', 'current_mode',
    466472        ) + year_range_tuple
    467 
    468     #: The title under which this exporter will be displayed
    469473    title = _(u'Student Payments Overview')
    470474
    471475    def mangle_value(self, value, name, context=None):
     476        """The mangler summarizes the school fee amounts made per year. It
     477        iterates over all paid school fee payment tickets and
     478        adds together the amounts paid in a year. Waived payments
     479        are marked ``waived``.
     480        """
    472481        if name in self.year_range_tuple and context is not None:
    473482            value = 0
     
    490499
    491500class StudentStudyLevelsOverviewExporter(StudentExporter):
    492     """Exporter for students with study level overview.
     501    """The Student Study Levels Overview Exporter first filters the set of
     502    students by searching the students catalog. Then it exports some student
     503    base data together with the session key of registered levels.
     504    Sample output:
     505
     506    header: ``...100,110,120,200,210,220,300...``
     507
     508    data: ``...2010,,,2011,2012,,2013...``
     509
     510    This csv data string means that level 100 was registered in session
     511    2010/2011, level 200 in session 2011/2012, level 210 (200 on 1st probation)
     512    in session 2012/2013 and level 300 in session 2013/2014.
    493513    """
    494514    grok.name('studylevelsoverview')
     
    496516    avail_levels = tuple([str(x) for x in study_levels(None)])
    497517
    498     #: Fieldnames considered by this exporter
    499518    fields = ('student_id', ) + (
    500519        'state', 'certcode', 'faccode', 'depcode', 'is_postgrad',
    501520        'entry_session', 'current_level', 'current_session',
    502521        ) + avail_levels
    503 
    504     #: The title under which this exporter will be displayed
    505522    title = _(u'Student Study Levels Overview')
    506523
    507524    def mangle_value(self, value, name, context=None):
     525        """The mangler checks if a given level has been registered. It returns
     526        the ``level_session`` attribute of the student study level object
     527        if the named level exists.
     528        """
    508529        if name in self.avail_levels and context is not None:
    509530            value = ''
    510531            for level in context['studycourse'].values():
    511532                if level.level == int(name):
    512                     #value = '%s|%s|%s|%s' % (
    513                     #    level.level_session,
    514                     #    len(level),
    515                     #    level.validated_by,
    516                     #    level.level_verdict)
    517533                    value = '%s' % level.level_session
    518534                    break
     
    522538
    523539class ComboCardDataExporter(grok.GlobalUtility, StudentExporterBase):
    524     """Exporter for Interswitch Combo Card Data.
     540    """Like all other exporters the Combo Card Data Exporter first filters the
     541    set of students by searching the students catalog. Then it exports some
     542    student base data which are neccessary to print for the Interswitch combo
     543    card (identity card for students). The output contains a ``passport_path``
     544    column which contains the filesystem path of the passport image file.
     545    If no path is given, no passport image file exists.
    525546    """
    526547    grok.name('combocard')
    527548
    528     #: Fieldnames considered by this exporter
    529549    fields = ('display_fullname',
    530550              'student_id','matric_number',
    531551              'certificate', 'faculty', 'department', 'passport_path')
    532 
    533     #: The title under which this exporter will be displayed
    534552    title = _(u'Combo Card Data')
    535553
    536554    def mangle_value(self, value, name, context=None):
     555        """The mangler determines the titles of faculty, department
     556        and certificate. It also computes the path of passport image file
     557        stored in the filesystem.
     558        """
    537559        certificate = context['studycourse'].certificate
    538560        if name == 'certificate' and certificate is not None:
     
    543565            value = certificate.__parent__.__parent__.__parent__.longtitle
    544566        if name == 'passport_path' and certificate is not None:
    545             file_id = IFileStoreNameChooser(context).chooseName(attr='passport.jpg')
     567            file_id = IFileStoreNameChooser(context).chooseName(
     568                attr='passport.jpg')
    546569            os_path = getUtility(IExtFileStore)._pathFromFileID(file_id)
    547570            if not os.path.exists(os_path):
  • main/waeup.kofa/trunk/src/waeup/kofa/university/vocabularies.py

    r11450 r12862  
    1616## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
    1717##
    18 """Vocabularies and sources for the academics section.
     18"""Vocabularies and sources for the academic section.
    1919"""
    2020from zc.sourcefactory.basic import BasicSourceFactory
Note: See TracChangeset for help on using the changeset viewer.