Index: /main/waeup.sirp/trunk/src/waeup/sirp/browser/pages.py
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/browser/pages.py	(revision 6021)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/browser/pages.py	(revision 6022)
@@ -41,5 +41,4 @@
     IWAeUPXMLImporter, IWAeUPXMLExporter, IBatchProcessor)
 from waeup.sirp.university.catalog import search
-from waeup.sirp.widgets.interfaces import ITableProvider
 from waeup.sirp.university.vocabularies import course_levels
 
@@ -1104,14 +1103,4 @@
         tabs.need()
         datatable.need() 
-        #if 'delcourse' in self.request.form:
-        #    code = self.request.form['code']
-        #    del self.context.courses[code]
-        #if 'delcert' in self.request.form:
-        #    code = self.request.form['code']
-        #    del self.context.certificates[code]
-        #self.tables = ITableProvider(self.context).getTables(view=self)
-        #self.coursetable = self.tables[0]
-        #self.certificatetable = self.tables[1]
-        #self.coursetable.need()
         super(DepartmentPage, self).update()
         return
@@ -1168,8 +1157,4 @@
         tabs.need()
         datatable.need() 
-    #    self.tables = ITableProvider(self.context).getTables(view=self)
-    #    self.coursetable = self.tables[0]
-    #    self.certificatetable = self.tables[1]
-    #    self.coursetable.need()
         super(DepartmentManageFormPage, self).update()
         return
