Index: /main/waeup.kofa/trunk/src/waeup/kofa/doctests/certcourses.txt
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/doctests/certcourses.txt	(revision 12949)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/doctests/certcourses.txt	(revision 12949)
@@ -0,0 +1,221 @@
+.. _removecertificatecourses:
+
+Persistence of Certificate Courses
+==================================
+
+If a certificate course requires a certain course and this is course
+is deleted, also the referring certificate course is deleted.
+
+We setup a data structure that reflects typical usage. It looks like
+this::
+
+    Department-Instance
+    |
+    +---> courses
+    |        |
+    |        +--------------------> Course-Instance
+    |                                        ^
+    +---> certificates                       |
+             |                               |
+             +-----> Certificate-Instance    |
+                        |                    |
+                        +------> Certificate-Course
+
+The Certifcate Course here refers to a Course instance.
+
+In Python we build such a structure like this (from top to bottom):
+
+    >>> from zope.component import createObject
+    >>> mydept = createObject('waeup.Department')
+
+In real world use this data will be stored in a ZODB. We setup our own
+litte ZODB backend (which is easy!):
+
+    >>> from ZODB import FileStorage, DB
+    >>> dbpath = 'tinyData.fs'
+    >>> class TinyZODB(object):
+    ...   def __init__(self, path=dbpath):
+    ...     self.storage = FileStorage.FileStorage(path)
+    ...     self.db = DB(self.storage)
+    ...     self.connection = self.db.open()
+    ...     self.dbroot = self.connection.root()
+    ...   def close(self):
+    ...     self.connection.close()
+    ...     self.db.close()
+    ...     self.storage.close()
+
+Now we can use this ZODB as backend database and store our data
+structure:
+
+    >>> import transaction
+    >>> db = TinyZODB()
+    >>> dbroot = db.dbroot
+    >>> dbroot['mydept'] = mydept
+    >>> mycourse = createObject('waeup.Course')
+    >>> mycourse.code = 'MYCOURSE'
+    >>> mydept.courses.addCourse(mycourse)
+    >>> mycert = createObject('waeup.Certificate')
+    >>> mycert.code = 'MYCERT'
+    >>> mydept.certificates.addCertificate(mycert)
+    >>> mycert.addCertCourse(mycourse)
+
+    >>> transaction.commit()
+
+The data is now stored in the ZODB. We can close the DB, reopen it
+later and the data will still be there:
+
+    >>> db.close()
+    >>> newdb = TinyZODB()
+    >>> newdbroot = newdb.dbroot
+    >>> list(newdbroot)
+    ['mydept']
+
+The certificate course we stored in the certificate is indeed a
+referrer of the course, not a copy of it:
+
+    >>> course = newdbroot['mydept'].courses['MYCOURSE']
+    >>> certcourse = newdbroot['mydept'].certificates['MYCERT']['MYCOURSE_100']
+    >>> certcourse.course is course
+    True
+
+So, we can be sure that modifications to the course are immediately
+reflected in the certcourse.
+
+We can also be sure, that when removing courses or referrers of them,
+other data will be handled in a way we expect. That is,
+
+* when we remove a course, we want all referrers to it be removed as
+  well
+
+* when we remove a referrer of a course, nothing else should be
+  touched but only this very referrer.
+
+
+As correct deletion of referrer needs support of catalogs (we lookup
+catalogs to find referrers), we need a fully blown ZODB here,
+including an instance of :class:`waeup.kofa.app.University`, as this is our
+`ISite` object where the catalogs are stored.
+
+We create a complete university tree, starting with a
+:class:`University` instance and going down to courses, certificats
+and course certificates:
+
+    >>> from waeup.kofa.app import University
+    >>> root = getRootFolder()
+    >>> root['app'] = University()
+
+We have to set the site, to enable proper working of catalogs and
+`IObjectRemoved` handlers:
+
+    >>> from zope.app.component.hooks import setSite
+    >>> setSite(root['app'])
+
+    >>> from zope.component import createObject
+    >>> faculty = createObject('waeup.Faculty')
+    >>> faculty.code = 'FAC'
+    >>> root['app']['faculties'].addFaculty(faculty)
+    >>> fac = root['app']['faculties']['FAC']
+
+    >>> dept = createObject('waeup.Department')
+    >>> dept.code = 'DEPT'
+    >>> root['app']['faculties']['FAC'].addDepartment(dept)
+
+    >>> course = createObject('waeup.Course')
+    >>> course.code = 'CRS1'
+    >>> fac['DEPT'].courses.addCourse(course)
+
+Now let's add another department, which will also hold a course:
+
+    >>> dept2 = createObject('waeup.Department')
+    >>> dept2.code = 'DEPT2'
+    >>> root['app']['faculties']['FAC'].addDepartment(dept2)
+
+    >>> course = createObject('waeup.Course')
+    >>> course.code = 'CRS2'
+    >>> fac['DEPT2'].courses.addCourse(course)
+
+Finally, we add a certificate with referrers (certificate courses) to
+the created courses:
+
+    >>> cert = createObject('waeup.Certificate')
+    >>> cert.code = 'CERT'
+    >>> fac['DEPT'].certificates.addCertificate(cert)
+
+    >>> fac['DEPT'].certificates['CERT'].addCertCourse(
+    ...   fac['DEPT'].courses['CRS1'])
+
+    >>> fac['DEPT'].certificates['CERT'].addCertCourse(
+    ...   fac['DEPT2'].courses['CRS2'])
+
+We add the latter course again, but this time for the second level:
+
+    >>> fac['DEPT'].certificates['CERT'].addCertCourse(
+    ...   fac['DEPT2'].courses['CRS2'], level=200)
+
+So, we have three referrers in our certificate of two different
+courses stored somewhere in the application:
+
+    >>> list(fac['DEPT'].certificates['CERT'])
+    [u'CRS1_100', u'CRS2_100', u'CRS2_200']
+
+Both, the courses themselves and the referrers of them, are the same
+(not only equal):
+
+    >>> a = root['app']['faculties']['FAC']['DEPT']
+    >>> b1 = a.courses['CRS1']
+    >>> b2 = a.certificates['CERT']['CRS1_100'].course
+    >>> b1 is b2
+    True
+
+If we remove the course, also the select item in the certificate course
+will be gone:
+
+    >>> list(a.certificates['CERT'])
+    [u'CRS1_100', u'CRS2_100', u'CRS2_200']
+
+    >>> list(a.courses)
+    [u'CRS1']
+
+    >>> del root['app']['faculties']['FAC']['DEPT'].courses['CRS1']
+    >>> list(a.certificates['CERT'])
+    [u'CRS2_100', u'CRS2_200']
+
+    >>> list(a.courses)
+    []
+
+If we remove a referrer of a course, this will not touch the course
+nor other referrers:
+
+    >>> del fac['DEPT'].certificates['CERT']['CRS2_200']
+    >>> list(a.certificates['CERT'])
+    [u'CRS2_100']
+
+    >>> list(fac['DEPT2'].courses)
+    [u'CRS2']
+
+If a single course is registered for several levels in a single
+certificate, this will not block things if the course is removed
+(regression test):
+
+We add the same course as a reference for level 200 and level 300:
+
+    >>> fac['DEPT'].certificates['CERT'].addCertCourse(
+    ...   fac['DEPT2'].courses['CRS2'], level=200)
+    >>> fac['DEPT'].certificates['CERT'].addCertCourse(
+    ...   fac['DEPT2'].courses['CRS2'], level=300)
+
+Deleting the course (thus also the refererrers) will work:
+
+    >>> del root['app']['faculties']['FAC']['DEPT2'].courses['CRS2']
+
+Now all references are gone:
+
+    >>> list(a.certificates['CERT'])
+    []
+
+and also the course itself vanished:
+
+    >>> list(fac['DEPT2'].courses)
+    []
+
+
Index: /main/waeup.kofa/trunk/src/waeup/kofa/doctests/certificate.txt
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/doctests/certificate.txt	(revision 12949)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/doctests/certificate.txt	(revision 12949)
@@ -0,0 +1,259 @@
+Certificates and Certificate Courses
+************************************
+
+.. module:: waeup.kofa.university.certificate
+
+Components that represent and manage certificates.
+
+.. :doctest:
+.. :layer: waeup.kofa.testing.KofaUnitTestLayer
+
+
+Content Classes (models and containers)
+=======================================
+
+
+:class:`Certificate`
+--------------------
+
+.. class:: Certificate([code=u'NA',[ title=u'Unnamed Certificate',[ study_mode=None,[ start_level=None,[ end_level=None,[ application_category=None,[ m_prefix=u'']]]]]]])
+
+   Create a certificate object with the given parameters.
+
+   .. attribute:: grok.implements(ICertificate)
+
+   All parameters are optional:
+
+     >>> from waeup.kofa.university.certificate import Certificate
+     >>> mycertificate = Certificate()
+
+   Certificates have the attributes required by the `ICertificate` interface:
+
+     >>> from waeup.kofa.university.interfaces import ICertificate
+     >>> ICertificate.providedBy(mycertificate)
+     True
+
+     >>> from zope.interface.verify import verifyObject
+     >>> verifyObject(ICertificate, mycertificate)
+     True
+
+   Beside the attributes, certificates are containers for
+   certificate-courses (see :class:`CertificateCourse`). Each
+   certificate course can be accessed by the code of the course it wraps.
+
+   .. attribute:: title
+
+      Each certificate has a title:
+
+        >>> mycertificate.title
+        u'Unnamed Certificate'
+
+   .. attribute:: code
+
+      Each certificate holds a code, which might be a shortcut or
+      abbreviation of the real certificate name. By default the code
+      is ``NA`` (=not assigned):
+
+        >>> mycertificate.code
+        u'NA'
+
+
+   .. attribute:: study_mode
+
+      Each :class:`Certificate` instance has a study mode:
+
+        >>> print mycertificate.study_mode
+        None
+
+      .. XXX: This is not a proper description
+
+   .. attribute:: start_level
+
+      Each :class:`Certificate` instance has a start level:
+
+        >>> print mycertificate.start_level
+        None
+
+      .. XXX: This is not a proper description
+
+   .. attribute:: end_level
+
+      Each :class:`Certificate` instance has a end level:
+
+        >>> print mycertificate.end_level
+        None
+
+      .. XXX: This is not a proper description
+   
+
+   .. attribute:: application_category
+
+      Each :class:`Certificate` instance has an application category:
+
+        >>> print mycertificate.application_category
+        None
+
+      .. XXX: This is not a proper description
+
+   .. method:: addCertCourse(course[, level=100,[ mandatory=True]])
+
+      Add a certificate course. A course is an object implementing
+      :class:`waeup.kofa.interfaces.ICourse`.
+
+      Please don't be confused by the term 'certificate course'.
+      As course objects will normaly be  stored
+      in a department, the certificate course refers to
+      the 'real' course in the department container.
+
+   .. method:: delCertCourses(code)
+
+      Remove a certificate course from a certificate.
+
+      The certificate course must be given by its code number.
+
+:class:`CertificateCourse`
+--------------------------
+
+.. class:: CertificateCourse(course[, level=100[, mandatory=True]])
+
+   Create a certificate course.
+
+   A certificate course are held in
+   certificates and refer to an existing :class:`Course` instance held
+   elsewhere.
+
+   A certificate can require several certificate courses and one
+   certificate course can be required by several certificates.
+
+   .. attribute:: course
+
+      An instance of :class:`ICourse`.
+
+   .. attribute:: level
+
+      An integer telling the level to which this course applies.
+
+   .. attribute:: mandatory
+
+      A bool stating whether this course is required or optional to
+      get the certificate.
+
+
+
+Utilities
+=========
+
+:class:`CertificateFactory`
+---------------------------
+
+.. class:: CertificateFactory()
+
+   .. attribute:: grok.name(u'waeup.Certificate')
+
+   .. attribute:: grok.implements(IFactory)
+
+   A named utility to deliver new instances of :class:`Certificate`
+   without the need to import the implementation before:
+
+     >>> from zope.component import createObject
+     >>> mycertificate = createObject(u'waeup.Certificate')
+     >>> mycertificate
+     <waeup.kofa.university.certificate.Certificate object at 0x...>
+
+   The factory complies with the specifications from the
+   :class:`IFactory` insterface:
+
+     >>> from zope.interface.verify import verifyClass
+     >>> from zope.component.interfaces import IFactory
+     >>> from waeup.kofa.university.certificate import CertificateFactory
+     >>> verifyClass(IFactory, CertificateFactory)
+     True
+
+   This means also, that we can get the interfaces of the created
+   object from the factory:
+
+     >>> certificate_factory = CertificateFactory()
+     >>> certificate_factory.getInterfaces()
+     <implementedBy waeup.kofa.university.certificate.Certificate>
+
+
+:class:`CertificateCourseFactory`
+---------------------------------
+
+.. class:: CertificateCourseFactory()
+
+   .. attribute:: grok.name(u'waeup.CertificateCourse')
+
+   .. attribute:: grok.implements(IFactory)
+
+   A named utility to deliver new instances of :class:`CertificateCourse`
+   without the need to import the implementation before:
+
+     >>> from zope.component import createObject
+     >>> mycertificatecourse = createObject(u'waeup.CertificateCourse')
+     >>> mycertificatecourse
+     <waeup.kofa.university.certificate.CertificateCourse object at 0x...>
+
+   The factory complies with the specifications from the
+   :class:`IFactory` insterface:
+
+     >>> from zope.interface.verify import verifyClass
+     >>> from zope.component.interfaces import IFactory
+     >>> from waeup.kofa.university.certificate import CertificateCourseFactory
+     >>> verifyClass(IFactory, CertificateCourseFactory)
+     True
+
+   This means also, that we can get the interfaces of the created
+   object from the factory:
+
+     >>> certcourse_factory = CertificateCourseFactory()
+     >>> certcourse_factory.getInterfaces()
+     <implementedBy waeup.kofa.university.certificate.CertificateCourse>
+
+
+Examples
+========
+
+Certificates
+------------
+
+We can create certificates:
+
+    >>> from waeup.kofa.university.certificate import Certificate
+    >>> mycertificate = Certificate()
+    >>> mycertificate
+    <waeup.kofa.university.certificate.Certificate object at 0x...>
+
+Another way to create certificates is by asking for a factory called
+``waeup.Certificate``. This way we can create a factory without
+importing a class:
+
+    >>> from zope.component import createObject
+    >>> mycertificate = createObject(u'waeup.Certificate')
+    >>> mycertificate
+    <waeup.kofa.university.certificate.Certificate object at 0x...>
+
+Certificate Courses
+-------------------
+
+:class:`CertificateCourse` instances comply with the
+:class:`ICertificateCourse` interface:
+
+    >>> from waeup.kofa.university.interfaces import ICertificateCourse
+    >>> from waeup.kofa.university.certificate import CertificateCourse
+    >>> mycertcourse = CertificateCourse(None, 200, False)
+    >>> ICertificateCourse.providedBy(mycertcourse)
+    True
+
+    >>> from zope.interface.verify import verifyObject
+    >>> verifyObject(ICertificateCourse, mycertcourse)
+    True
+
+Also instances of :class:`CertificateCourse` can be created by asking
+the component architechture:
+
+    >>> from zope.component import createObject
+    >>> mycertcourse = createObject(u'waeup.CertificateCourse')
+    >>> mycertcourse
+    <waeup.kofa.university.certificate.CertificateCourse object at 0x...>
+
Index: /main/waeup.kofa/trunk/src/waeup/kofa/doctests/certificatescontainer.txt
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/doctests/certificatescontainer.txt	(revision 12949)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/doctests/certificatescontainer.txt	(revision 12949)
@@ -0,0 +1,147 @@
+:mod:`waeup.kofa.university.certificatescontainer` -- Certificate containers
+****************************************************************************
+
+.. module:: waeup.kofa.university.certificatescontainer
+
+Containers for certificates.
+
+.. :doctest:
+.. :layer: waeup.kofa.testing.KofaUnitTestLayer
+
+
+Content Classes (models and containers)
+=======================================
+
+:class:`CertificatesContainer`
+------------------------------
+
+.. class:: CertificatesContainer()
+
+   Create a certificate container instance.
+
+   .. attribute:: grok.implements(ICertificatesContainer)
+
+   :class:`CertificatesContainer` instances are instances of
+   :class:`grok.Container` that hold and manage instances of
+   :class:`waeup.kofa.university.certificate.Certificate`.
+
+     >>> from waeup.kofa.university.certificatescontainer import CertificatesContainer
+     >>> mycontainer = CertificatesContainer()
+     >>> mycontainer
+     <waeup.kofa.university.certificatescontainer.CertificatesContainer object at 0x...>
+
+   Certificate containers provide `ICertificatesContainer`:
+
+     >>> from waeup.kofa.university.interfaces import ICertificatesContainer
+     >>> ICertificatesContainer.providedBy(mycontainer)
+     True
+
+   We can be sure, that the full interface is supported by the
+   CertificatesContainer class:
+
+     >>> from zope.interface.verify import verifyClass
+     >>> verifyClass(ICertificatesContainer, CertificatesContainer)
+     True
+
+   As normal ``grok.Container``, :class:`CertificatesContainer` instances
+   can be used like dicts:
+
+     >>> list(mycontainer.keys())
+     []
+
+   .. method:: addCertificate(certificate)
+
+      Add a certificate.
+
+      *certificate* must be an instance of
+      :class:`waeup.kofa.university.certificate.Certificate`:
+
+        >>> from waeup.kofa.university.certificatescontainer import (
+        ...   CertificatesContainer)
+        >>> mycontainer = CertificatesContainer()
+        >>> mycontainer.addCertificate('blah')
+        Traceback (most recent call last):
+        ...
+        TypeError: CertificatesContainers contain only ICertificate instances
+
+      The key of added items is the ``code`` attribute:
+
+        >>> from waeup.kofa.university.certificate import Certificate
+        >>> mycertificate = Certificate(code='CERTIFICATE1')
+        >>> mycontainer.addCertificate(mycertificate)
+        >>> list(mycontainer.keys())
+        [u'CERTIFICATE1']
+
+   .. method:: clear()
+
+      Remove all contained certificates:
+
+        >>> len(mycontainer.items())
+        1
+
+        >>> mycontainer.clear()
+        >>> len(mycontainer.items())
+        0
+
+Utilities
+=========
+
+:class:`CertificatesContainerFactory`
+-------------------------------------
+
+.. class:: CertificatesContainerFactory()
+
+   .. attribute:: grok.name(u'waeup.CertificatesContainer')
+
+   .. attribute:: grok.implements(IFactory)
+
+   A named utility to deliver new instances of :class:`CertificatesContainer`
+   without the need to import the implementation before:
+
+     >>> from zope.component import createObject
+     >>> mycertificatescontainer = createObject(u'waeup.CertificatesContainer')
+     >>> mycertificatescontainer
+     <waeup.kofa.university.certificatescontainer.CertificatesContainer object at 0x...>
+
+   The factory complies with the specifications from the
+   :class:`IFactory` insterface:
+
+     >>> from zope.interface.verify import verifyClass
+     >>> from zope.component.interfaces import IFactory
+     >>> from waeup.kofa.university.certificatescontainer import (
+     ...   CertificatesContainerFactory)
+     >>> verifyClass(IFactory, CertificatesContainerFactory)
+     True
+
+   This means also, that we can get the interfaces of the created
+   object from the factory:
+
+     >>> certificatescontainer_factory = CertificatesContainerFactory()
+     >>> certificatescontainer_factory.getInterfaces()
+     <implementedBy waeup.kofa.university.certificatescontainer.CertificatesContainer>
+
+
+Examples
+========
+
+Getting a certificate container
+-------------------------------
+
+We can easily create `CertificatesContainers`:
+
+    >>> from waeup.kofa.university.certificatescontainer import CertificatesContainer
+    >>> mycontainer = CertificatesContainer()
+
+
+Another way to get a certificate container -- without importing the
+class -- is via factories. We registered a factory for certificate
+containers under the name ``waeup.CertificatesContainer``. Now we can
+ask for an object by calling the appropriate factory:
+
+    >>> from zope.component import createObject
+    >>> createObject(u'waeup.CertificatesContainer')
+    <waeup.kofa.university.certificatescontainer.CertificatesContainer object at 0x...>
+
+This way we get a thing that implements ICertificatesContainer without
+imports or similar.
+
Index: /main/waeup.kofa/trunk/src/waeup/kofa/doctests/course.txt
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/doctests/course.txt	(revision 12949)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/doctests/course.txt	(revision 12949)
@@ -0,0 +1,143 @@
+:mod:`waeup.kofa.university.course` -- Courses
+**********************************************
+
+.. module:: waeup.kofa.university.course
+
+Components that represent courses.
+
+.. :doctest:
+.. :layer: waeup.kofa.testing.KofaUnitTestLayer
+
+Content Classes (models and containers)
+=======================================
+
+:class:`Course`
+---------------
+
+.. class:: Course([code=u'NA'[, title=u'Unnamed Course'[, credits=0[, passmark=40[, semester=1]]]]]])
+
+   Create a course instance with the given parameters.
+
+   .. attribute:: grok.implements(ICourse)
+
+   All parameters are optional:
+
+     >>> from waeup.kofa.university.course import Course
+     >>> mycourse = Course()
+     >>> mycourse
+     <waeup.kofa.university.course.Course object at 0x...>
+
+   Course instances have the attributes required by the
+   :class:`waeup.kofa.interfaces.ICourse` interface:
+
+     >>> from waeup.kofa.university.interfaces import ICourse
+     >>> ICourse.providedBy(mycourse)
+     True
+
+     >>> from zope.interface.verify import verifyObject
+     >>> verifyObject(ICourse, mycourse)
+     True
+
+   .. attribute:: title
+
+      Each course has a title:
+
+        >>> mycourse.title
+        u'Unnamed Course'
+
+   .. attribute:: code
+
+      Each course holds a code, which might be a shortcut or
+      abbreviation of the real course name. By default the code is
+      ``NA`` (=not assigned).
+
+      This value has to be unique if used in a :class:`Department`
+      instance as it serves as a key:
+
+        >>> mycourse.code
+        u'NA'
+
+   .. attribute:: passmark
+
+      Each course holdes a passmark, which is ``40`` by default:
+
+        >>> mycourse.passmark
+        40
+
+   .. attribute:: semester
+
+      Each course holds a semester attribute which is ``1`` by
+      default:
+
+        >>> mycourse.semester
+        1
+
+   .. attribute:: credits
+
+      Each course holds the number of credits that can be
+      earned. Default is ``0``.
+
+        >>> mycourse.credits
+        0
+
+
+
+Utilities
+=========
+
+:class:`CourseFactory`
+---------------------------
+
+.. class:: CourseFactory()
+
+   .. attribute:: grok.name(u'waeup.Course')
+
+   .. attribute:: grok.implements(IFactory)
+
+   A named utility to deliver new instances of :class:`Course`
+   without the need to import the implementation before:
+
+     >>> from zope.component import createObject
+     >>> mycourse = createObject(u'waeup.Course')
+     >>> mycourse
+     <waeup.kofa.university.course.Course object at 0x...>
+
+   The factory complies with the specifications from the
+   :class:`IFactory` insterface:
+
+     >>> from zope.interface.verify import verifyClass
+     >>> from zope.component.interfaces import IFactory
+     >>> from waeup.kofa.university.course import CourseFactory
+     >>> verifyClass(IFactory, CourseFactory)
+     True
+
+   This means also, that we can get the interfaces of the created
+   object from the factory:
+
+     >>> course_factory = CourseFactory()
+     >>> course_factory.getInterfaces()
+     <implementedBy waeup.kofa.university.course.Course>
+
+Examples
+========
+
+Creating courses
+----------------
+
+The simplest way to create a :class:`Course` instance is to import the
+class and calling the constructor:
+
+    >>> from waeup.kofa.university.course import Course
+    >>> mycourse = Course()
+    >>> mycourse
+    <waeup.kofa.university.course.Course object at 0x...>
+
+Another way to create courses is by asking for a factory called
+``waeup.Course``. This way we can create a factory without importing a
+class:
+
+    >>> from zope.component import createObject
+    >>> mycourse = createObject(u'waeup.Course')
+    >>> mycourse
+    <waeup.kofa.university.course.Course object at 0x...>
+
Index: /main/waeup.kofa/trunk/src/waeup/kofa/doctests/coursescontainer.txt
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/doctests/coursescontainer.txt	(revision 12949)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/doctests/coursescontainer.txt	(revision 12949)
@@ -0,0 +1,145 @@
+:mod:`waeup.kofa.university.coursescontainer` -- Course containers
+******************************************************************
+
+.. module:: waeup.kofa.university.coursescontainer
+
+Containers for courses.
+
+.. :doctest:
+.. :layer: waeup.kofa.testing.KofaUnitTestLayer
+
+
+Content Classes (models and containers)
+=======================================
+
+:class:`CoursesContainer`
+-------------------------
+
+.. class:: CoursesContainer()
+
+   Create a course container instance.
+
+   .. attribute:: grok.implements(ICoursesContainer)
+
+   :class:`CoursesContainer` instances are instances of
+   :class:`grok.Container` that hold and manage instances of
+   :class:`waeup.kofa.university.course.Course`.
+
+     >>> from waeup.kofa.university.coursescontainer import CoursesContainer
+     >>> mycontainer = CoursesContainer()
+     >>> mycontainer
+     <waeup.kofa.university.coursescontainer.CoursesContainer object at 0x...>
+
+   Course containers provide `ICoursesContainer`:
+
+     >>> from waeup.kofa.university.interfaces import ICoursesContainer
+     >>> ICoursesContainer.providedBy(mycontainer)
+     True
+
+   We can be sure, that the full interface is supported by the
+   CoursesContainer class:
+
+     >>> from zope.interface.verify import verifyClass
+     >>> verifyClass(ICoursesContainer, CoursesContainer)
+     True
+
+   As normal ``grok.Container``, :class:`CoursesContainer` instances
+   can be used like dicts:
+
+     >>> list(mycontainer.keys())
+     []
+
+   .. method:: addCourse(course)
+
+      Add a course.
+
+      *course* must be an instance of
+      :class:`waeup.kofa.university.course.Course`:
+
+        >>> from waeup.kofa.university.coursescontainer import CoursesContainer
+        >>> mycontainer = CoursesContainer()
+        >>> mycontainer.addCourse('blah')
+        Traceback (most recent call last):
+        ...
+        TypeError: CoursesContainers contain only ICourse instances
+
+      The key of added items is the ``code`` attribute:
+
+        >>> from waeup.kofa.university.course import Course
+        >>> mycourse = Course(code='COURSE1')
+        >>> mycontainer.addCourse(mycourse)
+        >>> list(mycontainer.keys())
+        [u'COURSE1']
+
+   .. method:: clear()
+
+      Remove all contained courses:
+
+        >>> len(mycontainer.items())
+        1
+
+        >>> mycontainer.clear()
+        >>> len(mycontainer.items())
+        0
+
+Utilities
+=========
+
+:class:`CoursesContainerFactory`
+--------------------------------
+
+.. class:: CoursesContainerFactory()
+
+   .. attribute:: grok.name(u'waeup.CoursesContainer')
+
+   .. attribute:: grok.implements(IFactory)
+
+   A named utility to deliver new instances of :class:`CoursesContainer`
+   without the need to import the implementation before:
+
+     >>> from zope.component import createObject
+     >>> mycoursescontainer = createObject(u'waeup.CoursesContainer')
+     >>> mycoursescontainer
+     <waeup.kofa.university.coursescontainer.CoursesContainer object at 0x...>
+
+   The factory complies with the specifications from the
+   :class:`IFactory` insterface:
+
+     >>> from zope.interface.verify import verifyClass
+     >>> from zope.component.interfaces import IFactory
+     >>> from waeup.kofa.university.coursescontainer import CoursesContainerFactory
+     >>> verifyClass(IFactory, CoursesContainerFactory)
+     True
+
+   This means also, that we can get the interfaces of the created
+   object from the factory:
+
+     >>> coursescontainer_factory = CoursesContainerFactory()
+     >>> coursescontainer_factory.getInterfaces()
+     <implementedBy waeup.kofa.university.coursescontainer.CoursesContainer>
+
+
+Examples
+========
+
+Getting a course container
+--------------------------
+
+We can easily create `CoursesContainers`:
+
+    >>> from waeup.kofa.university.coursescontainer import CoursesContainer
+    >>> mycontainer = CoursesContainer()
+
+
+Another way to get a course container -- without importing the class
+-- is via factories. We registered a factory for course containers
+under the name ``waeup.CoursesContainer``. Now we can ask for an object
+by calling the appropriate factory:
+
+    >>> from zope.component import createObject
+    >>> createObject(u'waeup.CoursesContainer')
+    <waeup.kofa.university.coursescontainer.CoursesContainer object at 0x...>
+
+This way we get a thing that implements ICoursesContainer without
+imports or similar.
+
Index: /main/waeup.kofa/trunk/src/waeup/kofa/doctests/department.txt
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/doctests/department.txt	(revision 12949)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/doctests/department.txt	(revision 12949)
@@ -0,0 +1,135 @@
+:mod:`waeup.kofa.university.department` -- Departments
+******************************************************
+
+.. module:: waeup.kofa.university.department
+
+Components that represent university departments.
+
+.. :doctest:
+.. :layer: waeup.kofa.testing.KofaUnitTestLayer
+
+Content Classes (models and containers)
+=======================================
+
+
+:class:`Department`
+-------------------
+
+.. class:: Department(title=u'Unnamed Department'[, title_prefix=u'department' [, code=u"NA"]])
+
+   Create a representation of a university department:
+
+     >>> from waeup.kofa.university.department import Department
+     >>> mydept = Department()
+     >>> mydept
+     <waeup.kofa.university.department.Department object at 0x...>
+
+   Another way to create :class:`Department` instances is by asking
+   for a factory called ``waeup.kofa.Department``. This way we can create a
+   department without importing a class:
+
+     >>> from zope.component import createObject
+     >>> mydept = createObject(u'waeup.Department')
+     >>> mydept
+     <waeup.kofa.university.department.Department object at 0x...>
+
+   :class:`Department` instances have the attributes required by the
+   `IDepartment` interface:
+
+     >>> from waeup.kofa.university.interfaces import IDepartment
+     >>> IDepartment.providedBy(mydept)
+     True
+
+     >>> from zope.interface.verify import verifyObject
+     >>> verifyObject(IDepartment, mydept)
+     True
+
+
+   .. attribute:: title
+
+      (string) The title of a department.
+
+      Each department has a title:
+
+        >>> mydept.title
+        u'Unnamed Department'
+
+
+   .. attribute:: title_prefix
+
+      (string) The prefix of a department.
+
+      Each department has a title prefix, which specifies the kind of
+      institution:
+
+        >>> mydept.title_prefix
+        u'department'
+
+
+   .. attribute:: code
+
+      (string) An internally used unique code string.
+
+      Each department holds a code, which might be a shortcut or
+      abbreviation of the real department name. By default the code is
+      ``NA`` (=not assigned):
+
+        >>> mydept.code
+        u'NA'
+
+
+   .. attribute:: courses
+
+      (ICoursesContainer instance) A container for courses.
+
+      Each department has a courses container:
+
+        >>> mydept.courses
+        <waeup.kofa.university.coursescontainer.CoursesContainer object at 0x...>
+
+
+   .. attribute:: certificates
+
+      (ICertificatesContainer instance) A container for certificates.
+
+      Each department has a certificate container, that holds the
+      descrtiptions of certificates the department has:
+
+        >>> mydept.certificates
+        <waeup.kofa...certificatescontainer.CertificatesContainer object at 0x...>
+
+Utilities
+=========
+
+:class:`DepartmentFactory`
+--------------------------
+
+.. class:: DepartmentFactory()
+
+   .. attribute:: grok.name(u'waeup.Department')
+
+   .. attribute:: grok.implements(IFactory)
+
+   A named utility to deliver new instances of :class:`Department`
+   without the need to import the implementation before:
+
+     >>> from zope.component import createObject
+     >>> mydepartment = createObject(u'waeup.Department')
+     >>> mydepartment
+     <waeup.kofa.university.department.Department object at 0x...>
+
+   The factory complies with the specifications from the
+   :class:`IFactory` insterface:
+
+     >>> from zope.interface.verify import verifyClass
+     >>> from zope.component.interfaces import IFactory
+     >>> from waeup.kofa.university.department import DepartmentFactory
+     >>> verifyClass(IFactory, DepartmentFactory)
+     True
+
+   This means also, that we can get the interfaces of the created
+   object from the factory:
+
+     >>> department_factory = DepartmentFactory()
+     >>> department_factory.getInterfaces()
+     <implementedBy waeup.kofa.university.department.Department>
Index: /main/waeup.kofa/trunk/src/waeup/kofa/doctests/facultiescontainer.txt
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/doctests/facultiescontainer.txt	(revision 12949)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/doctests/facultiescontainer.txt	(revision 12949)
@@ -0,0 +1,178 @@
+:mod:`waeup.kofa.university.facultiescontainer` -- Faculty Containers
+*********************************************************************
+
+.. module:: waeup.kofa.university.facultiescontainer
+
+Components that represent faculty containers.
+
+.. :doctest:
+.. :layer: waeup.kofa.testing.KofaUnitTestLayer
+
+
+Content Classes (models and containers)
+=======================================
+
+:class:`FacultiesContainer`
+---------------------------
+
+.. class:: FacultiesContainer()
+
+   Create a faculty container:
+
+     >>> from waeup.kofa.university.facultiescontainer import FacultiesContainer
+     >>> mycontainer = FacultiesContainer()
+     >>> mycontainer
+     <waeup.kofa.university.facultiescontainer.FacultiesContainer object at 0x...>
+
+   Another way to create :class:`FacultiesContainer` instances is by asking
+   for a factory called ``waeup.FacultiesContainer``. This way we can create a
+   faculty without importing a class:
+
+     >>> from zope.component import createObject
+     >>> mycontainer = createObject(u'waeup.FacultiesContainer')
+     >>> mycontainer
+     <waeup.kofa.university.facultiescontainer.FacultiesContainer object at 0x...>
+
+   :class:`FacultiesContainer` instances have the attributes required by the
+   `IFacultiesContainer` interface:
+
+     >>> from waeup.kofa.university.interfaces import IFacultiesContainer
+     >>> IFacultiesContainer.providedBy(mycontainer)
+     True
+
+     >>> from zope.interface.verify import verifyObject
+     >>> verifyObject(IFacultiesContainer, mycontainer)
+     True
+
+   .. method:: addFaculty(faculty)
+
+      Add a faculty into this container. Added objects are checked and
+      only `IFaculty` objects accepted:
+
+        >>> mycontainer.addFaculty(object())
+        Traceback (most recent call last):
+        ...
+        TypeError: FacultiesContainers contain only IFaculty instances
+
+        >>> list(mycontainer.values())
+        []
+
+      Regular faculties are accepted:
+
+        >>> from waeup.kofa.university.faculty import Faculty
+        >>> mycontainer.addFaculty(Faculty(title='Physics',
+        ...                                code='FP'))
+
+        >>> list(mycontainer.items())
+        [(u'FP', <waeup.kofa.university.faculty.Faculty object at 0x...>)]
+
+
+
+Utilities
+=========
+
+:class:`AcademicsPlugin`
+------------------------
+
+.. class:: AcademicsPlugin()
+
+   .. attribute:: grok.implements(IKofaPluggable)
+
+   This plugin component tells under which name (``faculties``) an
+   instance of academics stuff should be created in plain Kofa
+   instances. It also tells the factory name for FacultiesContainer
+   instances, which serve as root object for academics stuff in Kofa apps.
+
+
+:class:`FacultiesContainerFactory`
+----------------------------------
+
+.. class:: FacultiesContainerFactory()
+
+   .. attribute:: grok.name(u'waeup.FacultiesContainer')
+
+   .. attribute:: grok.implements(IFactoryContainer)
+
+   A named utility to deliver new instances of :class:`FacultiesContainer`
+   without the need to import the implementation before:
+
+     >>> from zope.component import createObject
+     >>> mycontainer = createObject(u'waeup.FacultiesContainer')
+     >>> mycontainer
+     <waeup.kofa.university.facultiescontainer.FacultiesContainer object at 0x...>
+
+   The factory complies with the specifications from the
+   :class:`IFactory` insterface:
+
+     >>> from zope.interface.verify import verifyClass
+     >>> from zope.component.interfaces import IFactory
+     >>> from waeup.kofa.university.facultiescontainer import (
+     ...   FacultiesContainerFactory)
+     >>> verifyClass(IFactory, FacultiesContainerFactory)
+     True
+
+   This means also, that we can get the interfaces of the created
+   object from the factory:
+
+     >>> fac_container_factory = FacultiesContainerFactory()
+     >>> fac_container_factory.getInterfaces()
+     <implementedBy waeup.kofa.university.facultiescontainer.FacultiesContainer>
+
+Examples
+========
+
+We can easily create `FacultiesContainers`:
+
+    >>> from waeup.kofa.university.facultiescontainer import FacultiesContainer
+    >>> mycontainer = FacultiesContainer()
+
+Faculty containers provide `IFacultiesContainer`:
+
+    >>> from waeup.kofa.university.interfaces import IFacultiesContainer
+    >>> IFacultiesContainer.providedBy(mycontainer)
+    True
+
+Another way to get a faculty container -- without importing the class
+-- is via factories. We registered a factory for faculty containers
+under the name ``waeup.facultiescontainer``:
+
+    >>> from zope.component import createObject
+    >>> createObject(u'waeup.FacultiesContainer')
+    <waeup.kofa.university.facultiescontainer.FacultiesContainer object at 0x...>
+
+This way we get a thing that implements IFacultiesContainer without
+imports or similar.
+
+We can be sure, that the full interface is supported by the
+FacultiesContainer class::
+
+    >>> from zope.interface.verify import verifyClass
+    >>> verifyClass(IFacultiesContainer, FacultiesContainer)
+    True
+
+
+Storing things in faculty containers
+====================================
+
+We can, of course, store things in a faculty container. But when we
+really store an object, then it must be a faculty::
+
+    >>> mycontainer.addFaculty(42)
+    Traceback (most recent call last):
+    ...
+    TypeError: FacultiesContainers contain only IFaculty instances
+
+Okay, so we have to get a faculty first::
+
+    >>> from waeup.kofa.university.faculty import Faculty
+    >>> myfaculty = Faculty()
+
+We can add this faculty to our container::
+
+    >>> mycontainer.addFaculty(myfaculty)
+
+We get back the key, under which the faculty was stored. It will be
+some string, but there is no guarantee at all, how this key looks
+like. It might be a string of integers, a name or whatever; you cannot
+know before.
+
Index: /main/waeup.kofa/trunk/src/waeup/kofa/doctests/faculty.txt
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/doctests/faculty.txt	(revision 12949)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/doctests/faculty.txt	(revision 12949)
@@ -0,0 +1,200 @@
+:mod:`waeup.kofa.university.faculty` -- Faculties
+*************************************************
+
+.. module:: waeup.kofa.university.faculty
+
+Components that represent university faculties.
+
+.. :doctest:
+.. :layer: waeup.kofa.testing.KofaUnitTestLayer
+
+
+Content Classes (models and containers)
+=======================================
+
+
+:class:`Faculty`
+----------------
+
+.. class:: Faculty(title=u'Unnamed Faculty'[, title_prefix=u'faculty' [, code=u"NA"]])
+
+   Create a representation of a university faculty:
+
+     >>> from waeup.kofa.university.faculty import Faculty
+     >>> myfac = Faculty()
+     >>> myfac
+     <waeup.kofa.university.faculty.Faculty object at 0x...>
+
+   Another way to create :class:`Faculty` instances is by asking
+   for a factory called ``waeup.Faculty``. This way we can create a
+   faculty without importing a class:
+
+     >>> from zope.component import createObject
+     >>> myfac = createObject(u'waeup.Faculty')
+     >>> myfac
+     <waeup.kofa.university.faculty.Faculty object at 0x...>
+
+   :class:`Faculty` instances have the attributes required by the
+   `IFaculty` interface:
+
+     >>> from waeup.kofa.university.interfaces import IFaculty
+     >>> IFaculty.providedBy(myfac)
+     True
+
+     >>> from zope.interface.verify import verifyObject
+     >>> verifyObject(IFaculty, myfac)
+     True
+
+   .. method:: addDepartment(department)
+
+      Add a department into this faculty. Faculties are containers for
+      departments. Added objects are checked and only `IDepartment`
+      objects accepted:
+
+        >>> myfac.addDepartment(object())
+        Traceback (most recent call last):
+        ...
+        TypeError: Faculties contain only IDepartment instances
+
+        >>> list(myfac.values())
+        []
+
+      Regular departments are accepted:
+
+        >>> from waeup.kofa.university.department import Department
+        >>> myfac.addDepartment(Department(title='Physics',
+        ...                                code='DP'))
+
+        >>> list(myfac.items())
+        [(u'DP', <waeup.kofa.university.department.Department object at 0x...>)]
+
+
+   .. attribute:: title
+
+      (string) The title of a faculty.
+
+      Each faculty has a title:
+
+        >>> myfac.title
+        u'Unnamed Faculty'
+
+
+   .. attribute:: title_prefix
+
+      (string) The prefix of a faculty.
+
+      Each faculty has a title prefix, which specifies the kind of
+      institution:
+
+        >>> myfac.title_prefix
+        u'faculty'
+
+
+   .. attribute:: code
+
+      (string) An internally used unique code string.
+
+      Each faculty holds a code, which might be a shortcut or
+      abbreviation of the real faculty name. By default the code is
+      ``NA`` (=not assigned):
+
+        >>> myfac.code
+        u'NA'
+
+
+Utilities
+=========
+
+:class:`FacultyFactory`
+--------------------------
+
+.. class:: FacultyFactory()
+
+   .. attribute:: grok.name(u'waeup.Faculty')
+
+   .. attribute:: grok.implements(IFactory)
+
+   A named utility to deliver new instances of :class:`Faculty`
+   without the need to import the implementation before:
+
+     >>> from zope.component import createObject
+     >>> myfaculty = createObject(u'waeup.Faculty')
+     >>> myfaculty
+     <waeup.kofa.university.faculty.Faculty object at 0x...>
+
+   The factory complies with the specifications from the
+   :class:`IFactory` insterface:
+
+     >>> from zope.interface.verify import verifyClass
+     >>> from zope.component.interfaces import IFactory
+     >>> from waeup.kofa.university.faculty import FacultyFactory
+     >>> verifyClass(IFactory, FacultyFactory)
+     True
+
+   This means also, that we can get the interfaces of the created
+   object from the factory:
+
+     >>> faculty_factory = FacultyFactory()
+     >>> faculty_factory.getInterfaces()
+     <implementedBy waeup.kofa.university.faculty.Faculty>
+
+
+Examples:
+=========
+
+We can create faculties:
+
+    >>> from waeup.kofa.university.faculty import Faculty
+    >>> myfaculty = Faculty()
+    >>> myfaculty
+    <waeup.kofa.university.faculty.Faculty object at 0x...>
+
+Another way to create faculties is by asking for a factory called
+``waeup.Faculty``. Now we can create a factory without importing a
+class:
+
+    >>> from zope.component import createObject
+    >>> myfaculty = createObject(u'waeup.Faculty')
+    >>> myfaculty
+    <waeup.kofa.university.faculty.Faculty object at 0x...>
+
+Faculty attributes
+==================
+
+Faculties have the attributes required by the `IFaculty` interface:
+
+    >>> from waeup.kofa.university.interfaces import IFaculty
+    >>> IFaculty.providedBy(myfaculty)
+    True
+
+    >>> from zope.interface.verify import verifyObject
+    >>> verifyObject(IFaculty, myfaculty)
+    True
+
+Each of the following attributes is mandatory.
+
+`title`
+-------
+
+Each faculty has a title:
+
+    >>> myfaculty.title
+    u'Unnamed Faculty'
+
+`title_prefix`
+--------------
+
+Each faculty has a title prefix, which specifies the kind of
+institution:
+
+    >>> myfaculty.title_prefix
+    u'faculty'
+
+`code`
+------
+
+Each faculty holds a code, which might be a shortcut or abbreviation
+of the real faculty name. By default the code is ``NA`` (=not assigned):
+
+    >>> myfaculty.code
+    u'NA'
Index: in/waeup.kofa/trunk/src/waeup/kofa/university/certcourses.txt
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/university/certcourses.txt	(revision 12948)
+++ 	(revision )
@@ -1,221 +1,0 @@
-.. _removecertificatecourses:
-
-Persistence of Certificate Courses
-==================================
-
-If a certificate course requires a certain course and this is course
-is deleted, also the referring certificate course is deleted.
-
-We setup a data structure that reflects typical usage. It looks like
-this::
-
-    Department-Instance
-    |
-    +---> courses
-    |        |
-    |        +--------------------> Course-Instance
-    |                                        ^
-    +---> certificates                       |
-             |                               |
-             +-----> Certificate-Instance    |
-                        |                    |
-                        +------> Certificate-Course
-
-The Certifcate Course here refers to a Course instance.
-
-In Python we build such a structure like this (from top to bottom):
-
-    >>> from zope.component import createObject
-    >>> mydept = createObject('waeup.Department')
-
-In real world use this data will be stored in a ZODB. We setup our own
-litte ZODB backend (which is easy!):
-
-    >>> from ZODB import FileStorage, DB
-    >>> dbpath = 'tinyData.fs'
-    >>> class TinyZODB(object):
-    ...   def __init__(self, path=dbpath):
-    ...     self.storage = FileStorage.FileStorage(path)
-    ...     self.db = DB(self.storage)
-    ...     self.connection = self.db.open()
-    ...     self.dbroot = self.connection.root()
-    ...   def close(self):
-    ...     self.connection.close()
-    ...     self.db.close()
-    ...     self.storage.close()
-
-Now we can use this ZODB as backend database and store our data
-structure:
-
-    >>> import transaction
-    >>> db = TinyZODB()
-    >>> dbroot = db.dbroot
-    >>> dbroot['mydept'] = mydept
-    >>> mycourse = createObject('waeup.Course')
-    >>> mycourse.code = 'MYCOURSE'
-    >>> mydept.courses.addCourse(mycourse)
-    >>> mycert = createObject('waeup.Certificate')
-    >>> mycert.code = 'MYCERT'
-    >>> mydept.certificates.addCertificate(mycert)
-    >>> mycert.addCertCourse(mycourse)
-
-    >>> transaction.commit()
-
-The data is now stored in the ZODB. We can close the DB, reopen it
-later and the data will still be there:
-
-    >>> db.close()
-    >>> newdb = TinyZODB()
-    >>> newdbroot = newdb.dbroot
-    >>> list(newdbroot)
-    ['mydept']
-
-The certificate course we stored in the certificate is indeed a
-referrer of the course, not a copy of it:
-
-    >>> course = newdbroot['mydept'].courses['MYCOURSE']
-    >>> certcourse = newdbroot['mydept'].certificates['MYCERT']['MYCOURSE_100']
-    >>> certcourse.course is course
-    True
-
-So, we can be sure that modifications to the course are immediately
-reflected in the certcourse.
-
-We can also be sure, that when removing courses or referrers of them,
-other data will be handled in a way we expect. That is,
-
-* when we remove a course, we want all referrers to it be removed as
-  well
-
-* when we remove a referrer of a course, nothing else should be
-  touched but only this very referrer.
-
-
-As correct deletion of referrer needs support of catalogs (we lookup
-catalogs to find referrers), we need a fully blown ZODB here,
-including an instance of :class:`waeup.kofa.app.University`, as this is our
-`ISite` object where the catalogs are stored.
-
-We create a complete university tree, starting with a
-:class:`University` instance and going down to courses, certificats
-and course certificates:
-
-    >>> from waeup.kofa.app import University
-    >>> root = getRootFolder()
-    >>> root['app'] = University()
-
-We have to set the site, to enable proper working of catalogs and
-`IObjectRemoved` handlers:
-
-    >>> from zope.app.component.hooks import setSite
-    >>> setSite(root['app'])
-
-    >>> from zope.component import createObject
-    >>> faculty = createObject('waeup.Faculty')
-    >>> faculty.code = 'FAC'
-    >>> root['app']['faculties'].addFaculty(faculty)
-    >>> fac = root['app']['faculties']['FAC']
-
-    >>> dept = createObject('waeup.Department')
-    >>> dept.code = 'DEPT'
-    >>> root['app']['faculties']['FAC'].addDepartment(dept)
-
-    >>> course = createObject('waeup.Course')
-    >>> course.code = 'CRS1'
-    >>> fac['DEPT'].courses.addCourse(course)
-
-Now let's add another department, which will also hold a course:
-
-    >>> dept2 = createObject('waeup.Department')
-    >>> dept2.code = 'DEPT2'
-    >>> root['app']['faculties']['FAC'].addDepartment(dept2)
-
-    >>> course = createObject('waeup.Course')
-    >>> course.code = 'CRS2'
-    >>> fac['DEPT2'].courses.addCourse(course)
-
-Finally, we add a certificate with referrers (certificate courses) to
-the created courses:
-
-    >>> cert = createObject('waeup.Certificate')
-    >>> cert.code = 'CERT'
-    >>> fac['DEPT'].certificates.addCertificate(cert)
-
-    >>> fac['DEPT'].certificates['CERT'].addCertCourse(
-    ...   fac['DEPT'].courses['CRS1'])
-
-    >>> fac['DEPT'].certificates['CERT'].addCertCourse(
-    ...   fac['DEPT2'].courses['CRS2'])
-
-We add the latter course again, but this time for the second level:
-
-    >>> fac['DEPT'].certificates['CERT'].addCertCourse(
-    ...   fac['DEPT2'].courses['CRS2'], level=200)
-
-So, we have three referrers in our certificate of two different
-courses stored somewhere in the application:
-
-    >>> list(fac['DEPT'].certificates['CERT'])
-    [u'CRS1_100', u'CRS2_100', u'CRS2_200']
-
-Both, the courses themselves and the referrers of them, are the same
-(not only equal):
-
-    >>> a = root['app']['faculties']['FAC']['DEPT']
-    >>> b1 = a.courses['CRS1']
-    >>> b2 = a.certificates['CERT']['CRS1_100'].course
-    >>> b1 is b2
-    True
-
-If we remove the course, also the select item in the certificate course
-will be gone:
-
-    >>> list(a.certificates['CERT'])
-    [u'CRS1_100', u'CRS2_100', u'CRS2_200']
-
-    >>> list(a.courses)
-    [u'CRS1']
-
-    >>> del root['app']['faculties']['FAC']['DEPT'].courses['CRS1']
-    >>> list(a.certificates['CERT'])
-    [u'CRS2_100', u'CRS2_200']
-
-    >>> list(a.courses)
-    []
-
-If we remove a referrer of a course, this will not touch the course
-nor other referrers:
-
-    >>> del fac['DEPT'].certificates['CERT']['CRS2_200']
-    >>> list(a.certificates['CERT'])
-    [u'CRS2_100']
-
-    >>> list(fac['DEPT2'].courses)
-    [u'CRS2']
-
-If a single course is registered for several levels in a single
-certificate, this will not block things if the course is removed
-(regression test):
-
-We add the same course as a reference for level 200 and level 300:
-
-    >>> fac['DEPT'].certificates['CERT'].addCertCourse(
-    ...   fac['DEPT2'].courses['CRS2'], level=200)
-    >>> fac['DEPT'].certificates['CERT'].addCertCourse(
-    ...   fac['DEPT2'].courses['CRS2'], level=300)
-
-Deleting the course (thus also the refererrers) will work:
-
-    >>> del root['app']['faculties']['FAC']['DEPT2'].courses['CRS2']
-
-Now all references are gone:
-
-    >>> list(a.certificates['CERT'])
-    []
-
-and also the course itself vanished:
-
-    >>> list(fac['DEPT2'].courses)
-    []
-
-
Index: in/waeup.kofa/trunk/src/waeup/kofa/university/certificate.txt
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/university/certificate.txt	(revision 12948)
+++ 	(revision )
@@ -1,259 +1,0 @@
-Certificates and Certificate Courses
-************************************
-
-.. module:: waeup.kofa.university.certificate
-
-Components that represent and manage certificates.
-
-.. :doctest:
-.. :layer: waeup.kofa.testing.KofaUnitTestLayer
-
-
-Content Classes (models and containers)
-=======================================
-
-
-:class:`Certificate`
---------------------
-
-.. class:: Certificate([code=u'NA',[ title=u'Unnamed Certificate',[ study_mode=None,[ start_level=None,[ end_level=None,[ application_category=None,[ m_prefix=u'']]]]]]])
-
-   Create a certificate object with the given parameters.
-
-   .. attribute:: grok.implements(ICertificate)
-
-   All parameters are optional:
-
-     >>> from waeup.kofa.university.certificate import Certificate
-     >>> mycertificate = Certificate()
-
-   Certificates have the attributes required by the `ICertificate` interface:
-
-     >>> from waeup.kofa.university.interfaces import ICertificate
-     >>> ICertificate.providedBy(mycertificate)
-     True
-
-     >>> from zope.interface.verify import verifyObject
-     >>> verifyObject(ICertificate, mycertificate)
-     True
-
-   Beside the attributes, certificates are containers for
-   certificate-courses (see :class:`CertificateCourse`). Each
-   certificate course can be accessed by the code of the course it wraps.
-
-   .. attribute:: title
-
-      Each certificate has a title:
-
-        >>> mycertificate.title
-        u'Unnamed Certificate'
-
-   .. attribute:: code
-
-      Each certificate holds a code, which might be a shortcut or
-      abbreviation of the real certificate name. By default the code
-      is ``NA`` (=not assigned):
-
-        >>> mycertificate.code
-        u'NA'
-
-
-   .. attribute:: study_mode
-
-      Each :class:`Certificate` instance has a study mode:
-
-        >>> print mycertificate.study_mode
-        None
-
-      .. XXX: This is not a proper description
-
-   .. attribute:: start_level
-
-      Each :class:`Certificate` instance has a start level:
-
-        >>> print mycertificate.start_level
-        None
-
-      .. XXX: This is not a proper description
-
-   .. attribute:: end_level
-
-      Each :class:`Certificate` instance has a end level:
-
-        >>> print mycertificate.end_level
-        None
-
-      .. XXX: This is not a proper description
-   
-
-   .. attribute:: application_category
-
-      Each :class:`Certificate` instance has an application category:
-
-        >>> print mycertificate.application_category
-        None
-
-      .. XXX: This is not a proper description
-
-   .. method:: addCertCourse(course[, level=100,[ mandatory=True]])
-
-      Add a certificate course. A course is an object implementing
-      :class:`waeup.kofa.interfaces.ICourse`.
-
-      Please don't be confused by the term 'certificate course'.
-      As course objects will normaly be  stored
-      in a department, the certificate course refers to
-      the 'real' course in the department container.
-
-   .. method:: delCertCourses(code)
-
-      Remove a certificate course from a certificate.
-
-      The certificate course must be given by its code number.
-
-:class:`CertificateCourse`
---------------------------
-
-.. class:: CertificateCourse(course[, level=100[, mandatory=True]])
-
-   Create a certificate course.
-
-   A certificate course are held in
-   certificates and refer to an existing :class:`Course` instance held
-   elsewhere.
-
-   A certificate can require several certificate courses and one
-   certificate course can be required by several certificates.
-
-   .. attribute:: course
-
-      An instance of :class:`ICourse`.
-
-   .. attribute:: level
-
-      An integer telling the level to which this course applies.
-
-   .. attribute:: mandatory
-
-      A bool stating whether this course is required or optional to
-      get the certificate.
-
-
-
-Utilities
-=========
-
-:class:`CertificateFactory`
----------------------------
-
-.. class:: CertificateFactory()
-
-   .. attribute:: grok.name(u'waeup.Certificate')
-
-   .. attribute:: grok.implements(IFactory)
-
-   A named utility to deliver new instances of :class:`Certificate`
-   without the need to import the implementation before:
-
-     >>> from zope.component import createObject
-     >>> mycertificate = createObject(u'waeup.Certificate')
-     >>> mycertificate
-     <waeup.kofa.university.certificate.Certificate object at 0x...>
-
-   The factory complies with the specifications from the
-   :class:`IFactory` insterface:
-
-     >>> from zope.interface.verify import verifyClass
-     >>> from zope.component.interfaces import IFactory
-     >>> from waeup.kofa.university.certificate import CertificateFactory
-     >>> verifyClass(IFactory, CertificateFactory)
-     True
-
-   This means also, that we can get the interfaces of the created
-   object from the factory:
-
-     >>> certificate_factory = CertificateFactory()
-     >>> certificate_factory.getInterfaces()
-     <implementedBy waeup.kofa.university.certificate.Certificate>
-
-
-:class:`CertificateCourseFactory`
----------------------------------
-
-.. class:: CertificateCourseFactory()
-
-   .. attribute:: grok.name(u'waeup.CertificateCourse')
-
-   .. attribute:: grok.implements(IFactory)
-
-   A named utility to deliver new instances of :class:`CertificateCourse`
-   without the need to import the implementation before:
-
-     >>> from zope.component import createObject
-     >>> mycertificatecourse = createObject(u'waeup.CertificateCourse')
-     >>> mycertificatecourse
-     <waeup.kofa.university.certificate.CertificateCourse object at 0x...>
-
-   The factory complies with the specifications from the
-   :class:`IFactory` insterface:
-
-     >>> from zope.interface.verify import verifyClass
-     >>> from zope.component.interfaces import IFactory
-     >>> from waeup.kofa.university.certificate import CertificateCourseFactory
-     >>> verifyClass(IFactory, CertificateCourseFactory)
-     True
-
-   This means also, that we can get the interfaces of the created
-   object from the factory:
-
-     >>> certcourse_factory = CertificateCourseFactory()
-     >>> certcourse_factory.getInterfaces()
-     <implementedBy waeup.kofa.university.certificate.CertificateCourse>
-
-
-Examples
-========
-
-Certificates
-------------
-
-We can create certificates:
-
-    >>> from waeup.kofa.university.certificate import Certificate
-    >>> mycertificate = Certificate()
-    >>> mycertificate
-    <waeup.kofa.university.certificate.Certificate object at 0x...>
-
-Another way to create certificates is by asking for a factory called
-``waeup.Certificate``. This way we can create a factory without
-importing a class:
-
-    >>> from zope.component import createObject
-    >>> mycertificate = createObject(u'waeup.Certificate')
-    >>> mycertificate
-    <waeup.kofa.university.certificate.Certificate object at 0x...>
-
-Certificate Courses
--------------------
-
-:class:`CertificateCourse` instances comply with the
-:class:`ICertificateCourse` interface:
-
-    >>> from waeup.kofa.university.interfaces import ICertificateCourse
-    >>> from waeup.kofa.university.certificate import CertificateCourse
-    >>> mycertcourse = CertificateCourse(None, 200, False)
-    >>> ICertificateCourse.providedBy(mycertcourse)
-    True
-
-    >>> from zope.interface.verify import verifyObject
-    >>> verifyObject(ICertificateCourse, mycertcourse)
-    True
-
-Also instances of :class:`CertificateCourse` can be created by asking
-the component architechture:
-
-    >>> from zope.component import createObject
-    >>> mycertcourse = createObject(u'waeup.CertificateCourse')
-    >>> mycertcourse
-    <waeup.kofa.university.certificate.CertificateCourse object at 0x...>
-
Index: in/waeup.kofa/trunk/src/waeup/kofa/university/certificatescontainer.txt
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/university/certificatescontainer.txt	(revision 12948)
+++ 	(revision )
@@ -1,147 +1,0 @@
-:mod:`waeup.kofa.university.certificatescontainer` -- Certificate containers
-****************************************************************************
-
-.. module:: waeup.kofa.university.certificatescontainer
-
-Containers for certificates.
-
-.. :doctest:
-.. :layer: waeup.kofa.testing.KofaUnitTestLayer
-
-
-Content Classes (models and containers)
-=======================================
-
-:class:`CertificatesContainer`
-------------------------------
-
-.. class:: CertificatesContainer()
-
-   Create a certificate container instance.
-
-   .. attribute:: grok.implements(ICertificatesContainer)
-
-   :class:`CertificatesContainer` instances are instances of
-   :class:`grok.Container` that hold and manage instances of
-   :class:`waeup.kofa.university.certificate.Certificate`.
-
-     >>> from waeup.kofa.university.certificatescontainer import CertificatesContainer
-     >>> mycontainer = CertificatesContainer()
-     >>> mycontainer
-     <waeup.kofa.university.certificatescontainer.CertificatesContainer object at 0x...>
-
-   Certificate containers provide `ICertificatesContainer`:
-
-     >>> from waeup.kofa.university.interfaces import ICertificatesContainer
-     >>> ICertificatesContainer.providedBy(mycontainer)
-     True
-
-   We can be sure, that the full interface is supported by the
-   CertificatesContainer class:
-
-     >>> from zope.interface.verify import verifyClass
-     >>> verifyClass(ICertificatesContainer, CertificatesContainer)
-     True
-
-   As normal ``grok.Container``, :class:`CertificatesContainer` instances
-   can be used like dicts:
-
-     >>> list(mycontainer.keys())
-     []
-
-   .. method:: addCertificate(certificate)
-
-      Add a certificate.
-
-      *certificate* must be an instance of
-      :class:`waeup.kofa.university.certificate.Certificate`:
-
-        >>> from waeup.kofa.university.certificatescontainer import (
-        ...   CertificatesContainer)
-        >>> mycontainer = CertificatesContainer()
-        >>> mycontainer.addCertificate('blah')
-        Traceback (most recent call last):
-        ...
-        TypeError: CertificatesContainers contain only ICertificate instances
-
-      The key of added items is the ``code`` attribute:
-
-        >>> from waeup.kofa.university.certificate import Certificate
-        >>> mycertificate = Certificate(code='CERTIFICATE1')
-        >>> mycontainer.addCertificate(mycertificate)
-        >>> list(mycontainer.keys())
-        [u'CERTIFICATE1']
-
-   .. method:: clear()
-
-      Remove all contained certificates:
-
-        >>> len(mycontainer.items())
-        1
-
-        >>> mycontainer.clear()
-        >>> len(mycontainer.items())
-        0
-
-Utilities
-=========
-
-:class:`CertificatesContainerFactory`
--------------------------------------
-
-.. class:: CertificatesContainerFactory()
-
-   .. attribute:: grok.name(u'waeup.CertificatesContainer')
-
-   .. attribute:: grok.implements(IFactory)
-
-   A named utility to deliver new instances of :class:`CertificatesContainer`
-   without the need to import the implementation before:
-
-     >>> from zope.component import createObject
-     >>> mycertificatescontainer = createObject(u'waeup.CertificatesContainer')
-     >>> mycertificatescontainer
-     <waeup.kofa.university.certificatescontainer.CertificatesContainer object at 0x...>
-
-   The factory complies with the specifications from the
-   :class:`IFactory` insterface:
-
-     >>> from zope.interface.verify import verifyClass
-     >>> from zope.component.interfaces import IFactory
-     >>> from waeup.kofa.university.certificatescontainer import (
-     ...   CertificatesContainerFactory)
-     >>> verifyClass(IFactory, CertificatesContainerFactory)
-     True
-
-   This means also, that we can get the interfaces of the created
-   object from the factory:
-
-     >>> certificatescontainer_factory = CertificatesContainerFactory()
-     >>> certificatescontainer_factory.getInterfaces()
-     <implementedBy waeup.kofa.university.certificatescontainer.CertificatesContainer>
-
-
-Examples
-========
-
-Getting a certificate container
--------------------------------
-
-We can easily create `CertificatesContainers`:
-
-    >>> from waeup.kofa.university.certificatescontainer import CertificatesContainer
-    >>> mycontainer = CertificatesContainer()
-
-
-Another way to get a certificate container -- without importing the
-class -- is via factories. We registered a factory for certificate
-containers under the name ``waeup.CertificatesContainer``. Now we can
-ask for an object by calling the appropriate factory:
-
-    >>> from zope.component import createObject
-    >>> createObject(u'waeup.CertificatesContainer')
-    <waeup.kofa.university.certificatescontainer.CertificatesContainer object at 0x...>
-
-This way we get a thing that implements ICertificatesContainer without
-imports or similar.
-
Index: in/waeup.kofa/trunk/src/waeup/kofa/university/course.txt
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/university/course.txt	(revision 12948)
+++ 	(revision )
@@ -1,143 +1,0 @@
-:mod:`waeup.kofa.university.course` -- Courses
-**********************************************
-
-.. module:: waeup.kofa.university.course
-
-Components that represent courses.
-
-.. :doctest:
-.. :layer: waeup.kofa.testing.KofaUnitTestLayer
-
-Content Classes (models and containers)
-=======================================
-
-:class:`Course`
----------------
-
-.. class:: Course([code=u'NA'[, title=u'Unnamed Course'[, credits=0[, passmark=40[, semester=1]]]]]])
-
-   Create a course instance with the given parameters.
-
-   .. attribute:: grok.implements(ICourse)
-
-   All parameters are optional:
-
-     >>> from waeup.kofa.university.course import Course
-     >>> mycourse = Course()
-     >>> mycourse
-     <waeup.kofa.university.course.Course object at 0x...>
-
-   Course instances have the attributes required by the
-   :class:`waeup.kofa.interfaces.ICourse` interface:
-
-     >>> from waeup.kofa.university.interfaces import ICourse
-     >>> ICourse.providedBy(mycourse)
-     True
-
-     >>> from zope.interface.verify import verifyObject
-     >>> verifyObject(ICourse, mycourse)
-     True
-
-   .. attribute:: title
-
-      Each course has a title:
-
-        >>> mycourse.title
-        u'Unnamed Course'
-
-   .. attribute:: code
-
-      Each course holds a code, which might be a shortcut or
-      abbreviation of the real course name. By default the code is
-      ``NA`` (=not assigned).
-
-      This value has to be unique if used in a :class:`Department`
-      instance as it serves as a key:
-
-        >>> mycourse.code
-        u'NA'
-
-   .. attribute:: passmark
-
-      Each course holdes a passmark, which is ``40`` by default:
-
-        >>> mycourse.passmark
-        40
-
-   .. attribute:: semester
-
-      Each course holds a semester attribute which is ``1`` by
-      default:
-
-        >>> mycourse.semester
-        1
-
-   .. attribute:: credits
-
-      Each course holds the number of credits that can be
-      earned. Default is ``0``.
-
-        >>> mycourse.credits
-        0
-
-
-
-Utilities
-=========
-
-:class:`CourseFactory`
----------------------------
-
-.. class:: CourseFactory()
-
-   .. attribute:: grok.name(u'waeup.Course')
-
-   .. attribute:: grok.implements(IFactory)
-
-   A named utility to deliver new instances of :class:`Course`
-   without the need to import the implementation before:
-
-     >>> from zope.component import createObject
-     >>> mycourse = createObject(u'waeup.Course')
-     >>> mycourse
-     <waeup.kofa.university.course.Course object at 0x...>
-
-   The factory complies with the specifications from the
-   :class:`IFactory` insterface:
-
-     >>> from zope.interface.verify import verifyClass
-     >>> from zope.component.interfaces import IFactory
-     >>> from waeup.kofa.university.course import CourseFactory
-     >>> verifyClass(IFactory, CourseFactory)
-     True
-
-   This means also, that we can get the interfaces of the created
-   object from the factory:
-
-     >>> course_factory = CourseFactory()
-     >>> course_factory.getInterfaces()
-     <implementedBy waeup.kofa.university.course.Course>
-
-Examples
-========
-
-Creating courses
-----------------
-
-The simplest way to create a :class:`Course` instance is to import the
-class and calling the constructor:
-
-    >>> from waeup.kofa.university.course import Course
-    >>> mycourse = Course()
-    >>> mycourse
-    <waeup.kofa.university.course.Course object at 0x...>
-
-Another way to create courses is by asking for a factory called
-``waeup.Course``. This way we can create a factory without importing a
-class:
-
-    >>> from zope.component import createObject
-    >>> mycourse = createObject(u'waeup.Course')
-    >>> mycourse
-    <waeup.kofa.university.course.Course object at 0x...>
-
Index: in/waeup.kofa/trunk/src/waeup/kofa/university/coursescontainer.txt
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/university/coursescontainer.txt	(revision 12948)
+++ 	(revision )
@@ -1,145 +1,0 @@
-:mod:`waeup.kofa.university.coursescontainer` -- Course containers
-******************************************************************
-
-.. module:: waeup.kofa.university.coursescontainer
-
-Containers for courses.
-
-.. :doctest:
-.. :layer: waeup.kofa.testing.KofaUnitTestLayer
-
-
-Content Classes (models and containers)
-=======================================
-
-:class:`CoursesContainer`
--------------------------
-
-.. class:: CoursesContainer()
-
-   Create a course container instance.
-
-   .. attribute:: grok.implements(ICoursesContainer)
-
-   :class:`CoursesContainer` instances are instances of
-   :class:`grok.Container` that hold and manage instances of
-   :class:`waeup.kofa.university.course.Course`.
-
-     >>> from waeup.kofa.university.coursescontainer import CoursesContainer
-     >>> mycontainer = CoursesContainer()
-     >>> mycontainer
-     <waeup.kofa.university.coursescontainer.CoursesContainer object at 0x...>
-
-   Course containers provide `ICoursesContainer`:
-
-     >>> from waeup.kofa.university.interfaces import ICoursesContainer
-     >>> ICoursesContainer.providedBy(mycontainer)
-     True
-
-   We can be sure, that the full interface is supported by the
-   CoursesContainer class:
-
-     >>> from zope.interface.verify import verifyClass
-     >>> verifyClass(ICoursesContainer, CoursesContainer)
-     True
-
-   As normal ``grok.Container``, :class:`CoursesContainer` instances
-   can be used like dicts:
-
-     >>> list(mycontainer.keys())
-     []
-
-   .. method:: addCourse(course)
-
-      Add a course.
-
-      *course* must be an instance of
-      :class:`waeup.kofa.university.course.Course`:
-
-        >>> from waeup.kofa.university.coursescontainer import CoursesContainer
-        >>> mycontainer = CoursesContainer()
-        >>> mycontainer.addCourse('blah')
-        Traceback (most recent call last):
-        ...
-        TypeError: CoursesContainers contain only ICourse instances
-
-      The key of added items is the ``code`` attribute:
-
-        >>> from waeup.kofa.university.course import Course
-        >>> mycourse = Course(code='COURSE1')
-        >>> mycontainer.addCourse(mycourse)
-        >>> list(mycontainer.keys())
-        [u'COURSE1']
-
-   .. method:: clear()
-
-      Remove all contained courses:
-
-        >>> len(mycontainer.items())
-        1
-
-        >>> mycontainer.clear()
-        >>> len(mycontainer.items())
-        0
-
-Utilities
-=========
-
-:class:`CoursesContainerFactory`
---------------------------------
-
-.. class:: CoursesContainerFactory()
-
-   .. attribute:: grok.name(u'waeup.CoursesContainer')
-
-   .. attribute:: grok.implements(IFactory)
-
-   A named utility to deliver new instances of :class:`CoursesContainer`
-   without the need to import the implementation before:
-
-     >>> from zope.component import createObject
-     >>> mycoursescontainer = createObject(u'waeup.CoursesContainer')
-     >>> mycoursescontainer
-     <waeup.kofa.university.coursescontainer.CoursesContainer object at 0x...>
-
-   The factory complies with the specifications from the
-   :class:`IFactory` insterface:
-
-     >>> from zope.interface.verify import verifyClass
-     >>> from zope.component.interfaces import IFactory
-     >>> from waeup.kofa.university.coursescontainer import CoursesContainerFactory
-     >>> verifyClass(IFactory, CoursesContainerFactory)
-     True
-
-   This means also, that we can get the interfaces of the created
-   object from the factory:
-
-     >>> coursescontainer_factory = CoursesContainerFactory()
-     >>> coursescontainer_factory.getInterfaces()
-     <implementedBy waeup.kofa.university.coursescontainer.CoursesContainer>
-
-
-Examples
-========
-
-Getting a course container
---------------------------
-
-We can easily create `CoursesContainers`:
-
-    >>> from waeup.kofa.university.coursescontainer import CoursesContainer
-    >>> mycontainer = CoursesContainer()
-
-
-Another way to get a course container -- without importing the class
--- is via factories. We registered a factory for course containers
-under the name ``waeup.CoursesContainer``. Now we can ask for an object
-by calling the appropriate factory:
-
-    >>> from zope.component import createObject
-    >>> createObject(u'waeup.CoursesContainer')
-    <waeup.kofa.university.coursescontainer.CoursesContainer object at 0x...>
-
-This way we get a thing that implements ICoursesContainer without
-imports or similar.
-
Index: in/waeup.kofa/trunk/src/waeup/kofa/university/department.txt
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/university/department.txt	(revision 12948)
+++ 	(revision )
@@ -1,135 +1,0 @@
-:mod:`waeup.kofa.university.department` -- Departments
-******************************************************
-
-.. module:: waeup.kofa.university.department
-
-Components that represent university departments.
-
-.. :doctest:
-.. :layer: waeup.kofa.testing.KofaUnitTestLayer
-
-Content Classes (models and containers)
-=======================================
-
-
-:class:`Department`
--------------------
-
-.. class:: Department(title=u'Unnamed Department'[, title_prefix=u'department' [, code=u"NA"]])
-
-   Create a representation of a university department:
-
-     >>> from waeup.kofa.university.department import Department
-     >>> mydept = Department()
-     >>> mydept
-     <waeup.kofa.university.department.Department object at 0x...>
-
-   Another way to create :class:`Department` instances is by asking
-   for a factory called ``waeup.kofa.Department``. This way we can create a
-   department without importing a class:
-
-     >>> from zope.component import createObject
-     >>> mydept = createObject(u'waeup.Department')
-     >>> mydept
-     <waeup.kofa.university.department.Department object at 0x...>
-
-   :class:`Department` instances have the attributes required by the
-   `IDepartment` interface:
-
-     >>> from waeup.kofa.university.interfaces import IDepartment
-     >>> IDepartment.providedBy(mydept)
-     True
-
-     >>> from zope.interface.verify import verifyObject
-     >>> verifyObject(IDepartment, mydept)
-     True
-
-
-   .. attribute:: title
-
-      (string) The title of a department.
-
-      Each department has a title:
-
-        >>> mydept.title
-        u'Unnamed Department'
-
-
-   .. attribute:: title_prefix
-
-      (string) The prefix of a department.
-
-      Each department has a title prefix, which specifies the kind of
-      institution:
-
-        >>> mydept.title_prefix
-        u'department'
-
-
-   .. attribute:: code
-
-      (string) An internally used unique code string.
-
-      Each department holds a code, which might be a shortcut or
-      abbreviation of the real department name. By default the code is
-      ``NA`` (=not assigned):
-
-        >>> mydept.code
-        u'NA'
-
-
-   .. attribute:: courses
-
-      (ICoursesContainer instance) A container for courses.
-
-      Each department has a courses container:
-
-        >>> mydept.courses
-        <waeup.kofa.university.coursescontainer.CoursesContainer object at 0x...>
-
-
-   .. attribute:: certificates
-
-      (ICertificatesContainer instance) A container for certificates.
-
-      Each department has a certificate container, that holds the
-      descrtiptions of certificates the department has:
-
-        >>> mydept.certificates
-        <waeup.kofa...certificatescontainer.CertificatesContainer object at 0x...>
-
-Utilities
-=========
-
-:class:`DepartmentFactory`
---------------------------
-
-.. class:: DepartmentFactory()
-
-   .. attribute:: grok.name(u'waeup.Department')
-
-   .. attribute:: grok.implements(IFactory)
-
-   A named utility to deliver new instances of :class:`Department`
-   without the need to import the implementation before:
-
-     >>> from zope.component import createObject
-     >>> mydepartment = createObject(u'waeup.Department')
-     >>> mydepartment
-     <waeup.kofa.university.department.Department object at 0x...>
-
-   The factory complies with the specifications from the
-   :class:`IFactory` insterface:
-
-     >>> from zope.interface.verify import verifyClass
-     >>> from zope.component.interfaces import IFactory
-     >>> from waeup.kofa.university.department import DepartmentFactory
-     >>> verifyClass(IFactory, DepartmentFactory)
-     True
-
-   This means also, that we can get the interfaces of the created
-   object from the factory:
-
-     >>> department_factory = DepartmentFactory()
-     >>> department_factory.getInterfaces()
-     <implementedBy waeup.kofa.university.department.Department>
Index: in/waeup.kofa/trunk/src/waeup/kofa/university/facultiescontainer.txt
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/university/facultiescontainer.txt	(revision 12948)
+++ 	(revision )
@@ -1,178 +1,0 @@
-:mod:`waeup.kofa.university.facultiescontainer` -- Faculty Containers
-*********************************************************************
-
-.. module:: waeup.kofa.university.facultiescontainer
-
-Components that represent faculty containers.
-
-.. :doctest:
-.. :layer: waeup.kofa.testing.KofaUnitTestLayer
-
-
-Content Classes (models and containers)
-=======================================
-
-:class:`FacultiesContainer`
----------------------------
-
-.. class:: FacultiesContainer()
-
-   Create a faculty container:
-
-     >>> from waeup.kofa.university.facultiescontainer import FacultiesContainer
-     >>> mycontainer = FacultiesContainer()
-     >>> mycontainer
-     <waeup.kofa.university.facultiescontainer.FacultiesContainer object at 0x...>
-
-   Another way to create :class:`FacultiesContainer` instances is by asking
-   for a factory called ``waeup.FacultiesContainer``. This way we can create a
-   faculty without importing a class:
-
-     >>> from zope.component import createObject
-     >>> mycontainer = createObject(u'waeup.FacultiesContainer')
-     >>> mycontainer
-     <waeup.kofa.university.facultiescontainer.FacultiesContainer object at 0x...>
-
-   :class:`FacultiesContainer` instances have the attributes required by the
-   `IFacultiesContainer` interface:
-
-     >>> from waeup.kofa.university.interfaces import IFacultiesContainer
-     >>> IFacultiesContainer.providedBy(mycontainer)
-     True
-
-     >>> from zope.interface.verify import verifyObject
-     >>> verifyObject(IFacultiesContainer, mycontainer)
-     True
-
-   .. method:: addFaculty(faculty)
-
-      Add a faculty into this container. Added objects are checked and
-      only `IFaculty` objects accepted:
-
-        >>> mycontainer.addFaculty(object())
-        Traceback (most recent call last):
-        ...
-        TypeError: FacultiesContainers contain only IFaculty instances
-
-        >>> list(mycontainer.values())
-        []
-
-      Regular faculties are accepted:
-
-        >>> from waeup.kofa.university.faculty import Faculty
-        >>> mycontainer.addFaculty(Faculty(title='Physics',
-        ...                                code='FP'))
-
-        >>> list(mycontainer.items())
-        [(u'FP', <waeup.kofa.university.faculty.Faculty object at 0x...>)]
-
-
-
-Utilities
-=========
-
-:class:`AcademicsPlugin`
-------------------------
-
-.. class:: AcademicsPlugin()
-
-   .. attribute:: grok.implements(IKofaPluggable)
-
-   This plugin component tells under which name (``faculties``) an
-   instance of academics stuff should be created in plain Kofa
-   instances. It also tells the factory name for FacultiesContainer
-   instances, which serve as root object for academics stuff in Kofa apps.
-
-
-:class:`FacultiesContainerFactory`
-----------------------------------
-
-.. class:: FacultiesContainerFactory()
-
-   .. attribute:: grok.name(u'waeup.FacultiesContainer')
-
-   .. attribute:: grok.implements(IFactoryContainer)
-
-   A named utility to deliver new instances of :class:`FacultiesContainer`
-   without the need to import the implementation before:
-
-     >>> from zope.component import createObject
-     >>> mycontainer = createObject(u'waeup.FacultiesContainer')
-     >>> mycontainer
-     <waeup.kofa.university.facultiescontainer.FacultiesContainer object at 0x...>
-
-   The factory complies with the specifications from the
-   :class:`IFactory` insterface:
-
-     >>> from zope.interface.verify import verifyClass
-     >>> from zope.component.interfaces import IFactory
-     >>> from waeup.kofa.university.facultiescontainer import (
-     ...   FacultiesContainerFactory)
-     >>> verifyClass(IFactory, FacultiesContainerFactory)
-     True
-
-   This means also, that we can get the interfaces of the created
-   object from the factory:
-
-     >>> fac_container_factory = FacultiesContainerFactory()
-     >>> fac_container_factory.getInterfaces()
-     <implementedBy waeup.kofa.university.facultiescontainer.FacultiesContainer>
-
-Examples
-========
-
-We can easily create `FacultiesContainers`:
-
-    >>> from waeup.kofa.university.facultiescontainer import FacultiesContainer
-    >>> mycontainer = FacultiesContainer()
-
-Faculty containers provide `IFacultiesContainer`:
-
-    >>> from waeup.kofa.university.interfaces import IFacultiesContainer
-    >>> IFacultiesContainer.providedBy(mycontainer)
-    True
-
-Another way to get a faculty container -- without importing the class
--- is via factories. We registered a factory for faculty containers
-under the name ``waeup.facultiescontainer``:
-
-    >>> from zope.component import createObject
-    >>> createObject(u'waeup.FacultiesContainer')
-    <waeup.kofa.university.facultiescontainer.FacultiesContainer object at 0x...>
-
-This way we get a thing that implements IFacultiesContainer without
-imports or similar.
-
-We can be sure, that the full interface is supported by the
-FacultiesContainer class::
-
-    >>> from zope.interface.verify import verifyClass
-    >>> verifyClass(IFacultiesContainer, FacultiesContainer)
-    True
-
-
-Storing things in faculty containers
-====================================
-
-We can, of course, store things in a faculty container. But when we
-really store an object, then it must be a faculty::
-
-    >>> mycontainer.addFaculty(42)
-    Traceback (most recent call last):
-    ...
-    TypeError: FacultiesContainers contain only IFaculty instances
-
-Okay, so we have to get a faculty first::
-
-    >>> from waeup.kofa.university.faculty import Faculty
-    >>> myfaculty = Faculty()
-
-We can add this faculty to our container::
-
-    >>> mycontainer.addFaculty(myfaculty)
-
-We get back the key, under which the faculty was stored. It will be
-some string, but there is no guarantee at all, how this key looks
-like. It might be a string of integers, a name or whatever; you cannot
-know before.
-
Index: in/waeup.kofa/trunk/src/waeup/kofa/university/faculty.txt
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/university/faculty.txt	(revision 12948)
+++ 	(revision )
@@ -1,200 +1,0 @@
-:mod:`waeup.kofa.university.faculty` -- Faculties
-*************************************************
-
-.. module:: waeup.kofa.university.faculty
-
-Components that represent university faculties.
-
-.. :doctest:
-.. :layer: waeup.kofa.testing.KofaUnitTestLayer
-
-
-Content Classes (models and containers)
-=======================================
-
-
-:class:`Faculty`
-----------------
-
-.. class:: Faculty(title=u'Unnamed Faculty'[, title_prefix=u'faculty' [, code=u"NA"]])
-
-   Create a representation of a university faculty:
-
-     >>> from waeup.kofa.university.faculty import Faculty
-     >>> myfac = Faculty()
-     >>> myfac
-     <waeup.kofa.university.faculty.Faculty object at 0x...>
-
-   Another way to create :class:`Faculty` instances is by asking
-   for a factory called ``waeup.Faculty``. This way we can create a
-   faculty without importing a class:
-
-     >>> from zope.component import createObject
-     >>> myfac = createObject(u'waeup.Faculty')
-     >>> myfac
-     <waeup.kofa.university.faculty.Faculty object at 0x...>
-
-   :class:`Faculty` instances have the attributes required by the
-   `IFaculty` interface:
-
-     >>> from waeup.kofa.university.interfaces import IFaculty
-     >>> IFaculty.providedBy(myfac)
-     True
-
-     >>> from zope.interface.verify import verifyObject
-     >>> verifyObject(IFaculty, myfac)
-     True
-
-   .. method:: addDepartment(department)
-
-      Add a department into this faculty. Faculties are containers for
-      departments. Added objects are checked and only `IDepartment`
-      objects accepted:
-
-        >>> myfac.addDepartment(object())
-        Traceback (most recent call last):
-        ...
-        TypeError: Faculties contain only IDepartment instances
-
-        >>> list(myfac.values())
-        []
-
-      Regular departments are accepted:
-
-        >>> from waeup.kofa.university.department import Department
-        >>> myfac.addDepartment(Department(title='Physics',
-        ...                                code='DP'))
-
-        >>> list(myfac.items())
-        [(u'DP', <waeup.kofa.university.department.Department object at 0x...>)]
-
-
-   .. attribute:: title
-
-      (string) The title of a faculty.
-
-      Each faculty has a title:
-
-        >>> myfac.title
-        u'Unnamed Faculty'
-
-
-   .. attribute:: title_prefix
-
-      (string) The prefix of a faculty.
-
-      Each faculty has a title prefix, which specifies the kind of
-      institution:
-
-        >>> myfac.title_prefix
-        u'faculty'
-
-
-   .. attribute:: code
-
-      (string) An internally used unique code string.
-
-      Each faculty holds a code, which might be a shortcut or
-      abbreviation of the real faculty name. By default the code is
-      ``NA`` (=not assigned):
-
-        >>> myfac.code
-        u'NA'
-
-
-Utilities
-=========
-
-:class:`FacultyFactory`
---------------------------
-
-.. class:: FacultyFactory()
-
-   .. attribute:: grok.name(u'waeup.Faculty')
-
-   .. attribute:: grok.implements(IFactory)
-
-   A named utility to deliver new instances of :class:`Faculty`
-   without the need to import the implementation before:
-
-     >>> from zope.component import createObject
-     >>> myfaculty = createObject(u'waeup.Faculty')
-     >>> myfaculty
-     <waeup.kofa.university.faculty.Faculty object at 0x...>
-
-   The factory complies with the specifications from the
-   :class:`IFactory` insterface:
-
-     >>> from zope.interface.verify import verifyClass
-     >>> from zope.component.interfaces import IFactory
-     >>> from waeup.kofa.university.faculty import FacultyFactory
-     >>> verifyClass(IFactory, FacultyFactory)
-     True
-
-   This means also, that we can get the interfaces of the created
-   object from the factory:
-
-     >>> faculty_factory = FacultyFactory()
-     >>> faculty_factory.getInterfaces()
-     <implementedBy waeup.kofa.university.faculty.Faculty>
-
-
-Examples:
-=========
-
-We can create faculties:
-
-    >>> from waeup.kofa.university.faculty import Faculty
-    >>> myfaculty = Faculty()
-    >>> myfaculty
-    <waeup.kofa.university.faculty.Faculty object at 0x...>
-
-Another way to create faculties is by asking for a factory called
-``waeup.Faculty``. Now we can create a factory without importing a
-class:
-
-    >>> from zope.component import createObject
-    >>> myfaculty = createObject(u'waeup.Faculty')
-    >>> myfaculty
-    <waeup.kofa.university.faculty.Faculty object at 0x...>
-
-Faculty attributes
-==================
-
-Faculties have the attributes required by the `IFaculty` interface:
-
-    >>> from waeup.kofa.university.interfaces import IFaculty
-    >>> IFaculty.providedBy(myfaculty)
-    True
-
-    >>> from zope.interface.verify import verifyObject
-    >>> verifyObject(IFaculty, myfaculty)
-    True
-
-Each of the following attributes is mandatory.
-
-`title`
--------
-
-Each faculty has a title:
-
-    >>> myfaculty.title
-    u'Unnamed Faculty'
-
-`title_prefix`
---------------
-
-Each faculty has a title prefix, which specifies the kind of
-institution:
-
-    >>> myfaculty.title_prefix
-    u'faculty'
-
-`code`
-------
-
-Each faculty holds a code, which might be a shortcut or abbreviation
-of the real faculty name. By default the code is ``NA`` (=not assigned):
-
-    >>> myfaculty.code
-    u'NA'
