Index: /waeup/branches/ulif-rewrite/src/waeup/datacenter.py
===================================================================
--- /waeup/branches/ulif-rewrite/src/waeup/datacenter.py	(revision 4172)
+++ /waeup/branches/ulif-rewrite/src/waeup/datacenter.py	(revision 4173)
@@ -5,4 +5,5 @@
 """
 import os
+import shutil
 import sys
 import grok
@@ -18,15 +19,5 @@
     storage = os.path.join(os.path.dirname(__file__), 'files')
 
-    def getImporters(self):
-        """Get a list of all importers available.
-
-        The search for available importers is done in two steps:
-
-        1) Look for a utility providing ICSVDataReceiver,
-
-        2) For every item of that utility: try to get an adapter
-           providing IWAeUPCSVImporter.
-        """
-        result = []
+    def getReceivers(self):
         receivers = []
         curr_obj = getattr(self, '__parent__', None)
@@ -36,4 +27,18 @@
                 break
             curr_obj = getattr(curr_obj, '__parent__', None)
+        return receivers
+    
+    def getImporters(self):
+        """Get a list of all importers available.
+
+        The search for available importers is done in two steps:
+
+        1) Look for a utility providing ICSVDataReceiver,
+
+        2) For every item of that utility: try to get an adapter
+           providing IWAeUPCSVImporter.
+        """
+        result = []
+        receivers = self.getReceivers()
         for receiver in receivers:
             try:
@@ -63,4 +68,15 @@
         if not os.path.exists(path):
             raise ValueError('The path given does not exist: %s' % path)
+        if move is True:
+            # copy contents of old location to new one
+            srcdir = self.storage
+            dstdir = path
+            for item in os.listdir(srcdir):
+                if os.path.isdir(item):
+                    shutil.copytree(os.path.join(srcdir, item),
+                                    os.path.join(dstdir, item))
+                else:
+                    shutil.copy2(os.path.join(srcdir, item), dstdir)
+        
         self.storage = path
 
@@ -102,9 +118,25 @@
                 except:
                     continue
-                possible_importers.append(importer)
+                importer_context = (
+                    importer, self.getReceiverId(importer.context))
+                possible_importers.append(importer_context)
             if len(possible_importers) == 0:
                 continue
             result.append((filedescr, possible_importers))
         return result
+
+    def getReceiverId(self, obj):
+        """Get a unique id for an object.
+
+        If the object is stored in ZODB it should contain a `_p_oid`
+        attribute, which is guaranteed to be unique over the ZODB.
+
+        If the object has no such attribute, then it will be held in
+        memory only and will vanish as soon as the request is over. In
+        this case we can use the memory address of it.
+        """
+        if hasattr(obj, '_p_oid'):
+            return getattr(obj, '_p_oid')
+        return str(id(obj))
 
         
@@ -213,5 +245,10 @@
     def render(self):
         return u'<div class="portlet"><a href="@@settings">Settings</a></div>'
-    
+
+class Import(object):
+    def __init__(self, filedescr, importers):
+        self.file = filedescr
+        self.importers = importers
+        
 class ImportCSVMain(grok.Viewlet):
     grok.viewletmanager(MainArea)
@@ -219,7 +256,12 @@
     grok.view(ImportCSV)
     grok.require('waeup.manageUniversity')
+
+    def getImports(self):
+        result = []
+        imports = self.context.getPossibleImports()
+        result = [Import(x, y) for x, y in imports]
+        return result
     
     def update(self, *args, **kw):
-        print "ARGS: ", args, kw
         return super(ImportCSVMain, self).update(*args, **kw)
         
