Ignore:
Timestamp:
24 May 2015, 08:23:56 (10 years ago)
Author:
Henrik Bettermann
Message:

More docs.

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

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/docs/source/userdocs/datacenter/import_stages.rst

    r12968 r12998  
    2929
    3030Many importer fields are of type 'Choice', which means only definied
    31 keywords are allowed. An overview of all sources and
    32 vocabularies, which feed the choices, can be also accessed from the
    33 datacenter upload page and shows up in a modal window.
    34 Sources and vocabularies of the base package can be viewed
    35 `here <http://kofa-demo.waeup.org/sources>`_.
     31keywords (tokens) are allowed, see :ref:`schema fields <kofa_schemas>`.
     32An overview of all sources and vocabularies, which feed the
     33choices, can be also accessed from the datacenter upload page and
     34shows up in a modal window. Sources and vocabularies of the base
     35package can be viewed `here <http://kofa-demo.waeup.org/sources>`_.
    3636
    3737Data center managers can upload any kind of CSV file from their
  • main/waeup.kofa/trunk/docs/source/userdocs/students.rst

    r12997 r12998  
    4141Let's talk about the attributes and methods belonging to the `Student` class, the so-called 'external behaviour' of student objects specified in Zope 'interfaces'. The data stored with each student object are subdivided into three parts: base data, personal data and clearance data. Each part has its own interface.
    4242
     43.. _kofa_interfaces:
     44
    4345.. note::
    4446
    45   **Interfaces** are one of the pillars of Zope's Component Architecture (ZCA, see also :ref:`prerequisites`). They document the 'external behaviour' of objects. In Kofa interfaces are used to specify the attributes, methods and schema fields of objects. The first two are well-known Python concepts. A Zope schema field is a bit more complicated. It's a detailed description of a field to be submitted via forms to the server, or which is processed by a batch processor. In both cases the input data are being validated against the schema. In Kofa, schema fields in interfaces are also used to automtically add `FieldProperty` attributes of the same name to most content classes. This is done by a class function called :py:func:`attrs_to_fields<waeup.kofa.utils.helpers.attrs_to_fields>` during startup. These class attributes ensure that corresponding attributes of instances of this class - when being added or changed - always meet the requirements of the schema. Another big advantage of such class attributes is, that attributes with a `FieldProperty` do not need to be set in `__init__` methods.
     47  **Interfaces** are one of the pillars of Zope's Component Architecture (ZCA, see also :ref:`prerequisites`). They document the 'external behaviour' of objects. In Kofa interfaces are used to specify the attributes, methods and schema fields of objects. The first two are well-known Python concepts. A Zope schema field is a bit more complicated. It's a detailed description of a field to be submitted via forms to the server, or which is processed by a batch processor. In both cases the input data are being validated against the schema field. In Kofa, schema fields in interfaces are also used to automtically add `FieldProperty` attributes of the same name to most content classes. This is done by a class function called :py:func:`attrs_to_fields<waeup.kofa.utils.helpers.attrs_to_fields>` during startup. These class attributes ensure that corresponding attributes of instances of this class - when being added or changed - always meet the requirements of the schema field. Another big advantage of such class attributes is, that attributes with a `FieldProperty` do not need to be set in `__init__` methods.
    4648
    4749All student classes implement `waeup.kofa.students.interfaces.IStudent` which defines a base set of attributes, schema fields and methods all students must provide. This 'behaviour' is fundamental so that we quote and explain the source code here.
     
    5052   :pyobject: IStudentBase
    5153
    52 The first part of the interface lists attributes. Except for the first two (`password` and `temp_password`) they are all read-only property attributes, i.e. attributes with a getter method only. These properties are computed dynamically and can't be set. Most of them return data derived from the ``studycourse`` subobject.
     54The **first part** of the interface lists attributes. Except for the first two (`password` and `temp_password`) they are all read-only property attributes, i.e. attributes with a getter method only. These properties are computed dynamically and can't be set. Most of them return data derived from the ``studycourse`` subobject.
    5355
    54 The second part of the interface specifies the schema fields, which are instances of schema classes with their `title`, `description`, `default`, `required`, `readonly` and `source` attributes.
     56The **second part** of the interface specifies the schema fields
     57
     58.. _kofa_schemas:
     59
     60.. note::
     61
     62  **Schema fields** are instances of schema field classes with `title`, `description`, `default`, `required`, `readonly` attributes. Class names and class attributes are self-explanatory and described in the `Zope Schema`_ documentation.
     63
     64  A very powerful Zope Schema field is `Choice`. Choice fields 'are constrained to values drawn from a specified set, which can be static or dynamic'. This set can be a simple list of choices (= `values`), or a `vocabulary` or `source` which produce dynamic choices.
     65
     66  **Vocabularies and sources** are very similar. The latter is a newer concept of producing choices and considered to replace vocabularies. In Kofa we are using both. Common to both is that a set of values is accompanied by a user-friendly title, which is displayed on pages (e.g. in select boxes) instead of a less informative value token or even a cryptic representation of a persistent value object. In most cases we have a token-title pair which perfectly describes the values of a source or a vocabulary. The tokens are being sent in forms or imported by batch processors.
     67
     68  **Token-title pairs** of most (non-database-dependent) sources and vocabularies of the Kofa base package can be viewed `here <http://kofa-demo.waeup.org/sources>`_.
     69
     70The **third part** of the interface lists the methods which can be applied to student objects.
    5571
    5672
     
    6682Student Accommodation
    6783=====================
     84
     85
     86.. _zope schema: http://docs.zope.org/zope.schema
  • main/waeup.kofa/trunk/src/waeup/kofa/browser/templates/source.pt

    r12933 r12998  
    2121        <thead>
    2222          <tr>
    23             <th i18n:translate="">Key</th>
     23            <th i18n:translate="">Value</th>
    2424            <th i18n:translate="">Title</th>
    2525          </tr>
Note: See TracChangeset for help on using the changeset viewer.