Index: main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/configure.zcml
===================================================================
--- main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/configure.zcml	(revision 12371)
+++ main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/configure.zcml	(revision 12371)
@@ -0,0 +1,20 @@
+<configure xmlns="http://namespaces.zope.org/zope"
+           xmlns:grok="http://namespaces.zope.org/grok">
+
+  <!-- Loading waeup.ikoba also configures a lot of other needed
+       packages correctly.
+  -->
+  <include package="waeup.ikoba" />
+  <include package="ikobacustom.pcn" file="locales.zcml" />
+  <grok:grok package="." />
+
+  <!-- Register edit widget for PhoneNumbers -->
+  <adapter
+      for="waeup.ikoba.schema.interfaces.IPhoneNumber
+           zope.publisher.interfaces.browser.IBrowserRequest"
+      provides="zope.formlib.interfaces.ISimpleInputWidget"
+      factory="ikobacustom.pcn.widgets.phonewidget.NigeriaPhoneWidget"
+      permission="zope.Public"
+      />
+
+</configure>
Index: main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/__init__.py
===================================================================
--- main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/__init__.py	(revision 12371)
+++ main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/__init__.py	(revision 12371)
@@ -0,0 +1,3 @@
+"""This package contains everything regarding customers.
+"""
+# Make this a package.
Index: main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/batching.py
===================================================================
--- main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/batching.py	(revision 12371)
+++ main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/batching.py	(revision 12371)
@@ -0,0 +1,56 @@
+## $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 pcn documents.
+"""
+import grok
+from waeup.ikoba.customers.batching import (
+    CustomerProcessor,
+    CustomerDocumentProcessorBase, ContractProcessorBase)
+from ikobacustom.pcn.customers.interfaces import (
+    IPCNCustomer,
+    IPCNCustomerDocument, IPCNContract)
+from ikobacustom.pcn.interfaces import MessageFactory as _
+
+
+class PCNCustomerProcessor(CustomerProcessor):
+    """A batch processor for ICustomer objects.
+    """
+    util_name = 'pcncustomerprocessor'
+    grok.name(util_name)
+    name = _('PCN Customer Processor')
+    iface = IPCNCustomer
+
+
+class PCNCustomerDocumentProcessor(CustomerDocumentProcessorBase):
+    """A batch processor for IPCNCustomerDocument objects.
+    """
+    util_name = 'pcncustomerdocumentprocessor'
+    grok.name(util_name)
+    name = _('PCN Customer Document Processor')
+    iface = IPCNCustomerDocument
+    factory_name = 'waeup.PCNCustomerDocument'
+
+
+class PCNContractProcessor(ContractProcessorBase):
+    """A batch processor for IPCNContract objects.
+    """
+    util_name = 'pcncontractprocessor'
+    grok.name(util_name)
+    name = _('PCN Customer Contract Processor')
+    iface = IPCNContract
+    factory_name = 'waeup.PCNContract'
Index: main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/contracts.py
===================================================================
--- main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/contracts.py	(revision 12371)
+++ main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/contracts.py	(revision 12371)
@@ -0,0 +1,67 @@
+## $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
+##
+"""
+Customer contract components.
+"""
+
+import grok
+from zope.component.interfaces import IFactory
+from zope.interface import implementedBy
+from waeup.ikoba.utils.helpers import attrs_to_fields
+from waeup.ikoba.customers.interfaces import ICustomerNavigation
+from waeup.ikoba.customers.contracts import ContractBase
+from ikobacustom.pcn.interfaces import MessageFactory as _
+from ikobacustom.pcn.customers.interfaces import (
+    IPCNContract, IPCNContractEdit, IPCNContractProcess)
+
+
+class PCNContract(ContractBase):
+    """This is a sample contract.
+    """
+
+    grok.implements(
+        IPCNContractProcess,
+        IPCNContract,
+        IPCNContractEdit,
+        ICustomerNavigation)
+
+    contract_category = 'sample'
+
+    form_fields_interface = IPCNContract
+
+    edit_form_fields_interface = IPCNContractEdit
+
+    check_docs_interface = IPCNContract
+
+PCNContract = attrs_to_fields(PCNContract)
+
+
+# Contracts must be importable. So we might need a factory.
+class PCNContractFactory(grok.GlobalUtility):
+    """A factory for contracts.
+    """
+    grok.implements(IFactory)
+    grok.name(u'waeup.PCNContract')
+    title = u"Create a new contract.",
+    description = u"This factory instantiates new sample contract instances."
+
+    def __call__(self, *args, **kw):
+        return PCNContract(*args, **kw)
+
+    def getInterfaces(self):
+        return implementedBy(PCNContract)
Index: main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/customer.py
===================================================================
--- main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/customer.py	(revision 12371)
+++ main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/customer.py	(revision 12371)
@@ -0,0 +1,53 @@
+## $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
+##
+"""
+Container for the various objects owned by customers.
+"""
+import grok
+from zope.component.interfaces import IFactory
+from zope.interface import implementedBy
+from waeup.ikoba.utils.helpers import attrs_to_fields
+from waeup.ikoba.customers.customer import Customer
+from waeup.ikoba.customers.interfaces import ICustomerNavigation
+from ikobacustom.pcn.customers.interfaces import IPCNCustomer
+from ikobacustom.pcn.interfaces import MessageFactory as _
+
+
+class PCNCustomer(Customer):
+    """This is a customer container for the various objects
+    owned by customers.
+    """
+    grok.implements(IPCNCustomer, ICustomerNavigation)
+    grok.provides(IPCNCustomer)
+
+PCNCustomer = attrs_to_fields(PCNCustomer)
+
+
+class PCNCustomerFactory(grok.GlobalUtility):
+    """A factory for customers.
+    """
+    grok.implements(IFactory)
+    grok.name(u'waeup.Customer')
+    title = u"Create a new pcn customer.",
+    description = u"This factory instantiates new pcn customer instances."
+
+    def __call__(self, *args, **kw):
+        return PCNCustomer()
+
+    def getInterfaces(self):
+        return implementedBy(PCNCustomer)
Index: main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/documents.py
===================================================================
--- main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/documents.py	(revision 12371)
+++ main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/documents.py	(revision 12371)
@@ -0,0 +1,62 @@
+## $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
+##
+"""
+Customer document components.
+"""
+import grok
+from zope.component.interfaces import IFactory
+from zope.interface import implementedBy
+from waeup.ikoba.utils.helpers import attrs_to_fields
+from waeup.ikoba.customers.interfaces import ICustomerNavigation
+from waeup.ikoba.customers.documents import CustomerDocumentBase
+from ikobacustom.pcn.interfaces import MessageFactory as _
+from ikobacustom.pcn.customers.interfaces import IPCNCustomerDocument
+
+
+class PCNCustomerDocument(CustomerDocumentBase):
+    """This is a sample customer document.
+    """
+
+    grok.implements(IPCNCustomerDocument, ICustomerNavigation)
+    grok.provides(IPCNCustomerDocument)
+
+    # Ikoba can store any number of files per Document object.
+    # However, we highly recommend to associate and store
+    # only one file per Document object. Thus the following
+    # tuple should contain only a single filename string.
+    filenames = ('sample',)
+
+    form_fields_interface = IPCNCustomerDocument
+
+PCNCustomerDocument = attrs_to_fields(PCNCustomerDocument)
+
+
+# Customer documents must be importable. So we need a factory.
+class PCNCustomerDocumentFactory(grok.GlobalUtility):
+    """A factory for customer documents.
+    """
+    grok.implements(IFactory)
+    grok.name(u'waeup.PCNCustomerDocument')
+    title = u"Create a new document.",
+    description = u"This factory instantiates new sample document instances."
+
+    def __call__(self, *args, **kw):
+        return PCNCustomerDocument(*args, **kw)
+
+    def getInterfaces(self):
+        return implementedBy(PCNCustomerDocument)
Index: main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/export.py
===================================================================
--- main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/export.py	(revision 12371)
+++ main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/export.py	(revision 12371)
@@ -0,0 +1,49 @@
+## $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 pcn customer objects and subobjects.
+"""
+import grok
+from waeup.ikoba.customers.export import (
+    CustomerExporter, CustomerDocumentExporterBase, ContractExporterBase)
+from ikobacustom.pcn.customers.interfaces import (
+    IPCNCustomer, IPCNCustomerDocument, IPCNContract)
+from ikobacustom.pcn.interfaces import MessageFactory as _
+
+class PCNCustomerExporter(CustomerExporter):
+    """Exporter for Customers.
+    """
+    iface = IPCNCustomer
+    title = _(u'PCN Customers')
+
+
+class PCNCustomerDocumentExporter(CustomerDocumentExporterBase):
+    """Exporter for documents.
+    """
+    grok.name('pcncustomerdocuments')
+    iface = IPCNCustomerDocument
+    title = _(u'PCN Customer Documents')
+    class_name = 'PCNCustomerDocument'
+
+
+class PCNContractExporter(ContractExporterBase):
+    """Exporter for Contract instances.
+    """
+    grok.name('pcncontracts')
+    iface = IPCNContract
+    title = _(u'PCN Customer Contracts')
+    class_name = 'PCNContract'
Index: main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/fileviewlets.py
===================================================================
--- main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/fileviewlets.py	(revision 12371)
+++ main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/fileviewlets.py	(revision 12371)
@@ -0,0 +1,123 @@
+## $Id: fileviewlets.py 12347 2014-12-31 08:18:54Z henrik $
+##
+## 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
+##
+
+import grok
+from waeup.ikoba.interfaces import MessageFactory as _
+
+from waeup.ikoba.browser.fileviewlets import (
+    FileDisplay, FileUpload, Image)
+
+from ikobacustom.pcn.customers.documents import PCNCustomerDocument
+
+from waeup.ikoba.customers.browser import (
+    DocumentDisplayFormPage,
+    DocumentManageFormPage,
+    DocumentEditFormPage,
+    PDFDocumentSlipPage,)
+
+grok.templatedir('browser_templates')
+
+# File viewlets for customer documents
+
+class SampleScanManageUpload(FileUpload):
+    """Scan upload viewlet for officers.
+    """
+    grok.order(1)
+    grok.context(PCNCustomerDocument)
+    grok.view(DocumentManageFormPage)
+    grok.require('waeup.manageCustomer')
+    label = _(u'Sample Scan')
+    title = _(u'Sample Scan')
+    mus = 1024 * 50
+    download_name = u'sample'
+    tab_redirect = '#tab2'
+
+
+class SampleScanEditUpload(SampleScanManageUpload):
+    """Scan upload viewlet for customer.
+    """
+    grok.view(DocumentEditFormPage)
+    grok.require('waeup.handleCustomer')
+
+
+class SampleScanDisplay(FileDisplay):
+    """Scan display viewlet.
+    """
+    grok.order(1)
+    grok.context(PCNCustomerDocument)
+    grok.require('waeup.viewCustomer')
+    grok.view(DocumentDisplayFormPage)
+    label = _(u'Sample Scan')
+    title = _(u'Sample Scan')
+    download_name = u'sample'
+
+
+class SampleScanImage(Image):
+    """Scan document.
+    """
+    grok.name('sample')
+    grok.context(PCNCustomerDocument)
+    grok.require('waeup.viewCustomer')
+    download_name = u'sample'
+
+class SampleScanPDFSlip(SampleScanDisplay):
+    grok.view(PDFDocumentSlipPage)
+
+
+class PDFScanManageUpload(FileUpload):
+    """Scan upload viewlet for officers.
+    """
+    grok.view(DocumentManageFormPage)
+    grok.context(PCNCustomerDocument)
+    grok.require('waeup.manageCustomer')
+    label = _(u'PDF File')
+    title = _(u'PDF File')
+    mus = 1024 * 200
+    download_name = u'sample.pdf'
+    tab_redirect = '#tab2'
+
+
+class PDFScanEditUpload(PDFScanManageUpload):
+    """Scan upload viewlet for customer.
+    """
+    grok.view(DocumentEditFormPage)
+    grok.require('waeup.handleCustomer')
+
+
+class PDFScanDisplay(FileDisplay):
+    """Scan display viewlet.
+    """
+    grok.order(1)
+    grok.context(PCNCustomerDocument)
+    grok.require('waeup.viewCustomer')
+    grok.view(DocumentDisplayFormPage)
+    label = _(u'PDF Scan')
+    title = _(u'PDF Scan')
+    download_name = u'sample.pdf'
+
+
+class PDFScanImage(Image):
+    """Scan document.
+    """
+    grok.name('sample.pdf')
+    grok.context(PCNCustomerDocument)
+    grok.require('waeup.viewCustomer')
+    download_name = u'sample.pdf'
+
+class PDFScanSlip(PDFScanDisplay):
+    grok.view(PDFDocumentSlipPage)
Index: main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/interfaces.py
===================================================================
--- main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/interfaces.py	(revision 12371)
+++ main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/interfaces.py	(revision 12371)
@@ -0,0 +1,81 @@
+## $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
+##
+
+from zope import schema
+from waeup.ikoba.customers.interfaces import (
+    ICustomer, ICustomerDocument, IContract)
+from waeup.ikoba.customers.vocabularies import (
+    ConCatProductSource, CustomerDocumentSource)
+from waeup.ikoba.products.productoptions import ProductOptionField
+from ikobacustom.pcn.interfaces import MessageFactory as _
+
+
+class IPCNCustomer(ICustomer):
+    """Representation of a customer.
+
+    """
+
+# Customer document interfaces
+
+
+class IPCNCustomerDocument(ICustomerDocument):
+    """A customer document.
+
+    """
+
+# Customer contract interfaces
+
+class IPCNContract(IContract):
+    """A customer contract sample with document attached.
+
+    """
+
+    document_object = schema.Choice(
+        title = _(u'Document'),
+        source = CustomerDocumentSource(),
+        required = False,
+        )
+
+class IPCNContractProcess(IPCNContract):
+    """Interface for processing contract data.
+    """
+
+    product_options = schema.List(
+        title = _(u'Options/Fees'),
+        value_type = ProductOptionField(),
+        required = False,
+        readonly = False,
+        default = [],
+        )
+
+class IPCNContractEdit(IPCNContract):
+    """Interface for editing sample contract data by customers.
+
+    """
+
+    product_object = schema.Choice(
+        title = _(u'Product'),
+        source = ConCatProductSource(),
+        required = True,
+        )
+
+    document_object = schema.Choice(
+        title = _(u'Document'),
+        source = CustomerDocumentSource(),
+        required = True,
+        )
Index: main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/tests/__init__.py
===================================================================
--- main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/tests/__init__.py	(revision 12371)
+++ main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/tests/__init__.py	(revision 12371)
@@ -0,0 +1,1 @@
+# Make this a package.
Index: main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/tests/test_browser.py
===================================================================
--- main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/tests/test_browser.py	(revision 12371)
+++ main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/tests/test_browser.py	(revision 12371)
@@ -0,0 +1,275 @@
+## $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
+##
+"""
+Document browser and functional tests.
+"""
+import os
+import grok
+import datetime
+from cStringIO import StringIO
+from zope.component import queryUtility, getUtility, createObject
+from zope.event import notify
+from zope.interface.verify import verifyObject, verifyClass
+from zope.testbrowser.testing import Browser
+from hurry.workflow.interfaces import IWorkflowState
+from waeup.ikoba.customers.tests.test_batching import CustomerImportExportSetup
+from waeup.ikoba.customers.tests.test_browser import CustomersFullSetup
+from ikobacustom.pcn.customers.export import (
+    PCNCustomerExporter,
+    PCNCustomerDocumentExporter,
+    PCNContractExporter)
+from ikobacustom.pcn.customers.batching import (
+    PCNCustomerProcessor,
+    PCNCustomerDocumentProcessor,
+    PCNContractProcessor)
+from ikobacustom.pcn.testing import FunctionalLayer, samples_dir
+
+SAMPLE_IMAGE = os.path.join(os.path.dirname(__file__), 'test_image.jpg')
+SAMPLE_IMAGE_BMP = os.path.join(os.path.dirname(__file__), 'test_image.bmp')
+SAMPLE_PDF = os.path.join(os.path.dirname(__file__), 'test_pdf.pdf')
+
+class CustomerImportExportTest(CustomerImportExportSetup):
+
+    layer = FunctionalLayer
+
+    def setup_for_export(self):
+        customer = createObject(u'waeup.Customer')
+        customer.firstname = u'Beate'
+        customer.lastname = u'Mueller'
+        customer.reg_number = u'123'
+        customer.sex = u'f'
+        IWorkflowState(customer).setState('started')
+        self.app['customers'].addCustomer(customer)
+        document = createObject(u'waeup.PCNCustomerDocument')
+        document.title = u'My first document'
+        customer['documents'].addDocument(document)
+        contract = createObject(u'waeup.PCNContract')
+        contract.tc_dict = {'en':u'Hello World'}
+        customer['contracts'].addContract(contract)
+        self.customer = customer
+        self.document = document
+        self.contract = contract
+        self.outfile = os.path.join(self.workdir, 'myoutput.csv')
+        return
+
+    def test_export_reimport_customers(self):
+        # we can export all customers in a portal
+        # set values we can expect in export file
+        self.setup_for_export()
+        exporter = PCNCustomerExporter()
+        exporter.export_all(self.app, self.outfile)
+        result = open(self.outfile, 'rb').read()
+        self.assertEqual(result,
+            'customer_id,email,firstname,lastname,middlename,phone,'
+            'reg_number,sex,suspended,suspended_comment,password,state,history\r\n'
+            'K1000000,,Beate,Mueller,,,123,f,0,,,started,[]\r\n')
+        # We can reimport the file ...
+        processor = PCNCustomerProcessor()
+        result = processor.doImport(
+            self.outfile,
+            ['customer_id','email','firstname','lastname','middlename','phone',
+            'reg_number','sex','suspended','suspended_comment','password','state'],
+            mode='create')
+        num, num_fail, finished_path, failed_path = result
+        self.assertEqual(num_fail,1)
+        # ... if we remove the original customer.
+        del self.app['customers']['K1000000']
+        result = processor.doImport(
+            self.outfile,
+            ['customer_id','email','firstname','lastname','middlename','phone',
+            'reg_number','sex','suspended','suspended_comment','password','state'],
+            mode='create')
+        num_succ, num_fail, finished_path, failed_path = result
+        self.assertEqual(num_fail,0)
+        # We can import the same file in update mode if we ignore the reg_number.
+        result = processor.doImport(
+            self.outfile,
+            ['customer_id','email','firstname','lastname','middlename','phone',
+            'xx_reg_number','sex','suspended','suspended_comment','password','state'],
+            mode='update')
+        num_succ, num_fail, finished_path, failed_path = result
+        self.assertEqual(num_succ,1)
+        self.assertEqual(num_fail,0)
+        return
+
+    def test_export_reimport_documents(self):
+        # we can export all documents in a portal
+        # set values we can expect in export file
+        self.setup_for_export()
+        exporter = PCNCustomerDocumentExporter()
+        exporter.export_all(self.app, self.outfile)
+        result = open(self.outfile, 'rb').read()
+        self.assertMatches(result,
+            'class_name,document_id,history,state,title,user_id\r\n'
+            'PCNCustomerDocument,%s,'
+            '[u\'2014-12-21 17:00:36 WAT - Document created by system\'],'
+            'created,My first document,K1000000\r\n'
+            % self.document.document_id)
+        # We can reimport the file if we change the header (user_id -> customer_id)
+        processor = PCNCustomerDocumentProcessor()
+        open(self.outfile, 'wb').write(
+            'customer_id,class_name,document_id,state,title\r\n'
+            'K1000000,PCNCustomerDocument,%s,started,My first title\r\n'
+            % self.document.document_id)
+        result = processor.doImport(
+            self.outfile,
+            ['customer_id','class_name','document_id','state','title'],
+            mode='create')
+        num, num_fail, finished_path, failed_path = result
+        # The object exists.
+        self.assertEqual(num_fail,1)
+        # We remove the original document.
+        del self.customer['documents'][self.document.document_id]
+        result = processor.doImport(
+            self.outfile,
+            ['customer_id','class_name','document_id','state','title'],
+            mode='create')
+        num_succ, num_fail, finished_path, failed_path = result
+        self.assertEqual(num_fail,0)
+        # We can import the same file in update mode.
+        result = processor.doImport(
+            self.outfile,
+            ['customer_id','class_name','document_id','state','title'],
+            mode='update')
+        num_succ, num_fail, finished_path, failed_path = result
+        self.assertEqual(num_succ,1)
+        self.assertEqual(num_fail,0)
+        return
+
+    def test_export_reimport_contracts(self):
+        # we can export all contracts in a portal
+        # set values we can expect in export file
+        self.setup_for_export()
+        exporter = PCNContractExporter()
+        exporter.export_all(self.app, self.outfile)
+        result = open(self.outfile, 'rb').read()
+        self.assertMatches(result,
+            'class_name,contract_category,contract_id,document_object,'
+            'history,last_product_id,product_object,product_options,'
+            'state,tc_dict,title,user_id\r\n'
+            'PCNContract,sample,%s,,'
+            '[u\'2014-12-21 22:26:00 WAT - Contract created by system\']'
+            ',,,[],created,{\'en\': u\'Hello World\'},,K1000000\r\n'
+            % self.contract.contract_id)
+        # We can reimport the file if we change the header (user_id -> customer_id)
+        processor = PCNContractProcessor()
+        open(self.outfile, 'wb').write(
+            'class_name,contract_category,contract_id,document_object,'
+            'history,last_product_id,product_object,product_options,'
+            'state,tc_dict,title,user_id\r\n'
+            'PCNContract,sample,%s,,'
+            '[u\'2014-12-21 22:26:00 WAT - Contract created by system\']'
+            ',,,[],created,{\'en\': u\'Hello World\'},,K1000000\r\n'
+            % self.contract.contract_id)
+        result = processor.doImport(
+            self.outfile,
+            ['class_name','contract_category','contract_id','document_object',
+            'history','last_product_id','product_object','product_options',
+            'state','tc_dict','title','customer_id'],
+            mode='create')
+        num, num_fail, finished_path, failed_path = result
+        # The object exists.
+        self.assertEqual(num_fail,1)
+        # We remove the original contract.
+        del self.customer['contracts'][self.contract.contract_id]
+        result = processor.doImport(
+            self.outfile,
+            ['class_name','contract_category','contract_id','document_object',
+            'history','last_product_id','product_object','product_options',
+            'state','tc_dict','title','customer_id'],
+            mode='create')
+        num_succ, num_fail, finished_path, failed_path = result
+        self.assertEqual(num_fail,0)
+        # We can import the same file in update mode.
+        result = processor.doImport(
+            self.outfile,
+            ['class_name','contract_category','contract_id','document_object',
+            'history','last_product_id','product_object','product_options',
+            'state','tc_dict','title','customer_id'],
+            mode='update')
+        num_succ, num_fail, finished_path, failed_path = result
+        self.assertEqual(num_succ,1)
+        self.assertEqual(num_fail,0)
+        return
+
+class DocumentUITests(CustomersFullSetup):
+    # Tests for customer document related views and pages
+
+    layer = FunctionalLayer
+
+    def test_manage_upload_pdf_file(self):
+        # Managers can upload a file via the DocumentManageFormPage
+        # The image is stored even if form has errors
+        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
+        self.browser.open(self.customer_path + '/documents')
+        self.browser.getControl("Add document").click()
+        self.browser.getControl(name="doctype").value = ['PCNCustomerDocument']
+        self.browser.getControl(name="form.title").value = 'My PCN Document'
+        self.browser.getControl("Add document").click()
+        docid = [i for i in self.customer['documents'].keys() if len(i) > 10][0]
+        self.browser.open(self.documents_path + '/%s/manage' % docid)
+        # Create a pseudo image file and select it to be uploaded
+        image = open(SAMPLE_IMAGE, 'rb')
+        ctrl = self.browser.getControl(name='pdfscanmanageupload')
+        file_ctrl = ctrl.mech_control
+        file_ctrl.add_file(image, filename='my_sample_scan.jpg')
+        self.browser.getControl(
+            name='upload_pdfscanmanageupload').click()
+        self.assertTrue(
+            'pdf file extension expected' in self.browser.contents)
+        ctrl = self.browser.getControl(name='pdfscanmanageupload')
+        file_ctrl = ctrl.mech_control
+        file_ctrl.add_file(image, filename='my_sample_scan.pdf')
+        self.browser.getControl(
+            name='upload_pdfscanmanageupload').click()
+        self.assertTrue(
+            'Could not determine file type' in self.browser.contents)
+        pdf = open(SAMPLE_PDF, 'rb')
+        ctrl = self.browser.getControl(name='pdfscanmanageupload')
+        file_ctrl = ctrl.mech_control
+        file_ctrl.add_file(pdf, filename='my_sample_scan.pdf')
+        self.browser.getControl(
+            name='upload_pdfscanmanageupload').click()
+        self.assertTrue(
+            'href="http://localhost/app/customers/K1000000/documents/%s/sample.pdf">PDF File</a>'
+            % docid in self.browser.contents)
+        # Browsing the link shows a real pdf
+        self.browser.open('sample.pdf')
+        self.assertEqual(
+            self.browser.headers['content-type'], 'application/pdf')
+
+class ContractUITests(CustomersFullSetup):
+    # Tests for contract related views and pages
+
+    layer = FunctionalLayer
+
+    def test_view_slips(self):
+        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
+        # Officers can open contract slips.
+        # First we add a submitted document and a product.
+        IWorkflowState(self.document).setState('submitted')
+        self.contract.document_object = self.document
+        self.contract.product_object = self.product
+        self.contract.tc_dict = {'en': u'<strong>Hello world</strong>'}
+        self.browser.open(self.customer_path + '/contracts/CON1')
+        self.browser.getLink("Download contract slip").click()
+        self.assertEqual(self.browser.headers['Status'], '200 Ok')
+        self.assertEqual(self.browser.headers['Content-Type'], 'application/pdf')
+        path = os.path.join(samples_dir(), 'contract_slip.pdf')
+        open(path, 'wb').write(self.browser.contents)
+        print "Sample contract_slip.pdf written to %s" % path
Index: main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/tests/test_contract.py
===================================================================
--- main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/tests/test_contract.py	(revision 12371)
+++ main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/tests/test_contract.py	(revision 12371)
@@ -0,0 +1,54 @@
+## $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
+##
+"""
+Tests for contracts.
+"""
+import tempfile
+import shutil
+from zope.interface.verify import verifyClass, verifyObject
+from zope.component import createObject
+from zope.component.hooks import setSite
+from zope.interface import verify
+from waeup.ikoba.customers.interfaces import ICustomerNavigation
+from waeup.ikoba.customers.contracts import ContractsContainer
+
+from ikobacustom.pcn.testing import (FunctionalLayer, FunctionalTestCase)
+from ikobacustom.pcn.customers.contracts import PCNContract
+from ikobacustom.pcn.customers.interfaces import IPCNContract
+
+
+class ContractsContainerTestCase(FunctionalTestCase):
+
+    layer = FunctionalLayer
+
+    def test_interfaces(self):
+        verify.verifyClass(IPCNContract, PCNContract)
+        verify.verifyClass(ICustomerNavigation, PCNContract)
+        verify.verifyObject(IPCNContract, PCNContract())
+        verify.verifyObject(ICustomerNavigation, PCNContract())
+        return
+
+    def test_addContract(self):
+        container = ContractsContainer()
+        contract = createObject(u'waeup.PCNContract')
+        id = contract.contract_id
+        container.addContract(contract)
+        self.assertEqual(container[id], contract)
+        self.assertRaises(TypeError, container.addContract, object())
+        self.assertEqual(contract.class_name, 'PCNContract')
+        return
Index: main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/tests/test_customer.py
===================================================================
--- main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/tests/test_customer.py	(revision 12371)
+++ main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/tests/test_customer.py	(revision 12371)
@@ -0,0 +1,71 @@
+## $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
+##
+"""
+Tests for pcn customers.
+"""
+import tempfile
+import shutil
+from zope.interface.verify import verifyClass, verifyObject
+from zope.component import createObject
+from zope.component.hooks import setSite
+from zope.interface import verify
+from waeup.ikoba.app import Company
+from waeup.ikoba.customers.interfaces import (
+    ICustomersContainer, ICustomerNavigation)
+from waeup.ikoba.customers.container import CustomersContainer
+
+from ikobacustom.pcn.testing import (FunctionalLayer, FunctionalTestCase)
+from ikobacustom.pcn.customers.customer import PCNCustomer
+from ikobacustom.pcn.customers.interfaces import IPCNCustomer
+
+class PCNCustomerTestCase(FunctionalTestCase):
+
+    layer = FunctionalLayer
+
+    def setUp(self):
+        super(PCNCustomerTestCase, self).setUp()
+
+        # Prepopulate ZODB
+        app = Company()
+        self.dc_root = tempfile.mkdtemp()
+        app['datacenter'].setStoragePath(self.dc_root)
+
+        # Prepopulate the ZODB...
+        self.getRootFolder()['app'] = app
+        self.app = self.getRootFolder()['app']
+        setSite(self.app)
+
+    def test_interfaces(self):
+        verify.verifyClass(IPCNCustomer, PCNCustomer)
+        verify.verifyClass(ICustomerNavigation, PCNCustomer)
+        verify.verifyObject(IPCNCustomer, PCNCustomer())
+        verify.verifyObject(ICustomerNavigation, PCNCustomer())
+        return
+
+    def test_addPCNCustomer(self):
+        customer = createObject(u'waeup.Customer')
+        verify.verifyObject(IPCNCustomer, customer)
+        self.app['customers'].addCustomer(customer)
+        self.assertEqual(customer.customer_id, 'K1000000')
+        self.assertEqual(self.app['customers']['K1000000'], customer)
+        return
+
+    def tearDown(self):
+        shutil.rmtree(self.dc_root)
+        super(PCNCustomerTestCase, self).tearDown()
+        return
Index: main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/tests/test_document.py
===================================================================
--- main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/tests/test_document.py	(revision 12371)
+++ main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/tests/test_document.py	(revision 12371)
@@ -0,0 +1,54 @@
+## $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
+##
+"""
+Tests for documents.
+"""
+import tempfile
+import shutil
+from zope.interface.verify import verifyClass, verifyObject
+from zope.component import createObject
+from zope.component.hooks import setSite
+from zope.interface import verify
+from waeup.ikoba.customers.interfaces import ICustomerNavigation
+from waeup.ikoba.customers.documents import CustomerDocumentsContainer
+
+from ikobacustom.pcn.testing import (FunctionalLayer, FunctionalTestCase)
+from ikobacustom.pcn.customers.documents import PCNCustomerDocument
+from ikobacustom.pcn.customers.interfaces import IPCNCustomerDocument
+
+
+class DocumentsContainerTestCase(FunctionalTestCase):
+
+    layer = FunctionalLayer
+
+    def test_interfaces(self):
+        verify.verifyClass(IPCNCustomerDocument, PCNCustomerDocument)
+        verify.verifyClass(ICustomerNavigation, PCNCustomerDocument)
+        verify.verifyObject(IPCNCustomerDocument, PCNCustomerDocument())
+        verify.verifyObject(ICustomerNavigation, PCNCustomerDocument())
+        return
+
+    def test_addDocument(self):
+        container = CustomerDocumentsContainer()
+        document = createObject(u'waeup.PCNCustomerDocument')
+        id = document.document_id
+        container.addDocument(document)
+        self.assertEqual(container[id], document)
+        self.assertRaises(TypeError, container.addDocument, object())
+        self.assertEqual(document.class_name, 'PCNCustomerDocument')
+        return
Index: main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/utils.py
===================================================================
--- main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/utils.py	(revision 12371)
+++ main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/utils.py	(revision 12371)
@@ -0,0 +1,65 @@
+## $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
+##
+"""General helper functions and utilities for the customer section.
+"""
+
+from copy import deepcopy
+from waeup.ikoba.customers.utils import (
+    CustomersUtils,
+    STARTED, CREATED, REQUESTED, APPROVED,
+    SUBMITTED, VERIFIED, REJECTED,
+    EXPIRED)
+from ikobacustom.pcn.interfaces import MessageFactory as _
+
+class PCNCustomersUtils(CustomersUtils):
+    """A collection of methods subject to customization.
+    """
+
+    #: A prefix used when generating new customer ids. Each customer id will
+    #: start with this string. The default is 'K'.
+    CUSTOMER_ID_PREFIX = u'K'
+
+    DOCMANAGE_CUSTOMER_STATES = (REQUESTED, APPROVED,)
+
+    DOCMANAGE_DOCUMENT_STATES = (CREATED,)
+
+    CONMANAGE_CUSTOMER_STATES = deepcopy(DOCMANAGE_CUSTOMER_STATES)
+
+    CONMANAGE_CONTRACT_STATES = (CREATED,)
+
+    DOCTYPES_DICT = {
+        #'CustomerSampleDocument': _('Sample Document'),
+        #'CustomerPDFDocument': _('PDF Document'),
+
+        'PCNCustomerDocument': _('PCN Document'),
+        }
+
+    CONTYPES_DICT = {
+        #'SampleContract': _('Sample Contract'),
+
+        'PCNContract': _('PCN Contract'),
+        }
+
+    SELECTABLE_DOCTYPES_DICT = deepcopy(DOCTYPES_DICT)
+
+    SELECTABLE_CONTYPES_DICT = deepcopy(CONTYPES_DICT)
+
+    EXPORTER_NAMES = (
+        'customers',
+        'pcncustomerdocuments',
+        'pcncontracts')
Index: main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/documents/__init__.py
===================================================================
--- main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/documents/__init__.py	(revision 12371)
+++ main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/documents/__init__.py	(revision 12371)
@@ -0,0 +1,8 @@
+"""This package contains everything regarding documents.
+"""
+# Make this a package.
+from ikobacustom.pcn.documents.document import PCNDocument
+
+__all__ = [
+    'PCNDocument',
+    ]
Index: main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/documents/batching.py
===================================================================
--- main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/documents/batching.py	(revision 12371)
+++ main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/documents/batching.py	(revision 12371)
@@ -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
+##
+"""Batch processing for pcn documents.
+"""
+import grok
+from waeup.ikoba.documents.batching import DocumentProcessorBase
+from ikobacustom.pcn.documents.interfaces import IPCNDocument
+from ikobacustom.pcn.interfaces import MessageFactory as _
+
+
+class PCNDocumentProcessor(DocumentProcessorBase):
+    """A batch processor for IPCNDocument objects.
+    """
+    util_name = 'pcndocumentprocessor'
+    grok.name(util_name)
+
+    name = _('PCN Document Processor')
+    iface = IPCNDocument
+
+    factory_name = 'waeup.PCNDocument'
Index: main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/documents/document.py
===================================================================
--- main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/documents/document.py	(revision 12371)
+++ main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/documents/document.py	(revision 12371)
@@ -0,0 +1,51 @@
+## $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
+##
+"""
+These are the documents.
+"""
+import grok
+from zope.component.interfaces import IFactory
+from zope.interface import implementedBy
+from waeup.ikoba.utils.helpers import attrs_to_fields
+from waeup.ikoba.documents.document import PublicDocumentBase
+from ikobacustom.pcn.documents.interfaces import IPCNDocument
+from ikobacustom.pcn.interfaces import MessageFactory as _
+
+
+class PCNDocument(PublicDocumentBase):
+    """This is a document.
+    """
+    grok.implements(IPCNDocument)
+    grok.provides(IPCNDocument)
+
+PCNDocument = attrs_to_fields(PCNDocument)
+
+
+class PCNDocumentFactory(grok.GlobalUtility):
+    """A factory for documents.
+    """
+    grok.implements(IFactory)
+    grok.name(u'waeup.PCNDocument')
+    title = u"Create a new document.",
+    description = u"This factory instantiates new pcn documents."
+
+    def __call__(self, *args, **kw):
+        return PCNDocument(*args, **kw)
+
+    def getInterfaces(self):
+        return implementedBy(PCNDocument)
Index: main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/documents/export.py
===================================================================
--- main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/documents/export.py	(revision 12371)
+++ main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/documents/export.py	(revision 12371)
@@ -0,0 +1,32 @@
+## $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 pcn documents.
+"""
+import grok
+from waeup.ikoba.documents.export import DocumentExporterBase
+from ikobacustom.pcn.documents.interfaces import IPCNDocument
+from ikobacustom.pcn.interfaces import MessageFactory as _
+
+
+class PCNDocumentExporter(DocumentExporterBase):
+    """Exporter for documents.
+    """
+    grok.name('pcndocuments')
+    iface = IPCNDocument
+    class_name = 'PCNDocument'
+    title = _(u'PCN Documents')
Index: main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/documents/interfaces.py
===================================================================
--- main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/documents/interfaces.py	(revision 12371)
+++ main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/documents/interfaces.py	(revision 12371)
@@ -0,0 +1,25 @@
+## $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
+##
+from waeup.ikoba.documents.interfaces import IPublicDocument
+from ikobacustom.pcn.interfaces import MessageFactory as _
+
+
+class IPCNDocument(IPublicDocument):
+    """A representation of a pcn document.
+
+    """
Index: main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/documents/tests/__init__.py
===================================================================
--- main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/documents/tests/__init__.py	(revision 12371)
+++ main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/documents/tests/__init__.py	(revision 12371)
@@ -0,0 +1,1 @@
+# Make this a package.
Index: main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/documents/tests/test_browser.py
===================================================================
--- main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/documents/tests/test_browser.py	(revision 12371)
+++ main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/documents/tests/test_browser.py	(revision 12371)
@@ -0,0 +1,90 @@
+## $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
+##
+"""
+Document browser and functional tests.
+"""
+import os
+import grok
+import datetime
+from cStringIO import StringIO
+from zope.component import queryUtility, getUtility
+from zope.event import notify
+from zope.interface.verify import verifyObject, verifyClass
+from waeup.ikoba.documents.tests.test_batching import DocumentImportExportSetup
+from ikobacustom.pcn.documents.document import PCNDocument
+from ikobacustom.pcn.documents.export import PCNDocumentExporter
+from ikobacustom.pcn.documents.batching import PCNDocumentProcessor
+from ikobacustom.pcn.testing import FunctionalLayer
+
+
+class DocumentImportExportTest(DocumentImportExportSetup):
+
+    layer = FunctionalLayer
+
+    def setup_for_export(self):
+        document = PCNDocument()
+        document.document_id = u'DOC1'
+        document.title = u'My first document'
+        self.app['documents'][document.document_id] = self.document = document
+        self.outfile = os.path.join(self.workdir, 'myoutput.csv')
+        return
+
+    def test_export_reimport_all(self):
+        # we can export all documents in a portal
+        # set values we can expect in export file
+        self.setup_for_export()
+        exporter = PCNDocumentExporter()
+        exporter.export_all(self.app, self.outfile)
+        result = open(self.outfile, 'rb').read()
+        self.assertMatches(result,
+            'class_name,description,document_id,history,state,title,'
+            'users_with_local_roles\r\n'
+            'PCNDocument,,DOC1,'
+            '[u\'2014-12-21 23:27:15 WAT - Document created by system\'],'
+            'created,My first document,[]\r\n')
+        # We can import the same file.
+        processor = PCNDocumentProcessor()
+        result = processor.doImport(
+            self.outfile,
+            ['class_name','description','document_id','history','state',
+             'title','users_with_local_roles'],
+            mode='create')
+        num, num_fail, finished_path, failed_path = result
+        #content = open(failed_path).read()
+        # The object exists.
+        self.assertEqual(num_fail,1)
+        # We remove the original document.
+        del self.app['documents']['DOC1']
+        result = processor.doImport(
+            self.outfile,
+            ['class_name','description','document_id','history','state',
+             'title','users_with_local_roles'],
+            mode='create')
+        num_succ, num_fail, finished_path, failed_path = result
+        self.assertEqual(num_fail,0)
+        # We can import the same file in update mode.
+        processor = PCNDocumentProcessor()
+        result = processor.doImport(
+            self.outfile,
+            ['class_name','description','document_id','history','state',
+             'title','users_with_local_roles'],
+            mode='update')
+        num_succ, num_fail, finished_path, failed_path = result
+        self.assertEqual(num_succ,1)
+        self.assertEqual(num_fail,0)
+        return
Index: main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/documents/tests/test_document.py
===================================================================
--- main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/documents/tests/test_document.py	(revision 12371)
+++ main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/documents/tests/test_document.py	(revision 12371)
@@ -0,0 +1,53 @@
+## $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
+##
+"""
+Tests for pcn documents.
+"""
+from zope.interface.verify import verifyClass, verifyObject
+from zope.component import createObject
+from waeup.ikoba.documents.container import DocumentsContainer
+
+from ikobacustom.pcn.testing import (FunctionalLayer, FunctionalTestCase)
+from ikobacustom.pcn.documents.document import PCNDocument
+from ikobacustom.pcn.documents.interfaces import IPCNDocument
+
+class PCNDocumentTestCase(FunctionalTestCase):
+
+    layer = FunctionalLayer
+
+    def test_interfaces(self):
+        # Make sure the correct interfaces are implemented.
+        self.assertTrue(
+            verifyClass(
+                IPCNDocument, PCNDocument)
+            )
+        self.assertTrue(
+            verifyObject(
+                IPCNDocument, PCNDocument())
+            )
+        return
+
+    def test_addPCNDocument(self):
+        container = DocumentsContainer()
+        document = createObject(u'waeup.PCNDocument')
+        document.document_id = u'DOC1'
+        container.addDocument(document)
+        self.assertRaises(TypeError, container.addDocument, object())
+        self.assertEqual(document.document_id, 'DOC1')
+        self.assertEqual(container['DOC1'], document)
+        return
Index: main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/documents/utils.py
===================================================================
--- main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/documents/utils.py	(revision 12371)
+++ main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/documents/utils.py	(revision 12371)
@@ -0,0 +1,34 @@
+## $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
+##
+"""General helper functions and utilities for the documents.
+"""
+from waeup.ikoba.documents.utils import DocumentsUtils
+from ikobacustom.pcn.interfaces import MessageFactory as _
+
+
+class PCNDocumentsUtils(DocumentsUtils):
+    """A collection of methods subject to customization.
+    """
+
+    DOCTYPES_DICT = {
+        'PDFDocument': _('PDF Document'),
+        'HTMLDocument': _('HTML Document'),
+        'PCNDocument': _('PCN Document'),
+        }
+
+    SELECTABLE_DOCTYPES_DICT = DOCTYPES_DICT
Index: main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/ftesting.zcml
===================================================================
--- main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/ftesting.zcml	(revision 12371)
+++ main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/ftesting.zcml	(revision 12371)
@@ -0,0 +1,91 @@
+<configure
+   xmlns="http://namespaces.zope.org/zope"
+   xmlns:ikoba="http://namespaces.waeup.org/ikoba"
+   i18n_domain="ikobacustom.pcn"
+   package="ikobacustom.pcn"
+   >
+
+  <include package="grok" />
+  <includeOverrides package="ikobacustom.pcn" />
+  <include package="ikobacustom.pcn" file="mail.zcml" />
+
+  <!-- Where should the datacenter reside by default?
+
+       The path is relative to the `package` defined in top
+       `configure` directive.
+  -->
+  <ikoba: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/ikobacustom.pcn/trunk/src/ikobacustom/pcn/interfaces.py
===================================================================
--- main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/interfaces.py	(revision 12371)
+++ main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/interfaces.py	(revision 12371)
@@ -0,0 +1,40 @@
+## $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 ikobacustom.pcn.utils.lgas import LGAS
+
+_ = MessageFactory = zope.i18nmessageid.MessageFactory('ikobacustom.pcn')
+
+
+class LGASource(BasicSourceFactory):
+    """A source for school subjects used in exam documentation.
+    """
+    lga_dict = dict(LGAS)
+
+    def getValues(self):
+        return sorted(self.lga_dict.keys())
+
+    def getToken(self, value):
+        return str(value)
+
+    def getTitle(self, value):
+        return self.lga_dict.get(value,
+            _('Invalid key: ${a}', mapping = {'a':value}))
Index: main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/locales.zcml
===================================================================
--- main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/locales.zcml	(revision 12371)
+++ main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/locales.zcml	(revision 12371)
@@ -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.ikoba" file="locales.zcml" />
+
+</configure>
Index: main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/locales/en/LC_MESSAGES/waeup.ikoba.po
===================================================================
--- main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/locales/en/LC_MESSAGES/waeup.ikoba.po	(revision 12371)
+++ main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/locales/en/LC_MESSAGES/waeup.ikoba.po	(revision 12371)
@@ -0,0 +1,11 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: WAeUP.Ikoba\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"
+
Index: main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/mail.zcml
===================================================================
--- main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/mail.zcml	(revision 12371)
+++ main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/mail.zcml	(revision 12371)
@@ -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 IKOBA 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.localhost"
+      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 localhost"
+      permission="zope.Public"
+      mailer="smtp.localhost"
+      queuePath="../../../var/mailqueue"
+      />
+
+  <mail:directDelivery
+      name="Direct SMTP on localhost"
+      permission="zope.Public"
+      mailer="smtp.localhost"
+      />
+
+</configure>
Index: main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/permissions.py
===================================================================
--- main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/permissions.py	(revision 12371)
+++ main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/permissions.py	(revision 12371)
@@ -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.ikoba.permissions import CCOfficer
+
+
+class CCOfficer(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/ikobacustom.pcn/trunk/src/ikobacustom/pcn/products/__init__.py
===================================================================
--- main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/products/__init__.py	(revision 12371)
+++ main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/products/__init__.py	(revision 12371)
@@ -0,0 +1,8 @@
+"""This package contains everything regarding products.
+"""
+# Make this a package.
+from ikobacustom.pcn.products.product import PCNProduct
+
+__all__ = [
+    'PCNProduct',
+    ]
Index: main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/products/batching.py
===================================================================
--- main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/products/batching.py	(revision 12371)
+++ main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/products/batching.py	(revision 12371)
@@ -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
+##
+"""Batch processing for pcn products.
+"""
+import grok
+from waeup.ikoba.products.batching import ProductProcessor
+from ikobacustom.pcn.products.interfaces import IPCNProduct
+from ikobacustom.pcn.interfaces import MessageFactory as _
+
+class PCNProductProcessor(ProductProcessor):
+
+    iface = IPCNProduct
+    name = _('PCN Product Processor')
+    util_name = 'pcnproductprocessor'
+    grok.name(util_name)
Index: main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/products/export.py
===================================================================
--- main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/products/export.py	(revision 12371)
+++ main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/products/export.py	(revision 12371)
@@ -0,0 +1,35 @@
+## $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 pcn products.
+"""
+import grok
+from waeup.ikoba.utils.helpers import iface_names
+from waeup.ikoba.products.export import ProductExporter
+from ikobacustom.pcn.products.interfaces import IPCNProduct
+from ikobacustom.pcn.interfaces import MessageFactory as _
+
+
+class PCNProductExporter(ProductExporter):
+    """Exporter for products.
+    """
+
+    fields = tuple(sorted(iface_names(IPCNProduct))) + (
+        'users_with_local_roles',)
+
+    #: The title under which this exporter will be displayed
+    #title = _(u'PCN Products')
Index: main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/products/interfaces.py
===================================================================
--- main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/products/interfaces.py	(revision 12371)
+++ main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/products/interfaces.py	(revision 12371)
@@ -0,0 +1,25 @@
+## $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
+##
+from waeup.ikoba.products.interfaces import IProduct
+from ikobacustom.pcn.interfaces import MessageFactory as _
+
+
+class IPCNProduct(IProduct):
+    """A representation of a pcn product.
+
+    """
Index: main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/products/product.py
===================================================================
--- main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/products/product.py	(revision 12371)
+++ main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/products/product.py	(revision 12371)
@@ -0,0 +1,51 @@
+## $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
+##
+"""
+These are the products (e.g. licenses).
+"""
+import grok
+from zope.component.interfaces import IFactory
+from zope.interface import implementedBy
+from waeup.ikoba.utils.helpers import attrs_to_fields
+from waeup.ikoba.products.product import Product
+from ikobacustom.pcn.products.interfaces import IPCNProduct
+from ikobacustom.pcn.interfaces import MessageFactory as _
+
+
+class PCNProduct(Product):
+    """This is a product.
+    """
+    grok.implements(IPCNProduct)
+    grok.provides(IPCNProduct)
+
+PCNProduct = attrs_to_fields(PCNProduct)
+
+
+class PCNProductFactory(grok.GlobalUtility):
+    """A factory for products.
+    """
+    grok.implements(IFactory)
+    grok.name(u'waeup.Product')
+    title = u"Create a new product.",
+    description = u"This factory instantiates new pcn products."
+
+    def __call__(self, *args, **kw):
+        return PCNProduct(*args, **kw)
+
+    def getInterfaces(self):
+        return implementedBy(PCNProduct)
Index: main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/products/tests/__init__.py
===================================================================
--- main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/products/tests/__init__.py	(revision 12371)
+++ main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/products/tests/__init__.py	(revision 12371)
@@ -0,0 +1,1 @@
+# Make this a package.
Index: main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/products/tests/test_browser.py
===================================================================
--- main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/products/tests/test_browser.py	(revision 12371)
+++ main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/products/tests/test_browser.py	(revision 12371)
@@ -0,0 +1,88 @@
+## $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
+##
+"""
+Product browser and functional tests.
+"""
+import os
+import grok
+import datetime
+from cStringIO import StringIO
+from zope.component import queryUtility, getUtility
+from zope.event import notify
+from zope.interface.verify import verifyObject, verifyClass
+from waeup.ikoba.products.tests.test_batching import ProductImportExportSetup
+from ikobacustom.pcn.products.product import PCNProduct
+from ikobacustom.pcn.products.export import PCNProductExporter
+from ikobacustom.pcn.products.batching import PCNProductProcessor
+from ikobacustom.pcn.testing import FunctionalLayer
+
+
+class ProductImportExportTest(ProductImportExportSetup):
+
+    layer = FunctionalLayer
+
+    def setup_for_export(self):
+        product = PCNProduct()
+        product.product_id = u'LIC'
+        product.valid_from = datetime.date(2015, 12, 4)
+        self.app['products'][product.product_id] = self.product = product
+        self.outfile = os.path.join(self.workdir, 'myoutput.csv')
+        return
+
+    def test_export_reimport_all(self):
+        # we can export all products in a portal
+        # set values we can expect in export file
+        self.setup_for_export()
+        exporter = PCNProductExporter()
+        exporter.export_all(self.app, self.outfile)
+        result = open(self.outfile, 'rb').read()
+        self.assertEqual(result,
+            'contract_category,contract_title,options,'
+            'product_id,terms_and_conditions,title,valid_from,valid_to,users_with_local_roles\r\n'
+            'license,,[],LIC,,Unnamed,2015-12-04#,,[]\r\n')
+        # We can import the same file.
+        processor = PCNProductProcessor()
+        result = processor.doImport(
+            self.outfile,
+            ['contract_category','contract_title', 'options,', 'product_id',
+            'terms_and_conditions','title','valid_from','valid_to','users_with_local_roles'],
+            mode='create')
+        num, num_fail, finished_path, failed_path = result
+        #content = open(failed_path).read()
+        # The object exists.
+        self.assertEqual(num_fail,1)
+        # We remove the original product.
+        del self.app['products']['LIC']
+        result = processor.doImport(
+            self.outfile,
+            ['contract_category','contract_title', 'options,', 'product_id',
+            'terms_and_conditions','title','valid_from','valid_to','users_with_local_roles'],
+            mode='create')
+        num, num_fail, finished_path, failed_path = result
+        self.assertEqual(num_fail,0)
+        # We can import the same file in update mode.
+        processor = PCNProductProcessor()
+        result = processor.doImport(
+            self.outfile,
+            ['contract_category','contract_title', 'options,', 'product_id',
+            'terms_and_conditions','title','valid_from','valid_to','users_with_local_roles'],
+            mode='update')
+        num, num_fail, finished_path, failed_path = result
+        self.assertEqual(num,1)
+        self.assertEqual(num_fail,0)
+        return
Index: main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/products/tests/test_product.py
===================================================================
--- main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/products/tests/test_product.py	(revision 12371)
+++ main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/products/tests/test_product.py	(revision 12371)
@@ -0,0 +1,53 @@
+## $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
+##
+"""
+Tests for pcn products.
+"""
+from zope.interface.verify import verifyClass, verifyObject
+from zope.component import createObject
+from waeup.ikoba.products.interfaces import IProductsContainer
+from waeup.ikoba.products.container import ProductsContainer
+
+from ikobacustom.pcn.testing import (FunctionalLayer, FunctionalTestCase)
+from ikobacustom.pcn.products.product import PCNProduct
+from ikobacustom.pcn.products.interfaces import IPCNProduct
+
+class PCNProductTestCase(FunctionalTestCase):
+
+    layer = FunctionalLayer
+
+    def test_interfaces(self):
+        # Make sure the correct interfaces are implemented.
+        self.assertTrue(
+            verifyClass(
+                IPCNProduct, PCNProduct)
+            )
+        self.assertTrue(
+            verifyObject(
+                IPCNProduct, PCNProduct())
+            )
+        return
+
+    def test_addPCNProduct(self):
+        container = ProductsContainer()
+        product = createObject(u'waeup.Product')
+        container.addProduct(product)
+        self.assertRaises(TypeError, container.addProduct, object())
+        self.assertEqual(product.product_id, 'NA')
+        self.assertEqual(container['NA'], product)
+        return
Index: main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/testing.py
===================================================================
--- main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/testing.py	(revision 12371)
+++ main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/testing.py	(revision 12371)
@@ -0,0 +1,39 @@
+## $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
+##
+"""Testing support for :mod:`waeup.ikoba`.
+"""
+import os
+import tempfile
+import ikobacustom.pcn
+from zope.app.testing.functional import ZCMLLayer
+from waeup.ikoba.testing import FunctionalTestCase
+
+# Some funcional layer that groks ikobacustom.pcn.
+ftesting_zcml = os.path.join(
+    os.path.dirname(ikobacustom.pcn.__file__), 'ftesting.zcml')
+FunctionalLayer = ZCMLLayer(ftesting_zcml, __name__, 'FunctionalLayer',
+                            allow_teardown=True)
+
+def samples_dir():
+    # create a directory for sample sheets, if it doesn't exist,
+    # and return its path.
+    tmp_dir = os.path.join(
+        tempfile.gettempdir(), 'ikobacustom.pcn.pdf-samples')
+    if not os.path.exists(tmp_dir):
+        os.mkdir(tmp_dir)
+    return tmp_dir
Index: main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/utils/__init__.py
===================================================================
--- main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/utils/__init__.py	(revision 12371)
+++ main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/utils/__init__.py	(revision 12371)
@@ -0,0 +1,1 @@
+# Make this a package.
Index: main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/utils/lgas.py
===================================================================
--- main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/utils/lgas.py	(revision 12371)
+++ main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/utils/lgas.py	(revision 12371)
@@ -0,0 +1,879 @@
+LGAS = (
+    ('abia_aba_north','Abia / Aba North'),
+    ('abia_aba_south','Abia / Aba South'),
+    ('abia_arochukwu','Abia / Arochukwu'),
+    ('abia_bende','Abia / Bende'),
+    ('abia_ikawuno','Abia / Ikawuno'),
+    ('abia_ikwuano','Abia / Ikwuano'),
+    ('abia_isiala-ngwa-north','Abia / Isiala-Ngwa-North'),
+    ('abia_isiala-ngwa-south','Abia / Isiala-Ngwa-South'),
+    ('abia_isikwuato','Abia / Isikwuato'),
+    ('abia_isuikwuato','Abia / Isuikwuato'),
+    ('abia_nneochi','Abia / Nneochi'),
+    ('abia_obi_ngwa','Abia / Obi Ngwa'),
+    ('abia_obioma-ngwa','Abia / Obioma-Ngwa'),
+    ('abia_ohafia','Abia / Ohafia'),
+    ('abia_ohaozara','Abia / Ohaozara'),
+    ('abia_osisioma','Abia / Osisioma'),
+    ('abia_ugwunagbo','Abia / Ugwunagbo'),
+    ('abia_ukwa_west','Abia / Ukwa West'),
+    ('abia_ukwu_east','Abia / Ukwu East'),
+    ('abia_umuahia','Abia / Umuahia'),
+    ('abia_umuahia_south','Abia / Umuahia South'),
+    ('abia_umuahia-north','Abia / Umuahia-North'),
+    ('abuja_abaji','Abuja / Abaji'),
+    ('abuja_amac','Abuja / Amac'),
+    ('abuja_bwari','Abuja / Bwari'),
+    ('abuja_kuje','Abuja / Kuje'),
+    ('abuja_gwagwalada','Abuja / Gwagwalada'),
+    ('abuja_kwali','Abuja / Kwali'),
+    ('abuja_municipal','Abuja / Municipal'),
+    ('adamawa_demsa','Adamawa / Demsa'),
+    ('adamawa_fufore','Adamawa / Fufore'),
+    ('adamawa_ganye','Adamawa / Ganye'),
+    ('adamawa_girei','Adamawa / Girei'),
+    ('adamawa_gombi','Adamawa / Gombi'),
+    ('adamawa_guyuk','Adamawa / Guyuk'),
+    ('adamawa_hong','Adamawa / Hong'),
+    ('adamawa_jada','Adamawa / Jada'),
+    ('adamawa_jimeta','Adamawa / Jimeta'),
+    ('adamawa_lamurde','Adamawa / Lamurde'),
+    ('adamawa_madagali','Adamawa / Madagali'),
+    ('adamawa_maiha','Adamawa / Maiha'),
+    ('adamawa_mayo-belwa','Adamawa / Mayo-Belwa'),
+    ('adamawa_michika','Adamawa / Michika'),
+    ('adamawa_mubi-north','Adamawa / Mubi-North'),
+    ('adamawa_mubi-south','Adamawa / Mubi-South'),
+    ('adamawa_numan','Adamawa / Numan'),
+    ('adamawa_shelleng','Adamawa / Shelleng'),
+    ('adamawa_song','Adamawa / Song'),
+    ('adamawa_toungo','Adamawa / Toungo'),
+    ('adamawa_yola','Adamawa / Yola'),
+    ('akwa_ibom_abak','Akwa Ibom / Abak'),
+    ('akwa_ibom_eastern-obolo','Akwa Ibom / Eastern-Obolo'),
+    ('akwa_ibom_eket','Akwa Ibom / Eket'),
+    ('akwa_ibom_ekpe-atani','Akwa Ibom / Ekpe-Atani'),
+    ('akwa_ibom_esit_ekit','Akwa Ibom / Esit Ekit'),
+    ('akwa_ibom_essien-udim','Akwa Ibom / Essien-Udim'),
+    ('akwa_ibom_etim-ekpo','Akwa Ibom / Etim-Ekpo'),
+    ('akwa_ibom_etinam','Akwa Ibom / Etinam'),
+    ('akwa_ibom_ibeno','Akwa Ibom / Ibeno'),
+    ('akwa_ibom_ibesikpo-asutan','Akwa Ibom / Ibesikpo-Asutan'),
+    ('akwa_ibom_ibiono-ibom','Akwa Ibom / Ibiono-Ibom'),
+    ('akwa_ibom_ika','Akwa Ibom / Ika'),
+    ('akwa_ibom_ikono','Akwa Ibom / Ikono'),
+    ('akwa_ibom_ikot-abasi','Akwa Ibom / Ikot-Abasi'),
+    ('akwa_ibom_ikot-ekpene','Akwa Ibom / Ikot-Ekpene'),
+    ('akwa_ibom_ini','Akwa Ibom / Ini'),
+    ('akwa_ibom_itu','Akwa Ibom / Itu'),
+    ('akwa_ibom_mbo','Akwa Ibom / Mbo'),
+    ('akwa_ibom_mkpat-enin','Akwa Ibom / Mkpat-Enin'),
+    ('akwa_ibom_nsit-atai','Akwa Ibom / Nsit-Atai'),
+    ('akwa_ibom_nsit-ibom','Akwa Ibom / Nsit-Ibom'),
+    ('akwa_ibom_nsit-ubium','Akwa Ibom / Nsit-Ubium'),
+    ('akwa_ibom_obot-akara','Akwa Ibom / Obot-Akara'),
+    ('akwa_ibom_okobo','Akwa Ibom / Okobo'),
+    ('akwa_ibom_onna','Akwa Ibom / Onna'),
+    ('akwa_ibom_oron','Akwa Ibom / Oron'),
+    ('akwa_ibom_oruk_anam','Akwa Ibom / Oruk-Anam'),
+    ('akwa_ibom_udung-uko','Akwa Ibom / Udung-Uko'),
+    ('akwa_ibom_ukanefun','Akwa Ibom / Ukanefun'),
+    ('akwa_ibom_uquo_ibeno','Akwa Ibom / Uquo Ibeno'),
+    ('akwa_ibom_urue-offong-oruko','Akwa Ibom / Urue-Offong-Oruko'),
+    ('akwa_ibom_uruan','Akwa Ibom / Uruan'),
+    ('akwa_ibom_uruk-anam','Akwa Ibom / Uruk-Anam'),
+    ('akwa_ibom_uyo','Akwa Ibom / Uyo'),
+    ('anambra_aguata','Anambra / Aguata'),
+    ('anambra_anambra-east','Anambra / Anambra-East'),
+    ('anambra_anambra-west','Anambra / Anambra-West'),
+    ('anambra_anaocha','Anambra / Anaocha'),
+    ('anambra_awka-north','Anambra / Awka-North'),
+    ('anambra_awka-south','Anambra / Awka-South'),
+    ('anambra_ayamelum','Anambra / Ayamelum'),
+    ('anambra_dunukofia','Anambra / Dunukofia'),
+    ('anambra_ekwusigo','Anambra / Ekwusigo'),
+    ('anambra_idemili','Anambra / Idemili'),
+    ('anambra_idemili-north','Anambra / Idemili-North'),
+    ('anambra_idemili-south','Anambra / Idemili-South'),
+    ('anambra_ihiala','Anambra / Ihiala'),
+    ('anambra_nibo','Anambra / Nibo'),
+    ('anambra_njikoka','Anambra / Njikoka'),
+    ('anambra_nnewi','Anambra / Nnewi'),
+    ('anambra_nnewi-north','Anambra / Nnewi-North'),
+    ('anambra_nnewi-south','Anambra / Nnewi-South'),
+    ('anambra_ogbaru','Anambra / Ogbaru'),
+    ('anambra_olumba','Anambra / Olumba'),
+    ('anambra_onitsha-north','Anambra / Onitsha-North'),
+    ('anambra_onitsha-south','Anambra / Onitsha-South'),
+    ('anambra_orumba-north','Anambra / Orumba-North'),
+    ('anambra_orumba-south','Anambra / Orumba-South'),
+    ('anambra_oti','Anambra / Oti'),
+    ('anambra_oyi','Anambra / Oyi'),
+    ('anambra_ubuluizor-ihiala','Anambra / Ubuluizor-Ihiala'),
+    ('anambra_uyi','Anambra / Uyi'),
+    ('bauchi_alkaleri','Bauchi / Alkaleri'),
+    ('bauchi_bauchi','Bauchi / Bauchi'),
+    ('bauchi_bogoro','Bauchi / Bogoro'),
+    ('bauchi_damban','Bauchi / Damban'),
+    ('bauchi_darazo','Bauchi / Darazo'),
+    ('bauchi_dass','Bauchi / Dass'),
+    ('bauchi_gamawa','Bauchi / Gamawa'),
+    ('bauchi_ganjuwa','Bauchi / Ganjuwa'),
+    ('bauchi_giade','Bauchi / Giade'),
+    ('bauchi_itas/gadau','Bauchi / Itas/Gadau'),
+    ('bauchi_jamaare','Bauchi / Jamaare'),
+    ('bauchi_katagum','Bauchi / Katagum'),
+    ('bauchi_kirfi','Bauchi / Kirfi'),
+    ('bauchi_misau','Bauchi / Misau'),
+    ('bauchi_ningi','Bauchi / Ningi'),
+    ('bauchi_shira','Bauchi / Shira'),
+    ('bauchi_tafawa-balewa','Bauchi / Tafawa-Balewa'),
+    ('bauchi_toro','Bauchi / Toro'),
+    ('bauchi_warji','Bauchi / Warji'),
+    ('bauchi_zaki','Bauchi / Zaki'),
+    ('bayelsa_brass','Bayelsa / Brass'),
+    ('bayelsa_ekeremor','Bayelsa / Ekeremor'),
+    ('bayelsa_kembe','Bayelsa / Kembe'),
+    ('bayelsa_kolokuma','Bayelsa / Kolokuma'),
+    ('bayelsa_kolokuma/opkuma','Bayelsa / Kolokuma/Opkuma'),
+    ('bayelsa_nembe','Bayelsa / Nembe'),
+    ('bayelsa_ogbia','Bayelsa / Ogbia'),
+    ('bayelsa_sagbama','Bayelsa / Sagbama'),
+    ('bayelsa_southern-ijaw','Bayelsa / Southern-Ijaw'),
+    ('bayelsa_toru-abubo','Bayelsa / Toru-Abubo'),
+    ('bayelsa_yenegoa','Bayelsa / Yenegoa'),
+    ('benue_ado','Benue / Ado'),
+    ('benue_agatu','Benue / Agatu'),
+    ('benue_apa','Benue / Apa'),
+    ('benue_buruku','Benue / Buruku'),
+    ('benue_gboko','Benue / Gboko'),
+    ('benue_guma','Benue / Guma'),
+    ('benue_gwer-east','Benue / Gwer-East'),
+    ('benue_gwer-west','Benue / Gwer-West'),
+    ('benue_katsina-ala','Benue / Katsina-Ala'),
+    ('benue_konshisha','Benue / Konshisha'),
+    ('benue_kwande','Benue / Kwande'),
+    ('benue_logo','Benue / Logo'),
+    ('benue_makurdi','Benue / Makurdi'),
+    ('benue_ogbadibo','Benue / Ogbadibo'),
+    ('benue_ohimini','Benue / Ohimini'),
+    ('benue_oju','Benue / Oju'),
+    ('benue_okpokwu','Benue / Okpokwu'),
+    ('benue_otukpo','Benue / Otukpo'),
+    ('benue_oturkpa','Benue / Oturkpa'),
+    ('benue_tarka','Benue / Tarka'),
+    ('benue_ukum','Benue / Ukum'),
+    ('benue_ushongo','Benue / Ushongo'),
+    ('benue_vandeikya','Benue / Vandeikya'),
+    ('borno_abadan','Borno / Abadan'),
+    ('borno_askira-uba','Borno / Askira-Uba'),
+    ('borno_bama','Borno / Bama'),
+    ('borno_bayo','Borno / Bayo'),
+    ('borno_biu','Borno / Biu'),
+    ('borno_chibok','Borno / Chibok'),
+    ('borno_damboa','Borno / Damboa'),
+    ('borno_dikwa','Borno / Dikwa'),
+    ('borno_gubio','Borno / Gubio'),
+    ('borno_guzamala','Borno / Guzamala'),
+    ('borno_gwoza','Borno / Gwoza'),
+    ('borno_hawul','Borno / Hawul'),
+    ('borno_jere','Borno / Jere'),
+    ('borno_kaga','Borno / Kaga'),
+    ('borno_kala/balge','Borno / Kala/Balge'),
+    ('borno_konduga','Borno / Konduga'),
+    ('borno_kukawa','Borno / Kukawa'),
+    ('borno_kwaya-kusar','Borno / Kwaya-Kusar'),
+    ('borno_mafa','Borno / Mafa'),
+    ('borno_magumeri','Borno / Magumeri'),
+    ('borno_maiduguri','Borno / Maiduguri'),
+    ('borno_marte','Borno / Marte'),
+    ('borno_mobbar','Borno / Mobbar'),
+    ('borno_mongunu','Borno / Mongunu'),
+    ('borno_ngala','Borno / Ngala'),
+    ('borno_nganzai','Borno / Nganzai'),
+    ('borno_shani','Borno / Shani'),
+    ('cross_river_abi','Cross River / Abi'),
+    ('cross_river_abuochichie','Cross River / Abuochichie'),
+    ('cross_river_akamkpa','Cross River / Akamkpa'),
+    ('cross_river_akpabuyo','Cross River / Akpabuyo'),
+    ('cross_river_bakassi','Cross River / Bakassi'),
+    ('cross_river_bekwara','Cross River / Bekwara'),
+    ('cross_river_biasi','Cross River / Biasi'),
+    ('cross_river_boki','Cross River / Boki'),
+    ('cross_river_calabar-municipal','Cross River / Calabar-Municipal'),
+    ('cross_river_calabar-south','Cross River / Calabar-South'),
+    ('cross_river_etunk','Cross River / Etunk'),
+    ('cross_river_ikom','Cross River / Ikom'),
+    ('cross_river_obanliku','Cross River / Obanliku'),
+    ('cross_river_obubra','Cross River / Obubra'),
+    ('cross_river_obudu','Cross River / Obudu'),
+    ('cross_river_odukpani','Cross River / Odukpani'),
+    ('cross_river_ogoja','Cross River / Ogoja'),
+    ('cross_river_ugep-north','Cross River / Ugep-North'),
+    ('cross_river_yakurr','Cross River / Yakurr'),
+    ('cross_river_yala','Cross River / Yala'),
+    ('delta_aniocha-north','Delta / Aniocha-North'),
+    ('delta_aniocha-south','Delta / Aniocha-South'),
+    ('delta_bomadi','Delta / Bomadi'),
+    ('delta_burutu','Delta / Burutu'),
+    ('delta_effurun','Delta / Effurun'),
+    ('delta_ethiope-east','Delta / Ethiope-East'),
+    ('delta_ethiope-west','Delta / Ethiope-West'),
+    ('delta_idu','Delta / Idu'),
+    ('delta_ika-ne','Delta / Ika-Ne'),
+    ('delta_ika-north-east','Delta / Ika-North-East'),
+    ('delta_ika-south','Delta / Ika-South'),
+    ('delta_idemili-south','Delta / Idemili-South'),
+    ('delta_isoko-north','Delta / Isoko-North'),
+    ('delta_isoko-south','Delta / Isoko-South'),
+    ('delta_ndokwa-east','Delta / Ndokwa-East'),
+    ('delta_ndokwa-north','Delta / Ndokwa-North'),
+    ('delta_ndokwa-south','Delta / Ndokwa-South'),
+    ('delta_ndokwa-west','Delta / Ndokwa-West'),
+    ('delta_okpe','Delta / Okpe'),
+    ('delta_okwuani','Delta / Okwuani'),
+    ('delta_oleh','Delta / Oleh'),
+    ('delta_oshielli-north','Delta / Oshielli-North'),
+    ('delta_oshimili','Delta / Oshimili'),
+    ('delta_oshimili-north','Delta / Oshimili-North'),
+    ('delta_oshimili-south','Delta / Oshimili-South'),
+    ('delta_patani','Delta / Patani'),
+    ('delta_sapele','Delta / Sapele'),
+    ('delta_udokwa','Delta / Udokwa'),
+    ('delta_udu','Delta / Udu'),
+    ('delta_ughelli-north','Delta / Ughelli-North'),
+    ('delta_ughelli-south','Delta / Ughelli-South'),
+    ('delta_ukwuani','Delta / Ukwuani'),
+    ('delta_urwie','Delta / Urwie'),
+    ('delta_uvie','Delta / Uvie'),
+    ('delta_uvwei','Delta / Uvwei'),
+    ('delta_uvwie','Delta / Uvwie'),
+    ('delta_warri-central','Delta / Warri-Central'),
+    ('delta_warri-north','Delta / Warri-North'),
+    ('delta_warri-south','Delta / Warri-South'),
+    ('delta_warri-south-west','Delta / Warri-South-West'),
+    ('ebonyi_abakaliki','Ebonyi / Abakaliki'),
+    ('ebonyi_afikpo-north','Ebonyi / Afikpo-North'),
+    ('ebonyi_afikpo-south','Ebonyi / Afikpo-South'),
+    ('ebonyi_bomadim','Ebonyi / Bomadim'),
+    ('ebonyi_ebonyi','Ebonyi / Ebonyi'),
+    ('ebonyi_ezza-north','Ebonyi / Ezza-North'),
+    ('ebonyi_ezza-south','Ebonyi / Ezza-South'),
+    ('ebonyi_ikwo','Ebonyi / Ikwo'),
+    ('ebonyi_ishielu','Ebonyi / Ishielu'),
+    ('ebonyi_ivo','Ebonyi / Ivo'),
+    ('ebonyi_izzi','Ebonyi / Izzi'),
+    ('ebonyi_obaukwu','Ebonyi / Obaukwu'),
+    ('ebonyi_ohakwu','Ebonyi / Ohakwu'),
+    ('ebonyi_ohaozara','Ebonyi / Ohaozara'),
+    ('ebonyi_onicha','Ebonyi / Onicha'),
+    ('ebonyi_ukaba','Ebonyi / Ukaba'),
+    ('edo_afokpella','Edo / Afokpella'),
+    ('edo_afuze','Edo / Afuze'),
+    ('edo_agbazilo','Edo / Agbazilo'),
+    ('edo_akoko-edo','Edo / Akoko-Edo'),
+    ('edo_egor','Edo / Egor'),
+    ('edo_esan-central','Edo / Esan-Central'),
+    ('edo_esan-north-east','Edo / Esan-North-East'),
+    ('edo_esan-north-west','Edo / Esan-North-West'),
+    ('edo_esan-south-east','Edo / Esan-South-East'),
+    ('edo_esan-west','Edo / Esan-West'),
+    ('edo_etsako-central','Edo / Etsako-Central'),
+    ('edo_etsako-east','Edo / Etsako-East'),
+    ('edo_etsako-west','Edo / Etsako-West'),
+    ('edo_igueben','Edo / Igueben'),
+    ('edo_ikpoba-okha','Edo / Ikpoba-Okha'),
+    ('edo_ohunmwode','Edo / Ohunmwode'),
+    ('edo_ologbo','Edo / Ologbo'),
+    ('edo_opoji_irrua','Edo / Opoji Irrua'),
+    ('edo_oredo','Edo / Oredo'),
+    ('edo_orhionmwon','Edo / Orhionmwon'),
+    ('edo_ovia-north-east','Edo / Ovia-North-East'),
+    ('edo_ovia-north-west','Edo / Ovia-North-West'),
+    ('edo_ovia-south-east','Edo / Ovia-South-East'),
+    ('edo_ovia-south-west','Edo / Ovia-South-West'),
+    ('edo_owan','Edo / Owan'),
+    ('edo_owan-east','Edo / Owan-East'),
+    ('edo_owan-west','Edo / Owan-West'),
+    ('edo_ubiaja','Edo / Ubiaja'), 
+    ('edo_uhunmwonde','Edo / Uhunmwonde'),
+    ('ekiti_ado-ekiti','Ekiti / Ado-Ekiti'),
+    ('ekiti_aiyekire','Ekiti / Aiyekire'),
+    ('ekiti_efon','Ekiti / Efon'),
+    ('ekiti_ekiti-east','Ekiti / Ekiti-East'),
+    ('ekiti_ekiti-south-west','Ekiti / Ekiti-South-West'),
+    ('ekiti_ekiti-west','Ekiti / Ekiti-West'),
+    ('ekiti_emure/ise/orun','Ekiti / Emure/Ise/Orun'),
+    ('ekiti_gbonyin','Ekiti / Gbonyin'),
+    ('ekiti_ido-osi','Ekiti / Ido-Osi'),
+    ('ekiti_ijero','Ekiti / Ijero'),
+    ('ekiti_ikare','Ekiti / Ikare'),
+    ('ekiti_ikere','Ekiti / Ikere'),
+    ('ekiti_ikole','Ekiti / Ikole'),
+    ('ekiti_ilejemeje','Ekiti / Ilejemeje'),
+    ('ekiti_irepodun/ifelodun','Ekiti / Irepodun/Ifelodun'),
+    ('ekiti_ise-orun','Ekiti / Ise-Orun'),
+    ('ekiti_moba','Ekiti / Moba'),
+    ('ekiti_oye','Ekiti / Oye'),
+    ('enugu_aninri','Enugu / Aninri'),
+    ('enugu_awgu','Enugu / Awgu'),
+    ('enugu_enugu-east','Enugu / Enugu-East'),
+    ('enugu_enugu-north','Enugu / Enugu-North'),
+    ('enugu_enugu-south','Enugu / Enugu-South'),
+    ('enugu_ezeagu','Enugu / Ezeagu'),
+    ('enugu_igbo-etiti','Enugu / Igbo-Etiti'),
+    ('enugu_igbo-eze-north','Enugu / Igbo-Eze-North'),
+    ('enugu_igbo-eze-south','Enugu / Igbo-Eze-South'),
+    ('enugu_isi-uzo','Enugu / Isi-Uzo'),
+    ('enugu_nkanu-east','Enugu / Nkanu-East'),
+    ('enugu_nkanu-central','Enugu / Nkanu-Central'),
+    ('enugu_nkanu-west','Enugu / Nkanu-West'),
+    ('enugu_nsukka','Enugu / Nsukka'),
+    ('enugu_nukanu_east','Enugu / Nukanu East'),
+    ('enugu_oji-river','Enugu / Oji-River'),
+    ('enugu_udenu','Enugu / Udenu'),
+    ('enugu_udi','Enugu / Udi'),
+    ('enugu_uzo-uwani','Enugu / Uzo-Uwani'),
+    ('gombe_akko','Gombe / Akko'),
+    ('gombe_balanga','Gombe / Balanga'),
+    ('gombe_billiri','Gombe / Billiri'),
+    ('gombe_dukku','Gombe / Dukku'),
+    ('gombe_funakaye','Gombe / Funakaye'),
+    ('gombe_gombe','Gombe / Gombe'),
+    ('gombe_kaltungo','Gombe / Kaltungo'),
+    ('gombe_kwami','Gombe / Kwami'),
+    ('gombe_nafada/bajoga','Gombe / Nafada/Bajoga'),
+    ('gombe_shomgom','Gombe / Shomgom'),
+    ('gombe_yamaltu/deba','Gombe / Yamaltu/Deba'),
+    ('imo_aboh-mbaise','Imo / Aboh-Mbaise'),
+    ('imo_ahiazu-mbaise','Imo / Ahiazu-Mbaise'),
+    ('imo_dral-esat','Imo / Dral-Esat'),
+    ('imo_ehime-mbano','Imo / Ehime-Mbano'),
+    ('imo_ezinihitte','Imo / Ezinihitte'),
+    ('imo_ideato','Imo / Ideato'),
+    ('imo_ideato-north','Imo / Ideato-North'),
+    ('imo_ideato-south','Imo / Ideato-South'),
+    ('imo_ihitte/uboma','Imo / Ihitte/Uboma'),
+    ('imo_ikeduru','Imo / Ikeduru'),
+    ('imo_isiala-mbano','Imo / Isiala-Mbano'),
+    ('imo_isu','Imo / Isu'),
+    ('imo_mbaitoli','Imo / Mbaitoli'),
+    ('imo_mbano','Imo / Mbano'),
+    ('imo_ngor-okpala','Imo / Ngor-Okpala'),
+    ('imo_njaba','Imo / Njaba'),
+    ('imo_nkwerre','Imo / Nkwerre'),
+    ('imo_nwangele','Imo / Nwangele'),
+    ('imo_obowo','Imo / Obowo'),
+    ('imo_oguta','Imo / Oguta'),
+    ('imo_ohaji-egbema','Imo / Ohaji-Egbema'),
+    ('imo_okigwe','Imo / Okigwe'),
+    ('imo_onuimo','Imo / Onuimo'),
+    ('imo_orlu','Imo / Orlu'),
+    ('imo_orsu','Imo / Orsu'),
+    ('imo_oru-east','Imo / Oru-East'),
+    ('imo_oru-west','Imo / Oru-West'),
+    ('imo_owerri-municipal','Imo / Owerri-Municipal'),
+    ('imo_owerri-north','Imo / Owerri-North'),
+    ('imo_owerri-west','Imo / Owerri-West'),
+    ('imo_ugiri-ike_ikeduru','Imo / Ugiri-Ike Ikeduru'),
+    ('imo_ugiri-ikedikeduru','Imo / Ugiri-Ikedikeduru'),
+    ('imo_unbano','Imo / Unbano'),
+    ('imo_zinihitte','Imo / Zinihitte'),
+    ('jigawa_auyo','Jigawa / Auyo'),
+    ('jigawa_babura','Jigawa / Babura'),
+    ('jigawa_biriniwa','Jigawa / Biriniwa'),
+    ('jigawa_birnin-kudu','Jigawa / Birnin-Kudu'),
+    ('jigawa_bosuwa','Jigawa / Bosuwa'),
+    ('jigawa_buji','Jigawa / Buji'),
+    ('jigawa_dutse','Jigawa / Dutse'),
+    ('jigawa_gagarawa','Jigawa / Gagarawa'),
+    ('jigawa_garki','Jigawa / Garki'),
+    ('jigawa_gumel','Jigawa / Gumel'),
+    ('jigawa_guri','Jigawa / Guri'),
+    ('jigawa_gwaram','Jigawa / Gwaram'),
+    ('jigawa_gwiwa','Jigawa / Gwiwa'),
+    ('jigawa_hadejia','Jigawa / Hadejia'),
+    ('jigawa_jahun','Jigawa / Jahun'),
+    ('jigawa_kafin-hausa','Jigawa / Kafin-Hausa'),
+    ('jigawa_kaugama','Jigawa / Kaugama'),
+    ('jigawa_kazaure','Jigawa / Kazaure'),
+    ('jigawa_kirkasamma','Jigawa / Kirkasamma'),
+    ('jigawa_maigatari','Jigawa / Maigatari'),
+    ('jigawa_malam-maduri','Jigawa / Malam-Maduri'),
+    ('jigawa_miga','Jigawa / Miga'),
+    ('jigawa_ringim','Jigawa / Ringim'),
+    ('jigawa_roni','Jigawa / Roni'),
+    ('jigawa_sule-tankarkar','Jigawa / Sule-Tankarkar'),
+    ('jigawa_taura','Jigawa / Taura'),
+    ('jigawa_yankwashi','Jigawa / Yankwashi'),
+    ('kaduna_birnin-gwari','Kaduna / Birnin-Gwari'),
+    ('kaduna_chikun','Kaduna / Chikun'),
+    ('kaduna_giwa','Kaduna / Giwa'),
+    ('kaduna_gwagwada','Kaduna / Gwagwada'),
+    ('kaduna_igabi','Kaduna / Igabi'),
+    ('kaduna_ikara','Kaduna / Ikara'),
+    ('kaduna_jaba','Kaduna / Jaba'),
+    ('kaduna_jemaa','Kaduna / Jemaa'),
+    ('kaduna_kachia','Kaduna / Kachia'),
+    ('kaduna_kaduna-north','Kaduna / Kaduna-North'),
+    ('kaduna_kagarko','Kaduna / Kagarko'),
+    ('kaduna_kajuru','Kaduna / Kajuru'),
+    ('kaduna_kaura','Kaduna / Kaura'),
+    ('kaduna_kauru','Kaduna / Kauru'),
+    ('kaduna_koka/kawo','Kaduna / Koka/Kawo'),
+    ('kaduna_kubah','Kaduna / Kubah'),
+    ('kaduna_kudan','Kaduna / Kudan'),
+    ('kaduna_lere','Kaduna / Lere'),
+    ('kaduna_makarfi','Kaduna / Makarfi'),
+    ('kaduna_sabon-gari','Kaduna / Sabon-Gari'),
+    ('kaduna_sanga','Kaduna / Sanga'),
+    ('kaduna_soba','Kaduna / Soba'),
+    ('kaduna_tudun-wada/makera','Kaduna / Tudun-Wada/Makera'),
+    ('kaduna_zango-kataf','Kaduna / Zango-Kataf'),
+    ('kaduna_zaria','Kaduna / Zaria'),
+    ('kano_ajingi','Kano / Ajingi'),
+    ('kano_albasu','Kano / Albasu'),
+    ('kano_bagwai','Kano / Bagwai'),
+    ('kano_bebeji','Kano / Bebeji'),
+    ('kano_bichi','Kano / Bichi'),
+    ('kano_bunkure','Kano / Bunkure'),
+    ('kano_dala','Kano / Dala'),
+    ('kano_dambatta','Kano / Dambatta'),
+    ('kano_dawakin-kudu','Kano / Dawakin-Kudu'),
+    ('kano_dawakin-tofa','Kano / Dawakin-Tofa'),
+    ('kano_doguwa','Kano / Doguwa'),
+    ('kano_fagge','Kano / Fagge'),
+    ('kano_gabasawa','Kano / Gabasawa'),
+    ('kano_garko','Kano / Garko'),
+    ('kano_garun-mallam','Kano / Garun-Mallam'),
+    ('kano_gaya','Kano / Gaya'),
+    ('kano_gezawa','Kano / Gezawa'),
+    ('kano_gwale','Kano / Gwale'),
+    ('kano_gwarzo','Kano / Gwarzo'),
+    ('kano_kano-municipal','Kano / Kano-Municipal'),
+    ('kano_karaye','Kano / Karaye'),
+    ('kano_kibiya','Kano / Kibiya'),
+    ('kano_kiru','Kano / Kiru'),
+    ('kano_kumbotso','Kano / Kumbotso'),
+    ('kano_kunchi','Kano / Kunchi'),
+    ('kano_kura','Kano / Kura'),
+    ('kano_madobi','Kano / Madobi'),
+    ('kano_makoda','Kano / Makoda'),
+    ('kano_minjibir','Kano / Minjibir'),
+    ('kano_nasarawa','Kano / Nasarawa'),
+    ('kano_rano','Kano / Rano'),
+    ('kano_rimin-gado','Kano / Rimin-Gado'),
+    ('kano_rogo','Kano / Rogo'),
+    ('kano_shanono','Kano / Shanono'),
+    ('kano_sumaila','Kano / Sumaila'),
+    ('kano_takai','Kano / Takai'),
+    ('kano_tarauni','Kano / Tarauni'),
+    ('kano_tofa','Kano / Tofa'),
+    ('kano_tsanyawa','Kano / Tsanyawa'),
+    ('kano_tudun-wada','Kano / Tudun-Wada'),
+    ('kano_ungogo','Kano / Ungogo'),
+    ('kano_warawa','Kano / Warawa'),
+    ('kano_wudil','Kano / Wudil'),
+    ('katsina_bakori','Katsina / Bakori'),
+    ('katsina_batagarawa','Katsina / Batagarawa'),
+    ('katsina_batsari','Katsina / Batsari'),
+    ('katsina_baure','Katsina / Baure'),
+    ('katsina_bindawa','Katsina / Bindawa'),
+    ('katsina_charanchi','Katsina / Charanchi'),
+    ('katsina_dan-musa','Katsina / Dan-Musa'),
+    ('katsina_dandume','Katsina / Dandume'),
+    ('katsina_danji','Katsina / Danji'),
+    ('katsina_daura','Katsina / Daura'),
+    ('katsina_dutsi','Katsina / Dutsi'),
+    ('katsina_dutsinma','Katsina / Dutsinma'),
+    ('katsina_faskari','Katsina / Faskari'),
+    ('katsina_funtua','Katsina / Funtua'),
+    ('katsina_ingawa','Katsina / Ingawa'),
+    ('katsina_jibia','Katsina / Jibia'),
+    ('katsina_kafur','Katsina / Kafur'),
+    ('katsina_kaita','Katsina / Kaita'),
+    ('katsina_kankara','Katsina / Kankara'),
+    ('katsina_kankia','Katsina / Kankia'),
+    ('katsina_katsina','Katsina / Katsina'),
+    ('katsina_kurfi','Katsina / Kurfi'),
+    ('katsina_kusada','Katsina / Kusada'),
+    ('katsina_mai-adua','Katsina / Mai-Adua'),
+    ('katsina_malumfashi','Katsina / Malumfashi'),
+    ('katsina_mani','Katsina / Mani'),
+    ('katsina_mashi','Katsina / Mashi'),
+    ('katsina_matazu','Katsina / Matazu'),
+    ('katsina_musawa','Katsina / Musawa'),
+    ('katsina_rimi','Katsina / Rimi'),
+    ('katsina_sabuwa','Katsina / Sabuwa'),
+    ('katsina_safana','Katsina / Safana'),
+    ('katsina_sandamu','Katsina / Sandamu'),
+    ('katsina_zango','Katsina / Zango'),
+    ('kebbi_aleiro','Kebbi / Aleiro'),
+    ('kebbi_arewa-dandi','Kebbi / Arewa-Dandi'),
+    ('kebbi_argungu','Kebbi / Argungu'),
+    ('kebbi_augie','Kebbi / Augie'),
+    ('kebbi_bagudo','Kebbi / Bagudo'),
+    ('kebbi_birnin-kebbi','Kebbi / Birnin-Kebbi'),
+    ('kebbi_bumza','Kebbi / Bumza'),
+    ('kebbi_dandi','Kebbi / Dandi'),
+    ('kebbi_danko','Kebbi / Danko'),
+    ('kebbi_fakai','Kebbi / Fakai'),
+    ('kebbi_gwandu','Kebbi / Gwandu'),
+    ('kebbi_jega','Kebbi / Jega'),
+    ('kebbi_kalgo','Kebbi / Kalgo'),
+    ('kebbi_koko-besse','Kebbi / Koko-Besse'),
+    ('kebbi_maiyama','Kebbi / Maiyama'),
+    ('kebbi_ngaski','Kebbi / Ngaski'),
+    ('kebbi_sakaba','Kebbi / Sakaba'),
+    ('kebbi_shanga','Kebbi / Shanga'),
+    ('kebbi_suru','Kebbi / Suru'),
+    ('kebbi_wasagu','Kebbi / Wasagu'),
+    ('kebbi_yauri','Kebbi / Yauri'),
+    ('kebbi_zuru','Kebbi / Zuru'),
+    ('kogi_adavi','Kogi / Adavi'),
+    ('kogi_ajaokuta','Kogi / Ajaokuta'),
+    ('kogi_ankpa','Kogi / Ankpa'),
+    ('kogi_bassa','Kogi / Bassa'),
+    ('kogi_dekina','Kogi / Dekina'),
+    ('kogi_ibaji','Kogi / Ibaji'),
+    ('kogi_idah','Kogi / Idah'),
+    ('kogi_igalamela','Kogi / Igalamela'),
+    ('kogi_ijumu','Kogi / Ijumu'),
+    ('kogi_ikoyi-ijumu','Kogi / Ikoyi-Ijumu'),
+    ('kogi_kabba/bunu','Kogi / Kabba/Bunu'),
+    ('kogi_kogi','Kogi / Kogi'),
+    ('kogi_lokoja','Kogi / Lokoja'),
+    ('kogi_mopa-muro','Kogi / Mopa-Muro'),
+    ('kogi_obaji','Kogi / Obaji'),
+    ('kogi_ofu','Kogi / Ofu'),
+    ('kogi_ogori/magongo','Kogi / Ogori/Magongo'),
+    ('kogi_okehi','Kogi / Okehi'),
+    ('kogi_okene','Kogi / Okene'),
+    ('kogi_olamaboro','Kogi / Olamaboro'),
+    ('kogi_omala','Kogi / Omala'),
+    ('kogi_oru','Kogi / Oru'),
+    ('kogi_oyi','Kogi / Oyi'),
+    ('kogi_yagba-east','Kogi / Yagba-East'),
+    ('kogi_yagba-west','Kogi / Yagba-West'),
+    ('kwara_asa','Kwara / Asa'),
+    ('kwara_baruten','Kwara / Baruten'),
+    ('kwara_edu','Kwara / Edu'),
+    ('kwara_ekiti','Kwara / Ekiti'),
+    ('kwara_ilorin-east','Kwara / Ilorin-East'),
+    ('kwara_ilorin-south','Kwara / Ilorin-South'),
+    ('kwara_ilorin-west','Kwara / Ilorin-West'),
+    ('kwara_isin','Kwara / Isin'),
+    ('kwara_kaiama','Kwara / Kaiama'),
+    ('kwara_moro','Kwara / Moro'),
+    ('kwara_offa','Kwara / Offa'),
+    ('kwara_oke-ero','Kwara / Oke-Ero'),
+    ('kwara_oyun','Kwara / Oyun'),
+    ('kwara_pategi','Kwara / Pategi'),
+    ('kwara_ifelodun','Kwara / Ifelodun'),
+    ('kwara_irepodun','Kwara / Irepodun'),
+    ('lagos_agege','Lagos / Agege'),
+    ('lagos_ajeromi-ifelodun','Lagos / Ajeromi-Ifelodun'),
+    ('lagos_alimosho','Lagos / Alimosho'),
+    ('lagos_amuwo-odofin','Lagos / Amuwo-Odofin'),
+    ('lagos_apapa','Lagos / Apapa'),
+    ('lagos_badagry','Lagos / Badagry'),
+    ('lagos_epe','Lagos / Epe'),
+    ('lagos_eti-osa','Lagos / Eti-Osa'),
+    ('lagos_ibeju-lekki','Lagos / Ibeju-Lekki'),
+    ('lagos_ifako-ijaiye','Lagos / Ifako-Ijaiye'),
+    ('lagos_ikeja','Lagos / Ikeja'),
+    ('lagos_ikorodu','Lagos / Ikorodu'),
+    ('lagos_island','Lagos / Island'),
+    ('lagos_kosofe','Lagos / Kosofe'),
+    ('lagos_lagos-island','Lagos / Lagos-Island'),
+    ('lagos_lagos-mainland','Lagos / Lagos-Mainland'),
+    ('lagos_mushin','Lagos / Mushin'),
+    ('lagos_ojo','Lagos / Ojo'),
+    ('lagos_oshodi-isolo','Lagos / Oshodi-Isolo'),
+    ('lagos_shomolu','Lagos / Shomolu'),
+    ('lagos_somolu','Lagos / Somolu'),
+    ('lagos_suru-lere','Lagos / Suru-Lere'),
+    ('nassarawa_akwanga','Nassarawa / Akwanga'),
+    ('nassarawa_awe','Nassarawa / Awe'),
+    ('nassarawa_doma','Nassarawa / Doma'),
+    ('nassarawa_karu','Nassarawa / Karu'),
+    ('nassarawa_keana','Nassarawa / Keana'),
+    ('nassarawa_keffi','Nassarawa / Keffi'),
+    ('nassarawa_kokona','Nassarawa / Kokona'),
+    ('nassarawa_lafia','Nassarawa / Lafia'),
+    ('nassarawa_nassawara','Nassarawa / Nassawara'),
+    ('nassarawa_nassawara_eggon','Nassarawa / Nassawara Eggon'),
+    ('nassarawa_obi','Nassarawa / Obi'),
+    ('nassarawa_toto','Nassarawa / Toto'),
+    ('nassarawa_wambu','Nassarawa / Wambu'),
+    ('niger_agaie','Niger / Agaie'),
+    ('niger_agwara','Niger / Agwara'),
+    ('niger_bida','Niger / Bida'),
+    ('niger_borgu','Niger / Borgu'),
+    ('niger_bosso','Niger / Bosso'),
+    ('niger_chanchaga','Niger / Chanchaga'),
+    ('niger_edati','Niger / Edati'),
+    ('niger_gbako','Niger / Gbako'),
+    ('niger_gurara','Niger / Gurara'),
+    ('niger_katcha','Niger / Katcha'),
+    ('niger_kontagora','Niger / Kontagora'),
+    ('niger_lapai','Niger / Lapai'),
+    ('niger_lavun','Niger / Lavun'),
+    ('niger_magama','Niger / Magama'),
+    ('niger_mariga','Niger / Mariga'),
+    ('niger_mashegu','Niger / Mashegu'),
+    ('niger_mokwa','Niger / Mokwa'),
+    ('niger_muya','Niger / Muya'),
+    ('niger_paikoro','Niger / Paikoro'),
+    ('niger_rafi','Niger / Rafi'),
+    ('niger_rijau','Niger / Rijau'),
+    ('niger_shiroro','Niger / Shiroro'),
+    ('niger_suleja','Niger / Suleja'),
+    ('niger_tafa','Niger / Tafa'),
+    ('niger_wushishi','Niger / Wushishi'),
+    ('ogun_abeokuta-north','Ogun / Abeokuta-North'),
+    ('ogun_abeokuta-south','Ogun / Abeokuta-South'),
+    ('ogun_ado-odo/ota','Ogun / Ado-Odo/Ota'),
+    ('ogun_adoodo-ota','Ogun / Adoodo-Ota'),
+    ('ogun_ewekoro','Ogun / Ewekoro'),
+    ('ogun_idarapo','Ogun / Idarapo'),
+    ('ogun_iffo-otta','Ogun / Iffo-Otta'),
+    ('ogun_ifo','Ogun / Ifo'),
+    ('ogun_igbado-north','Ogun / Igbado-North'),
+    ('ogun_igbado-south','Ogun / Igbado-South'),
+    ('ogun_ijebu-east','Ogun / Ijebu-East'),
+    ('ogun_ijebu-north','Ogun / Ijebu-North'),
+    ('ogun_ijebu-north-east','Ogun / Ijebu-North-East'),
+    ('ogun_ijebu-ode','Ogun / Ijebu-Ode'),
+    ('ogun_ikenne','Ogun / Ikenne'),
+    ('ogun_ilishan_remo','Ogun / Ilishan Remo'),
+    ('ogun_ilugun-alaro','Ogun / Ilugun-Alaro'),
+    ('ogun_imeko-afon','Ogun / Imeko-Afon'),
+    ('ogun_ipokia','Ogun / Ipokia'),
+    ('ogun_lgayekpe_','Ogun / Lgayekpe'),
+    ('ogun_obafemi-owode','Ogun / Obafemi-Owode'),
+    ('ogun_odedah','Ogun / Odedah'),
+    ('ogun_odogbolu','Ogun / Odogbolu'),
+    ('ogun_ogun-waterside','Ogun / Ogun-Waterside'),
+    ('ogun_remo-north','Ogun / Remo-North'),
+    ('ogun_sagamu','Ogun / Sagamu'),
+    ('ogun_yewa','Ogun / Yewa'),
+    ('ondo_akoko','Ondo / Akoko'),
+    ('ondo_akoko-north','Ondo / Akoko-North'),
+    ('ondo_akoko-north-east','Ondo / Akoko-North-East'),
+    ('ondo_akoko-north-west','Ondo / Akoko-North-West'),
+    ('ondo_akoko-south','Ondo / Akoko-South'),
+    ('ondo_akoko-south-east','Ondo / Akoko-South-East'),
+    ('ondo_akoko-south-west','Ondo / Akoko-South-West'),
+    ('ondo_akure','Ondo / Akure'),
+    ('ondo_akure-north','Ondo / Akure-North'),
+    ('ondo_akure-south','Ondo / Akure-South'),
+    ('ondo_ese-odo','Ondo / Ese-Odo'),
+    ('ondo_idanre','Ondo / Idanre'),
+    ('ondo_ifedore','Ondo / Ifedore'),
+    ('ondo_ikale','Ondo / Ikale'),
+    ('ondo_ilaje','Ondo / Ilaje'),
+    ('ondo_ilaje-west','Ondo / Ilaje-West'),
+    ('ondo_ile-oluji-okeigbo','Ondo / Ile-Oluji-Okeigbo'),
+    ('ondo_irele','Ondo / Irele'),
+    ('ondo_odigbo','Ondo / Odigbo'),
+    ('ondo_okiti-pupa','Ondo / Okiti-Pupa'),
+    ('ondo_ondo','Ondo / Ondo'),
+    ('ondo_ondo-east','Ondo / Ondo-East'),
+    ('ondo_ondo-west','Ondo / Ondo-West'),
+    ('ondo_ose','Ondo / Ose'),
+    ('ondo_owo','Ondo / Owo'),
+    ('osun_atakumosa','Osun / Atakumosa'),
+    ('osun_atakumosa_east','Osun / Atakumosa East'),
+    ('osun_ayeda-ade','Osun / Ayeda-Ade'),
+    ('osun_ayedire','Osun / Ayedire'),
+    ('osun_boluwaduro','Osun / Boluwaduro'),
+    ('osun_boripe','Osun / Boripe'),
+    ('osun_ede','Osun / Ede'),
+    ('osun_ede-north','Osun / Ede North'),
+    ('osun_egbedore','Osun / Egbedore'),
+    ('osun_ejigbo','Osun / Ejigbo'),
+    ('osun_ife','Osun / Ife'),
+    ('osun_ife-north','Osun / Ife-North'),
+    ('osun_ife-south','Osun / Ife-South'),
+    ('osun_ife-central','Osun / Ife-Central'),
+    ('osun_ife-east','Osun / Ife-East'),
+    ('osun_ifelodun','Osun / Ifelodun'),
+    ('osun_ila','Osun / Ila'),
+    ('osun_ilesa-east','Osun / Ilesa-East'),
+    ('osun_ilesa-west','Osun / Ilesa-West'),
+    ('osun_ilesha','Osun / Ilesha'),
+    ('osun_ilesha_west','Osun / Ilesha West'),
+    ('osun_irepodun','Osun / Irepodun'),
+    ('osun_irewole','Osun / Irewole'),
+    ('osun_isokan','Osun / Isokan'),
+    ('osun_iwo','Osun / Iwo'),
+    ('osun_obokun','Osun / Obokun'),
+    ('osun_odo-otin','Osun / Odo-Otin'),
+    ('osun_ola_oluwa','Osun / Ola Oluwa'),
+    ('osun_olorunda','Osun / Olorunda'),
+    ('osun_ori-ade','Osun / Ori-Ade'),
+    ('osun_orolu','Osun / Orolu'),
+    ('osun_osogbo','Osun / Osogbo'),
+    ('oyo_afijio','Oyo / Afijio'),
+    ('oyo_akinyele','Oyo / Akinyele'),
+    ('oyo_atiba','Oyo / Atiba'),
+    ('oyo_atigbo','Oyo / Atigbo'),
+    ('oyo_egbeda','Oyo / Egbeda'),
+    ('oyo_ibadan-central','Oyo / Ibadan-Central'),
+    ('oyo_ibadan-north-east','Oyo / Ibadan-North-East'),
+    ('oyo_ibadan-north-west','Oyo / Ibadan-North-West'),
+    ('oyo_ibadan-south-east','Oyo / Ibadan-South-East'),
+    ('oyo_ibadan-south-west','Oyo / Ibadan-South-West'),
+    ('oyo_ibarapa-central','Oyo / Ibarapa-Central'),
+    ('oyo_ibarapa-east','Oyo / Ibarapa-East'),
+    ('oyo_ibarapa-north','Oyo / Ibarapa-North'),
+    ('oyo_ido','Oyo / Ido'),
+    ('oyo_ifedayo','Oyo / Ifedayo'),
+    ('oyo_ifeloju','Oyo / Ifeloju'),
+    ('oyo_irepo','Oyo / Irepo'),
+    ('oyo_iseyin','Oyo / Iseyin'),
+    ('oyo_itseiwaju','Oyo / Itseiwaju'),
+    ('oyo_iwajowa','Oyo / Iwajowa'),
+    ('oyo_kajola','Oyo / Kajola'),
+    ('oyo_lagelu','Oyo / Lagelu'),
+    ('oyo_odo-oluwa','Oyo / Odo-Oluwa'),
+    ('oyo_ogbomosho-north','Oyo / Ogbomosho-North'),
+    ('oyo_ogbomosho-south','Oyo / Ogbomosho-South'),
+    ('oyo_olorunsogo','Oyo / Olorunsogo'),
+    ('oyo_oluyole','Oyo / Oluyole'),
+    ('oyo_ona-ara','Oyo / Ona-Ara'),
+    ('oyo_orelope','Oyo / Orelope'),
+    ('oyo_ori-ire','Oyo / Ori-Ire'),
+    ('oyo_oyo-west','Oyo / Oyo-West'),
+    ('oyo_saki-east','Oyo / Saki-East'),
+    ('oyo_saki-west','Oyo / Saki-West'),
+    ('oyo_surulere','Oyo / Surulere'),
+    ('plateau_barkin-ladi','Plateau / Barkin-Ladi'),
+    ('plateau_bassa','Plateau / Bassa'),
+    ('plateau_bokkos','Plateau / Bokkos'),
+    ('plateau_jos-east','Plateau / Jos-East'),
+    ('plateau_jos-north','Plateau / Jos-North'),
+    ('plateau_jos-south','Plateau / Jos-South'),
+    ('plateau_kanam','Plateau / Kanam'),
+    ('plateau_kanke','Plateau / Kanke'),
+    ('plateau_langtang-north','Plateau / Langtang-North'),
+    ('plateau_langtang-south','Plateau / Langtang-South'),
+    ('plateau_mangu','Plateau / Mangu'),
+    ('plateau_mikang','Plateau / Mikang'),
+    ('plateau_pankshin','Plateau / Pankshin'),
+    ('plateau_quananpan','Plateau / Quananpan'),
+    ('plateau_riyom','Plateau / Riyom'),
+    ('plateau_shendam','Plateau / Shendam'),
+    ('plateau_wase','Plateau / Wase'),
+    ('rivers_aboa/odual','Rivers / Aboa/Odual'),
+    ('rivers_ahoada-east','Rivers / Ahoada-East'),
+    ('rivers_ahoada-west','Rivers / Ahoada-West'),
+    ('rivers_akukutoru','Rivers / Akukutoru'),
+    ('rivers_andoni','Rivers / Andoni'),
+    ('rivers_asari-toru','Rivers / Asari-Toru'),
+    ('rivers_bonny','Rivers / Bonny'),
+    ('rivers_buguma','Rivers / Buguma'),
+    ('rivers_degema','Rivers / Degema'),
+    ('rivers_eleme','Rivers / Eleme'),
+    ('rivers_elfane','Rivers / Elfane'),
+    ('rivers_emuoha','Rivers / Emuoha'),
+    ('rivers_etche','Rivers / Etche'),
+    ('rivers_gokana','Rivers / Gokana'),
+    ('rivers_ikwerre','Rivers / Ikwerre'),
+    ('rivers_khana','Rivers / Khana'),
+    ('rivers_obia/akpor','Rivers / Obia/Akpor'),
+    ('rivers_ogba-egbema-ndoni','Rivers / Ogba-Egbema-Ndoni'),
+    ('rivers_ogu/bolo','Rivers / Ogu/Bolo'),
+    ('rivers_okirika','Rivers / Okirika'),
+    ('rivers_omuma','Rivers / Omuma'),
+    ('rivers_opobo/nkoro','Rivers / Opobo/Nkoro'),
+    ('rivers_oyigbo','Rivers / Oyigbo'),
+    ('rivers_port-harcourt','Rivers / Port-Harcourt'),
+    ('rivers_tai','Rivers / Tai'),
+    ('sokoto_binji','Sokoto / Binji'),
+    ('sokoto_bodinga','Sokoto / Bodinga'),
+    ('sokoto_dange-shuni','Sokoto / Dange-Shuni'),
+    ('sokoto_gada','Sokoto / Gada'),
+    ('sokoto_goronyo','Sokoto / Goronyo'),
+    ('sokoto_gudu','Sokoto / Gudu'),
+    ('sokoto_gwadabawa','Sokoto / Gwadabawa'),
+    ('sokoto_illela','Sokoto / Illela'),
+    ('sokoto_kebbe','Sokoto / Kebbe'),
+    ('sokoto_kware','Sokoto / Kware'),
+    ('sokoto_raba','Sokoto / Raba'),
+    ('sokoto_sabo-birni','Sokoto / Sabo-Birni'),
+    ('sokoto_shagari','Sokoto / Shagari'),
+    ('sokoto_silame','Sokoto / Silame'),
+    ('sokoto_sokoto-north','Sokoto / Sokoto-North'),
+    ('sokoto_sokoto-south','Sokoto / Sokoto-South'),
+    ('sokoto_tambuwal','Sokoto / Tambuwal'),
+    ('sokoto_tangaza','Sokoto / Tangaza'),
+    ('sokoto_tureta','Sokoto / Tureta'),
+    ('sokoto_wamakko','Sokoto / Wamakko'),
+    ('sokoto_wurno','Sokoto / Wurno'),
+    ('sokoto_yabo','Sokoto / Yabo'),
+    ('taraba_ardo-kola','Taraba / Ardo-Kola'),
+    ('taraba_bali','Taraba / Bali'),
+    ('taraba_donga','Taraba / Donga'),
+    ('taraba_gashaka','Taraba / Gashaka'),
+    ('taraba_gassol','Taraba / Gassol'),
+    ('taraba_ibi','Taraba / Ibi'),
+    ('taraba_jalingo','Taraba / Jalingo'),
+    ('taraba_karim-lamido','Taraba / Karim-Lamido'),
+    ('taraba_kurmi','Taraba / Kurmi'),
+    ('taraba_lau','Taraba / Lau'),
+    ('taraba_oilingo','Taraba / Oilingo'),
+    ('taraba_sardauna','Taraba / Sardauna'),
+    ('taraba_takum','Taraba / Takum'),
+    ('taraba_ussa','Taraba / Ussa'),
+    ('taraba_wukari','Taraba / Wukari'),
+    ('taraba_yorro','Taraba / Yorro'),
+    ('taraba_zing','Taraba / Zing'),
+    ('yobe_bade','Yobe / Bade'),
+    ('yobe_borsali','Yobe / Borsali'),
+    ('yobe_damaturu','Yobe / Damaturu'),
+    ('yobe_fika','Yobe / Fika'),
+    ('yobe_fune','Yobe / Fune'),
+    ('yobe_geidam','Yobe / Geidam'),
+    ('yobe_gogaram','Yobe / Gogaram'),
+    ('yobe_gujba','Yobe / Gujba'),
+    ('yobe_gulani','Yobe / Gulani'),
+    ('yobe_jakusko','Yobe / Jakusko'),
+    ('yobe_karasuwa','Yobe / Karasuwa'),
+    ('yobe_machina','Yobe / Machina'),
+    ('yobe_nangere','Yobe / Nangere'),
+    ('yobe_nguru','Yobe / Nguru'),
+    ('yobe_potiskum','Yobe / Potiskum'),
+    ('yobe_tarmua','Yobe / Tarmua'),
+    ('yobe_yunusari','Yobe / Yunusari'),
+    ('zamfara_anka','Zamfara / Anka'),
+    ('zamfara_bakura','Zamfara / Bakura'),
+    ('zamfara_bukkuyum','Zamfara / Bukkuyum'),
+    ('zamfara_bungudu','Zamfara / Bungudu'),
+    ('zamfara_gumi','Zamfara / Gumi'),
+    ('zamfara_gusau','Zamfara / Gusau'),
+    ('zamfara_isa','Zamfara / Isa'),
+    ('zamfara_kaura-namoda','Zamfara / Kaura-Namoda'),
+    ('zamfara_kiyawa','Zamfara / Kiyawa'),
+    ('zamfara_maradun','Zamfara / Maradun'),
+    ('zamfara_maru','Zamfara / Maru'),
+    ('zamfara_shinkafi','Zamfara / Shinkafi'),
+    ('zamfara_talata-mafara','Zamfara / Talata-Mafara'),
+    ('zamfara_tsafe','Zamfara / Tsafe'),
+    ('zamfara_zurmi','Zamfara / Zurmi'),
+    ('osun_aiyedire','Osun / Aiyedire'),
+    ('cross_river_biase','Cross River / Biase'),
+    ('ogun_egbado-north','Ogun / Egbado-North'),
+    ('ogun_egbado-south','Ogun / Egbado-South'),
+    ('oyo_itesiwaju','Oyo / Itesiwaju'),
+    ('oyo_ogo-oluwa','Oyo / Ogo-Oluwa'),
+    ('ebonyi_ohaukwu','Ebonyi / Ohaukwu'),
+    ('ondo_okitipupa','Ondo / Okitipupa'),
+    ('osun_oriade','Osun / Oriade'),
+    ('benue_oturkpo','Benue / Oturkpo'),
+    ('oyo_oyo-east','Oyo / Oyo-East'),
+    ('abia_ukwa-east','Abia / Ukwa-East'),
+    ('akwa_ibom_urue-ffong-oruko','Akwa Ibom / Urue-Offong-Oruko'),
+    ('foreigner','Foreigner')
+    )
Index: main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/utils/utils.py
===================================================================
--- main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/utils/utils.py	(revision 12371)
+++ main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/utils/utils.py	(revision 12371)
@@ -0,0 +1,74 @@
+## $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 Ikoba.
+"""
+import pytz
+from waeup.ikoba.utils.utils import IkobaUtils, sorted_phone_prefixes
+from ikobacustom.pcn.interfaces import MessageFactory as _
+
+INT_PHONE_PREFIXES = [
+    (1, _('Nigeria'), '234'),
+    (99, _('Germany'), '49'),
+    (99, _('United States'), '1'),
+    (99, _('Niger'), '227'),
+    (99, _('Benin'), '229'),
+    (99, _('Cameroon'), '237'),
+    (99, _('United Kingdom'), '44'),
+    (99, _('France'), '33'),
+    ]
+
+class PCNIkobaUtils(IkobaUtils):
+    """A collection of methods subject to customization.
+    """
+    PORTAL_LANGUAGE = 'en'
+
+    PREFERRED_LANGUAGES_DICT = {
+        'en':(1, u'English'),
+        'fr':(2, u'Fran&ccedil;ais'),
+        'de':(3, u'Deutsch'),
+        'ha':(4, u'Hausa'),
+        'yo':(5, u'Yoruba'),
+        'ig':(6, u'Igbo'),
+        }
+
+    EXPORTER_NAMES = (
+        'pdfdocuments',
+        'htmldocuments',
+        'users',
+        'products',
+        'customers',
+        'pcncustomerdocuments',
+        'pcncontracts')
+
+    BATCH_PROCESSOR_NAMES = (
+        'pcncustomerprocessor',
+        'pcncustomerdocumentprocessor',
+        'pcncontractprocessor',
+        'pcnproductprocessor',
+        'pdfdocumentprocessor',
+        'htmldocumentprocessor',
+        'userprocessor')
+
+    #: A function to return
+    @classmethod
+    def sorted_phone_prefixes(cls, data=INT_PHONE_PREFIXES, request=None):
+        return sorted_phone_prefixes(data, request)
+
+    @property
+    def tzinfo(self):
+        return pytz.timezone('Africa/Lagos')
Index: main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/widgets/__init__.py
===================================================================
--- main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/widgets/__init__.py	(revision 12371)
+++ main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/widgets/__init__.py	(revision 12371)
@@ -0,0 +1,1 @@
+# Make this a package.
Index: main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/widgets/phonewidget.py
===================================================================
--- main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/widgets/phonewidget.py	(revision 12371)
+++ main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/widgets/phonewidget.py	(revision 12371)
@@ -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
+##
+"""
+A customized phone widget
+"""
+
+from waeup.ikoba.widgets.phonewidget import PhoneWidget
+
+class NigeriaPhoneWidget(PhoneWidget):
+    """A phone widget without area prefix.
+    """
+    subwidget_names = ('country', 'ext')
+    bootstrap_span = 'span3'
