Index: /main/waeup.kofa/trunk/src/waeup/kofa/hostels/browser.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/hostels/browser.py	(revision 9198)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/hostels/browser.py	(revision 9199)
@@ -93,5 +93,5 @@
 
     def title(self):
-        co = self.context.getBedCoordinates()
+        co = self.context.coordinates
         return _('Block ${a}, Room ${b}, Bed ${c}',
             mapping = {'a':co[1], 'b':co[2], 'c':co[3]})
@@ -354,5 +354,5 @@
     grok.require('waeup.manageHostels')
     form_fields = grok.AutoFields(IBedAllocateStudent).omit(
-        'bed_id').omit('bed_number').omit('bed_type')
+        'bed_id', 'bed_number', 'bed_type')
     label = _('Allocate student')
     pnav = 5
Index: /main/waeup.kofa/trunk/src/waeup/kofa/hostels/export.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/hostels/export.py	(revision 9199)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/hostels/export.py	(revision 9199)
@@ -0,0 +1,75 @@
+## $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
+##
+"""Exporters for hostels and beds.
+"""
+import grok
+from zope.securitypolicy.interfaces import IPrincipalRoleMap
+from waeup.kofa.interfaces import ICSVExporter
+from waeup.kofa.interfaces import MessageFactory as _
+from waeup.kofa.utils.batching import ExporterBase
+from waeup.kofa.utils.helpers import iface_names
+from waeup.kofa.hostels.interfaces import IBed, IHostel
+
+class HostelExporter(grok.GlobalUtility, ExporterBase):
+    """Exporter for hostels.
+    """
+    grok.implements(ICSVExporter)
+    grok.name('hostels')
+
+    #: Fieldnames considered by this exporter
+    fields = tuple(sorted(iface_names(IHostel))) 
+
+    #: The title under which this exporter will be displayed
+    title = _(u'Hostels')
+
+    def export_all(self, site, filepath=None):
+        """Export hostels into filepath as CSV data.
+
+        If `filepath` is ``None``, a raw string with CSV data is returned.
+        """
+        writer, outfile = self.get_csv_writer(filepath)
+        hostels = site.get('hostels', {})
+        for hostel in hostels.values():
+            self.write_item(hostel, writer)
+        return self.close_outfile(filepath, outfile)
+
+class BedExporter(grok.GlobalUtility, ExporterBase):
+    """Exporter for courses.
+    """
+    grok.implements(ICSVExporter)
+    grok.name('beds')
+
+    #: Fieldnames considered by this exporter
+    fields = tuple(sorted(iface_names(IBed))) + (
+        'hall', 'block', 'room', 'bed', 'special_handling', 'sex', 'bt')
+
+    #: The title under which this exporter will be displayed
+    title = _(u'Beds')
+
+    def export_all(self, site, filepath=None):
+        """Export beds into filepath as CSV data.
+
+        If `filepath` is ``None``, a raw string with CSV data is returned.
+        """
+        writer, outfile = self.get_csv_writer(filepath)
+        hostels = site.get('hostels', {})
+        for hostel in hostels.values():
+            for bed in hostel.values():
+                self.write_item(bed, writer)
+        return self.close_outfile(filepath, outfile)
+
Index: /main/waeup.kofa/trunk/src/waeup/kofa/hostels/hostel.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/hostels/hostel.py	(revision 9198)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/hostels/hostel.py	(revision 9199)
@@ -145,8 +145,41 @@
     grok.provides(IBed)
 
-    def getBedCoordinates(self):
+    @property
+    def coordinates(self):
         """Determine the coordinates from the bed_id.
         """
         return self.bed_id.split('_')
+
+    # The following property attributes are only needed
+    # for the exporter to ease evaluation with  Excel.
+
+    @property
+    def hall(self):
+        return self.coordinates[0]
+
+    @property
+    def block(self):
+        return self.coordinates[1]
+
+    @property
+    def room(self):
+        return self.coordinates[2]
+
+    @property
+    def bed(self):
+        return self.coordinates[3]
+
+    @property
+    def special_handling(self):
+        return self.bed_type.split('_')[0]
+
+    @property
+    def sex(self):
+        return self.bed_type.split('_')[1]
+
+    @property
+    def bt(self):
+        return self.bed_type.split('_')[2]
+
 
     def bookBed(self, student_id):
@@ -162,5 +195,5 @@
         """
         sh, sex, bt = self.bed_type.split('_')
-        hostel_id, block, room_nr, bed = self.getBedCoordinates()
+        hostel_id, block, room_nr, bed = self.coordinates
         hostel = self.__parent__
         beds_for_fresh = getattr(hostel,'beds_for_fresh',[])
Index: /main/waeup.kofa/trunk/src/waeup/kofa/hostels/interfaces.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/hostels/interfaces.py	(revision 9198)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/hostels/interfaces.py	(revision 9199)
@@ -199,11 +199,10 @@
     """
 
+    coordinates = Attribute('The coordinates of the bed from bed_id')
+
     def loggerInfo(ob_class, comment):
         """Adds an INFO message to the log file
         """
 
-    def getBedCoordinates():
-        """Determine the coordinates from bed_id.
-        """
     def bookBed(student_id):
         """Book a bed for a student.
Index: /main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py	(revision 9198)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py	(revision 9199)
@@ -1524,5 +1524,5 @@
         bedticket.bed = bed
         hall_title = bed.__parent__.hostel_name
-        coordinates = bed.getBedCoordinates()[1:]
+        coordinates = bed.coordinates[1:]
         block, room_nr, bed_nr = coordinates
         bc = _('${a}, Block ${b}, Room ${c}, Bed ${d} (${e})', mapping = {
@@ -1640,5 +1640,5 @@
         self.context.bed = new_bed
         hall_title = new_bed.__parent__.hostel_name
-        coordinates = new_bed.getBedCoordinates()[1:]
+        coordinates = new_bed.coordinates[1:]
         block, room_nr, bed_nr = coordinates
         bc = _('${a}, Block ${b}, Room ${c}, Bed ${d} (${e})', mapping = {
