Index: main/waeup.ikoba/trunk/src/waeup/ikoba/customers/export.py
===================================================================
--- main/waeup.ikoba/trunk/src/waeup/ikoba/customers/export.py	(revision 12006)
+++ main/waeup.ikoba/trunk/src/waeup/ikoba/customers/export.py	(revision 12007)
@@ -157,4 +157,6 @@
         """Treat location values special.
         """
+        if name == 'history':
+            value = value.messages
         if context is not None:
             customer = context.customer
Index: main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_export.py
===================================================================
--- main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_export.py	(revision 12006)
+++ main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_export.py	(revision 12007)
@@ -10,7 +10,8 @@
 from waeup.ikoba.customers.catalog import CustomersQuery
 from waeup.ikoba.customers.export import (
-    CustomersExporter, get_customers)
+    CustomersExporter, CustomerDocumentsExporter, get_customers)
 from waeup.ikoba.customers.interfaces import ICSVCustomerExporter
 from waeup.ikoba.customers.customer import Customer
+from waeup.ikoba.customers.documents import CustomerDocument
 from waeup.ikoba.customers.tests.test_batching import CustomerImportExportSetup
 from waeup.ikoba.testing import FunctionalLayer
@@ -106,2 +107,85 @@
             )
         return
+
+class CustomerDocumentsExporterTest(CustomerImportExportSetup):
+
+    layer = FunctionalLayer
+
+    def setUp(self):
+        super(CustomerDocumentsExporterTest, self).setUp()
+        self.setup_for_export()
+        return
+
+    def test_ifaces(self):
+        # make sure we fullfill interface contracts
+        obj = CustomerDocumentsExporter()
+        verifyObject(ICSVCustomerExporter, obj)
+        verifyClass(ICSVCustomerExporter, CustomerDocumentsExporter)
+        return
+
+    def test_get_as_utility(self):
+        # we can get a documents exporter as utility
+        result = queryUtility(ICSVExporter, name="customerdocuments")
+        self.assertTrue(result is not None)
+        return
+
+    def test_export_empty(self):
+        # we can export a nearly empty document
+        document = CustomerDocument()
+        exporter = CustomerDocumentsExporter()
+        exporter.export([document], self.outfile)
+        result = open(self.outfile, 'rb').read()
+        self.assertEqual(
+            result,
+            'doctype,document_id,history,title,customer_id\r\n'
+            ',d101,[],,\r\n'
+            )
+        return
+
+    def test_export(self):
+        # we can really export customer documents.
+        # set values we can expect in export file
+        self.setup_customer(self.customer)
+        document = self.customer['documents']['d101']
+        exporter = CustomerDocumentsExporter()
+        exporter.export([document], self.outfile)
+        result = open(self.outfile, 'rb').read()
+        self.assertTrue(
+            'doctype,document_id,history,title,customer_id\r\n'
+            in result
+            )
+        self.assertTrue(
+            'Document created by system\'],My Document,A111111\r\n'
+            in result
+            )
+        return
+
+    def test_export_all(self):
+        # we can really export all documents
+        # set values we can expect in export file
+        self.setup_customer(self.customer)
+        exporter = CustomerDocumentsExporter()
+        exporter.export_all(self.app, self.outfile)
+        result = open(self.outfile, 'rb').read()
+        self.assertTrue(
+            'doctype,document_id,history,title,customer_id\r\n'
+            in result)
+        self.assertTrue(
+            ' Document created by system\'],My Document,A111111\r\n'
+            in result)
+        return
+
+    def test_export_customer(self):
+        # we can really export all documents of a certain customer
+        # set values we can expect in export file
+        self.setup_customer(self.customer)
+        exporter = CustomerDocumentsExporter()
+        exporter.export_customer(self.customer, self.outfile)
+        result = open(self.outfile, 'rb').read()
+        self.assertTrue(
+            'doctype,document_id,history,title,customer_id\r\n'
+            in result)
+        self.assertTrue(
+            ' Document created by system\'],My Document,A111111\r\n'
+            in result)
+        return
Index: main/waeup.ikoba/trunk/src/waeup/ikoba/documents/interfaces.py
===================================================================
--- main/waeup.ikoba/trunk/src/waeup/ikoba/documents/interfaces.py	(revision 12006)
+++ main/waeup.ikoba/trunk/src/waeup/ikoba/documents/interfaces.py	(revision 12007)
@@ -23,5 +23,5 @@
 from waeup.ikoba.interfaces import MessageFactory as _
 
-class DocumentCategorySource(ContextualDictSourceFactoryBase):
+class DocumentTypeSource(ContextualDictSourceFactoryBase):
     """A document type source delivers all types of documents.
 
@@ -46,7 +46,7 @@
     history = Attribute('Object history, a list of messages')
 
-    category = schema.Choice(
-        title = _(u'Document Category'),
-        source = DocumentCategorySource(),
+    doctype = schema.Choice(
+        title = _(u'Document Type'),
+        source = DocumentTypeSource(),
         required = True,
         )
