[Zope3-checkins] CVS: Zope3/src/zope/app/workflow - metadirectives.py:1.1 configure.zcml:1.5 meta.zcml:1.4 metaconfigure.py:1.2

Stephan Richter srichter@cosmos.phy.tufts.edu
Fri, 1 Aug 2003 16:41:35 -0400


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

Modified Files:
	configure.zcml meta.zcml metaconfigure.py 
Added Files:
	metadirectives.py 
Log Message:
Another ZCML namespace converted. This time 'workflow'.


=== Added File Zope3/src/zope/app/workflow/metadirectives.py ===
##############################################################################
#
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""Directive schema for the 'workflow' namespace.

$Id: metadirectives.py,v 1.1 2003/08/01 20:40:59 srichter Exp $
"""
from zope.configuration.fields import GlobalObject
from zope.interface import Interface

class IImportHandlerDirective(Interface):
    """Register an Import Handler, that is able to load a XML Representation
    of a ProcessDefinition and create a persistent Instance for it."""

    interface = GlobalObject(
        title=u"Interface",
        description=u"The interface of the process definition this "\
                    u"handler can load.",
        required=True)

    factory = GlobalObject(
        title=u"Factory",
        description=u"The factory for the instance that implements the "\
                    u"handler.",
        required=True)


class IExportHandlerDirective(Interface):
    """Register an Export Handler, that is able to save a XML Representation
        of a ProcessDefinition from a given object."""

    interface = GlobalObject(
        title=u"Interface",
        description=u"The interface of the process definition this "\
                    u"handler can save.",
        required=True)

    factory = GlobalObject(
        title=u"Factory",
        description=u"The factory for the instance that implements the "\
                    u"handler.",
        required=True)



=== Zope3/src/zope/app/workflow/configure.zcml 1.4 => 1.5 ===
--- Zope3/src/zope/app/workflow/configure.zcml:1.4	Thu Jul 31 11:01:33 2003
+++ Zope3/src/zope/app/workflow/configure.zcml	Fri Aug  1 16:40:59 2003
@@ -1,4 +1,4 @@
-<zopeConfigure
+<configure
    xmlns="http://namespaces.zope.org/zope"
    xmlns:service="http://namespaces.zope.org/service">
 
@@ -131,4 +131,4 @@
 
 <include package=".stateful" />
 
-</zopeConfigure>
+</configure>


=== Zope3/src/zope/app/workflow/meta.zcml 1.3 => 1.4 ===
--- Zope3/src/zope/app/workflow/meta.zcml:1.3	Mon Jul 28 18:21:53 2003
+++ Zope3/src/zope/app/workflow/meta.zcml	Fri Aug  1 16:40:59 2003
@@ -1,56 +1,17 @@
-<zopeConfigure xmlns='http://namespaces.zope.org/zope'>
+<configure 
+    xmlns="http://namespaces.zope.org/zope"
+    xmlns:meta="http://namespaces.zope.org/meta">
   
-  <directives namespace="http://namespaces.zope.org/workflow">
+    <meta:directive 
+        namespace="http://namespaces.zope.org/workflow"
+        name="importHandler" 
+        schema=".metadirectives.IImportHandlerDirective"
+        handler=".metaconfigure.importHandlerDirective" />
+
+    <meta:directive 
+        namespace="http://namespaces.zope.org/workflow"
+        name="exportHandler" 
+        schema=".metadirectives.IExportHandlerDirective"
+        handler=".metaconfigure.exportHandlerDirective" />
 
-    <directive name="importHandler" 
-               handler=".metaconfigure.importHandlerDirective">
-
-      <description>
-        Register an Import Handler, that is able to load a XML
-        Representation of a ProcessDefinition and create
-        a persistent Instance for it.
-      </description>
-
-
-      <attribute name="interface" required="yes">
-        <description>
-              The interface of the process definition, 
-              this handler can load. 
-          </description>
-      </attribute>
-
-      <attribute name="factory">
-        <description>
-              The factory for the instance that implements the handler. 
-          </description>
-      </attribute>
-
-    </directive>
-
-    <directive name="exportHandler" 
-               handler=".metaconfigure.exportHandlerDirective">
-
-      <description>
-        Register an Export Handler, that is able to save a XML
-        Representation of a ProcessDefinition from a given object.
-      </description>
-
-
-      <attribute name="interface" required="yes">
-        <description>
-              The interface of the process definition, 
-              this handler can save. 
-          </description>
-      </attribute>
-
-      <attribute name="factory">
-        <description>
-              The factory for the instance that implements the handler. 
-          </description>
-      </attribute>
-
-    </directive>
-
-  </directives>
-
-</zopeConfigure>
+</configure>
\ No newline at end of file


=== Zope3/src/zope/app/workflow/metaconfigure.py 1.1 => 1.2 ===
--- Zope3/src/zope/app/workflow/metaconfigure.py:1.1	Thu May  8 13:27:18 2003
+++ Zope3/src/zope/app/workflow/metaconfigure.py	Fri Aug  1 16:40:59 2003
@@ -15,37 +15,22 @@
 
 $Id$
 """
-__metaclass__ = type
-
 from zope.configuration.action import Action
 from globalimportexport import globalImportExport
 
-#
 
 def importHandlerDirective(_context, interface, factory):
-    interface = _context.resolve(interface)
-    factory = _context.resolve(factory)
-    return [
-        Action(
-              discriminator = ('workflow','importHandler', interface),
-              callable = addImportHandler,
-              args = (interface, factory)
-              )
-        ]
+    _context.action(
+        discriminator = ('workflow','importHandler', interface),
+        callable = addImportHandler,
+        args = (interface, factory) )
 
 
 def exportHandlerDirective(_context, interface, factory):
-    interface = _context.resolve(interface)
-    factory = _context.resolve(factory)
-    return [
-        Action(
-              discriminator = ('workflow','exportHandler', interface),
-              callable = addExportHandler,
-              args = (interface, factory)
-              )
-        ]
-
-
+    _context.action(
+        discriminator = ('workflow','exportHandler', interface),
+        callable = addExportHandler,
+        args = (interface, factory) )
 
 
 def addImportHandler(interface, factory):