Index: /main/kofacustom.wdu/trunk/CHANGES.txt
===================================================================
--- /main/kofacustom.wdu/trunk/CHANGES.txt	(revision 11939)
+++ /main/kofacustom.wdu/trunk/CHANGES.txt	(revision 11940)
@@ -2,43 +2,5 @@
 *******
 
-1.2dev (unreleased)
-===================
-
-* Use init_update method.
-
-* Use base classes InterswitchPageApplicant and InterswitchPageStudent from
-  kofacustom.nigeria.
-
-* File input fields brought into shape with Bootstrap 3.
-
-* Adapt exporters and batch processors to customized interfaces.
-
-* Use kofa-scrollto script.
-
-1.1 (2014-03-14)
-================
-
-* Back-to links replaced by animated jQuery plugins.
-
-* jquery-ui.min.js is also used for tooltips.
-
-* Refer to INSTALL.txt in waeup.kofa sources.
-
-* Use only https in theme.html.
-
-* Removed sphinx docs.
-
-* Added generic install instructions.
-
-* Removed README in src/.
-
-
-1.0 (2014-02-22)
-================
-
-* Diazofied complete package.
-
-
-0.1 (2014-02-21)
+1.0dev (unreleased)
 ================
 
Index: /main/kofacustom.wdu/trunk/README.txt
===================================================================
--- /main/kofacustom.wdu/trunk/README.txt	(revision 11939)
+++ /main/kofacustom.wdu/trunk/README.txt	(revision 11940)
@@ -1,9 +1,7 @@
-waeup.skeleton
+waeup.wdu
 **************
 
-`waeup.skeleton` is a Python package providing a student information
-portal based on WAeUP Kofa.
-
-This is a skelton package which can be used to create customized version of Kofa.
+`waeup.wdu` is a Python package providing a student information
+portal based on WAeUP Kofa for western Delta University.
 
 For generic install instructions please see sources/waeup.kofa/docs/INSTALL.txt.
@@ -14,5 +12,5 @@
 The Subversion_ repository location of this package is
 
-  https://svn.waeup.org/repos/main/waeup.skeleton/
+  https://svn.waeup.org/repos/main/waeup.wdu/
 
 .. _Subversion: http://subversion.apache.org/
Index: /main/kofacustom.wdu/trunk/buildout-zeo.cfg
===================================================================
--- /main/kofacustom.wdu/trunk/buildout-zeo.cfg	(revision 11939)
+++ /main/kofacustom.wdu/trunk/buildout-zeo.cfg	(revision 11940)
@@ -118,5 +118,5 @@
 # See http://pypi.python.org/pypi/zc.recipe.egg for details...
 recipe = zc.recipe.egg
-eggs = kofacustom.skeleton [beaker, diazo]
+eggs = kofacustom.wdu [beaker, diazo]
 arguments = "${buildout:parts-directory}/etc/zeo1.conf"
 scripts = kofactl=zeo_client1
@@ -125,5 +125,5 @@
 # See http://pypi.python.org/pypi/zc.recipe.egg for details...
 recipe = zc.recipe.egg
-eggs = kofacustom.skeleton [beaker, diazo]
+eggs = kofacustom.wdu [beaker, diazo]
 arguments = "${buildout:parts-directory}/etc/zeo2.conf"
 scripts = kofactl=zeo_client2
Index: /main/kofacustom.wdu/trunk/buildout.cfg
===================================================================
--- /main/kofacustom.wdu/trunk/buildout.cfg	(revision 11939)
+++ /main/kofacustom.wdu/trunk/buildout.cfg	(revision 11940)
@@ -52,10 +52,9 @@
 host = 0.0.0.0
 # default is 8080
-base_port = 8080
-
-zeo1_port = 8011
-zeo2_port = 8012
-# zeo3_port = 8013
-server_port = 8010
+base_port = 7111
+zeo1_port = 7111
+zeo2_port = 7112
+# zeo3_port = 7113
+server_port = 7110
 # default 7. Number of pre-opened ZODB threads/client
 pool_size = 7
@@ -66,10 +65,10 @@
 # number of preopened paster threads, default 10
 threadpool_workers = 10
-devel_pkg = kofacustom.skeleton
+devel_pkg = kofacustom.wdu
 
 [app]
 # This creates all scripts in bin/. The kofactl created here is 'faulty'.
 recipe = zc.recipe.egg
-eggs = kofacustom.skeleton [beaker, diazo]
+eggs = kofacustom.wdu [beaker, diazo]
        z3c.evalexception>=2.0
        Paste
@@ -85,5 +84,5 @@
 # fixed path to zdaemon.conf as argument.
 recipe = zc.recipe.egg
-eggs = kofacustom.skeleton [beaker, diazo]
+eggs = kofacustom.wdu [beaker, diazo]
 arguments = "${buildout:parts-directory}/etc/zdaemon.conf"
 scripts = kofactl=kofactl
@@ -100,5 +99,5 @@
 [test]
 recipe = zc.recipe.testrunner
-eggs = kofacustom.skeleton [beaker, test]
+eggs = kofacustom.wdu [beaker, test]
 defaults = ['--tests-pattern', '^f?tests$', '-v']
 
@@ -106,8 +105,8 @@
 [i18n]
 recipe = z3c.recipe.i18n:i18n
-packages = kofacustom.skeleton
-eggs = kofacustom.skeleton
-domain = kofacustom.skeleton
-output = src/kofacustom/skeleton/locales
+packages = kofacustom.wdu
+eggs = kofacustom.wdu
+domain = kofacustom.wdu
+output = src/kofacustom/wdu/locales
 zcml =
 
@@ -116,5 +115,5 @@
 [zpasswd]
 recipe = z3c.recipe.dev:script
-eggs = kofacustom.skeleton
+eggs = kofacustom.wdu
 module = zope.app.server.zpasswd
 method = main
@@ -184,5 +183,5 @@
 [coverage-detect]
 recipe = zc.recipe.testrunner
-eggs = kofacustom.skeleton[beaker]
+eggs = kofacustom.wdu[beaker]
 defaults = ['--tests-pattern', '^f?tests$', '-v', '--coverage', 'coverage']
 
@@ -205,3 +204,3 @@
     diazo [wsgi]
     PasteScript
-    kofacustom.skeleton [beaker, diazo]
+    kofacustom.wdu [beaker, diazo]
Index: /main/kofacustom.wdu/trunk/etc/site.zcml.in
===================================================================
--- /main/kofacustom.wdu/trunk/etc/site.zcml.in	(revision 11939)
+++ /main/kofacustom.wdu/trunk/etc/site.zcml.in	(revision 11940)
@@ -1,8 +1,8 @@
 <configure xmlns="http://namespaces.zope.org/zope"
            xmlns:kofa="http://namespaces.waeup.org/kofa"
-           i18n_domain="kofacustom.skeleton">
+           i18n_domain="kofacustom.wdu">
 
-  <include package="kofacustom.skeleton" />
-  <include package="kofacustom.skeleton" file="mail.zcml" />
+  <include package="kofacustom.wdu" />
+  <include package="kofacustom.wdu" file="mail.zcml" />
 
   <!-- install job container
@@ -29,5 +29,5 @@
       path="${buildout:directory}/var/datacenter" />
 
-    <configure i18n_domain="kofacustom.skeleton">
+    <configure i18n_domain="kofacustom.wdu">
 
       <unauthenticatedPrincipal id="zope.anybody"
@@ -42,6 +42,6 @@
                  title="Manager"
                  login="grok"
-                 password_manager="SHA1"
-                 password="321b9cd3739bd029629243732eb682db005a7541f7509622"
+                 password_manager="SSHA"
+                 password="{SSHA}PQQypyPElik2Pi3wM5kO1W78eVCGgdZ8"
                  />
 
Index: /main/kofacustom.wdu/trunk/etc/zope_zeo1.conf.in
===================================================================
--- /main/kofacustom.wdu/trunk/etc/zope_zeo1.conf.in	(revision 11939)
+++ /main/kofacustom.wdu/trunk/etc/zope_zeo1.conf.in	(revision 11940)
@@ -24,5 +24,5 @@
 # Uncomment this if you want to connect to a ZEO server instead:
   <zeoclient>
-    server localhost:8010
+    server localhost:7110
     storage 1
     # ZEO client cache, in bytes
@@ -63,5 +63,5 @@
 <zodb async>
   <zeoclient>
-    server localhost:8010
+    server localhost:7110
     storage async
     name async
Index: /main/kofacustom.wdu/trunk/etc/zope_zeo2.conf.in
===================================================================
--- /main/kofacustom.wdu/trunk/etc/zope_zeo2.conf.in	(revision 11939)
+++ /main/kofacustom.wdu/trunk/etc/zope_zeo2.conf.in	(revision 11940)
@@ -24,5 +24,5 @@
 # Uncomment this if you want to connect to a ZEO server instead:
   <zeoclient>
-    server localhost:8010
+    server localhost:7110
     storage 1
     # ZEO client cache, in bytes
@@ -63,5 +63,5 @@
 <zodb async>
   <zeoclient>
-    server localhost:8010
+    server localhost:7110
     storage async
     name async
Index: /main/kofacustom.wdu/trunk/setup.py
===================================================================
--- /main/kofacustom.wdu/trunk/setup.py	(revision 11939)
+++ /main/kofacustom.wdu/trunk/setup.py	(revision 11940)
@@ -2,5 +2,5 @@
 from setuptools import setup, find_packages
 
-version = '1.2dev'
+version = '1.0dev'
 
 install_requires = [
@@ -47,5 +47,5 @@
     )
 
