Index: main/waeup.ikoba/trunk/src/waeup/ikoba/documents/batching.py
===================================================================
--- main/waeup.ikoba/trunk/src/waeup/ikoba/documents/batching.py	(revision 12250)
+++ main/waeup.ikoba/trunk/src/waeup/ikoba/documents/batching.py	(revision 12256)
@@ -56,5 +56,4 @@
     factory_name = 'waeup.PDFDocument'
 
-    location_fields = []
     additional_fields = ['class_name']
     additional_headers = ['class_name']
@@ -66,5 +65,10 @@
 
     def entryExists(self, row, site):
-        return row['document_id'] in site['documents'].keys()
+        document_id = row.get('document_id', None)
+        cat = queryUtility(ICatalog, name='documents_catalog')
+        results = list(cat.searchResults(document_id=(document_id, document_id)))
+        if results:
+            return True
+        return False
 
     def getParent(self, row, site):
@@ -94,5 +98,5 @@
         """Update obj to the values given in row.
         """
-        items_changed = super(DocumentProcessor, self).updateEntry(
+        items_changed = super(PDFDocumentProcessor, self).updateEntry(
             obj, row, site, filename)
         # Log actions...
@@ -110,24 +114,11 @@
         # We need to check if the class_name corresponds with the
         # processor chosen. This is to avoid accidentally wrong imports.
-        if mode != 'remove':
+        if mode == 'create':
             class_name = row.get('class_name', None)
             if class_name != self.factory_name.strip('waeup.'):
                 errs.append(('class_name','wrong processor'))
-        # We have to check document_id.
         document_id = row.get('document_id', None)
-        if mode == 'create':
-            if not document_id:
-                document_id = generate_document_id()
-                conv_dict['document_id'] = document_id
-                return errs, inv_errs, conv_dict
-            cat = queryUtility(ICatalog, name='documents_catalog')
-            results = list(
-                cat.searchResults(document_id=(document_id, document_id)))
-            if results:
-                # document_id must not exist.
-                errs.append(('document_id','id exists'))
-        else:
-            if not document_id.startswith('d'):
-                errs.append(('document_id','invalid format'))
+        if ' ' in document_id:
+            errs.append(('document_id','must not contain spaces'))
         return errs, inv_errs, conv_dict
 
Index: main/waeup.ikoba/trunk/src/waeup/ikoba/documents/document.py
===================================================================
--- main/waeup.ikoba/trunk/src/waeup/ikoba/documents/document.py	(revision 12250)
+++ main/waeup.ikoba/trunk/src/waeup/ikoba/documents/document.py	(revision 12256)
@@ -39,5 +39,4 @@
     IDocument, IPublicDocument, IDocumentsUtils,
     IPDFDocument, IHTMLDocument)
-from waeup.ikoba.documents.utils import generate_document_id
 
 class Document(grok.Container):
@@ -58,13 +57,4 @@
     translated_state = None
     translated_class_name = None
-
-    def __init__(self):
-        super(Document, self).__init__()
-        # The site doesn't exist in unit tests
-        try:
-            self.document_id = generate_document_id()
-        except AttributeError:
-            self.document_id = u'd123'
-        return
 
     @property
