Changeset 12998
- Timestamp:
- 24 May 2015, 08:23:56 (9 years ago)
- 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 29 29 30 30 Many importer fields are of type 'Choice', which means only definied 31 keywords are allowed. An overview of all sources and32 vocabularies, which feed the choices, can be also accessed fromthe33 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>`_.31 keywords (tokens) are allowed, see :ref:`schema fields <kofa_schemas>`. 32 An overview of all sources and vocabularies, which feed the 33 choices, can be also accessed from the datacenter upload page and 34 shows up in a modal window. Sources and vocabularies of the base 35 package can be viewed `here <http://kofa-demo.waeup.org/sources>`_. 36 36 37 37 Data center managers can upload any kind of CSV file from their -
main/waeup.kofa/trunk/docs/source/userdocs/students.rst
r12997 r12998 41 41 Let'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. 42 42 43 .. _kofa_interfaces: 44 43 45 .. note:: 44 46 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. 46 48 47 49 All 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. … … 50 52 :pyobject: IStudentBase 51 53 52 The first partof 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.54 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. 53 55 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. 56 The **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 70 The **third part** of the interface lists the methods which can be applied to student objects. 55 71 56 72 … … 66 82 Student Accommodation 67 83 ===================== 84 85 86 .. _zope schema: http://docs.zope.org/zope.schema -
main/waeup.kofa/trunk/src/waeup/kofa/browser/templates/source.pt
r12933 r12998 21 21 <thead> 22 22 <tr> 23 <th i18n:translate=""> Key</th>23 <th i18n:translate="">Value</th> 24 24 <th i18n:translate="">Title</th> 25 25 </tr>
Note: See TracChangeset for help on using the changeset viewer.