-setup(name = 'kofacustom.skeleton',
+setup(name = 'kofacustom.wdu',
       version = version,
       description = "A customized waeup.kofa",
Index: /main/kofacustom.wdu/trunk/src/kofacustom/wdu/__init__.py
===================================================================
--- /main/kofacustom.wdu/trunk/src/kofacustom/wdu/__init__.py	(revision 11940)
+++ /main/kofacustom.wdu/trunk/src/kofacustom/wdu/__init__.py	(revision 11940)
@@ -0,0 +1,1 @@
+# Make this a package.
Index: /main/kofacustom.wdu/trunk/src/kofacustom/wdu/applicants/__init__.py
===================================================================
--- /main/kofacustom.wdu/trunk/src/kofacustom/wdu/applicants/__init__.py	(revision 11940)
+++ /main/kofacustom.wdu/trunk/src/kofacustom/wdu/applicants/__init__.py	(revision 11940)
@@ -0,0 +1,1 @@
+# Make this a package.
Index: /main/kofacustom.wdu/trunk/src/kofacustom/wdu/applicants/applicant.py
===================================================================
--- /main/kofacustom.wdu/trunk/src/kofacustom/wdu/applicants/applicant.py	(revision 11940)
+++ /main/kofacustom.wdu/trunk/src/kofacustom/wdu/applicants/applicant.py	(revision 11940)
@@ -0,0 +1,47 @@
+## $Id$
+##
+## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+
+import grok
+from zope.interface import implementedBy
+from waeup.kofa.applicants.applicant import ApplicantFactory
+from waeup.kofa.utils.helpers import attrs_to_fields
+from kofacustom.nigeria.applicants.applicant import NigeriaApplicant
+from kofacustom.wdu.applicants.interfaces import(
+    ICustomApplicant, ICustomUGApplicantEdit, ICustomPGApplicantEdit, IPUTMEApplicantEdit)
+
+class CustomApplicant(NigeriaApplicant):
+
+    grok.implements(ICustomApplicant, ICustomUGApplicantEdit,
+        ICustomPGApplicantEdit, IPUTMEApplicantEdit)
+    grok.provides(ICustomApplicant)
+
+# Set all attributes of CustomApplicant required in ICustomApplicant as field
+# properties. Doing this, we do not have to set initial attributes
+# ourselves and as a bonus we get free validation when an attribute is
+# set.
+CustomApplicant = attrs_to_fields(CustomApplicant)
+
+class CustomApplicantFactory(ApplicantFactory):
+    """A factory for customized applicants.
+    """
+
+    def __call__(self, *args, **kw):
+        return CustomApplicant()
+
+    def getInterfaces(self):
+        return implementedBy(CustomApplicant)
Index: /main/kofacustom.wdu/trunk/src/kofacustom/wdu/applicants/batching.py
===================================================================
--- /main/kofacustom.wdu/trunk/src/kofacustom/wdu/applicants/batching.py	(revision 11940)
+++ /main/kofacustom.wdu/trunk/src/kofacustom/wdu/applicants/batching.py	(revision 11940)
@@ -0,0 +1,38 @@
+## $Id$
+##
+## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+"""Batch processing for applicants.
+"""
+from waeup.kofa.utils.batching import BatchProcessor
+from waeup.kofa.applicants.batching import ApplicantProcessor
+from kofacustom.wdu.applicants.interfaces import (
+    ICustomApplicant, ICustomApplicantUpdateByRegNo)
+
+class CustomApplicantProcessor(ApplicantProcessor):
+    """A batch processor for IApplicant objects.
+
+    In create mode container_code is required. If application_number is given
+    an applicant with this number is created in the designated container.
+    If application_number is not given a random application_number is assigned.
+    applicant_id is being determined by the system and can't be imported.
+
+    In update or remove mode container_code and application_number columns
+    must not exist. The applicant object is solely searched by its applicant_id
+    or reg_number.
+    """
+    iface = ICustomApplicant
+    iface_byregnumber = ICustomApplicantUpdateByRegNo
Index: /main/kofacustom.wdu/trunk/src/kofacustom/wdu/applicants/browser.py
===================================================================
--- /main/kofacustom.wdu/trunk/src/kofacustom/wdu/applicants/browser.py	(revision 11940)
+++ /main/kofacustom.wdu/trunk/src/kofacustom/wdu/applicants/browser.py	(revision 11940)
@@ -0,0 +1,28 @@
+## $Id$
+##
+## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+"""UI components for basic applicants and related components.
+"""
+import grok
+from waeup.kofa.applicants.browser import (
+    ApplicantRegistrationPage, ApplicantsContainerPage)
+from kofacustom.nigeria.applicants.browser import (
+    NigeriaApplicantDisplayFormPage,
+    NigeriaPDFApplicationSlip)
+
+from kofacustom.wdu.interfaces import MessageFactory as _
+
Index: /main/kofacustom.wdu/trunk/src/kofacustom/wdu/applicants/export.py
===================================================================
--- /main/kofacustom.wdu/trunk/src/kofacustom/wdu/applicants/export.py	(revision 11940)
+++ /main/kofacustom.wdu/trunk/src/kofacustom/wdu/applicants/export.py	(revision 11940)
@@ -0,0 +1,38 @@
+## $Id$
+##
+## Copyright (C) 2014 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+"""Exporters for applicant-related stuff.
+"""
+import grok
+from waeup.kofa.applicants.interfaces import IApplicantBaseData
+from kofacustom.nigeria.applicants.export import NigeriaApplicantsExporter
+from kofacustom.nigeria.applicants.interfaces import (
+    INigeriaUGApplicant, INigeriaPGApplicant)
+from kofacustom.wdu.applicants.interfaces import (
+    ICustomUGApplicant, ICustomPGApplicant)
+
+class CustomApplicantsExporter(NigeriaApplicantsExporter):
+    """Exporter for Custom Applicants.
+    """
+
+    fields = tuple(sorted(set(
+        ICustomUGApplicant.names() +
+        ICustomPGApplicant.names() +
+        INigeriaUGApplicant.names() +
+        INigeriaPGApplicant.names() +
+        IApplicantBaseData.names()
+        ))) + ('container_code',)
Index: /main/kofacustom.wdu/trunk/src/kofacustom/wdu/applicants/interfaces.py
===================================================================
--- /main/kofacustom.wdu/trunk/src/kofacustom/wdu/applicants/interfaces.py	(revision 11940)
+++ /main/kofacustom.wdu/trunk/src/kofacustom/wdu/applicants/interfaces.py	(revision 11940)
@@ -0,0 +1,124 @@
+## $Id$
+##
+## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+"""Customized interfaces of the university application package.
+"""
+
+from zope import schema
+from waeup.kofa.applicants.interfaces import (
+    IApplicantBaseData,
+    AppCatCertificateSource, CertificateSource)
+from waeup.kofa.schoolgrades import ResultEntryField
+from waeup.kofa.interfaces import (
+    SimpleKofaVocabulary, academic_sessions_vocab, validate_email)
+from waeup.kofa.schema import FormattedDate, TextLineChoice
+from waeup.kofa.students.vocabularies import nats_vocab, GenderSource
+from waeup.kofa.applicants.interfaces import contextual_reg_num_source
+from kofacustom.nigeria.applicants.interfaces import (
+    LGASource, high_qual, high_grade, exam_types,
+    INigeriaUGApplicant, INigeriaPGApplicant,
+    INigeriaApplicantOnlinePayment,
+    INigeriaUGApplicantEdit, INigeriaPGApplicantEdit,
+    INigeriaApplicantUpdateByRegNo,
+    IPUTMEApplicantEdit,
+    )
+from kofacustom.wdu.interfaces import MessageFactory as _
+from kofacustom.wdu.payments.interfaces import ICustomOnlinePayment
+
+class ICustomUGApplicant(INigeriaUGApplicant):
+    """An undergraduate applicant.
+
+    This interface defines the least common multiple of all fields
+    in ug application forms. In customized forms, fields can be excluded by
+    adding them to the UG_OMIT* tuples.
+    """
+
+class ICustomPGApplicant(INigeriaPGApplicant):
+    """A postgraduate applicant.
+
+    This interface defines the least common multiple of all fields
+    in pg application forms. In customized forms, fields can be excluded by
+    adding them to the PG_OMIT* tuples.
+    """
+
+
+class ICustomApplicant(ICustomUGApplicant, ICustomPGApplicant):
+    """An interface for both types of applicants.
+
+    Attention: The ICustomPGApplicant field seetings will be overwritten
+    by ICustomPGApplicant field settings. If a field is defined
+    in both interfaces zope.schema validates only against the
+    constraints in ICustomUGApplicant. This does not affect the forms
+    since they are build on either ICustomUGApplicant or ICustomPGApplicant.
+    """
+
+    def writeLogMessage(view, comment):
+        """Adds an INFO message to the log file
+        """
+
+    def createStudent():
+        """Create a student object from applicant data
+        and copy applicant object.
+        """
+
+class ICustomUGApplicantEdit(INigeriaUGApplicantEdit):
+    """An undergraduate applicant interface for edit forms.
+
+    Here we can repeat the fields from base data and set the
+    `required` and `readonly` attributes to True to further restrict
+    the data access. Or we can allow only certain certificates to be
+    selected by choosing the appropriate source.
+
+    We cannot omit fields here. This has to be done in the
+    respective form page.
+    """
+
+class ICustomPGApplicantEdit(INigeriaPGApplicantEdit):
+    """A postgraduate applicant interface for editing.
+
+    Here we can repeat the fields from base data and set the
+    `required` and `readonly` attributes to True to further restrict
+    the data access. Or we can allow only certain certificates to be
+    selected by choosing the appropriate source.
+
+    We cannot omit fields here. This has to be done in the
+    respective form page.
+    """
+
+class ICustomApplicantOnlinePayment(INigeriaApplicantOnlinePayment):
+    """An applicant payment via payment gateways.
+
+    """
+
+class IPUTMEApplicantEdit(IPUTMEApplicantEdit):
+    """An undergraduate applicant interface for editing.
+
+    Here we can repeat the fields from base data and set the
+    `required` and `readonly` attributes to True to further restrict
+    the data access. Or we can allow only certain certificates to be
+    selected by choosing the appropriate source.
+
+    We cannot omit fields here. This has to be done in the
+    respective form page.
+    """
+
+class ICustomApplicantUpdateByRegNo(INigeriaApplicantUpdateByRegNo):
+    """Representation of an applicant.
+
+    Skip regular reg_number validation if reg_number is used for finding
+    the applicant object.
+    """
Index: /main/kofacustom.wdu/trunk/src/kofacustom/wdu/applicants/payment.py
===================================================================
--- /main/kofacustom.wdu/trunk/src/kofacustom/wdu/applicants/payment.py	(revision 11940)
+++ /main/kofacustom.wdu/trunk/src/kofacustom/wdu/applicants/payment.py	(revision 11940)
@@ -0,0 +1,59 @@
+## $Id$
+##
+## Copyright (C) 2012 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+"""
+Application fee payment.
+"""
+import grok
+from zope.component.interfaces import IFactory
+from zope.interface import implementedBy
+from waeup.kofa.applicants.payment import ApplicantOnlinePayment
+from waeup.kofa.utils.helpers import attrs_to_fields
+from kofacustom.wdu.applicants.interfaces import ICustomApplicantOnlinePayment
+
+class CustomApplicantOnlinePayment(ApplicantOnlinePayment):
+    """This is a custom online payment for applicants.
+
+    Since this class inherits from ApplicantOnlinePayment, it automatically
+    implements the interfaces of the parent class which means
+    all viewlets and views meant for StudentOnlinePayment
+    can also be accessed in the customized system.
+    """
+    grok.implements(ICustomApplicantOnlinePayment)
+    grok.provides(ICustomApplicantOnlinePayment)
+
+    def __init__(self):
+        super(CustomApplicantOnlinePayment, self).__init__()
+        return
+
+CustomApplicantOnlinePayment = attrs_to_fields(
+    CustomApplicantOnlinePayment, omit=['display_item'])
+
+# Applicant online payments must be importable. So we might need a factory.
+class CustomApplicantOnlinePaymentFactory(grok.GlobalUtility):
+    """A factory for applicant online payments.
+    """
+    grok.implements(IFactory)
+    grok.name(u'waeup.ApplicantOnlinePayment')
+    title = u"Create a new online payment.",
+    description = u"This factory instantiates new online payment instances."
+
+    def __call__(self, *args, **kw):
+        return CustomApplicantOnlinePayment()
+
+    def getInterfaces(self):
+        return implementedBy(CustomApplicantOnlinePayment)
Index: /main/kofacustom.wdu/trunk/src/kofacustom/wdu/applicants/tests/__init__.py
===================================================================
--- /main/kofacustom.wdu/trunk/src/kofacustom/wdu/applicants/tests/__init__.py	(revision 11940)
+++ /main/kofacustom.wdu/trunk/src/kofacustom/wdu/applicants/tests/__init__.py	(revision 11940)
@@ -0,0 +1,1 @@
+# Make this a package.
Index: /main/kofacustom.wdu/trunk/src/kofacustom/wdu/applicants/tests/test_applicant.py
===================================================================
--- /main/kofacustom.wdu/trunk/src/kofacustom/wdu/applicants/tests/test_applicant.py	(revision 11940)
+++ /main/kofacustom.wdu/trunk/src/kofacustom/wdu/applicants/tests/test_applicant.py	(revision 11940)
@@ -0,0 +1,79 @@
+## $Id$
+##
+## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+"""Tests for applicants and related.
+"""
+import grok
+import shutil
+import tempfile
+from StringIO import StringIO
+from zope.component import adapts, queryUtility
+from zope.component.interfaces import IFactory
+from zope.interface import verify, implements
+from zope.location.interfaces import ILocation
+from waeup.kofa.image.interfaces import IKofaImageFile
+from waeup.kofa.imagestorage import DefaultStorage
+from waeup.kofa.interfaces import IFileStoreHandler, IFileStoreNameChooser
+from waeup.kofa.testing import FunctionalTestCase
+from kofacustom.wdu.applicants.applicant import (
+    CustomApplicant, CustomApplicantFactory,
+    )
+from kofacustom.wdu.applicants.interfaces import ICustomApplicant
+from kofacustom.wdu.testing import FunctionalLayer
+
+class CustomApplicantTest(FunctionalTestCase):
+
+    layer = FunctionalLayer
+
+    def setUp(self):
+        super(CustomApplicantTest, self).setUp()
+        self.applicant = CustomApplicant()
+        return
+
+    def tearDown(self):
+        super(CustomApplicantTest, self).tearDown()
+        return
+
+    def test_interfaces(self):
+        verify.verifyClass(ICustomApplicant, CustomApplicant)
+        verify.verifyObject(ICustomApplicant, self.applicant)
+        return
+
+class CustomApplicantFactoryTest(FunctionalTestCase):
+
+    layer = FunctionalLayer
+
+    def setUp(self):
+        super(CustomApplicantFactoryTest, self).setUp()
+        self.factory = CustomApplicantFactory()
+        return
+
+    def tearDown(self):
+        super(CustomApplicantFactoryTest, self).tearDown()
+        return
+
+    def test_interfaces(self):
+        verify.verifyClass(IFactory, CustomApplicantFactory)
+        verify.verifyObject(IFactory, self.factory)
+
+    def test_factory(self):
+        obj = self.factory()
+        assert isinstance(obj, CustomApplicant)
+
+    def test_getInterfaces(self):
+        implemented_by = self.factory.getInterfaces()
+        assert implemented_by.isOrExtends(ICustomApplicant)
Index: /main/kofacustom.wdu/trunk/src/kofacustom/wdu/applicants/tests/test_browser.py
===================================================================
--- /main/kofacustom.wdu/trunk/src/kofacustom/wdu/applicants/tests/test_browser.py	(revision 11940)
+++ /main/kofacustom.wdu/trunk/src/kofacustom/wdu/applicants/tests/test_browser.py	(revision 11940)
@@ -0,0 +1,144 @@
+## $Id$
+##
+## Copyright (C) 2013 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+"""
+Test the applicant-related UI components.
+"""
+import os
+import datetime
+from zope.component import createObject, getUtility
+from zope.catalog.interfaces import ICatalog
+from zope.intid.interfaces import IIntIds
+from kofacustom.wdu.testing import FunctionalLayer
+from waeup.kofa.applicants.tests.test_browser import ApplicantsFullSetup
+from waeup.kofa.applicants.tests.test_batching import ApplicantImportExportSetup
+from kofacustom.wdu.applicants.export import CustomApplicantsExporter
+from kofacustom.wdu.applicants.batching import CustomApplicantProcessor
+
+class CustomApplicantUITests(ApplicantsFullSetup):
+    # Tests for uploading/browsing the passport image of appplicants
+
+    layer = FunctionalLayer
+
+class ApplicantsExporterTest(ApplicantImportExportSetup):
+
+    layer = FunctionalLayer
+
+    def setUp(self):
+        super(ApplicantsExporterTest, self).setUp()
+        self.outfile = os.path.join(self.workdir, 'myoutput.csv')
+        self.cat = getUtility(ICatalog, name='applicants_catalog')
+        self.intids = getUtility(IIntIds)
+        return
+
+    def setup_applicant(self, applicant):
+        # set predictable values for `applicant`
+        applicant.reg_number = u'123456'
+        applicant.applicant_id = u'dp2011_654321'
+        applicant.firstname = u'Anna'
+        applicant.lastname = u'Tester'
+        applicant.middlename = u'M.'
+        applicant.nationality = u'NG'
+        applicant.date_of_birth = datetime.date(1981, 2, 4)
+        applicant.sex = 'f'
+        applicant.email = 'anna@sample.com'
+        applicant.phone = u'+234-123-12345'
+        applicant.course1 = self.certificate
+        applicant.course2 = self.certificate
+        applicant.course_admitted = self.certificate
+        applicant.notice = u'Some notice\nin lines.'
+        applicant.screening_score = 98
+        applicant.screening_venue = u'Exam Room'
+        applicant.screening_date = u'Saturday, 16th June 2012 2:00:00 PM'
+        applicant.password = 'any password'
+        return applicant
+
+    def test_export_reimport_all(self):
+        # we can export all applicants in a portal
+        # set values we can expect in export file
+        self.applicant = self.setup_applicant(self.applicant)
+        exporter = CustomApplicantsExporter()
+        exporter.export_all(self.app, self.outfile)
+        result = open(self.outfile, 'rb').read()
+        self.assertMatches(result,
+            'aggregate,applicant_id,application_date,application_number,'
+            'course1,course2,course_admitted,date_of_birth,display_fullname,'
+            'email,emp2_end,emp2_position,emp2_reason,emp2_start,emp_end,'
+            'emp_position,emp_reason,emp_start,employer,employer2,'
+            'firstname,history,hq_degree,hq_disc,hq_matric_no,hq_school,'
+            'hq_session,hq_type,jamb_age,jamb_score,jamb_subjects,lastname,lga,'
+            'locked,middlename,nationality,notice,nysc_lga,nysc_year,'
+            'password,phone,pp_school,presently_inst,reg_number,'
+            'result_uploaded,screening_date,screening_score,'
+            'screening_venue,sex,special_application,'
+            'state,student_id,suspended,container_code\r\n'
+            ',dp2011_654321,,654321,CERT1,CERT1,CERT1,1981-02-04#,'
+            'Anna M. Tester,anna@sample.com,,,,,,,,,,,Anna,'
+            '[u\'2012-10-28 21:27:52 WAT - Application initialized by system\']'
+            ',,,,,,,,,,Tester,,0,M.,NG,"Some notice\nin lines.",,,'
+            'any password,+234-123-12345#,,,123456,,'
+            '"Saturday, 16th June 2012 2:00:00 PM",98,Exam Room,f,,initialized,,'
+            '0,dp2011\r\n')
+        # We can import the same file if we ignore some columns.
+        # Since the applicants_catalog hasn't been notified, the same
+        # record with same reg_number can be imported twice.
+        processor = CustomApplicantProcessor()
+        result = processor.doImport(
+            self.outfile,
+            ['aggreagate','ignore_applicant_id','application_date',
+            'ignore_application_number','course1','course2',
+            'course_admitted','date_of_birth','ignore3','email','emp2_end',
+            'emp2_position','emp2_reason','emp2_start','emp_end','emp_position',
+            'emp_reason','emp_start','employer','employer2','firstname','ignore4',
+            'hq_degree','hq_disc','hq_matric_no','hq_school','hq_session','hq_type',
+            'jamb_age','jamb_score','jamb_subjects','lastname','lga','locked','middlename',
+            'nationality','notice','nysc_lga',
+            'nysc_year','password','phone','pp_school','presently_inst',
+            'reg_number','result_uploaded',
+            'screening_date','screening_score','screening_venue','sex',
+            'special_application',
+            'state','student_id','suspended','container_code'],
+            mode='create')
+        num_succ, num_fail, finished_path, failed_path = result
+        #content = open(failed_path).read()
+        self.assertEqual(num_succ,1)
+        self.assertEqual(num_fail,0)
+        # Now we ignore also the container_code and import the same file
+        # in update mode which means that INigeriaApplicantUpdateByRegNo
+        # is used for field conversion. applicant_id must be ignored
+        # too since the previous import has notified the applicants_catalog
+        # so that the portal 'knows' that reg_number is in use.
+        processor = CustomApplicantProcessor()
+        result = processor.doImport(
+            self.outfile,
+            ['aggregate','ignore_applicant_id','application_date',
+            'ignore_application_number','course1','course2',
+            'course_admitted','date_of_birth','ignore3','email','emp2_end',
+            'emp2_position','emp2_reason','emp2_start','emp_end','emp_position',
+            'emp_reason','emp_start','employer','employer2','firstname','ignore4',
+            'hq_degree','hq_disc','hq_matric_no','hq_school','hq_session','hq_type',
+            'jamb_age','jamb_score','jamb_subjects','lastname','lga','locked','middlename',
+            'nationality','notice','nysc_lga',
+            'nysc_year','password','phone','pp_school','presently_inst',
+            'reg_number','result_uploaded','screening_date','screening_score',
+            'screening_venue','sex','special_application',
+            'state','student_id','suspended','ignore_container_code'],
+            mode='update')
+        num_succ, num_fail, finished_path, failed_path = result
+        self.assertEqual(num_succ,1)
+        self.assertEqual(num_fail,0)
+        return
Index: /main/kofacustom.wdu/trunk/src/kofacustom/wdu/applicants/utils.py
===================================================================
--- /main/kofacustom.wdu/trunk/src/kofacustom/wdu/applicants/utils.py	(revision 11940)
+++ /main/kofacustom.wdu/trunk/src/kofacustom/wdu/applicants/utils.py	(revision 11940)
@@ -0,0 +1,30 @@
+## $Id$
+##
+## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+"""General helper functions and utilities for the application section.
+"""
+
+from kofacustom.nigeria.applicants.utils import NigeriaApplicantsUtils
+from waeup.kofa.applicants.workflow import (INITIALIZED,
+    STARTED, PAID, ADMITTED, NOT_ADMITTED, SUBMITTED, CREATED)
+from kofacustom.wdu.interfaces import MessageFactory as _
+
+
+
+class ApplicantsUtils(NigeriaApplicantsUtils):
+    """A collection of parameters and methods subject to customization.
+    """
Index: /main/kofacustom.wdu/trunk/src/kofacustom/wdu/browser/__init__.py
===================================================================
--- /main/kofacustom.wdu/trunk/src/kofacustom/wdu/browser/__init__.py	(revision 11940)
+++ /main/kofacustom.wdu/trunk/src/kofacustom/wdu/browser/__init__.py	(revision 11940)
@@ -0,0 +1,1 @@
+# Make this a package.
Index: /main/kofacustom.wdu/trunk/src/kofacustom/wdu/browser/pages.py
===================================================================
--- /main/kofacustom.wdu/trunk/src/kofacustom/wdu/browser/pages.py	(revision 11940)
+++ /main/kofacustom.wdu/trunk/src/kofacustom/wdu/browser/pages.py	(revision 11940)
@@ -0,0 +1,35 @@
+## $Id$
+##
+## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+import grok
+from waeup.kofa.browser.pages import (
+    SessionConfigurationAddFormPage, SessionConfigurationManageFormPage,
+    LoginPage, CertificatePage, CertificateManageFormPage)
+from waeup.kofa.university.interfaces import ICertificate
+from kofacustom.wdu.interfaces import (
+    ICustomSessionConfiguration, ICustomSessionConfigurationAdd)
+
+class CustomSessionConfigurationAddFormPage(SessionConfigurationAddFormPage):
+    """Add a session configuration object to configuration container.
+    """
+    form_fields = grok.AutoFields(ICustomSessionConfigurationAdd)
+
+class CustomSessionConfigurationManageFormPage(SessionConfigurationManageFormPage):
+    """Manage session configuration object.
+    """
+    form_fields = grok.AutoFields(ICustomSessionConfiguration)
+
Index: /main/kofacustom.wdu/trunk/src/kofacustom/wdu/browser/pdf.py
===================================================================
--- /main/kofacustom.wdu/trunk/src/kofacustom/wdu/browser/pdf.py	(revision 11940)
+++ /main/kofacustom.wdu/trunk/src/kofacustom/wdu/browser/pdf.py	(revision 11940)
@@ -0,0 +1,35 @@
+## $Id$
+##
+## Copyright (C) 2012 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+## 
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+## 
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+"""
+Reusable components for pdf generation.
+"""
+
+import os
+from waeup.kofa.browser.pdf import PDFCreator
+
+class CustomPDFCreator(PDFCreator):
+    """A utility to help with generating PDF docs.
+    """
+
+    #header_logo_path = os.path.join(
+    #    os.path.dirname(__file__), 'static', 'pdf_logo.jpg')
+    #watermark_path = os.path.join(
+    #    os.path.dirname(__file__), 'static', 'pdf_watermark.jpg')
+
+    watermark_pos = [-25, 100]
+    logo_pos = [507, 720, 40]
Index: /main/kofacustom.wdu/trunk/src/kofacustom/wdu/browser/tests.py
===================================================================
--- /main/kofacustom.wdu/trunk/src/kofacustom/wdu/browser/tests.py	(revision 11940)
+++ /main/kofacustom.wdu/trunk/src/kofacustom/wdu/browser/tests.py	(revision 11940)
@@ -0,0 +1,50 @@
+## $Id$
+##
+## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+import tempfile
+import shutil
+from zope.testbrowser.testing import Browser
+from zope.component.hooks import setSite, clearSite
+from zope.security.interfaces import Unauthorized
+from waeup.kofa.testing import FunctionalTestCase
+from kofacustom.wdu.testing import FunctionalLayer
+from waeup.kofa.app import University
+
+class CustomPackageBrowserTests(FunctionalTestCase):
+
+    layer = FunctionalLayer
+
+    def setUp(self):
+        super(CustomPackageBrowserTests, self).setUp()
+
+        # Setup a sample site for each test
+        app = University()
+        self.dc_root = tempfile.mkdtemp()
+        app['datacenter'].setStoragePath(self.dc_root)
+
+        # Put the prepopulated site into test ZODB and prepare test
+        # browser
+        self.getRootFolder()['app'] = app
+        setSite(app)
+        self.browser = Browser()
+        self.browser.handleErrors = False
+
+    def tearDown(self):
+        super(CustomPackageBrowserTests, self).tearDown()
+        clearSite()
+        shutil.rmtree(self.dc_root)
+
Index: /main/kofacustom.wdu/trunk/src/kofacustom/wdu/configuration.py
===================================================================
--- /main/kofacustom.wdu/trunk/src/kofacustom/wdu/configuration.py	(revision 11940)
+++ /main/kofacustom.wdu/trunk/src/kofacustom/wdu/configuration.py	(revision 11940)
@@ -0,0 +1,47 @@
+## $Id$
+##
+## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+"""
+Containers for session configuration objects.
+"""
+import grok
+from zope.interface import implementedBy
+from waeup.kofa.utils.helpers import attrs_to_fields
+from waeup.kofa.configuration import (
+    SessionConfigurationFactory, SessionConfiguration)
+from kofacustom.wdu.interfaces import (
+    ICustomSessionConfiguration, ICustomSessionConfigurationAdd)
+
+
+class CustomSessionConfiguration(SessionConfiguration):
+    """
+    Customized session configuration model
+    """
+
+    grok.implements(ICustomSessionConfiguration, ICustomSessionConfigurationAdd)
+
+CustomSessionConfiguration = attrs_to_fields(CustomSessionConfiguration)
+
+class CustomSessionConfigurationFactory(SessionConfigurationFactory):
+    """A customized factory for session configuration objects.
+    """
+
+    def __call__(self, *args, **kw):
+        return CustomSessionConfiguration(*args, **kw)
+
+    def getInterfaces(self):
+        return implementedBy(CustomSessionConfiguration)
Index: /main/kofacustom.wdu/trunk/src/kofacustom/wdu/configure.zcml
===================================================================
--- /main/kofacustom.wdu/trunk/src/kofacustom/wdu/configure.zcml	(revision 11940)
+++ /main/kofacustom.wdu/trunk/src/kofacustom/wdu/configure.zcml	(revision 11940)
@@ -0,0 +1,11 @@
+<configure xmlns="http://namespaces.zope.org/zope"
+           xmlns:grok="http://namespaces.zope.org/grok">
+  <include package="kofacustom.wdu" file="locales.zcml" />
+
+  <!-- kofacustom.nigeria configures everything we basically need.
+  -->
+  <include package="kofacustom.nigeria" />
+
+  <grok:grok package="." />
+
+</configure>
Index: /main/kofacustom.wdu/trunk/src/kofacustom/wdu/ftesting.zcml
===================================================================
--- /main/kofacustom.wdu/trunk/src/kofacustom/wdu/ftesting.zcml	(revision 11940)
+++ /main/kofacustom.wdu/trunk/src/kofacustom/wdu/ftesting.zcml	(revision 11940)
@@ -0,0 +1,67 @@
+<configure
+   xmlns="http://namespaces.zope.org/zope"
+   xmlns:kofa="http://namespaces.waeup.org/kofa"
+   i18n_domain="kofacustom.wdu"
+   package="kofacustom.wdu"
+   >
+
+  <include package="kofacustom.wdu" />
+  <include package="kofacustom.wdu" file="mail.zcml"/>
+
+  <!-- Where should the datacenter reside by default? -->
+  <kofa:datacenter
+      path="../../../parts/test/datacenter" />
+
+  <!-- Typical functional testing security setup -->
+  <securityPolicy
+      component="zope.securitypolicy.zopepolicy.ZopeSecurityPolicy"
+      />
+
+  <unauthenticatedPrincipal
+      id="zope.anybody"
+      title="Unauthenticated User"
+      />
+  <unauthenticatedGroup id="zope.Anybody"
+      title="Unauthenticated Users" />
+  <authenticatedGroup id="zope.Authenticated"
+      title="Authenticated Users" />
+  <everybodyGroup id="zope.Everybody"
+      title="All Users" />
+
+  <!-- grant
+      permission="zope.View"
+      principal="zope.Anybody"
+      / -->
+  <grant
+      permission="zope.app.dublincore.view"
+      principal="zope.Anybody" />
+  <grant
+      permission="zope.View"
+      principal="zope.Authenticated"
+      />
+  <grant
+      permission="zope.app.dublincore.view"
+      principal="zope.Authenticated"
+      />
+  <grant
+      permission="waeup.Public"
+      principal="zope.Everybody"
+      />
+  <grant 
+      permission="waeup.Anonymous"
+      principal="zope.Anybody"
+      />
+
+
+  <principal
+      id="zope.mgr"
+      title="Manager"
+      login="mgr"
+      password="mgrpw"
+      />
+
+  <role id="zope.Manager" title="Site Manager" />
+  <grantAll role="zope.Manager" />
+  <grant role="zope.Manager" principal="zope.mgr" />
+
+</configure>
Index: /main/kofacustom.wdu/trunk/src/kofacustom/wdu/interfaces.py
===================================================================
--- /main/kofacustom.wdu/trunk/src/kofacustom/wdu/interfaces.py	(revision 11940)
+++ /main/kofacustom.wdu/trunk/src/kofacustom/wdu/interfaces.py	(revision 11940)
@@ -0,0 +1,92 @@
+## $Id$
+##
+## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+
+import zope.i18nmessageid
+from zope import schema
+from zc.sourcefactory.basic import BasicSourceFactory
+from waeup.kofa.interfaces import (SimpleKofaVocabulary,
+    ISessionConfiguration, academic_sessions_vocab)
+
+_ = MessageFactory = zope.i18nmessageid.MessageFactory('kofacustom.wdu')
+
+# It's recommended to replicate all fields from the base package here.
+class ICustomSessionConfiguration(ISessionConfiguration):
+    """A session configuration object.
+    """
+
+    # Base fees, do not remove.
+
+    school_fee_base = schema.Float(
+        title = _(u'School Fee (ignored)'),
+        default = 0.0,
+        required = False,
+        )
+
+    application_fee = schema.Float(
+        title = _(u'Application Fee (fallback)'),
+        default = 0.0,
+        required = False,
+        )
+
+    clearance_fee = schema.Float(
+        title = _(u'Clearance Fee (ignored)'),
+        default = 0.0,
+        required = False,
+        )
+
+    booking_fee = schema.Float(
+        title = _(u'Booking Fee'),
+        default = 0.0,
+        required = False,
+        )
+
+    maint_fee = schema.Float(
+        title = _(u'Maintenance Fee (ignored)'),
+        default = 0.0,
+        required = False,
+        )
+
+    transcript_fee = schema.Float(
+        title = _(u'Transcript Fee'),
+        default = 0.0,
+        required = False,
+        )
+
+    # Additional fees in custom package add here
+
+
+    def getSessionString():
+        """Returns the session string from the vocabulary.
+        """
+
+
+class ICustomSessionConfigurationAdd(ICustomSessionConfiguration):
+    """A session configuration object in add mode.
+    """
+
+    academic_session = schema.Choice(
+        title = _(u'Academic Session'),
+        source = academic_sessions_vocab,
+        default = None,
+        required = True,
+        readonly = False,
+        )
+
+ICustomSessionConfigurationAdd[
+    'academic_session'].order =  ICustomSessionConfiguration[
+    'academic_session'].order
Index: /main/kofacustom.wdu/trunk/src/kofacustom/wdu/interswitch/__init__.py
===================================================================
--- /main/kofacustom.wdu/trunk/src/kofacustom/wdu/interswitch/__init__.py	(revision 11940)
+++ /main/kofacustom.wdu/trunk/src/kofacustom/wdu/interswitch/__init__.py	(revision 11940)
@@ -0,0 +1,1 @@
+# Make this a package.
Index: /main/kofacustom.wdu/trunk/src/kofacustom/wdu/interswitch/browser.py
===================================================================
--- /main/kofacustom.wdu/trunk/src/kofacustom/wdu/interswitch/browser.py	(revision 11940)
+++ /main/kofacustom.wdu/trunk/src/kofacustom/wdu/interswitch/browser.py	(revision 11940)
@@ -0,0 +1,154 @@
+## $Id$
+##
+## Copyright (C) 2012 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+import httplib
+import grok
+from kofacustom.nigeria.interswitch.browser import (
+    InterswitchPaymentRequestWebservicePageApplicant,
+    InterswitchPaymentRequestWebservicePageStudent,
+    InterswitchPageStudent, InterswitchPageApplicant,
+    )
+from kofacustom.wdu.students.interfaces import ICustomStudentOnlinePayment
+from kofacustom.wdu.applicants.interfaces import ICustomApplicantOnlinePayment
+from kofacustom.wdu.interfaces import MessageFactory as _
+
+PRODUCT_ID = '57'
+SITE_NAME = 'wdu-kofa.waeup.org'
+PROVIDER_ACCT = '00000000'
+PROVIDER_BANK_ID = '00'
+PROVIDER_ITEM_NAME = 'BT Education'
+INSTITUTION_NAME = 'Skeleton'
+CURRENCY = '566'
+GATEWAY_AMT = 150.0
+#QUERY_URL = 'https://webpay.interswitchng.com/paydirect/services/TransactionQueryURL.aspx'
+#QUERY_URL = 'https://testwebpay.interswitchng.com/test_paydirect/services/TransactionQueryURL.aspx'
+POST_ACTION = 'https://webpay.interswitchng.com/paydirect/webpay/pay.aspx'
+#POST_ACTION = 'https://testwebpay.interswitchng.com/test_paydirect/webpay/pay.aspx'
+
+HOST = 'webpay.interswitchng.com'
+#HOST = 'testwebpay.interswitchng.com'
+URL = '/paydirect/services/TransactionQueryWs.asmx'
+#URL = '/test_paydirect/services/TransactionQueryWs.asmx'
+httplib.HTTPConnection.debuglevel = 0
+
+class CustomInterswitchPageStudent(InterswitchPageStudent):
+    """ View which sends a POST request to the Interswitch
+    CollegePAY payment gateway.
+    """
+    grok.context(ICustomStudentOnlinePayment)
+    action = POST_ACTION
+    site_name = SITE_NAME
+    currency = CURRENCY
+    product_id = PRODUCT_ID
+
+    def update(self):
+        error = self.init_update()
+        if error:
+            self.flash(error, type='danger')
+            self.redirect(self.url(self.context, '@@index'))
+            return
+        student = self.student
+        xmldict = self.xmldict
+        # Provider data
+        xmldict['detail_ref'] = self.context.p_id
+        xmldict['provider_acct'] = PROVIDER_ACCT
+        xmldict['provider_bank_id'] = PROVIDER_BANK_ID
+        xmldict['provider_item_name'] = PROVIDER_ITEM_NAME
+        # Institution data
+        xmldict['institution_acct'] = '00000000'
+        xmldict['institution_bank_id'] = '00'
+        xmldict['institution_amt'] = '0.0'
+        provider_amt = 0.0
+        self.pay_item_id = '0000'
+        xmldict['provider_amt'] = 100 * provider_amt
+        xmldict['institution_item_name'] = self.category
+        xmldict['institution_name'] = INSTITUTION_NAME
+        xmldict['institution_amt'] = 100 * (
+            self.context.amount_auth - provider_amt - GATEWAY_AMT)
+        # Interswitch amount is not part of the xml data
+        if provider_amt == 0:
+            xmltext = """<payment_item_detail>
+<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
+<item_detail item_id="1" item_name="%(institution_item_name)s" item_amt="%(institution_amt)d" bank_id="%(institution_bank_id)s" acct_num="%(institution_acct)s" />
+</item_details>
+</payment_item_detail>""" % xmldict
+        else:
+            xmltext = """<payment_item_detail>
+<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
+<item_detail item_id="1" item_name="%(institution_item_name)s" item_amt="%(institution_amt)d" bank_id="%(institution_bank_id)s" acct_num="%(institution_acct)s" />
+<item_detail item_id="2" item_name="%(provider_item_name)s" item_amt="%(provider_amt)d" bank_id="%(provider_bank_id)s" acct_num="%(provider_acct)s" />
+</item_details>
+</payment_item_detail>""" % xmldict
+        self.xml_data = """<input type="hidden" name="xml_data" value='%s'  />""" % xmltext
+        self.context.provider_amt = provider_amt
+        self.context.gateway_amt = GATEWAY_AMT
+        return
+
+class CustomInterswitchPageApplicant(InterswitchPageApplicant):
+    """ View which sends a POST request to the Interswitch
+    CollegePAY payment gateway.
+    """
+    grok.context(ICustomApplicantOnlinePayment)
+    action = POST_ACTION
+    site_name = SITE_NAME
+    currency = CURRENCY
+    pay_item_id = '0000'
+    product_id = PRODUCT_ID
+
+    def update(self):
+        super(CustomInterswitchPageApplicant, self).update()
+        xmldict = {}
+        provider_amt = 400.0
+        xmldict['institution_acct'] = '00000000000'
+        xmldict['institution_bank_id'] = '00'
+        xmldict['detail_ref'] = self.context.p_id
+        xmldict['provider_amt'] = 100 * provider_amt
+        xmldict['provider_acct'] = PROVIDER_ACCT
+        xmldict['provider_bank_id'] = PROVIDER_BANK_ID
+        xmldict['provider_item_name'] = PROVIDER_ITEM_NAME
+        xmldict['institution_amt'] = 100 * (self.context.amount_auth - provider_amt - GATEWAY_AMT)
+        xmldict['institution_item_name'] = self.context.p_category
+        xmldict['institution_name'] = INSTITUTION_NAME
+        # Interswitch amount is not part of the xml data
+        xmltext = """<payment_item_detail>
+<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s">
+<item_detail item_id="1" item_name="%(institution_item_name)s" item_amt="%(institution_amt)d" bank_id="%(institution_bank_id)s" acct_num="%(institution_acct)s" />
+<item_detail item_id="2" item_name="%(provider_item_name)s" item_amt="%(provider_amt)d" bank_id="%(provider_bank_id)s" acct_num="%(provider_acct)s" />
+</item_details>
+</payment_item_detail>""" % xmldict
+        self.xml_data = """<input type="hidden" name="xml_data" value='%s'  />""" % xmltext
+        self.context.provider_amt = provider_amt
+        self.context.gateway_amt = GATEWAY_AMT
+        return
+
+class CustomInterswitchPaymentRequestWebservicePageStudent(
+    InterswitchPaymentRequestWebservicePageStudent):
+    """ Request webservice view for the CollegePAY gateway
+    """
+    grok.context(ICustomStudentOnlinePayment)
+    product_id = PRODUCT_ID
+    gateway_host = HOST
+    gateway_url = URL
+
+class CustomInterswitchPaymentRequestWebservicePageApplicant(
+    InterswitchPaymentRequestWebservicePageApplicant):
+    """ Request webservice view for the CollegePAY gateway
+    """
+    grok.context(ICustomApplicantOnlinePayment)
+    product_id = PRODUCT_ID
+    gateway_host = HOST
+    gateway_url = URL
Index: /main/kofacustom.wdu/trunk/src/kofacustom/wdu/interswitch/tests.py
===================================================================
--- /main/kofacustom.wdu/trunk/src/kofacustom/wdu/interswitch/tests.py	(revision 11940)
+++ /main/kofacustom.wdu/trunk/src/kofacustom/wdu/interswitch/tests.py	(revision 11940)
@@ -0,0 +1,219 @@
+## $Id$
+##
+## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+import os
+from datetime import datetime, date, timedelta
+from zope.component import createObject, getUtility
+from zope.catalog.interfaces import ICatalog
+from hurry.workflow.interfaces import IWorkflowState
+from waeup.kofa.students.tests.test_browser import StudentsFullSetup
+from waeup.kofa.applicants.tests.test_browser import ApplicantsFullSetup
+from waeup.kofa.configuration import SessionConfiguration
+from kofacustom.wdu.testing import FunctionalLayer
+
+# Also run tests that send requests to external servers?
+#   If you enable this, please make sure the external services
+#   do exist really and are not bothered by being spammed by a test programme.
+EXTERNAL_TESTS = False
+
+def external_test(func):
+    if not EXTERNAL_TESTS:
+        myself = __file__
+        if myself.endswith('.pyc'):
+            myself = myself[:-2]
+        print "WARNING: external tests are skipped!"
+        print "WARNING: edit %s to enable them." % myself
+        return
+    return func
+
+
+class InterswitchTestsStudents(StudentsFullSetup):
+    """Tests for the Interswitch payment gateway.
+    """
+
+    layer = FunctionalLayer
+
+    def setUp(self):
+        super(InterswitchTestsStudents, self).setUp()
+
+    def test_interswitch_form(self):
+        # Manager can access InterswitchForm
+        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
+        self.browser.open(self.payments_path)
+        IWorkflowState(self.student).setState('cleared')
+        self.student.nationality = u'NG'
+        self.browser.open(self.payments_path + '/addop')
+        self.browser.getControl(name="form.p_category").value = ['schoolfee']
+        self.browser.getControl("Create ticket").click()
+        self.assertMatches('...ticket created...',
+                           self.browser.contents)
+        ctrl = self.browser.getControl(name='val_id')
+        self.value = ctrl.options[0]
+        self.browser.getLink(self.value).click()
+        self.assertMatches('...Amount Authorized...',
+                           self.browser.contents)
+        self.assertMatches(
+            '...<span>40000.0</span>...',
+            self.browser.contents)
+        self.payment_url = self.browser.url
+        self.browser.getLink("CollegePAY", index=0).click()
+        # The total amount to be processed by Interswitch
+        # has been reduced by the Interswitch fee of 150 Nairas
+        self.assertMatches('...<input type="hidden" name="pay_item_id" value="0000" />...',
+                           self.browser.contents)
+        self.assertMatches('...Total Amount Authorized:...',
+                           self.browser.contents)
+        self.assertEqual(self.student.current_mode, 'ug_ft')
+        self.assertMatches(
+            '...<input type="hidden" name="amount" value="4000000" />...',
+            self.browser.contents)
+        self.assertMatches(
+            '...item_name="School Fee" item_amt="4000000" bank_id="00" acct_num="00000000"...',
+            self.browser.contents)
+
+    @external_test
+    def test_webservice(self):
+        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
+        self.browser.open(self.payments_path)
+        IWorkflowState(self.student).setState('cleared')
+        self.student.nationality = u'NG'
+        self.browser.open(self.payments_path + '/addop')
+        self.browser.getControl(name="form.p_category").value = ['schoolfee']
+        self.browser.getControl("Create ticket").click()
+        self.assertMatches('...ticket created...',
+                           self.browser.contents)
+        ctrl = self.browser.getControl(name='val_id')
+        self.value = ctrl.options[0]
+        self.browser.getLink(self.value).click()
+        self.payment_url = self.browser.url
+        # First we have open InterswitchPageStudent to set provider_amt
+        # and gateway_amt
+        self.browser.open(self.payment_url + '/goto_interswitch')
+        # Now we can call the webservice
+        self.browser.open(self.payment_url + '/request_webservice')
+        self.assertMatches('...Unsuccessful callback...',
+                          self.browser.contents)
+        # The payment is now in state failed ...
+        self.assertMatches('...<span>Failed</span>...',
+                          self.browser.contents)
+        # ... and the catalog has been updated
+        cat = getUtility(ICatalog, name='payments_catalog')
+        results = list(
+            cat.searchResults(p_state=('failed', 'failed')))
+        self.assertEqual(len(results), 1)
+        self.assertEqual(results[0].p_state, 'failed')
+
+        # Let's replace the p_id with a valid p_id of the Uniben
+        # live system. This is definitely not an appropriate
+        # solution for testing, but we have no choice since
+        # Interswitch doesn't provide any interface
+        # for testing.
+        payment = self.student['payments'][self.value]
+        payment.p_id = 'p3547789850240'
+        self.browser.open(self.payment_url + '/request_webservice')
+        self.assertMatches('...Callback amount does not match...',
+                          self.browser.contents)
+        # The payment is now in state failed ...
+        self.assertMatches('...<span>Failed</span>...',
+                          self.browser.contents)
+        # Let's replace the amount autorized with the amount of the
+        # live system payment
+        payment.amount_auth = payment.r_amount_approved
+        self.browser.open(self.payment_url + '/request_webservice')
+        self.assertMatches('...Successful payment...',
+                          self.browser.contents)
+        # The payment is now in state paid ...
+        self.assertMatches('...<span>Paid</span>...',
+                          self.browser.contents)
+        # ... and the catalog has been updated
+        cat = getUtility(ICatalog, name='payments_catalog')
+        results = list(
+            cat.searchResults(p_state=('paid', 'paid')))
+        self.assertEqual(len(results), 1)
+        self.assertEqual(results[0].p_state, 'paid')
+        # Approval is logged in students.log ...
+        logfile = os.path.join(
+            self.app['datacenter'].storage, 'logs', 'students.log')
+        logcontent = open(logfile).read()
+        self.assertTrue(
+            'zope.mgr - '
+            'kofacustom.wdu.interswitch.browser.CustomInterswitchPaymentRequestWebservicePageStudent - '
+            'X1000000 - successful schoolfee payment: p3547789850240\n'
+            in logcontent)
+        # ... and in payments.log
+        logfile = os.path.join(
+            self.app['datacenter'].storage, 'logs', 'payments.log')
+        logcontent = open(logfile).read()
+        self.assertTrue(
+            '"zope.mgr",X1000000,p3547789850240,schoolfee,'
+            '12000.0,00,0.0,150.0,0.0,,,\n'
+            in logcontent)
+
+
+class InterswitchTestsApplicants(ApplicantsFullSetup):
+    """Tests for the Interswitch payment gateway.
+    """
+
+    layer = FunctionalLayer
+
+    def setUp(self):
+        super(InterswitchTestsApplicants, self).setUp()
+        configuration = SessionConfiguration()
+        configuration.academic_session = datetime.now().year - 2
+        self.app['configuration'].addSessionConfiguration(configuration)
+        self.configuration = configuration
+        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
+        self.browser.open(self.manage_path)
+        #IWorkflowState(self.student).setState('started')
+        super(InterswitchTestsApplicants, self).fill_correct_values()
+        self.applicantscontainer.application_fee = 1000.0
+        self.browser.getControl(name="form.nationality").value = ['NG']
+        self.browser.getControl(name="transition").value = ['start']
+        self.browser.getControl("Save").click()
+        self.browser.getControl("Add online").click()
+        self.assertMatches('...ticket created...',
+                           self.browser.contents)
+        #ctrl = self.browser.getControl(name='val_id')
+        #value = ctrl.options[0]
+        #self.browser.getLink(value).click()
+        self.assertMatches('...Amount Authorized...',
+                           self.browser.contents)
+        self.assertMatches(
+            '...<span>1000.0</span>...',
+            self.browser.contents)
+        self.payment_url = self.browser.url
+
+
+    def test_interswitch_form(self):
+
+        # Manager can access InterswitchForm
+        self.browser.getLink("CollegePAY", index=0).click()
+        self.assertMatches('...Total Amount Authorized:...',
+                           self.browser.contents)
+        self.assertMatches(
+            '...<input type="hidden" name="amount" value="100000" />...',
+            self.browser.contents)
+
+    @external_test
+    def test_webservice(self):
+
+        self.browser.open(self.payment_url + '/request_webservice')
+        self.assertMatches('...Unsuccessful callback...',
+                          self.browser.contents)
+        # The payment is now in state failed
+        self.assertMatches('...<span>Failed</span>...',
+                          self.browser.contents)
Index: /main/kofacustom.wdu/trunk/src/kofacustom/wdu/locales.zcml
===================================================================
--- /main/kofacustom.wdu/trunk/src/kofacustom/wdu/locales.zcml	(revision 11940)
+++ /main/kofacustom.wdu/trunk/src/kofacustom/wdu/locales.zcml	(revision 11940)
@@ -0,0 +1,8 @@
+<configure xmlns="http://namespaces.zope.org/zope"
+           xmlns:i18n="http://namespaces.zope.org/i18n">
+
+  <include package="zope.i18n" file="meta.zcml" />
+  <i18n:registerTranslations directory="locales" />
+  <include package="waeup.kofa" file="locales.zcml" />
+
+</configure>
Index: /main/kofacustom.wdu/trunk/src/kofacustom/wdu/locales/en/LC_MESSAGES/waeup.kofa.po
===================================================================
--- /main/kofacustom.wdu/trunk/src/kofacustom/wdu/locales/en/LC_MESSAGES/waeup.kofa.po	(revision 11940)
+++ /main/kofacustom.wdu/trunk/src/kofacustom/wdu/locales/en/LC_MESSAGES/waeup.kofa.po	(revision 11940)
@@ -0,0 +1,14 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: \n"
+"POT-Creation-Date: \n"
+"PO-Revision-Date: \n"
+"Last-Translator: Henrik Bettermann <henrik@waeup.org>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=iso-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+msgid "Academics"
+msgstr "Institutions"
+
Index: /main/kofacustom.wdu/trunk/src/kofacustom/wdu/mail.zcml
===================================================================
--- /main/kofacustom.wdu/trunk/src/kofacustom/wdu/mail.zcml	(revision 11940)
+++ /main/kofacustom.wdu/trunk/src/kofacustom/wdu/mail.zcml	(revision 11940)
@@ -0,0 +1,82 @@
+<configure xmlns="http://namespaces.zope.org/zope"
+           xmlns:mail="http://namespaces.zope.org/mail">
+  <!--
+
+   SMTP Settings
+   *************
+
+   In here we define the mailers and mail deliveries we want to be
+   used by the portal.
+
+   They are set here (and not dynamically in the portal) to increase
+   security. Even portal users with all permissions cannot change mail
+   server credentials and related. You need filesystem access to
+   change/override the settings in here.
+
+   In the portal you can pick one of the deliveries for use with all
+   SMTP (aka mail) related functionality.
+
+   Each delivery (direct or queued) is bound to a certain mailer,
+   defined by a 'mail:smtpMailer' directive.
+
+   The smtpMailer directives define real mail hosts (local or remote)
+   where mail from the portal should be processed.
+
+   The 'mail:directDelivery' and 'mail:queuedDelivery' directives send
+   local mail to the mailer set in their 'mailer' attribute. While
+   directDelivery sends mail immediately when a request is finished
+   (see zope.sendmail for more info), queuedDelivery handles mail in a
+   background thread and sends mail independently from requests.
+
+   By default in Kofa we have a fake mailer activated, that does not
+   send real mail to the outside world.
+  -->
+
+  <!-- A mail server on localhost -->
+  <!-- Mail server definitions require the following attributes:
+
+        - name: (string) name to be used by deliveries
+
+       Mail server definitions allow the following additional attribs:
+
+        - hostname   (string) hostname or IP(?) of mail server to use
+                              ('localhost' by default)
+        - port       (int number) port to connect to SMTP mailer
+                              (25 by default)
+        - username   (string) Username to log in to mail server
+        - password   (string) Password to log in to mail server
+
+  -->
+  <mail:smtpMailer
+      name="smtp.mailserver"
+      hostname="localhost"
+      port="25"
+      />
+
+  <!-- The mail deliveries -->
+  <!-- Mail deliveries require the following attributes:
+
+        - name:       (string) this string will appear in portal select
+                               boxes
+        - permission: (string) zope default perms only
+        - mailer:     (string) name of some mailer registered above or
+                               'smtp'
+        - queuePath:  (string) must exist and contain cur/, new/, and
+                               tmp/ dirs. Relative paths are relative
+                               to the directory this files lives in.
+
+   -->
+  <mail:queuedDelivery
+      name="Queued SMTP on mail server"
+      permission="zope.Public"
+      mailer="smtp.mailserver"
+      queuePath="../../../var/mailqueue"
+      />
+
+  <mail:directDelivery
+      name="Direct SMTP on mail server"
+      permission="zope.Public"
+      mailer="smtp.mailserver"
+      />
+
+</configure>
Index: /main/kofacustom.wdu/trunk/src/kofacustom/wdu/meta.zcml
===================================================================
--- /main/kofacustom.wdu/trunk/src/kofacustom/wdu/meta.zcml	(revision 11940)
+++ /main/kofacustom.wdu/trunk/src/kofacustom/wdu/meta.zcml	(revision 11940)
@@ -0,0 +1,12 @@
+<configure
+    xmlns="http://namespaces.zope.org/zope"
+    xmlns:meta="http://namespaces.zope.org/meta"
+    xmlns:grok="http://namespaces.zope.org/grok">
+
+  <include package="grok" file="meta.zcml" />
+  <!-- include package="z3c.autoinclude" file="meta.zcml" / -->
+
+  <!-- Load the grokkers -->
+  <grok:grok package=".meta" />
+
+</configure>
Index: /main/kofacustom.wdu/trunk/src/kofacustom/wdu/payments/__init__.py
===================================================================
--- /main/kofacustom.wdu/trunk/src/kofacustom/wdu/payments/__init__.py	(revision 11940)
+++ /main/kofacustom.wdu/trunk/src/kofacustom/wdu/payments/__init__.py	(revision 11940)
@@ -0,0 +1,3 @@
+"""This package contains everything regarding payments.
+"""
+# Make this a package.
Index: /main/kofacustom.wdu/trunk/src/kofacustom/wdu/payments/interfaces.py
===================================================================
--- /main/kofacustom.wdu/trunk/src/kofacustom/wdu/payments/interfaces.py	(revision 11940)
+++ /main/kofacustom.wdu/trunk/src/kofacustom/wdu/payments/interfaces.py	(revision 11940)
@@ -0,0 +1,26 @@
+## $Id$
+##
+## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+from zope.interface import Attribute
+from zope import schema
+from kofacustom.nigeria.payments.interfaces import INigeriaOnlinePayment
+from kofacustom.wdu.interfaces import MessageFactory as _
+
+class ICustomOnlinePayment(INigeriaOnlinePayment):
+    """A payment via payment gateways.
+
+    """
Index: /main/kofacustom.wdu/trunk/src/kofacustom/wdu/permissions.py
===================================================================
--- /main/kofacustom.wdu/trunk/src/kofacustom/wdu/permissions.py	(revision 11940)
+++ /main/kofacustom.wdu/trunk/src/kofacustom/wdu/permissions.py	(revision 11940)
@@ -0,0 +1,30 @@
+## $Id$
+##
+## Copyright (C) 2012 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+import grok
+from waeup.kofa.permissions import CCOfficer
+
+
+class CRPUOfficer(CCOfficer):
+    """ Permissions of Computer Center members.
+
+    This is basically a copy of the the PortalManager. We exclude some
+    permissions by commenting them out.
+    """
+
+    grok.name('waeup.CCOfficer')
+    grok.title(u'CC Officer')
Index: /main/kofacustom.wdu/trunk/src/kofacustom/wdu/students/__init__.py
===================================================================
--- /main/kofacustom.wdu/trunk/src/kofacustom/wdu/students/__init__.py	(revision 11940)
+++ /main/kofacustom.wdu/trunk/src/kofacustom/wdu/students/__init__.py	(revision 11940)
@@ -0,0 +1,1 @@
+# Make this a package.
Index: /main/kofacustom.wdu/trunk/src/kofacustom/wdu/students/batching.py
===================================================================
--- /main/kofacustom.wdu/trunk/src/kofacustom/wdu/students/batching.py	(revision 11940)
+++ /main/kofacustom.wdu/trunk/src/kofacustom/wdu/students/batching.py	(revision 11940)
@@ -0,0 +1,44 @@
+## $Id$
+##
+## Copyright (C) 2012 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+"""Batch processing components for student objects.
+
+Batch processors eat CSV files to add, update or remove large numbers
+of certain kinds of objects at once.
+
+Here we define the processors for students specific objects like
+students, studycourses, payment tickets and accommodation tickets.
+"""
+from kofacustom.wdu.students.interfaces import (
+    ICustomStudent, ICustomStudentUpdateByRegNo,
+    ICustomStudentUpdateByMatricNo,
+    ICustomStudentOnlinePayment
+    )
+from waeup.kofa.students.batching import (
+    StudentProcessor, StudentOnlinePaymentProcessor)
+
+class CustomStudentProcessor(StudentProcessor):
+    """A batch processor for ICustomStudent objects.
+    """
+    iface = ICustomStudent
+    iface_byregnumber = ICustomStudentUpdateByRegNo
+    iface_bymatricnumber = ICustomStudentUpdateByMatricNo
+
+class CustomStudentOnlinePaymentProcessor(StudentOnlinePaymentProcessor):
+    """A batch processor for ICustomStudentOnlinePayment objects.
+    """
+    iface = ICustomStudentOnlinePayment
Index: /main/kofacustom.wdu/trunk/src/kofacustom/wdu/students/browser.py
===================================================================
--- /main/kofacustom.wdu/trunk/src/kofacustom/wdu/students/browser.py	(revision 11940)
+++ /main/kofacustom.wdu/trunk/src/kofacustom/wdu/students/browser.py	(revision 11940)
@@ -0,0 +1,47 @@
+## $Id$
+##
+## Copyright (C) 2012 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+import grok
+from zope.i18n import translate
+from zope.schema.interfaces import ConstraintNotSatisfied
+from zope.component import getUtility
+from hurry.workflow.interfaces import IWorkflowInfo
+from waeup.kofa.interfaces import REQUESTED, IExtFileStore, IKofaUtils
+from waeup.kofa.widgets.datewidget import FriendlyDatetimeDisplayWidget
+from waeup.kofa.browser.layout import KofaEditFormPage
+from waeup.kofa.browser.layout import action, jsaction
+from waeup.kofa.students.browser import (
+    StudyLevelEditFormPage, StudyLevelDisplayFormPage,
+    StudentBasePDFFormPage, ExportPDFCourseRegistrationSlipPage,
+    CourseTicketDisplayFormPage, StudentTriggerTransitionFormPage,
+    msave, emit_lock_message)
+from waeup.kofa.students.interfaces import IStudentsUtils, ICourseTicket
+from waeup.kofa.students.workflow import FORBIDDEN_POSTGRAD_TRANS
+from kofacustom.nigeria.students.browser import (
+    NigeriaOnlinePaymentDisplayFormPage,
+    NigeriaStudentBaseManageFormPage,
+    NigeriaStudentClearanceEditFormPage,
+    NigeriaOnlinePaymentAddFormPage,
+    NigeriaExportPDFPaymentSlipPage,
+    NigeriaExportPDFClearanceSlipPage,
+    )
+
+from kofacustom.wdu.students.interfaces import (
+    ICustomStudentOnlinePayment, ICustomStudentStudyCourse,
+    ICustomStudentStudyLevel)
+from kofacustom.wdu.interfaces import MessageFactory as _
+
Index: /main/kofacustom.wdu/trunk/src/kofacustom/wdu/students/export.py
===================================================================
--- /main/kofacustom.wdu/trunk/src/kofacustom/wdu/students/export.py	(revision 11940)
+++ /main/kofacustom.wdu/trunk/src/kofacustom/wdu/students/export.py	(revision 11940)
@@ -0,0 +1,75 @@
+## $Id$
+##
+## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+"""Exporters for student related stuff.
+"""
+from kofacustom.wdu.students.interfaces import (
+    ICustomStudent,
+    ICustomStudentStudyCourse,
+    ICustomStudentStudyLevel,
+    ICustomCourseTicket,
+    ICustomStudentOnlinePayment)
+from kofacustom.nigeria.students.export import (
+    NigeriaStudentsExporter,
+    NigeriaStudentStudyCourseExporter,
+    NigeriaStudentStudyLevelExporter,
+    NigeriaCourseTicketExporter,
+    NigeriaStudentPaymentsExporter)
+from waeup.kofa.utils.helpers import iface_names
+
+class CustomStudentsExporter(NigeriaStudentsExporter):
+    """Exporter for Students.
+    """
+
+    fields = tuple(sorted(iface_names(
+        ICustomStudent, omit=['loggerInfo']))) + (
+        'password', 'state', 'history', 'certcode', 'is_postgrad',
+        'current_level', 'current_session')
+
+class CustomStudentStudyCourseExporter(NigeriaStudentStudyCourseExporter):
+    """Exporter for StudentStudyCourses.
+    """
+
+    fields = tuple(
+        sorted(iface_names(ICustomStudentStudyCourse))) + ('student_id',)
+
+class CustomStudentStudyLevelExporter(NigeriaStudentStudyLevelExporter):
+    """Exporter for StudentStudyLevels.
+    """
+    #: Fieldnames considered by this exporter
+    fields = tuple(sorted(iface_names(
+        ICustomStudentStudyLevel) + ['level'])) + (
+        'student_id', 'number_of_tickets','certcode')
+
+class CustomCourseTicketExporter(NigeriaCourseTicketExporter):
+    """Exporter for CourseTickets.
+    """
+
+    fields = tuple(sorted(iface_names(ICustomCourseTicket) +
+        ['level', 'code', 'level_session'])) + ('student_id',
+        'certcode', 'display_fullname')
+
+class CustomStudentPaymentsExporter(NigeriaStudentPaymentsExporter):
+    """Exporter for OnlinePayment instances.
+    """
+
+    fields = tuple(
+        sorted(iface_names(
+            ICustomStudentOnlinePayment, exclude_attribs=False,
+            omit=['display_item']))) + (
+            'student_id','state','current_session')
+
Index: /main/kofacustom.wdu/trunk/src/kofacustom/wdu/students/interfaces.py
===================================================================
--- /main/kofacustom.wdu/trunk/src/kofacustom/wdu/students/interfaces.py	(revision 11940)
+++ /main/kofacustom.wdu/trunk/src/kofacustom/wdu/students/interfaces.py	(revision 11940)
@@ -0,0 +1,100 @@
+## $Id$
+##
+## Copyright (C) 2012 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+
+from zope import schema
+from kofacustom.nigeria.students.interfaces import (
+    INigeriaStudentBase, INigeriaUGStudentClearance, INigeriaPGStudentClearance,
+    INigeriaStudentPersonal, INigeriaStudentStudyLevel,
+    INigeriaStudentStudyCourse, INigeriaCourseTicket,
+    INigeriaStudentUpdateByRegNo, INigeriaStudentUpdateByMatricNo,
+    )
+from kofacustom.wdu.payments.interfaces import ICustomOnlinePayment
+from kofacustom.wdu.interfaces import MessageFactory as _
+
+class ICustomStudentBase(INigeriaStudentBase):
+    """Representation of student base data.
+
+    """
+
+class ICustomStudentPersonal(INigeriaStudentPersonal):
+    """Student personal data.
+
+    """
+
+class ICustomUGStudentClearance(INigeriaUGStudentClearance):
+    """Representation of ug student clearance data.
+
+    """
+
+class ICustomPGStudentClearance(INigeriaPGStudentClearance):
+    """Representation of pg student clearance data.
+
+    """
+
+
+class ICustomStudent(ICustomStudentBase,ICustomUGStudentClearance,
+    ICustomPGStudentClearance,ICustomStudentPersonal):
+    """Representation of a student.
+
+    """
+
+class ICustomStudentStudyCourse(INigeriaStudentStudyCourse):
+    """A container for student study levels.
+
+    """
+
+class ICustomStudentStudyLevel(INigeriaStudentStudyLevel):
+    """A container for course tickets.
+
+    """
+
+class ICustomStudentOnlinePayment(ICustomOnlinePayment):
+    """A student payment via payment gateways.
+
+    This Interface does not inherit from IStudentOnlinePayment.
+    Thus all fields from IStudentOnlinePayment have to be repeated here.
+    """
+
+    p_current = schema.Bool(
+        title = _(u'Current Session Payment'),
+        default = True,
+        required = False,
+        )
+
+    p_level = schema.Int(
+        title = _(u'Payment Level'),
+        required = False,
+        )
+
+ICustomStudentOnlinePayment['p_level'].order = ICustomStudentOnlinePayment[
+    'p_session'].order
+
+class ICustomCourseTicket(INigeriaCourseTicket):
+    """A course ticket.
+
+    """
+
+class ICustomStudentUpdateByRegNo(INigeriaStudentUpdateByRegNo):
+    """Representation of a student. Skip regular reg_number validation.
+
+    """
+
+class ICustomStudentUpdateByMatricNo(INigeriaStudentUpdateByMatricNo):
+    """Representation of a student. Skip regular matric_number validation.
+
+    """
Index: /main/kofacustom.wdu/trunk/src/kofacustom/wdu/students/payments.py
===================================================================
--- /main/kofacustom.wdu/trunk/src/kofacustom/wdu/students/payments.py	(revision 11940)
+++ /main/kofacustom.wdu/trunk/src/kofacustom/wdu/students/payments.py	(revision 11940)
@@ -0,0 +1,60 @@
+## $Id$
+##
+## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+"""
+Student payment components.
+"""
+import grok
+from zope.component.interfaces import IFactory
+from zope.interface import implementedBy
+from waeup.kofa.students.interfaces import IStudentNavigation
+from waeup.kofa.students.payments import (
+    StudentOnlinePayment, StudentOnlinePaymentFactory)
+from waeup.kofa.utils.helpers import attrs_to_fields
+from kofacustom.wdu.students.interfaces import ICustomStudentOnlinePayment
+
+class CustomStudentOnlinePayment(StudentOnlinePayment):
+    """This is a custom online payment for students.
+
+    Since this class inherits from StudentOnlinePayment, it automatically
+    implements the interfaces of the parent class which means
+    all viewlets and views meant for StudentOnlinePayment
+    can also be accessed in the customized system.
+    """
+    grok.implements(ICustomStudentOnlinePayment, IStudentNavigation)
+    grok.provides(ICustomStudentOnlinePayment)
+
+    def __init__(self):
+        super(CustomStudentOnlinePayment, self).__init__()
+        return
+
+    @property
+    def student(self):
+        return self.__parent__.__parent__
+
+CustomStudentOnlinePayment = attrs_to_fields(
+    CustomStudentOnlinePayment, omit=['display_item'])
+
+class CustomStudentOnlinePaymentFactory(StudentOnlinePaymentFactory):
+    """A factory for student online payments.
+    """
+
+    def __call__(self, *args, **kw):
+        return CustomStudentOnlinePayment()
+
+    def getInterfaces(self):
+        return implementedBy(CustomStudentOnlinePayment)
Index: /main/kofacustom.wdu/trunk/src/kofacustom/wdu/students/student.py
===================================================================
--- /main/kofacustom.wdu/trunk/src/kofacustom/wdu/students/student.py	(revision 11940)
+++ /main/kofacustom.wdu/trunk/src/kofacustom/wdu/students/student.py	(revision 11940)
@@ -0,0 +1,60 @@
+## $Id$
+##
+## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+"""
+Container for the various objects owned by students.
+"""
+import grok
+from zope.interface import implementedBy
+from waeup.kofa.utils.helpers import attrs_to_fields
+from waeup.kofa.students.student import StudentFactory
+from waeup.kofa.students.interfaces import IStudentNavigation
+from waeup.kofa.utils.helpers import get_current_principal
+from kofacustom.nigeria.students.student import NigeriaStudent
+from kofacustom.wdu.students.interfaces import ICustomStudent
+
+
+class CustomStudent(NigeriaStudent):
+    """This is a student container for the various objects
+    owned by students.
+    """
+    grok.implements(ICustomStudent, IStudentNavigation)
+    grok.provides(ICustomStudent)
+
+    @property
+    def transcript_enabled(self):
+        user = get_current_principal()
+        if user.id in ('admin', 'isouaba', 'niyi', 'delejason'):
+            return True
+        return False
+
+
+# Set all attributes of Student required in IStudent as field
+# properties. Doing this, we do not have to set initial attributes
+# ourselves and as a bonus we get free validation when an attribute is
+# set.
+CustomStudent = attrs_to_fields(CustomStudent)
+
+class CustomStudentFactory(StudentFactory):
+    """A factory for students.
+    """
+
+    def __call__(self, *args, **kw):
+        return CustomStudent()
+
+    def getInterfaces(self):
+        return implementedBy(CustomStudent)
Index: /main/kofacustom.wdu/trunk/src/kofacustom/wdu/students/studycourse.py
===================================================================
--- /main/kofacustom.wdu/trunk/src/kofacustom/wdu/students/studycourse.py	(revision 11940)
+++ /main/kofacustom.wdu/trunk/src/kofacustom/wdu/students/studycourse.py	(revision 11940)
@@ -0,0 +1,47 @@
+## $Id$
+##
+## Copyright (C) 2012 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+"""
+Container which holds the data of the student study courses
+and contains the (student) study level objects.
+"""
+import grok
+from zope.interface import implementedBy
+from waeup.kofa.students.studycourse import StudentStudyCourseFactory
+from waeup.kofa.utils.helpers import attrs_to_fields
+from waeup.kofa.students.interfaces import IStudentNavigation
+from waeup.kofa.students.workflow import CLEARED, RETURNING, PAID
+from kofacustom.nigeria.students.studycourse import NigeriaStudentStudyCourse
+from kofacustom.wdu.students.interfaces import ICustomStudentStudyCourse
+
+class CustomStudentStudyCourse(NigeriaStudentStudyCourse):
+    """This is a container for study levels.
+    """
+    grok.implements(ICustomStudentStudyCourse, IStudentNavigation)
+    grok.provides(ICustomStudentStudyCourse)
+
+CustomStudentStudyCourse = attrs_to_fields(CustomStudentStudyCourse)
+
+class CustomStudentStudyCourseFactory(StudentStudyCourseFactory):
+    """A factory for student study courses.
+    """
+
+    def __call__(self, *args, **kw):
+        return CustomStudentStudyCourse()
+
+    def getInterfaces(self):
+        return implementedBy(CustomStudentStudyCourse)
Index: /main/kofacustom.wdu/trunk/src/kofacustom/wdu/students/studylevel.py
===================================================================
--- /main/kofacustom.wdu/trunk/src/kofacustom/wdu/students/studylevel.py	(revision 11940)
+++ /main/kofacustom.wdu/trunk/src/kofacustom/wdu/students/studylevel.py	(revision 11940)
@@ -0,0 +1,77 @@
+## $Id$
+##
+## Copyright (C) 2012 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+"""
+Container which holds the data of a student study level
+and contains the course tickets.
+"""
+import grok
+from zope.component.interfaces import IFactory
+from zope.interface import implementedBy
+from waeup.kofa.utils.helpers import attrs_to_fields
+from waeup.kofa.students.studylevel import (
+    StudentStudyLevel, CourseTicket,
+    CourseTicketFactory, StudentStudyLevelFactory)
+from waeup.kofa.students.interfaces import IStudentNavigation
+from kofacustom.wdu.students.interfaces import (
+    ICustomStudentStudyLevel, ICustomCourseTicket)
+
+
+class CustomStudentStudyLevel(StudentStudyLevel):
+    """This is a container for course tickets.
+    """
+    grok.implements(ICustomStudentStudyLevel, IStudentNavigation)
+    grok.provides(ICustomStudentStudyLevel)
+
+CustomStudentStudyLevel = attrs_to_fields(
+    CustomStudentStudyLevel, omit=['total_credits', 'gpa'])
+
+class CustomStudentStudyLevelFactory(StudentStudyLevelFactory):
+    """A factory for student study levels.
+    """
+
+    def __call__(self, *args, **kw):
+        return CustomStudentStudyLevel()
+
+    def getInterfaces(self):
+        return implementedBy(CustomStudentStudyLevel)
+
+class CustomCourseTicket(CourseTicket):
+    """This is a course ticket which allows the
+    student to attend the course. Lecturers will enter scores and more at
+    the end of the term.
+
+    A course ticket contains a copy of the original course and
+    course referrer data. If the courses and/or their referrers are removed, the
+    corresponding tickets remain unchanged. So we do not need any event
+    triggered actions on course tickets.
+    """
+    grok.implements(ICustomCourseTicket, IStudentNavigation)
+    grok.provides(ICustomCourseTicket)
+
+
+CustomCourseTicket = attrs_to_fields(CustomCourseTicket)
+
+class CustomCourseTicketFactory(CourseTicketFactory):
+    """A factory for student study levels.
+    """
+
+    def __call__(self, *args, **kw):
+        return CustomCourseTicket()
+
+    def getInterfaces(self):
+        return implementedBy(CustomCourseTicket)
Index: /main/kofacustom.wdu/trunk/src/kofacustom/wdu/students/tests/__init__.py
===================================================================
--- /main/kofacustom.wdu/trunk/src/kofacustom/wdu/students/tests/__init__.py	(revision 11940)
+++ /main/kofacustom.wdu/trunk/src/kofacustom/wdu/students/tests/__init__.py	(revision 11940)
@@ -0,0 +1,1 @@
+# Make this a package.
Index: /main/kofacustom.wdu/trunk/src/kofacustom/wdu/students/tests/test_browser.py
===================================================================
--- /main/kofacustom.wdu/trunk/src/kofacustom/wdu/students/tests/test_browser.py	(revision 11940)
+++ /main/kofacustom.wdu/trunk/src/kofacustom/wdu/students/tests/test_browser.py	(revision 11940)
@@ -0,0 +1,37 @@
+## $Id$
+##
+## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+import os
+import shutil
+import tempfile
+from StringIO import StringIO
+from hurry.workflow.interfaces import IWorkflowState, IWorkflowInfo
+from zope.securitypolicy.interfaces import IPrincipalRoleManager
+from zope.component.hooks import setSite, clearSite
+from zope.component import getUtility, createObject
+from zope.interface import verify
+from zope.event import notify
+from waeup.kofa.authentication import LocalRoleSetEvent
+from waeup.kofa.app import University
+from waeup.kofa.students.tests.test_browser import StudentsFullSetup
+from waeup.kofa.students.accommodation import BedTicket
+from waeup.kofa.testing import FunctionalTestCase
+from waeup.kofa.interfaces import (
+    IExtFileStore, IFileStoreNameChooser)
+from waeup.kofa.students.interfaces import IStudentsUtils
+from kofacustom.wdu.testing import FunctionalLayer
+
Index: /main/kofacustom.wdu/trunk/src/kofacustom/wdu/students/tests/test_export.py
===================================================================
--- /main/kofacustom.wdu/trunk/src/kofacustom/wdu/students/tests/test_export.py	(revision 11940)
+++ /main/kofacustom.wdu/trunk/src/kofacustom/wdu/students/tests/test_export.py	(revision 11940)
@@ -0,0 +1,111 @@
+import datetime
+from zope.component import queryUtility
+from zope.interface.verify import verifyObject, verifyClass
+from waeup.kofa.interfaces import ICSVExporter
+from waeup.kofa.schoolgrades import ResultEntry
+from waeup.kofa.students.tests.test_batching import StudentImportExportSetup
+from kofacustom.wdu.utils.utils import CustomKofaUtils
+from kofacustom.wdu.students.export import (
+    CustomStudentsExporter, CustomStudentPaymentsExporter)
+from kofacustom.wdu.testing import FunctionalLayer
+
+
+class CustomStudentsExporterTest(StudentImportExportSetup):
+
+    layer = FunctionalLayer
+
+    def setUp(self):
+        super(CustomStudentsExporterTest, self).setUp()
+        self.setup_for_export()
+        result_entry = ResultEntry(
+            CustomKofaUtils.EXAM_SUBJECTS_DICT.keys()[0],
+            CustomKofaUtils.EXAM_GRADES[0][0]
+            )
+        self.student.alr_results = [
+            result_entry]
+        self.student.fst_sit_results = [
+            result_entry]
+        self.student.scd_sit_results = [
+            result_entry]
+        return
+
+    def test_ifaces(self):
+        # make sure we fullfill interface contracts
+        obj = CustomStudentsExporter()
+        verifyObject(ICSVExporter, obj)
+        verifyClass(ICSVExporter, CustomStudentsExporter)
+        return
+
+
+    def test_export_all(self):
+        # we can really export students
+        # set values we can expect in export file
+        self.setup_student(self.student)
+        exporter = CustomStudentsExporter()
+        exporter.export_all(self.app, self.outfile)
+        result = open(self.outfile, 'rb').read()
+        self.assertMatches(
+            'adm_code,alr_date,alr_fname,alr_no,alr_results,clearance_locked,'
+            'clr_code,date_of_birth,def_adm,disabled,email,emp2_end,'
+            'emp2_position,emp2_reason,emp2_start,emp_end,emp_position,'
+            'emp_reason,emp_start,employer,employer2,firstname,former_matric,'
+            'fst_sit_date,fst_sit_fname,fst_sit_no,fst_sit_results,'
+            'fst_sit_type,hq2_degree,hq2_disc,hq2_matric_no,hq2_school,'
+            'hq2_session,hq2_type,hq_degree,hq_disc,hq_fname,hq_matric_no,'
+            'hq_school,hq_session,hq_type,is_staff,lastname,lga,'
+            'marit_stat,matric_number,middlename,nationality,'
+            'next_kin_address,next_kin_name,next_kin_phone,next_kin_relation,'
+            'nysc_lga,nysc_location,nysc_year,officer_comment,'
+            'perm_address,personal_updated,phone,reg_number,'
+            'religion,scd_sit_date,scd_sit_fname,scd_sit_no,'
+            'scd_sit_results,scd_sit_type,sex,student_id,'
+            'suspended,suspended_comment,password,state,history,certcode,is_postgrad,'
+            'current_level,current_session\r\nmy adm code,,,,'
+            '"[(\'printing_craft_practice\', \'A1\')]",0,my clr code,1981-02-04#,,,'
+            'anna@sample.com,,,,,,,,,,,Anna,,,,,"[(\'printing_craft_practice\', \'A1\')]"'
+            ',,,,,,,,,,,,,,,,Tester,,,234,M.,NG,,,,,,,,,'
+            '"Studentroad 21\nLagos 123456\n",,+234-123-12345#,123,,,,,'
+            '"[(\'printing_craft_practice\', \'A1\')]",,f,A111111,0,,,created,'
+            '[u\'2012-11-06 13:16:41 WAT - Record created by system\'],'
+            'CERT1,0,200,2012\r\n',
+            result
+            )
+        return
+
+class CustomStudentPaymentsExporterTest(StudentImportExportSetup):
+
+    layer = FunctionalLayer
+
+    def setUp(self):
+        super(CustomStudentPaymentsExporterTest, self).setUp()
+        self.setup_for_export()
+        return
+
+    def test_ifaces(self):
+        # make sure we fullfill interface contracts
+        obj = CustomStudentPaymentsExporter()
+        verifyObject(ICSVExporter, obj)
+        verifyClass(ICSVExporter, CustomStudentPaymentsExporter)
+        return
+
+    def test_export_all(self):
+        # we can really export students
+        # set values we can expect in export file
+        self.setup_student(self.student)
+        self.student['payments']['my-payment'].r_company = 'interswatch'
+        self.student['payments']['my-payment'].r_card_num = '789'
+        exporter = CustomStudentPaymentsExporter()
+        exporter.export_all(self.app, self.outfile)
+        result = open(self.outfile, 'rb').read()
+        self.assertMatches(
+            'ac,amount_auth,creation_date,gateway_amt,p_category,p_current,'
+            'p_id,p_item,p_level,p_session,p_state,payment_date,provider_amt,'
+            'r_amount_approved,r_card_num,r_code,r_company,r_desc,'
+            'r_pay_reference,thirdparty_amt,student_id,state,'
+            'current_session\r\n'
+            '666,12.12,2012-04-01 13:12:01#,,schoolfee,1,my-id,p-item,'
+            '100,2012,paid,2012-04-01 14:12:01#,,12.12,'
+            '789,r-code,interswatch,,,,A111111,created,2012\r\n',
+            result
+            )
+        return
Index: /main/kofacustom.wdu/trunk/src/kofacustom/wdu/students/tests/test_student.py
===================================================================
--- /main/kofacustom.wdu/trunk/src/kofacustom/wdu/students/tests/test_student.py	(revision 11940)
+++ /main/kofacustom.wdu/trunk/src/kofacustom/wdu/students/tests/test_student.py	(revision 11940)
@@ -0,0 +1,127 @@
+## $Id$
+##
+## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+"""Tests for students and related.
+"""
+from datetime import tzinfo
+from zope.component.interfaces import IFactory
+from zope.interface import verify
+from waeup.kofa.testing import FunctionalTestCase
+from kofacustom.wdu.students.student import CustomStudent, CustomStudentFactory
+from kofacustom.wdu.students.studycourse import (
+    CustomStudentStudyCourse, CustomStudentStudyCourseFactory)
+from kofacustom.wdu.students.studylevel import (
+    CustomStudentStudyLevel, CustomCourseTicket,
+    CustomStudentStudyLevelFactory,
+    CustomCourseTicketFactory)
+from kofacustom.wdu.students.interfaces import (
+    ICustomStudent, ICustomStudentStudyCourse,
+    ICustomStudentStudyLevel, ICustomCourseTicket)
+from kofacustom.wdu.testing import FunctionalLayer
+
+
+class CustomStudentFactoryTest(FunctionalTestCase):
+
+    layer = FunctionalLayer
+
+    def setUp(self):
+        super(CustomStudentFactoryTest, self).setUp()
+        self.factory = CustomStudentFactory()
+
+    def tearDown(self):
+        super(CustomStudentFactoryTest, self).tearDown()
+
+    def test_interfaces(self):
+        verify.verifyClass(IFactory, CustomStudentFactory)
+        verify.verifyObject(IFactory, self.factory)
+
+    def test_factory(self):
+        obj = self.factory()
+        assert isinstance(obj, CustomStudent)
+
+    def test_getInterfaces(self):
+        implemented_by = self.factory.getInterfaces()
+        assert implemented_by.isOrExtends(ICustomStudent)
+
+class CustomStudentStudyCourseFactoryTest(FunctionalTestCase):
+
+    layer = FunctionalLayer
+
+    def setUp(self):
+        super(CustomStudentStudyCourseFactoryTest, self).setUp()
+        self.factory = CustomStudentStudyCourseFactory()
+
+    def tearDown(self):
+        super(CustomStudentStudyCourseFactoryTest, self).tearDown()
+
+    def test_interfaces(self):
+        verify.verifyClass(IFactory, CustomStudentStudyCourseFactory)
+        verify.verifyObject(IFactory, self.factory)
+
+    def test_factory(self):
+        obj = self.factory()
+        assert isinstance(obj, CustomStudentStudyCourse)
+
+    def test_getInterfaces(self):
+        implemented_by = self.factory.getInterfaces()
+        assert implemented_by.isOrExtends(ICustomStudentStudyCourse)
+
+class CustomStudentStudyLevelFactoryTest(FunctionalTestCase):
+
+    layer = FunctionalLayer
+
+    def setUp(self):
+        super(CustomStudentStudyLevelFactoryTest, self).setUp()
+        self.factory = CustomStudentStudyLevelFactory()
+
+    def tearDown(self):
+        super(CustomStudentStudyLevelFactoryTest, self).tearDown()
+
+    def test_interfaces(self):
+        verify.verifyClass(IFactory, CustomStudentStudyLevelFactory)
+        verify.verifyObject(IFactory, self.factory)
+
+    def test_factory(self):
+        obj = self.factory()
+        assert isinstance(obj, CustomStudentStudyLevel)
+
+    def test_getInterfaces(self):
+        implemented_by = self.factory.getInterfaces()
+        assert implemented_by.isOrExtends(ICustomStudentStudyLevel)
+
+class CustomCourseTicketFactoryTest(FunctionalTestCase):
+
+    layer = FunctionalLayer
+
+    def setUp(self):
+        super(CustomCourseTicketFactoryTest, self).setUp()
+        self.factory = CustomCourseTicketFactory()
+
+    def tearDown(self):
+        super(CustomCourseTicketFactoryTest, self).tearDown()
+
+    def test_interfaces(self):
+        verify.verifyClass(IFactory, CustomCourseTicketFactory)
+        verify.verifyObject(IFactory, self.factory)
+
+    def test_factory(self):
+        obj = self.factory()
+        assert isinstance(obj, CustomCourseTicket)
+
+    def test_getInterfaces(self):
+        implemented_by = self.factory.getInterfaces()
+        assert implemented_by.isOrExtends(ICustomCourseTicket)
Index: /main/kofacustom.wdu/trunk/src/kofacustom/wdu/students/utils.py
===================================================================
--- /main/kofacustom.wdu/trunk/src/kofacustom/wdu/students/utils.py	(revision 11940)
+++ /main/kofacustom.wdu/trunk/src/kofacustom/wdu/students/utils.py	(revision 11940)
@@ -0,0 +1,31 @@
+## $Id$
+##
+## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+from time import time
+from zope.component import createObject, getUtility
+from waeup.kofa.interfaces import (IKofaUtils,
+    CLEARED, RETURNING, PAID, REGISTERED, VALIDATED)
+from kofacustom.nigeria.students.utils import NigeriaStudentsUtils
+from kofacustom.wdu.interfaces import MessageFactory as _
+
+class CustomStudentsUtils(NigeriaStudentsUtils):
+    """A collection of customized methods.
+
+    """
+
+    # refix
+    STUDENT_ID_PREFIX = u'X'
Index: /main/kofacustom.wdu/trunk/src/kofacustom/wdu/students/viewlets.py
===================================================================
--- /main/kofacustom.wdu/trunk/src/kofacustom/wdu/students/viewlets.py	(revision 11940)
+++ /main/kofacustom.wdu/trunk/src/kofacustom/wdu/students/viewlets.py	(revision 11940)
@@ -0,0 +1,30 @@
+## $Id$
+##
+## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+
+import grok
+from waeup.kofa.interfaces import REQUESTED
+from waeup.kofa.browser.viewlets import ManageActionButton
+from kofacustom.wdu.students.interfaces import (
+    ICustomStudentStudyCourse, ICustomStudentStudyLevel)
+from waeup.kofa.students.viewlets import (
+    FileDisplay, FileUpload, Image)
+from waeup.kofa.students.browser import (
+    ExportPDFClearanceSlipPage, StudyCourseDisplayFormPage,
+    StudyLevelDisplayFormPage)
+
+from kofacustom.nigeria.interfaces import MessageFactory as _
Index: /main/kofacustom.wdu/trunk/src/kofacustom/wdu/testing.py
===================================================================
--- /main/kofacustom.wdu/trunk/src/kofacustom/wdu/testing.py	(revision 11940)
+++ /main/kofacustom.wdu/trunk/src/kofacustom/wdu/testing.py	(revision 11940)
@@ -0,0 +1,27 @@
+## $Id$
+##
+## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+"""Testing support for custom package.
+"""
+import os.path
+import kofacustom.wdu
+from zope.app.testing.functional import ZCMLLayer
+
+ftesting_zcml = os.path.join(
+    os.path.dirname(kofacustom.wdu.__file__), 'ftesting.zcml')
+FunctionalLayer = ZCMLLayer(ftesting_zcml, __name__, 'FunctionalLayer',
+                            allow_teardown=True)
Index: /main/kofacustom.wdu/trunk/src/kofacustom/wdu/tests/__init__.py
===================================================================
--- /main/kofacustom.wdu/trunk/src/kofacustom/wdu/tests/__init__.py	(revision 11940)
+++ /main/kofacustom.wdu/trunk/src/kofacustom/wdu/tests/__init__.py	(revision 11940)
@@ -0,0 +1,2 @@
+# This is a package
+
Index: /main/kofacustom.wdu/trunk/src/kofacustom/wdu/tests/test_configuration.py
===================================================================
--- /main/kofacustom.wdu/trunk/src/kofacustom/wdu/tests/test_configuration.py	(revision 11940)
+++ /main/kofacustom.wdu/trunk/src/kofacustom/wdu/tests/test_configuration.py	(revision 11940)
@@ -0,0 +1,76 @@
+## $Id$
+##
+## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+"""Tests for configuration containers and related.
+"""
+from zope.component.interfaces import IFactory
+from zope.interface import verify
+from waeup.kofa.testing import FunctionalTestCase
+from waeup.kofa.configuration import ConfigurationContainer
+from waeup.kofa.interfaces import IConfigurationContainer
+from waeup.kofa.tests.test_configuration import (
+    ConfigurationTest, SessionConfigurationFactoryTest)
+from kofacustom.wdu.configuration import (
+    CustomSessionConfiguration, CustomSessionConfigurationFactory)
+from kofacustom.wdu.interfaces import(
+    ICustomSessionConfiguration, ICustomSessionConfigurationAdd)
+from kofacustom.wdu.testing import FunctionalLayer
+
+class ConfigurationTest(ConfigurationTest):
+
+    layer = FunctionalLayer
+
+    def setUp(self):
+        super(ConfigurationTest, self).setUp()
+        self.confcontainer = ConfigurationContainer()
+        self.sessionconf = CustomSessionConfiguration()
+        return
+
+    #def tearDown(self):
+    #    super(ConfigurationTest, self).tearDown()
+    #    return
+
+    def test_interfaces(self):
+        #verify.verifyClass(IConfigurationContainer, ConfigurationContainer)
+        #verify.verifyObject(IConfigurationContainer, self.confcontainer)
+        verify.verifyClass(ICustomSessionConfiguration, CustomSessionConfiguration)
+        verify.verifyObject(ICustomSessionConfiguration, self.sessionconf)
+        verify.verifyClass(ICustomSessionConfigurationAdd, CustomSessionConfiguration)
+        verify.verifyObject(ICustomSessionConfigurationAdd, self.sessionconf)
+
+class SessionConfigurationFactoryTest(SessionConfigurationFactoryTest):
+
+    layer = FunctionalLayer
+
+    def setUp(self):
+        super(SessionConfigurationFactoryTest, self).setUp()
+        self.factory = CustomSessionConfigurationFactory()
+
+    #def tearDown(self):
+    #    super(SessionConfigurationFactoryTest, self).tearDown()
+
+    def test_interfaces(self):
+        verify.verifyClass(IFactory, CustomSessionConfigurationFactory)
+        verify.verifyObject(IFactory, self.factory)
+
+    def test_factory(self):
+        obj = self.factory()
+        assert isinstance(obj, CustomSessionConfiguration)
+
+    def test_getInterfaces(self):
+        implemented_by = self.factory.getInterfaces()
+        assert implemented_by.isOrExtends(ICustomSessionConfiguration)
Index: /main/kofacustom.wdu/trunk/src/kofacustom/wdu/tests/test_datacenter.py
===================================================================
--- /main/kofacustom.wdu/trunk/src/kofacustom/wdu/tests/test_datacenter.py	(revision 11940)
+++ /main/kofacustom.wdu/trunk/src/kofacustom/wdu/tests/test_datacenter.py	(revision 11940)
@@ -0,0 +1,30 @@
+## $Id$
+##
+## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+from waeup.kofa.datacenter import DataCenter
+from waeup.kofa.testing import FunctionalTestCase
+from kofacustom.wdu.testing import FunctionalLayer
+
+
+class DatacenterTests(FunctionalTestCase):
+
+    layer = FunctionalLayer
+
+    def test_storage_path(self):
+        mydatacenter = DataCenter()
+        storagepath = mydatacenter.storage
+        self.assertTrue('/parts/test/datacenter' in storagepath)
Index: /main/kofacustom.wdu/trunk/src/kofacustom/wdu/tests/test_smtp.py
===================================================================
--- /main/kofacustom.wdu/trunk/src/kofacustom/wdu/tests/test_smtp.py	(revision 11940)
+++ /main/kofacustom.wdu/trunk/src/kofacustom/wdu/tests/test_smtp.py	(revision 11940)
@@ -0,0 +1,129 @@
+# -*- coding: utf-8 -*-
+## $Id$
+##
+## Copyright (C) 2012 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+# Tests for email-related components
+import base64
+import logging
+import tempfile
+import shutil
+import unittest
+from StringIO import StringIO
+from zope.component import getUtility
+from zope.component.hooks import setSite
+from zope.sendmail.interfaces import IMailDelivery
+from waeup.kofa.app import University
+from waeup.kofa.interfaces import IMailService
+from waeup.kofa.smtp import (
+    encode_header_item, encode_address, encode_body, FakeSMTPDelivery,
+    send_mail)
+from waeup.kofa.testing import FunctionalTestCase
+from kofacustom.wdu.testing import FunctionalLayer
+
+#
+# SMTP test config
+#
+
+# Also run tests that send mail to external servers?
+#   If you enable this, please make sure the external smtp hosts and receivers
+#   do exist really and are not bothered by being spammed by a test programme.
+EXTERNAL_MAIL_TESTS = False
+
+# Maybe existing receiver of externally sent mail. If this mail account
+# exists really, it might receive mail from the tests!
+EXTERNAL_MAIL_RECEIVER = 'existing_address@waeup.org'
+
+# Names of mail deliveries to use when external mail tests are enabled.
+#   See local mail.zcml for names of available deliveries.
+EXTERNAL_DIRECT_DELIVERY = 'Direct SMTP on mail server'
+EXTERNAL_QUEUED_DELIVERY = 'Queued SMTP on mail server'
+
+#
+# end of SMTP test config
+#
+
+def external_mail_test(func):
+    if not EXTERNAL_MAIL_TESTS:
+        myself = __file__
+        if myself.endswith('.pyc'):
+            myself = myself[:-2]
+        print "WARNING: external mail tests are skipped!"
+        print "WARNING: edit %s to enable them." % myself
+        return
+    return func
+
+class ExternalMailerTests(FunctionalTestCase):
+
+    layer = FunctionalLayer
+
+    def setUp(self):
+        super(ExternalMailerTests, self).setUp()
+        # Setup a sample site for each test
+        app = University()
+        self.dc_root = tempfile.mkdtemp()
+        app['datacenter'].setStoragePath(self.dc_root)
+
+        # Prepopulate the ZODB...
+        self.getRootFolder()['app'] = app
+        self.app = self.getRootFolder()['app']
+        return
+
+    def tearDown(self):
+        super(ExternalMailerTests, self).tearDown()
+        shutil.rmtree(self.dc_root)
+        return
+
+    def test_config_default_mailer(self):
+        # The default mailer set in config is 'no mailer'.
+        self.assertEqual(
+            getattr(self.app.get('configuration', None), 'smtp_mailer'),
+            u'No email service')
+        return
+
+    @external_mail_test
+    def test_send_direct_mail(self):
+        # send mail using direct mail delivery
+        self.app['configuration'].smtp_mailer = EXTERNAL_DIRECT_DELIVERY
+        setSite(self.app)
+        result = send_mail(
+            'test program', 'no-reply@waeup.org',
+            'test mail receiver', EXTERNAL_MAIL_RECEIVER,
+            'Test Mail from WAeUP Kofa',
+            'Hi from test mailer!\n\nRegards,\nTest Programme\n'
+            )
+        import transaction
+        transaction.commit() # The mail is really sent when transactions is
+                             # committed
+        self.assertTrue('@' in result)
+        return
+
+    @external_mail_test
+    def test_send_queued_mail(self):
+        # send mail using queued mail delivery
+        self.app['configuration'].smtp_mailer = EXTERNAL_QUEUED_DELIVERY
+        setSite(self.app)
+        result = send_mail(
+            'test program', 'no-reply@waeup.org',
+            'test mail receiver', EXTERNAL_MAIL_RECEIVER,
+            'Test Mail from WAeUP Kofa',
+            'Hi from test mailer!\n\nRegards,\nTest Programme\n'
+            )
+        import transaction
+        transaction.commit() # The mail is really sent when transactions is
+                             # committed
+        self.assertTrue('@' in result)
+        return
Index: /main/kofacustom.wdu/trunk/src/kofacustom/wdu/university/__init__.py
===================================================================
--- /main/kofacustom.wdu/trunk/src/kofacustom/wdu/university/__init__.py	(revision 11940)
+++ /main/kofacustom.wdu/trunk/src/kofacustom/wdu/university/__init__.py	(revision 11940)
@@ -0,0 +1,1 @@
+# Make this a package.
Index: /main/kofacustom.wdu/trunk/src/kofacustom/wdu/utils/__init__.py
===================================================================
--- /main/kofacustom.wdu/trunk/src/kofacustom/wdu/utils/__init__.py	(revision 11940)
+++ /main/kofacustom.wdu/trunk/src/kofacustom/wdu/utils/__init__.py	(revision 11940)
@@ -0,0 +1,1 @@
+# Make this a package.
Index: /main/kofacustom.wdu/trunk/src/kofacustom/wdu/utils/tests.py
===================================================================
--- /main/kofacustom.wdu/trunk/src/kofacustom/wdu/utils/tests.py	(revision 11940)
+++ /main/kofacustom.wdu/trunk/src/kofacustom/wdu/utils/tests.py	(revision 11940)
@@ -0,0 +1,29 @@
+## $Id$
+##
+## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+from waeup.kofa.testing import FunctionalTestCase
+from kofacustom.wdu.testing import FunctionalLayer
+
+
+class CustomPackageUtilsTests(FunctionalTestCase):
+
+    layer = FunctionalLayer
+
+    def test_foo(self):
+        '''Test method foo.
+        '''
+        return
Index: /main/kofacustom.wdu/trunk/src/kofacustom/wdu/utils/utils.py
===================================================================
--- /main/kofacustom.wdu/trunk/src/kofacustom/wdu/utils/utils.py	(revision 11940)
+++ /main/kofacustom.wdu/trunk/src/kofacustom/wdu/utils/utils.py	(revision 11940)
@@ -0,0 +1,25 @@
+## $Id$
+##
+## Copyright (C) 2012 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+"""Customize general helper utilities for Kofa.
+"""
+from kofacustom.nigeria.utils.utils import NigeriaKofaUtils
+
+class CustomKofaUtils(NigeriaKofaUtils):
+    """A collection of methods subject to customization.
+    """
+
