Index: /waeup/branches/ulif-rewrite/src/waeup/utils/importexport.py
===================================================================
--- /waeup/branches/ulif-rewrite/src/waeup/utils/importexport.py	(revision 4219)
+++ /waeup/branches/ulif-rewrite/src/waeup/utils/importexport.py	(revision 4220)
@@ -7,4 +7,5 @@
 from xml.dom.minidom import Document, getDOMImplementation
 from zope.interface import Interface
+from waeup.csvfile.interfaces import ICSVFile
 from waeup.interfaces import (IWAeUPObject, IWAeUPExporter, IWAeUPXMLExporter,
                               IWAeUPXMLImporter, IWAeUPCSVImporter)
@@ -86,46 +87,14 @@
         return obj
 
-class CSVImporter(grok.Adapter):
-    grok.context(IWAeUPObject)
+
+class CSVImporter(grok.MultiAdapter):
+    grok.adapts(ICSVFile, IWAeUPObject)
     grok.provides(IWAeUPCSVImporter)
-    grok.baseclass() # We don't want this base to be registered really.
-    column_terms = [] # The column terms supported by this importer
-    
-    def __init__(self, context):
-        self.context = context
-    
-    def doImport(self, filepath):
+    grok.baseclass()  # We don't want this base to be registered really.
+
+    def __init__(self, csvfile, receiver):
+        self.csvfile = csvfile
+        self.receiver = receiver
+
+    def doImport(self):
         pass
-    
-    def getData(self, filepath):
-        result = readFile(open(filepath, 'rb'))
-        return result
-
-    def validate(self, filepath):
-        self.checkHeader(filepath)
-        self.getData(filepath)
-        return True
-
-    def checkHeader(self, filepath):
-        missing = []
-        headerline = ''
-
-        # Extract the header fields...
-        for line in open(filepath, 'rb'):
-            headerline = line
-            if len(headerline.strip()) == 0:
-                continue # Ignore leading empty lines...
-            break # We only want the first line...
-        tmpfile = StringIO(headerline)
-        headerfields = readFile(tmpfile)[0]
-
-        # Find missing header fields...
-        for key in self.column_terms:
-            if key not in headerfields:
-                missing.append(key)
-        if len(missing):
-            raise KeyError(
-                'Validation Error: the follwing '
-                'columns could not be found: %s' % (', '.join(missing))
-                )
-        return
