[Zope3-checkins] CVS: Zope3/src/zope/app/workflow/browser - definition.py:1.5

Stephan Richter srichter at cosmos.phy.tufts.edu
Fri Apr 16 07:51:35 EDT 2004


Update of /cvs-repository/Zope3/src/zope/app/workflow/browser
In directory cvs.zope.org:/tmp/cvs-serv16202/src/zope/app/workflow/browser

Modified Files:
	definition.py 
Log Message:


Update to use zapi.



Remove export/import utility indirection. Use adapters directly.




=== Zope3/src/zope/app/workflow/browser/definition.py 1.4 => 1.5 ===
--- Zope3/src/zope/app/workflow/browser/definition.py:1.4	Sat Mar 13 13:01:24 2004
+++ Zope3/src/zope/app/workflow/browser/definition.py	Fri Apr 16 07:51:35 2004
@@ -15,37 +15,29 @@
  
 $Id$
 """
-__metaclass__ = type
- 
-from zope.component import getView, getUtility
+from zope.app import zapi
 from zope.app.traversing import traverse
 from zope.app.registration.interfaces import IRegistered
-from zope.app.workflow.interfaces import IProcessDefinitionImportExport
+from zope.app.workflow.interfaces import IProcessDefinitionImportHandler
+from zope.app.workflow.interfaces import IProcessDefinitionExportHandler
 
 
-class ProcessDefinitionView:
+class ProcessDefinitionView(object):
  
     def getName(self):
         return """I'm a dummy ProcessInstance"""
 
 
-class ImportExportView:
-
-    def doExport(self):
-        return self._getUtil().exportProcessDefinition(self.context,
-                                                       self.context)
-
-    def doImport(self, data):
-        return self._getUtil().importProcessDefinition(self.context,
-                                                       data)
-    def _getUtil(self):
-        return getUtility(self.context, IProcessDefinitionImportExport)
+class ImportExportView(object):
 
     def importDefinition(self):
         xml = self.request.get('definition')
         if xml:
-            self.doImport(xml)
+            zapi.getAdapter(
+                self.context, IProcessDefinitionImportHandler, context=self
+                ).doImport(xml)
         self.request.response.redirect('@@importexport.html?success=1')
 
     def exportDefinition(self):
-        return self.doExport()
+        return zapi.getAdapter(self.context, IProcessDefinitionExportHandler,
+                               context=self).doExport()




More information about the Zope3-Checkins mailing list