[Zope3-checkins] SVN: Zope3/branches/philikon-reduce-zcml/src/zope/app/ Get rid of remaining <vocabulary /> directives in zope.app

Philipp von Weitershausen philikon at philikon.de
Wed Mar 15 08:06:38 EST 2006


Log message for revision 66027:
  Get rid of remaining <vocabulary /> directives in zope.app
  

Changed:
  U   Zope3/branches/philikon-reduce-zcml/src/zope/app/sqlscript/configure.zcml
  U   Zope3/branches/philikon-reduce-zcml/src/zope/app/sqlscript/sqlscript.py
  U   Zope3/branches/philikon-reduce-zcml/src/zope/app/workflow/configure.zcml
  U   Zope3/branches/philikon-reduce-zcml/src/zope/app/workflow/definition.py
  U   Zope3/branches/philikon-reduce-zcml/src/zope/app/workflow/stateful/configure.zcml
  U   Zope3/branches/philikon-reduce-zcml/src/zope/app/workflow/stateful/definition.py

-=-
Modified: Zope3/branches/philikon-reduce-zcml/src/zope/app/sqlscript/configure.zcml
===================================================================
--- Zope3/branches/philikon-reduce-zcml/src/zope/app/sqlscript/configure.zcml	2006-03-15 12:19:19 UTC (rev 66026)
+++ Zope3/branches/philikon-reduce-zcml/src/zope/app/sqlscript/configure.zcml	2006-03-15 13:06:38 UTC (rev 66027)
@@ -3,11 +3,10 @@
     i18n_domain="zope"
     >
 
-  <vocabulary
+  <utility
+      component=".sqlscript.ConnectionNamesVocabulary"
       name="Connection Names"
-      factory="zope.app.component.vocabulary.UtilityVocabulary"
-      interface="zope.app.rdb.interfaces.IZopeDatabaseAdapter" 
-      nameOnly="True" />
+      />
 
   <permission
       id="zope.AddSQLScripts"

Modified: Zope3/branches/philikon-reduce-zcml/src/zope/app/sqlscript/sqlscript.py
===================================================================
--- Zope3/branches/philikon-reduce-zcml/src/zope/app/sqlscript/sqlscript.py	2006-03-15 12:19:19 UTC (rev 66026)
+++ Zope3/branches/philikon-reduce-zcml/src/zope/app/sqlscript/sqlscript.py	2006-03-15 13:06:38 UTC (rev 66027)
@@ -21,12 +21,14 @@
 from persistent import Persistent
 from persistent.dict import PersistentDict
 
-from zope.interface import implements
+from zope.interface import implements, classProvides
 from zope.interface.common.mapping import IEnumerableMapping
 
 from zope.app import zapi
 from zope.app.rdb import queryForResults
 from zope.app.container.contained import Contained
+from zope.app.schema.interfaces import IVocabularyFactory
+from zope.app.component.vocabulary import UtilityVocabulary
 from zope.app.cache.caching import getCacheForObject, getLocationForCache
 from zope.app.rdb.interfaces import IZopeDatabaseAdapter
 
@@ -203,3 +205,8 @@
 
     return parseArguments(text[length:], result)
 
+
+class ConnectionNamesVocabulary(UtilityVocabulary):
+    classProvides(IVocabularyFactory)
+    interface = IZopeDatabaseAdapter
+    nameOnly = True

Modified: Zope3/branches/philikon-reduce-zcml/src/zope/app/workflow/configure.zcml
===================================================================
--- Zope3/branches/philikon-reduce-zcml/src/zope/app/workflow/configure.zcml	2006-03-15 12:19:19 UTC (rev 66026)
+++ Zope3/branches/philikon-reduce-zcml/src/zope/app/workflow/configure.zcml	2006-03-15 13:06:38 UTC (rev 66027)
@@ -39,10 +39,10 @@
 
   <!-- Process Definition Name Vocabualry -->
 
-  <vocabulary
-     name="ProcessDefinitions"
-     factory=".definition.ProcessDefinitionVocabulary"
-     />
+  <utility
+      component=".definition.ProcessDefinitionVocabulary"
+      name="ProcessDefinitions"
+      />
 
   <content class=".definition.ProcessDefinitionVocabulary">
       <allow interface="zope.schema.interfaces.IVocabularyTokenized"/>

