[Zope3-checkins] CVS: Zope3/src/zope/app/browser/workflow - configure.zcml:1.1.4.1 definition.py:1.1.4.1 instance.py:1.1.4.1
Grégoire Weber
zope@i-con.ch
Sun, 22 Jun 2003 10:24:27 -0400
Update of /cvs-repository/Zope3/src/zope/app/browser/workflow
In directory cvs.zope.org:/tmp/cvs-serv24874/src/zope/app/browser/workflow
Modified Files:
Tag: cw-mail-branch
configure.zcml definition.py instance.py
Log Message:
Synced up with HEAD
=== Zope3/src/zope/app/browser/workflow/configure.zcml 1.1 => 1.1.4.1 ===
--- Zope3/src/zope/app/browser/workflow/configure.zcml:1.1 Thu May 8 13:27:17 2003
+++ Zope3/src/zope/app/browser/workflow/configure.zcml Sun Jun 22 10:22:52 2003
@@ -8,7 +8,7 @@
for="zope.app.interfaces.workflow.IWorkflowService"
name="index.html"
template="workflows.pt"
- class="zope.app.browser.services.configuration.NameComponentConfigurableView"
+ class="zope.app.browser.services.registration.NameComponentRegistryView"
permission="zope.ManageServices"
/>
@@ -24,25 +24,25 @@
-<!-- ProcessDefinition Configuration -->
+<!-- ProcessDefinition Registration -->
<browser:page
for="zope.app.interfaces.workflow.IProcessDefinition"
- name="useConfiguration.html"
+ name="useRegistration.html"
template="useprocessdefinitionconfig.pt"
- class=".definition.UseConfiguration"
+ class=".definition.Registered"
permission="zope.workflow.ManageProcessDefinitions"
- menu="zmi_views" title="Configurations"
+ menu="zmi_views" title="Registrations"
/>
<browser:addform
for="zope.app.interfaces.workflow.IProcessDefinition"
- name="addConfiguration.html"
- schema="zope.app.interfaces.workflow.IProcessDefinitionConfiguration"
- class="zope.app.browser.services.configuration.AddComponentConfiguration"
+ name="addRegistration.html"
+ schema="zope.app.interfaces.workflow.IProcessDefinitionRegistration"
+ class="zope.app.browser.services.registration.AddComponentRegistration"
permission="zope.workflow.ManageProcessDefinitions"
- content_factory="zope.app.workflow.service.ProcessDefinitionConfiguration"
+ content_factory="zope.app.workflow.service.ProcessDefinitionRegistration"
arguments="name componentPath"
set_after_add="status"
fields="name componentPath permission status"
@@ -51,8 +51,8 @@
<browser:editform
name="index.html"
menu="zmi_views" title="Edit"
- schema="zope.app.interfaces.workflow.IProcessDefinitionConfiguration"
- label="ProcessDefinition Configuration"
+ schema="zope.app.interfaces.workflow.IProcessDefinitionRegistration"
+ label="ProcessDefinition Registration"
permission="zope.workflow.ManageProcessDefinitions"
fields="name componentPath permission status"
/>
@@ -84,35 +84,14 @@
name="contents.html"
/>
-<browser:pages
+<browser:page
for="zope.app.interfaces.workflow.IProcessDefinitionElementContainer"
permission="zope.workflow.ManageProcessDefinitions"
- class="zope.app.browser.container.contents.Contents">
- >
-
- <browser:page name="contents.html" attribute="contents" />
- <browser:page name="removeObjects.html" attribute="removeObjects" />
- <browser:page name="cutObjects.html" attribute="cutObjects" />
- <browser:page name="copyObjects.html" attribute="copyObjects" />
- <browser:page name="pasteObjects.html" attribute="pasteObjects" />
- <browser:page name="renameObjects.html" attribute="renameObjects" />
- <browser:page name="rename.html" attribute="rename" />
-
- </browser:pages>
-
-
-<browser:menuItem
- for="zope.app.interfaces.workflow.IProcessDefinitionElementContainer"
- menu="zmi_views"
- title="Contents"
- action="contents.html"
- />
-
-<adapter factory="zope.app.container.zopecontainer.ZopeContainerAdapter"
- provides="zope.app.interfaces.container.IZopeContainer"
- for="zope.app.interfaces.workflow.IProcessDefinitionElementContainer"
- />
-
+ class="zope.app.browser.container.contents.Contents"
+ name="contents.html" attribute="contents"
+ menu="zmi_views"
+ title="Contents"
+ />
<!-- ProcessInstanceContainerAdaptable
XXX Commented Out .. is just a demo
=== Zope3/src/zope/app/browser/workflow/definition.py 1.1 => 1.1.4.1 ===
--- Zope3/src/zope/app/browser/workflow/definition.py:1.1 Thu May 8 13:27:17 2003
+++ Zope3/src/zope/app/browser/workflow/definition.py Sun Jun 22 10:22:52 2003
@@ -11,7 +11,7 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
-"""ProcessDefinition configuration adding view
+"""ProcessDefinition registration adding view
$Id$
"""
@@ -20,20 +20,20 @@
from zope.component import getAdapter, getView, getUtility
from zope.publisher.browser import BrowserView
from zope.app.traversing import traverse
-from zope.app.interfaces.services.configuration import IUseConfiguration
+from zope.app.interfaces.services.registration import IRegistered
from zope.app.interfaces.workflow import IProcessDefinitionImportExport
-class UseConfiguration(BrowserView):
- """View for displaying the configurations for a process definition
+class Registered(BrowserView):
+ """View for displaying the registrations for a process definition
"""
def uses(self):
- """Get a sequence of configuration summaries
+ """Get a sequence of registration summaries
"""
component = self.context
- useconfig = getAdapter(component, IUseConfiguration)
+ useconfig = getAdapter(component, IRegistered)
result = []
for path in useconfig.usages():
config = traverse(component, path)
=== Zope3/src/zope/app/browser/workflow/instance.py 1.1 => 1.1.4.1 ===
--- Zope3/src/zope/app/browser/workflow/instance.py:1.1 Thu May 8 13:27:17 2003
+++ Zope3/src/zope/app/browser/workflow/instance.py Sun Jun 22 10:22:52 2003
@@ -18,7 +18,7 @@
__metaclass__ = type
from zope.schema import getFieldNames
-from zope.component import queryView, queryAdapter, getAdapter
+from zope.component import getAdapter
from zope.publisher.browser import BrowserView
from zope.app.pagetemplate.viewpagetemplatefile import ViewPageTemplateFile
@@ -26,12 +26,11 @@
from zope.app.interfaces.workflow import IProcessInstanceContainer
from zope.app.interfaces.workflow.stateful import IStatefulProcessInstance
-
+
class InstanceContainerView(BrowserView):
__used_for__ = IProcessInstanceContainerAdaptable
-
def _extractContentInfo(self, item):
id, obj = item
info = {}
@@ -40,33 +39,32 @@
# XXX need to urlencode the id in this case !!!
info['url'] = "processinstance.html?pi_name=%s" % id
-
+
return info
-
-
+
def removeObjects(self, ids):
"""Remove objects specified in a list of object ids"""
container = getAdapter(self.context, IProcessInstanceContainer)
for id in ids:
container.__delitem__(id)
-
+
self.request.response.redirect('@@processinstances.html')
-
+
def listContentInfo(self):
return map(self._extractContentInfo,
getAdapter(self.context, IProcessInstanceContainer).items())
-
+
contents = ViewPageTemplateFile('instancecontainer_main.pt')
contentsMacros = contents
-
+
_index = ViewPageTemplateFile('instancecontainer_index.pt')
-
+
def index(self):
if 'index.html' in self.context:
self.request.response.redirect('index.html')
return ''
-
- return self._index()
+
+ return self._index()
# ProcessInstance Details
@@ -76,14 +74,16 @@
# we really want to traverse to the instance and display a view
def _getProcessInstanceData(self, data):
- names = getFieldNames(data.__implements__)
- return dict([(name, getattr(data, name, None),) for name in names ])
+ names = []
+ for interface in providedBy(data):
+ names.append(getFieldNames(interface))
+ return dict([(name, getattr(data, name, None),) for name in names])
def getProcessInstanceInfo(self, pi_name):
info = {}
pi = getAdapter(self.context, IProcessInstanceContainer)[pi_name]
info['status'] = pi.status
-
+
# temporary
if IStatefulProcessInstance.isImplementedBy(pi):
info['outgoing_transitions'] = pi.getOutgoingTransitions()
@@ -92,7 +92,7 @@
info['data'] = self._getProcessInstanceData(pi.data)
else:
info['data'] = None
-
+
return info
def _fireTransition(self, pi_name, id):
@@ -112,5 +112,5 @@
if request.has_key('fire_transition'):
self._fireTransition(pi_name, request['fire_transition'])
-
+
return self._instanceindex()