Index: in/waeup.sirp/trunk/src/waeup/sirp/browser/tables.py
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/browser/tables.py	(revision 6021)
+++ 	(revision )
@@ -1,105 +1,0 @@
-"""Datatables and related components used in different contexts.
-
-The tables defined here are javascript-powered output. In contrast to
-regular HTML tables they allow client-side sorting and batching of
-results.
-"""
-import grok
-from zope.security.management import checkPermission
-from waeup.sirp.browser.interfaces import (
-    IFacultyContainer, IFaculty, IDepartment, ICourseContainer)
-from waeup.sirp.tables import CodeAndTitleTableProvider, Col, Table
-from waeup.sirp.widgets.interfaces import ITableProvider
-
-#class DepartmentTableProvider(CodeAndTitleTableProvider):
-#    grok.context(IFaculty)
-#    grok.provides(ITableProvider)
-#    title = 'Departments'
-
-#class FacultyTableProvider(CodeAndTitleTableProvider):
-#    grok.context(IFacultyContainer)
-#    grok.provides(ITableProvider)
-#    title = 'Faculties'
-
-class CourseTableProvider(CodeAndTitleTableProvider):
-    grok.context(IDepartment)
-    grok.provides(ITableProvider)
-    title = 'Courses'
-
-    def prepare(self):
-        self.data_source = self.context.courses
-        
-    def getTables(self, view=None):
-        data = self.data_source
-        context_url = ''
-        if view:
-            context_url = view.url(self.context) + '/'
-
-        # Create a courses table...
-        cols = (
-            Col(
-                header='Code', sortable=True,
-                data = tuple([self.getItemURL(view, data[x].code)
-                              for x in data])),
-            Col(
-                header='Title', sortable=True,
-                data = tuple([data[x].title for x in data])),
-            )
-        delcol = Col(header='&nbsp;', sortable=False,
-                     data = [
-                '<input type="checkbox" name="val_id" value="%s" />' 
-                % (data[x].code) for x in data])
-
-        if checkPermission('waeup.manageUniversity', self.context.courses):
-            cols = list(cols)
-            cols = [delcol] + cols
-            cols = tuple(cols)
-        self.coursetable = Table('Courses', cols=cols)
-
-        # Create a certificates table...
-        self.data_source = self.context.certificates
-        data = self.data_source
-        certcols =(
-            Col(
-                header='Code', sortable=True,
-                data = tuple([self.getItemURL(view, data[x].code)
-                              for x in data])),
-            Col(
-                header='Title', sortable=True,
-                data = tuple([data[x].title for x in data])),
-            )
-
-        delcol = Col(header='&nbsp;', sortable=False,
-                     data = [
-                '<input type="checkbox" name="val_id" value="%s" />' 
-                % (data[x].code) for x in data])
-
-        if checkPermission('waeup.manageUniversity', self.context.certificates):
-            certcols = list(certcols)
-            certcols = [delcol] + certcols
-            certcols = tuple(certcols)
-
-        self.certtable = Table('Certificates', cols=certcols)
-        return (self.coursetable, self.certtable)
-
-#class CourseContainerCourseTableProvider(CodeAndTitleTableProvider):
-#    grok.context(ICourseContainer)
-#    grok.provides(ITableProvider)
-#    title = 'Courses'
-
-#    def getTables(self, view=None):
-#        data = self.data_source
-#        context_url = ''
-#        if view:
-#            context_url = view.url(self.context) + '/'
-#        cols = (
-#            Col(
-#                header='Code', sortable=True,
-#                data = tuple([self.getItemURL(view, data[x].code)
-#                              for x in data])),
-#            Col(
-#                header='Title', sortable=True,
-#                data = tuple([data[x].title for x in data])),
-#            )
-#        self.table = Table(self.title, cols=cols)
-#        return (self.table,)
Index: in/waeup.sirp/trunk/src/waeup/sirp/tables.py
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/tables.py	(revision 6021)
+++ 	(revision )
@@ -1,55 +1,0 @@
-"""Datatables and related components used in different contexts.
-"""
-import grok
-from waeup.sirp.interfaces import IUniversity
-from waeup.sirp.widgets.interfaces import ITableProvider
-from waeup.sirp.widgets.table import YUITable as Table
-from waeup.sirp.widgets.table import Col
-
-class CodeAndTitleTableProvider(grok.Adapter):
-    """A table provider for objects that have a code, title and prefix.
-    """
-    grok.baseclass()
-    grok.provides(ITableProvider)
-
-    title = None
-
-    def __init__(self, context):
-        self.context = context
-        self.prepare()
-
-    def prepare(self):
-        self.data_source = self.context
-
-    def getItemURL(self, view, value):
-        context_url = ''
-        if not view is None:
-            context_url = view.url(self.data_source) + '/'
-        result = '<a href="%s%s">%s</a>' % (context_url, value, value)
-        return result
-    
-    def getTables(self, view=None):
-        data = self.data_source
-        context_url = ''
-        if view:
-            context_url = view.url(self.context) + '/'
-        cols = (
-            Col(
-                header='Code', sortable=True,
-                data = tuple([self.getItemURL(view, data[x].code)
-                              for x in data])),
-            Col(
-                header='Title', sortable=True,
-                data = tuple([data[x] for x in data])),
-            )
-        self.table = Table(self.title, cols=cols)
-        return (self.table,)
-    
-class UniversityTableProvider(CodeAndTitleTableProvider):
-    grok.context(IUniversity)
-    grok.provides(ITableProvider)
-    title = 'Faculties'
-
-    def prepare(self):
-        self.data_source = self.context.faculties
-
Index: in/waeup.sirp/trunk/src/waeup/sirp/university/tables.py
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/university/tables.py	(revision 6021)
+++ 	(revision )
@@ -1,2 +1,0 @@
-"""
-"""
Index: /main/waeup.sirp/trunk/src/waeup/sirp/widgets/interfaces.py
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/widgets/interfaces.py	(revision 6021)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/widgets/interfaces.py	(revision 6022)
@@ -5,8 +5,2 @@
 from zope.interface import Interface
 
