Index: /main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/browser.txt
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/browser.txt	(revision 5124)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/browser.txt	(revision 5125)
@@ -1,4 +1,6 @@
-Browsing the access-code related UI components
-**********************************************
+:mod:`waeup.sirp.accesscodes.browser` -- UI components for access-codes
+***********************************************************************
+
+.. module:: waeup.sirp.accesscodes.browser
 
 Here we visit the access-code related parts of a WAeUP SIRP site using
@@ -130,4 +132,106 @@
     >>> browser.getControl('Create batch').click()
 
+And a third one that can be deleted afterwards:
+
+    >>> browser.getLink('Add Scratch Card Batch').click()
+    >>> browser.getControl(name='form.batch_prefix').value = 'BLA'
+    >>> browser.getControl(name='form.entry_num').value = '3'
+    >>> browser.getControl(name='form.cost').value = '19.12'
+    >>> browser.getControl('Create batch').click()
+
+Creating Archive Files
+======================
+
+Once a batch is created, we can archive it. To do so we have to tick
+the respective checkbox and click on 'Archive':
+
+    >>> ctrl = browser.getControl(name='batches')
+    >>> ctrl.getControl(value='APP-2').selected = True
+    >>> browser.getControl(name='archive').click()
+    >>> print browser.contents
+    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+    ...
+    <li ...>Archived APP-2 (APP-2_archive-...-zope.mgr.csv)</li>
+    ...
+
+If we do not select a batch and try to archive or delete, the system
+will complain:
+
+    >>> browser.getControl(name='archive').click()
+    >>> print browser.contents
+    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+    ...
+    <li ...>No batch selected.</li>
+    ...
+
+Deleting Batches
+================
+
+We can delete batches. They are automatically archived when doing so:
+
+    >>> ctrl = browser.getControl(name='batches')
+    >>> ctrl.getControl(value='BLA-1').selected = True
+    >>> browser.getControl('Archive and Delete').click()
+    >>> print browser.contents
+    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+    ...Archived BLA-1 (BLA-1_archive-...-zope.mgr.csv)...
+    ...Deleted batch BLA-1...
+    ...
+
+
+Log- and Archive Files
+======================
+
+We store log- and archive-files inside the storage managed by the
+local datacenter. Access-code related files are placed inside an
+``accesscode`` subdir:
+
+    >>> ac_storage = os.path.join(uploadpath, 'accesscodes')
+
+Log files for access-code batches
+---------------------------------
+
+Whenever a batch is created, there is also a log file with all entries
+created:
+
+    >>> sorted(os.listdir(ac_storage))
+    ['APP-1-...-zope.mgr.csv', 'APP-2-...-zope.mgr.csv', ...]
+
+Each logfile name contains the prefix, batch number, date of creation
+and userid of creator.
+
+    >>> logfile1 = os.path.join(ac_storage, 
+    ...                         sorted(os.listdir(ac_storage))[0])
+    >>> print open(logfile1, 'rb').read()
+    "serial","ac","cost"
+    "APP","1","12.12"
+    "0","APP-1-<10-DIGITS>"
+    "1","APP-1-<10-DIGITS>"
+    "2","APP-1-<10-DIGITS>"
+    "3","APP-1-<10-DIGITS>"
+    "4","APP-1-<10-DIGITS>"
+
+
+Archive files
+-------------
+
+We created an archive file above. An archive file name consists of the
+batch prefix, batch number, the string ``_archive``, creation datetime of
+the archive file and userid of batch creator:
+
+    >>> sorted(os.listdir(ac_storage))
+    [..., 'BLA-1_archive-...-zope.mgr.csv']
+
+Archive files eventually also contain infos about invalidation dates
+and have a slightly different format therefore.
+
+    >>> archive_file = os.path.join(ac_storage, os.listdir(ac_storage)[-1])
+    >>> print open(archive_file, 'rb').read()
+    "prefix","serial","ac","student","date"
+    "BLA","19.12","1","3"
+    "BLA","0","BLA-1-<10-DIGITS>","",""
+    "BLA","1","BLA-1-<10-DIGITS>","",""
+    "BLA","2","BLA-1-<10-DIGITS>","",""
+
 Clean up:
 