Modified: Zope3/branches/philikon-reduce-zcml/src/zope/app/workflow/definition.py
===================================================================
--- Zope3/branches/philikon-reduce-zcml/src/zope/app/workflow/definition.py	2006-03-15 12:19:19 UTC (rev 66026)
+++ Zope3/branches/philikon-reduce-zcml/src/zope/app/workflow/definition.py	2006-03-15 13:06:38 UTC (rev 66027)
@@ -18,13 +18,14 @@
 from persistent import Persistent
 from persistent.dict import PersistentDict
 
-from zope.interface import implements
+from zope.interface import implements, classProvides
 
 from zope.schema.interfaces import ITokenizedTerm
 from zope.schema.interfaces import IVocabularyTokenized
 
 from zope.app import zapi
 from zope.app.container.contained import Contained, setitem, uncontained
+from zope.app.schema.interfaces import IVocabularyFactory
 from zope.app.workflow.interfaces import IProcessDefinitionElementContainer
 from zope.app.workflow.interfaces import IProcessDefinition
 
@@ -107,6 +108,7 @@
 class ProcessDefinitionVocabulary(object):
     """Vocabulary providing available process definition names."""
     implements(IVocabularyTokenized)
+    classProvides(IVocabularyFactory)
 
     def __init__(self, context):
         self.sm = zapi.getSiteManager(context)

Modified: Zope3/branches/philikon-reduce-zcml/src/zope/app/workflow/stateful/configure.zcml
===================================================================
--- Zope3/branches/philikon-reduce-zcml/src/zope/app/workflow/stateful/configure.zcml	2006-03-15 12:19:19 UTC (rev 66026)
+++ Zope3/branches/philikon-reduce-zcml/src/zope/app/workflow/stateful/configure.zcml	2006-03-15 13:06:38 UTC (rev 66027)
@@ -56,9 +56,10 @@
       />
 </content>
 
-<vocabulary
+<utility
+    component=".definition.StateNamesVocabulary"
     name="Workflow State Names"
-    factory=".definition.StateNamesVocabulary" />
+    />
 
 <!-- Transitions Container -->
 

Modified: Zope3/branches/philikon-reduce-zcml/src/zope/app/workflow/stateful/definition.py
===================================================================
--- Zope3/branches/philikon-reduce-zcml/src/zope/app/workflow/stateful/definition.py	2006-03-15 12:19:19 UTC (rev 66026)
+++ Zope3/branches/philikon-reduce-zcml/src/zope/app/workflow/stateful/definition.py	2006-03-15 13:06:38 UTC (rev 66027)
@@ -18,7 +18,7 @@
 from persistent import Persistent
 from persistent.dict import PersistentDict
 
-from zope.interface import implements
+from zope.interface import implements, classProvides
 from zope.schema.vocabulary import SimpleVocabulary, SimpleTerm
 from zope.security.checker import CheckerPublic
 
@@ -26,6 +26,7 @@
 from zope.app.container.contained import Contained, containedEvent
 from zope.event import notify
 from zope.app.event.objectevent import ObjectEvent, modified
+from zope.app.schema.interfaces import IVocabularyFactory
 from zope.app.workflow.definition import ProcessDefinition
 from zope.app.workflow.definition import ProcessDefinitionElementContainer
 from zope.app.workflow.stateful.interfaces import IStatefulProcessDefinition
@@ -53,6 +54,7 @@
 class StateNamesVocabulary(SimpleVocabulary):
     """Vocabulary providing the names of states in a local process definition.
     """
+    classProvides(IVocabularyFactory)
 
     def __init__(self, context):
         terms = [SimpleTerm(name) for name in self._getStateNames(context)]
@@ -102,8 +104,8 @@
 
 class StatefulProcessDefinition(ProcessDefinition):
     """Stateful workflow process definition."""
-
     implements(IStatefulProcessDefinition, IReadContainer)
+    classProvides(IVocabularyFactory)
 
     def __init__(self):
         super(StatefulProcessDefinition, self).__init__()



More information about the Zope3-Checkins mailing list