-class ITableProvider(Interface):
-    """A provider for tables.
-    """
-    def getTables():
-        """Get a tuple of tables.
-        """
Index: in/waeup.sirp/trunk/src/waeup/sirp/widgets/table.py
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/widgets/table.py	(revision 6021)
+++ 	(revision )
@@ -1,127 +1,0 @@
-"""Table widget.
-"""
-import grok
-from hurry import yui
-from zope.interface import Interface
-from waeup.sirp.widgets.interfaces import ITableProvider
-
-def varName(string):
-    varname = string.lower()
-    return ''.join([x for x in varname
-                    if x in 'abcdefghijklmnopqrstuvwxyz_0123456789'])
-
-class Col(object):
-    """A column in a table.
-    """
-    header = 'Unnamed'
-    type = None
-    sortable = False
-    width = 100
-
-    def __init__(self, header=u'Unnamed', width=None, sortable=False,
-                 type=None, data=()):
-        self.header = header
-        self.width = width
-        self.sortable = sortable
-        self.type = type
-        self.data = data
-        self.key = varName(header)
-    
-class Table(object):
-    """A table.
-    """
-    def __init__(self, title=u'Unnamed', width=500, height=180, cols=()):
-        self.title = title
-        self.cols = cols
-        self.width = width
-        self.height = height
-        self.internal_title = varName(title)
-
-    def renderHTML(self):
-        result = '<div id="%s-tablecontainer"><table id="%s-table">' % (
-            self.internal_title, self.internal_title)
-        data_rows = self.getRows()
-        result += '<thead><tr>'
-        for col in self.cols:
-            result += '<th>%s</th>' % (col.header,)
-        result += '</tr></thead>\n'
-        result += '<tbody>'
-            
-        for row in data_rows:
-            result += '<tr>\n  '
-            for elem in row:
-                result += '<td>%s</td>' % elem
-            result += '\n</tr>'
-        result += '</tbody></table></div>'
-        return result
-
-    def getRows(self):
-        data_cols = (x.data for x in self.cols)
-        # turn rows into cols and vice versa:
-        # ((a, 1, p), (b, 2, q)) --> ((a, b), (1, 2), (p, q))
-        data_rows = tuple(map(lambda *x: (x), *data_cols))
-        return data_rows
-
-
-class YUITable(Table):
-    """A table that can generate JavaScript code for use with YUI.
-    """
-    def need(self):
-        yui.dragdrop.need() # datatable needs dragdrop loaded in advance.
-                            # This dependency is not defined yet in hurry.yui.
-        yui.paginator.need()
-        yui.datatable.need()
-        yui.sam.need()
-        yui.fonts.need()
-
-    def getJSTableCode(self, paginator=True):
-        title = self.internal_title
-        fielddefs = ",".join(['{key:"%s"}'%x.key for x in self.cols])
-        coldefs = ",".join([
-                '{key:"%s",label:"%s",sortable:%s}' % (
-                    x.key, x.header, str(x.sortable).lower())
-                for x in self.cols
-                ])
-        result = """
-YAHOO.util.Event.addListener(window, "load", function() {
-  var %sDataSource = new YAHOO.util.DataSource(YAHOO.util.Dom.get("%s-table"));
-  %sDataSource.responseType = YAHOO.util.DataSource.TYPE_HTMLTABLE;
-  %sDataSource.responseSchema = {
-    fields: [%s]
-  };
-
-  var %sColDefs = [%s];
-  var %sDataTable = new YAHOO.widget.DataTable("%s-tablecontainer",
-                                               %sColDefs, %sDataSource,
-                                               {
-paginator: new YAHOO.widget.Paginator({ 
-	                rowsPerPage: 15, 
-	                template: YAHOO.widget.Paginator.TEMPLATE_ROWS_PER_PAGE, 
-	                rowsPerPageOptions: [10,15,30,50,100], 
-	                pageLinks: 5 
-	            }), 
-draggableColumns:true });
-});
-""" % (
-            title, title, title, title, fielddefs, title, coldefs,
-            title, title, title, title)
-        return result
-
-
-
-class YUIStaticTableView(grok.View):
-    grok.context(Interface)
-    grok.name('yuistatictables.js')
-    grok.require('zope.Public')
-
-    def render(self):
-        self.response.setHeader('Content-Type',
-                                'text/javascript; charset=UTF-8')
-        try:
-            provider = ITableProvider(self.context)
-        except:
-            # No table provider for the context. Be gentle...
-            return u'/* No content */'
-        tables = provider.getTables()
-        results = [table.getJSTableCode() for table in tables]
-        return '\n'.join(results)
Index: in/waeup.sirp/trunk/src/waeup/sirp/widgets/table.txt
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/widgets/table.txt	(revision 6021)
+++ 	(revision )
@@ -1,134 +1,0 @@
-waeup.sirp.widgets
-******************
-
-Widgets for the WAeUP SRP.
-
-
-.. :doctest:
-.. :layer: waeup.sirp.testing.WAeUPSIRPUnitTestLayer
-
-Tables
-======
-
-    >>> from waeup.sirp.widgets.table import Col, Table
-    >>> id = Col(
-    ...       header='Id', width=100, sortable=True, type='int',
-    ...       data = (1, 2, 3))
-    >>> mycol1 = Col(
-    ...       header='Column 1', width=100, sortable=True,
-    ...       data = ('bli', 'bla', 'blub'))
-
-    >>> mycol2 = Col(
-    ...     header='Column 2', width=100, sortable=True,
-    ...     data = ('schwi', 'schwa', 'schwafel'))
-
-    >>> table = Table('My Table', cols=(id, mycol1, mycol2))
-    >>> print table.renderHTML()
-    <div id="mytable-tablecontainer"><table id="mytable-table"><thead><tr><th>Id</th><th>Column 1</th><th>Column 2</th></tr></thead>
-    ...<tbody><tr>
-    ...<td>1</td><td>bli</td><td>schwi</td>
-    ...</tr><tr>
-    ...<td>2</td><td>bla</td><td>schwa</td>
-    ...</tr><tr>
-    ...<td>3</td><td>blub</td><td>schwafel</td>
-    ...</tr></tbody></table></div>
-
-    >>> print table.internal_title
-    mytable
-
-YUITable
---------
-
-A YUI table extends a regular table by adding some JavaScript
-code-generation facilities suitable for rendering YUI based
-datatables. Futhermore they provide a `need` method, which includes
-all needed YUI scripts and stylesheets.
-
-
-    >>> from waeup.sirp.widgets.table import YUITable
-    >>> table = YUITable('My YUI Table', cols=(id, mycol1, mycol2))
-    >>> print table.getJSTableCode()
-    <BLANKLINE>
-    YAHOO.util.Event.addListener(window, "load", function() {...
-    ...
-    draggableColumns:true });
-    });
-
-Naturally, YUITable objects are suited for use by views.
-
-
-YUIStaticTableView
-==================
-
-This is a view named ``yuistatictables.js`` which from a users'
-perspective can be used like a static file. It is, however, not
-static, but returns the JavaScript code suitable for a given table.
-
-We define some content object that contains a table for which we want
-the JavaScript to be generated:
-
-    >>> class SomeContent(object):
-    ...   mytable = table
-
-    >>> obj = SomeContent()
-
-Now we need an adapter, that knows how to get a table from this kind
-of object. The YUIStaticTableView looks up such an adapter for a given
-context to find a table to manage. The adapter has to implement
-`ITableProvider` from `waeup.sirp.widgets.interfaces` and should provide a
-`getTables` method.
-
-We define and register such an adapter using grok:
-
-    >>> import grok
-    >>> from waeup.sirp.widgets.interfaces import ITableProvider
-    >>> class TableAdapter(grok.Adapter):
-    ...   grok.context(SomeContent)
-    ...   grok.provides(ITableProvider)
-    ...
-    ...   def getTables(self):
-    ...     # We know that our context stores a table in `mytable`
-    ...     return (self.context.mytable,)
-    >>> grok.testing.grok_component('TableAdapter', TableAdapter)
-    True
-
-Now let's get a view on the object defined above. We want the view
-named ``yuistatictables.js``:
-
-    >>> from zope.publisher.browser import TestRequest
-    >>> from zope.component import getMultiAdapter
-    >>> from zope.interface import Interface
-    >>> view = getMultiAdapter((obj, TestRequest()), Interface, 
-    ...                        name='yuistatictables.js')
-    >>> view
-    <waeup.sirp.widgets.table.YUIStaticTableView object at 0x...>
-
-When we call the view we get pure JavaScript:
-
-    >>> print view()
-    <BLANKLINE>
-    YAHOO.util.Event.addListener(window, "load", function() {
-    ...
-    draggableColumns:true });
-    });
-
-Table views for objects that have no table
-------------------------------------------
-
-What happens, when no `ITableProvider` can be found for an object? The
-view will return a script with a comment only.
-
-Let's try this with a simple object for which no adapter is
-registered. We can get the view:
-
-    >>> obj = object()
-    >>> view = getMultiAdapter((obj, TestRequest()), Interface, 
-    ...                        name='yuistatictables.js')
-    >>> view
-    <waeup.sirp.widgets.table.YUIStaticTableView object at 0x...>
-
-But if we call this adapter, we will get an empty result, because
-there is no ITableProvider adapter registered for the 'viewed' object:
-
-    >>> view()
-    u'/* No content */'
