Index: main/waeup.kofa/trunk/src/waeup/kofa/students/export.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/students/export.py	(revision 9733)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/export.py	(revision 9734)
@@ -34,5 +34,37 @@
                   'coursetickets', 'studentpayments')
 
-def get_students(site):
+class StudentsExportFilter(object):
+    """A filter to find students that match certain criteria.
+
+    The filter is meant as a component to aggregate search parameters
+    for students. This way we can tell some exporter to use 'this
+    filter' instead of passing in all (probably different) parameters.
+
+    Just an idea right now. There might be better ways.
+    """
+
+    def __init__(self, session=None, level=None,
+                 faculty_code=None, department_code=None):
+        self.session = session
+        self.level = level
+        self.faculty_code = faculty_code
+        self.department_code = department_code
+        return
+
+    def get_students(self, catalog):
+        students = catalog.searchResults(
+            student_id=(None, None),
+            current_session=(self.session, self.session),
+            #level=(self.level, self.level), # would be nice
+            faccode=(self.faculty_code, self.faculty_code),
+            depcode=(self.department_code, self.department_code)
+            )
+        # filter out by level
+        if self.level is not None:
+            return [x for x in students
+                    if x['studycourse'].current_level == self.level]
+        return students
+
+def get_students(site, stud_filter=None):
     """Get all students registered in catalog in `site`.
     """
@@ -41,5 +73,8 @@
     if catalog is None:
         return []
-    students = catalog.searchResults(student_id=(None, None))
+    if stud_filter is None:
+        students = catalog.searchResults(student_id=(None, None))
+    else:
+        students = stud_filter.get_students(catalog)
     return students
 
@@ -104,4 +139,8 @@
             self.write_item(value, writer)
         return self.close_outfile(filepath, outfile)
+
+    def export_filtered(self, site, session, level, faculty_code=None,
+                        department_code=None, filepath=None):
+        pass
 
 
Index: main/waeup.kofa/trunk/src/waeup/kofa/students/interfaces.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/students/interfaces.py	(revision 9733)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/interfaces.py	(revision 9734)
@@ -751,2 +751,7 @@
         """Export data for a given student.
         """
+
+    def export_filtered(site, session, level, faculty_code=None,
+                        department_code=None, filepath=None):
+        """Export filtered set of students.
+        """
Index: main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_export.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_export.py	(revision 9733)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_export.py	(revision 9734)
@@ -1,4 +1,6 @@
+import grok
 import datetime
 from zope.component import queryUtility
+from zope.event import notify
 from zope.interface.verify import verifyObject, verifyClass
 from waeup.kofa.interfaces import ICSVExporter
@@ -6,7 +8,9 @@
     StudentsExporter, StudentStudyCourseExporter, StudentStudyLevelExporter,
     CourseTicketExporter, PaymentsExporter, BedTicketsExporter,
-    StudentPaymentsOverviewExporter)
+    StudentPaymentsOverviewExporter, get_students, StudentsExportFilter)
+from waeup.kofa.students.accommodation import BedTicket
+from waeup.kofa.students.interfaces import ICSVStudentExporter
 from waeup.kofa.students.payments import StudentOnlinePayment
-from waeup.kofa.students.accommodation import BedTicket
+from waeup.kofa.students.student import Student
 from waeup.kofa.students.studycourse import StudentStudyCourse
 from waeup.kofa.students.studylevel import StudentStudyLevel, CourseTicket
@@ -18,4 +22,42 @@
 year_range_str = ','.join([str(i) for i in year_range])
 
+class ExportHelperTests(StudentImportExportSetup):
+    layer = FunctionalLayer
+    def setUp(self):
+        super(ExportHelperTests, self).setUp()
+        student = Student()
+        self.app['students'].addStudent(student)
+        student = self.setup_student(student)
+        notify(grok.ObjectModifiedEvent(student))
+        self.student = self.app['students'][student.student_id]
+        return
+
+    def test_get_students_plain(self):
+        # without a filter we get all students
+        result = get_students(self.app)
+        self.assertEqual(len(list(result)), 1)
+        return
+
+    def test_get_students_by_session(self):
+        # we can filter out students of a certain session
+        my_filter1 = StudentsExportFilter(session=2012)
+        result = get_students(self.app, stud_filter=my_filter1)
+        self.assertEqual(len(list(result)), 1)
+
+        my_filter2 = StudentsExportFilter(session=1964)
+        result = get_students(self.app, stud_filter=my_filter2)
+        self.assertEqual(len(list(result)), 0)
+        return
+
+    def test_get_students_by_level(self):
+        # we can filter out students of a certain level
+        my_filter1 = StudentsExportFilter(level=200)
+        result = get_students(self.app, stud_filter=my_filter1)
+        self.assertEqual(len(list(result)), 1)
+
+        my_filter2 = StudentsExportFilter(level=300)
+        result = get_students(self.app, stud_filter=my_filter2)
+        self.assertEqual(len(list(result)), 0)
+        return
 
 class StudentsExporterTest(StudentImportExportSetup):
@@ -31,6 +73,6 @@
         # make sure we fullfill interface contracts
         obj = StudentsExporter()
-        verifyObject(ICSVExporter, obj)
-        verifyClass(ICSVExporter, StudentsExporter)
+        verifyObject(ICSVStudentExporter, obj)
+        verifyClass(ICSVStudentExporter, StudentsExporter)
         return
 
