Index: main/waeup.kofa/trunk/src/waeup/kofa/utils/browser.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/utils/browser.py	(revision 9011)
+++ main/waeup.kofa/trunk/src/waeup/kofa/utils/browser.py	(revision 9011)
@@ -0,0 +1,56 @@
+## $Id$
+##
+## Copyright (C) 2011 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
+##
+"""UI components for utilities and helpers.
+"""
+
+import grok
+from zope.catalog.interfaces import ICatalog
+from zope.component import queryUtility, getUtility, createObject
+from waeup.kofa.browser.layout import UtilityView
+
+from waeup.kofa.interfaces import IUniversity
+
+class ReindexPage(UtilityView, grok.View):
+    """ Reindex view.
+
+    Reindexes a catalog. For managers only.
+    """
+    grok.context(IUniversity)
+    grok.name('reindex')
+    grok.require('waeup.managePortal')
+
+    def update(self,ctlg=None):
+        if ctlg is None:
+            self.flash('No catalog name provided.')
+            return
+        cat = queryUtility(ICatalog, name='%s_catalog' % ctlg)
+        if cat is None:
+            self.flash('%s_catalog does not exist' % ctlg)
+            return
+        self.context.logger.info(
+            'Catalog `%s_catalog` re-indexing started.' % ctlg)
+        cat.updateIndexes()
+        no_of_entries = cat.values()[0].documentCount()
+        self.flash('%d %s re-indexed.' % (no_of_entries,ctlg))
+        self.context.logger.info(
+            'Re-indexing of %d objects finished.' % no_of_entries)
+        return
+
+    def render(self):
+        self.redirect(self.url(self.context, '@@index'))
+        return
Index: main/waeup.kofa/trunk/src/waeup/kofa/utils/helpers.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/utils/helpers.py	(revision 8905)
+++ main/waeup.kofa/trunk/src/waeup/kofa/utils/helpers.py	(revision 9011)
@@ -683,15 +683,2 @@
         writer.writerow(row)
     return tmp_path
-
-# Save function used for save methods in pages
-def msave(view, **data):
-    changed_fields = view.applyData(view.context, **data)
-    # Turn list of lists into single list
-    if changed_fields:
-        changed_fields = reduce(lambda x,y: x+y, changed_fields.values())
-    fields_string = ' + '.join(changed_fields)
-    view.flash(_('Form has been saved.'))
-    ob_class = view.__implemented__.__name__.replace('waeup.kofa.','')
-    if fields_string:
-        grok.getSite().logger.info('%s - saved: %s' % (ob_class, fields_string))
-    return
Index: main/waeup.kofa/trunk/src/waeup/kofa/utils/tests/test_browser.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/utils/tests/test_browser.py	(revision 9011)
+++ main/waeup.kofa/trunk/src/waeup/kofa/utils/tests/test_browser.py	(revision 9011)
@@ -0,0 +1,57 @@
+## $Id$
+## 
+## Copyright (C) 2011 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
+##
+"""
+Test the student-related UI components.
+"""
+import shutil
+import tempfile
+import pytz
+from datetime import datetime, timedelta
+from StringIO import StringIO
+import os
+import grok
+from zope.event import notify
+from zope.component import createObject, queryUtility
+from zope.component.hooks import setSite, clearSite
+from zope.catalog.interfaces import ICatalog
+from zope.security.interfaces import Unauthorized
+from waeup.kofa.testing import FunctionalLayer, FunctionalTestCase
+
+from waeup.kofa.students.tests.test_browser import StudentsFullSetup
+
+class UtilsUITests(StudentsFullSetup):
+    # Tests for Student class views and pages
+
+    layer = FunctionalLayer
+
+    def test_reindex(self):
+        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
+        self.browser.open('http://localhost/app/reindex')
+        self.assertTrue('No catalog name provided' in self.browser.contents)
+        self.browser.open('http://localhost/app/reindex?ctlg=xyz')
+        self.assertTrue('xyz_catalog does not exist' in self.browser.contents)
+        cat = queryUtility(ICatalog, name='students_catalog')
+        results = cat.searchResults(student_id=(None, None))
+        self.assertEqual(len(results),1)
+        cat.clear()
+        results = cat.searchResults(student_id=(None, None))
+        self.assertEqual(len(results),0)
+        self.browser.open('http://localhost/app/reindex?ctlg=students')
+        self.assertTrue('1 students re-indexed' in self.browser.contents)
+        results = cat.searchResults(student_id=(None, None))
+        self.assertEqual(len(results),1)