Index: main/waeup.ikoba/trunk/src/waeup/ikoba/documents/interfaces.py
===================================================================
--- main/waeup.ikoba/trunk/src/waeup/ikoba/documents/interfaces.py	(revision 12250)
+++ main/waeup.ikoba/trunk/src/waeup/ikoba/documents/interfaces.py	(revision 12256)
@@ -38,5 +38,4 @@
 
     """
-    document_id = Attribute('Document Identifier')
     history = Attribute('Object history, a list of messages')
     state = Attribute('Returns the verification state of a document')
@@ -49,4 +48,9 @@
     connected_files = Attribute('Names of files connected to a document')
     is_verifiable = Attribute('Contract verifiable by officer')
+
+    document_id = schema.TextLine(
+        title = _(u'Document Id'),
+        required = False,
+        )
 
     title = schema.TextLine(
Index: main/waeup.ikoba/trunk/src/waeup/ikoba/documents/tests/test_browser.py
===================================================================
--- main/waeup.ikoba/trunk/src/waeup/ikoba/documents/tests/test_browser.py	(revision 12250)
+++ main/waeup.ikoba/trunk/src/waeup/ikoba/documents/tests/test_browser.py	(revision 12256)
@@ -111,10 +111,11 @@
         self.browser.getControl(name="doctype").value = ['PDFDocument']
         self.browser.getControl(name="form.title").value = 'My PDF Document'
+        self.browser.getControl(name="form.document_id").value = 'DOC1'
         self.browser.getControl("Add document").click()
         self.assertTrue('PDF Document added.' in self.browser.contents)
-        document = self.app['documents']['d101']
+        document = self.app['documents']['DOC1']
 
         # Document can be edited
-        self.browser.getLink("d101").click()
+        self.browser.getLink("DOC1").click()
         self.browser.getLink("Manage").click()
         self.browser.getControl(name="form.title").value = 'My first doc'
@@ -122,5 +123,5 @@
         self.assertTrue('Form has been saved.' in self.browser.contents)
         self.browser.getLink("View").click()
-        self.assertEqual(self.browser.url, self.container_path + '/d101/index')
+        self.assertEqual(self.browser.url, self.container_path + '/DOC1/index')
 
         # File can be uploaded
@@ -149,5 +150,5 @@
             name='upload_pdfscanmanageupload').click()
         self.assertTrue(
-            'href="http://localhost/app/documents/d101/sample.pdf">PDF File</a>'
+            'href="http://localhost/app/documents/DOC1/sample.pdf">PDF File</a>'
             in self.browser.contents)
         # Browsing the link shows a real pdf only if the document
@@ -158,5 +159,5 @@
             in self.browser.contents)
         IWorkflowState(document).setState(PUBLISHED)
-        self.browser.open(self.container_path + '/d101/sample.pdf')
+        self.browser.open(self.container_path + '/DOC1/sample.pdf')
         self.assertEqual(
             self.browser.headers['content-type'], 'application/pdf')
@@ -164,5 +165,5 @@
         # Transitions can be performed
         self.assertEqual(document.state, 'published')
-        self.browser.open(self.container_path + '/d101')
+        self.browser.open(self.container_path + '/DOC1')
         self.browser.getLink("Transition").click()
         self.browser.getControl(name="transition").value = ['retract']
@@ -213,11 +214,12 @@
         self.browser.getControl("Add document").click()
         self.browser.getControl(name="doctype").value = ['HTMLDocument']
+        self.browser.getControl(name="form.document_id").value = 'DOC2'
         self.browser.getControl(name="form.title").value = 'My HTML Document'
         self.browser.getControl("Add document").click()
         self.assertTrue('HTML Document added.' in self.browser.contents)
-        document = self.app['documents']['d101']
+        document = self.app['documents']['DOC2']
 
         # Document can be edited
-        self.browser.getLink("d101").click()
+        self.browser.getLink("DOC2").click()
         self.browser.getLink("Manage").click()
         self.browser.getControl(name="form.title").value = 'My second doc'
@@ -230,5 +232,5 @@
         self.assertTrue('Form has been saved.' in self.browser.contents)
         self.browser.getLink("View").click()
-        self.assertEqual(self.browser.url, self.container_path + '/d101/index')
+        self.assertEqual(self.browser.url, self.container_path + '/DOC2/index')
         self.assertTrue(
             '<h1>Hello World</h1>' in self.browser.contents)
@@ -241,5 +243,5 @@
             '<h1>Hallo Welt</h1>' in self.browser.contents)
         # The content can't be rendered yet
-        self.browser.open(self.container_path + '/d101/display')
+        self.browser.open(self.container_path + '/DOC2/display')
         self.assertTrue(
             'The document requested has not yet been published'
@@ -249,5 +251,5 @@
 
         # Transitions can be performed
-        self.browser.open(self.container_path + '/d101')
+        self.browser.open(self.container_path + '/DOC2')
         self.browser.getLink("Transition").click()
         self.browser.getControl(name="transition").value = ['publish']
@@ -256,5 +258,5 @@
 
         # The content can be rendered
-        self.browser.open(self.container_path + '/d101/display')
+        self.browser.open(self.container_path + '/DOC2/display')
         self.assertTrue(
             '<h1>Hallo Welt</h1>' in self.browser.contents)
Index: main/waeup.ikoba/trunk/src/waeup/ikoba/documents/tests/test_document.py
===================================================================
--- main/waeup.ikoba/trunk/src/waeup/ikoba/documents/tests/test_document.py	(revision 12250)
+++ main/waeup.ikoba/trunk/src/waeup/ikoba/documents/tests/test_document.py	(revision 12256)
@@ -72,9 +72,9 @@
         container = DocumentsContainer()
         document = createObject(u'waeup.HTMLDocument')
-        document_id = document.document_id
+        document.document_id = u'DOC'
         container.addDocument(document)
-        self.assertEqual(container[document_id], document)
+        self.assertEqual(container[document.document_id], document)
         self.assertRaises(TypeError, container.addDocument, object())
-        self.assertEqual(document_id, 'd123')
+        self.assertEqual(document.document_id, 'DOC')
         return
 
@@ -151,8 +151,9 @@
         # we can get an image filename for documents not in a container
         doc = PDFDocument()
+        doc.document_id = u'DOC'
         chooser = IFileStoreNameChooser(doc)
         result = chooser.chooseName('sample.jpg')
         # the file would be stored in a ``_default`` directory.
         self.assertEqual(
-            result, '__file-document__documents/sample_d123.jpg')
+            result, '__file-document__documents/sample_DOC.jpg')
         return
Index: main/waeup.ikoba/trunk/src/waeup/ikoba/documents/utils.py
===================================================================
--- main/waeup.ikoba/trunk/src/waeup/ikoba/documents/utils.py	(revision 12250)
+++ main/waeup.ikoba/trunk/src/waeup/ikoba/documents/utils.py	(revision 12256)
@@ -26,9 +26,4 @@
 
 
-def generate_document_id():
-    new_id = grok.getSite().unique_document_id
-    return new_id
-
-
 class DocumentsUtils(grok.GlobalUtility):
     """A collection of methods subject to customization.
