[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/Workflow/Browser - AddProcessDefinitionConfiguration.py:1.1.2.1 add_pd_config.pt:1.1.2.1 pd_config_edit.pt:1.1.2.1 pd_config_edit_part.pt:1.1.2.1 configure.zcml:1.1.2.2 AddWorkflowProcessDefinitionConfiguration.py:NONE add_workflow_pd_config.pt:NONE workflow_pd_config_edit.pt:NONE workflow_pd_config_edit_part.pt:NONE
Florent Guillaume
fg@nuxeo.com
Thu, 5 Dec 2002 11:45:10 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/App/Workflow/Browser
In directory cvs.zope.org:/tmp/cvs-serv27144/Browser
Modified Files:
Tag: sprintathon-wf-branch
configure.zcml
Added Files:
Tag: sprintathon-wf-branch
AddProcessDefinitionConfiguration.py add_pd_config.pt
pd_config_edit.pt pd_config_edit_part.pt
Removed Files:
Tag: sprintathon-wf-branch
AddWorkflowProcessDefinitionConfiguration.py
add_workflow_pd_config.pt workflow_pd_config_edit.pt
workflow_pd_config_edit_part.pt
Log Message:
Big renaming, remove the Workflow prefix in most cases. It's redundant
and makes for very long lines.
=== Added File Zope3/lib/python/Zope/App/Workflow/Browser/AddProcessDefinitionConfiguration.py ===
##############################################################################
#
# Copyright (c) 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.
#
##############################################################################
"""Adding view for the workflow configuration object.
$Id: AddProcessDefinitionConfiguration.py,v 1.1.2.1 2002/12/05 16:44:39 efge Exp $
"""
__metaclass__ = type
from Zope.ComponentArchitecture import getServiceManager
from Zope.Proxy.ContextWrapper import getWrapperContainer
from Zope.App.Traversing import getPhysicalPathString
from Zope.Publisher.Browser.BrowserView import BrowserView
from Zope.App.Workflow.IProcessDefinition import IProcessDefinition
from Zope.App.Workflow.IProcessDefinitionConfiguration \
import IProcessDefinitionConfiguration
from Zope.App.Workflow.ProcessDefinitionConfiguration \
import ProcessDefinitionConfiguration
from Zope.App.Forms.Utility import setUpWidgets
from Zope.App.Forms.Utility import getWidgetsDataForContent
class AddProcessDefinitionConfiguration(BrowserView):
def __init__(self, *args):
super(AddProcessDefinitionConfiguration, self).__init__(*args)
setUpWidgets(self, IProcessDefinitionConfiguration)
def paths(self):
package = getWrapperContainer(self.context.context)
base_path = getPhysicalPathString(package)
paths = []
for name, ob in package.items():
if IProcessDefinition.isImplementedBy(ob):
path = '%s/%s' % (base_path, name)
paths.append(path)
return paths
def action(self, path):
name = self.request.form['field.name'] # XXX cleanup this
sd = ProcessDefinitionConfiguration(name, path)
sd = self.context.add(sd)
getWidgetsDataForContent(self, IProcessDefinition, sd)
self.request.response.redirect(self.context.nextURL())
=== Added File Zope3/lib/python/Zope/App/Workflow/Browser/add_pd_config.pt ===
<html metal:use-macro="views/standard_macros/page">
<head>
<title>Add a workflow process definition configuration component</title>
</head>
<body>
<div metal:fill-slot="body">
<form action="action.html">
<table>
<tr>
<td>Component</td>
<td><select name="path">
<option tal:repeat="path view/paths"
tal:attributes="value path"
tal:content="path">path</option>
</select>
</td>
</tr>
<tr>
<td>Name</td>
<td tal:content="structure view/name"><input type="text"></td>
</tr>
<tr>
<td>Title</td>
<td tal:content="structure view/title"><input type="text"></td>
</tr>
<tr>
<td>Description</td>
<td tal:content="structure view/description"><textarea></textarea></td>
</tr>
</table>
<input type=submit value="Next"/>
</form>
</div></body></html>
=== Added File Zope3/lib/python/Zope/App/Workflow/Browser/pd_config_edit.pt ===
<html metal:use-macro="views/standard_macros/page">
<body>
<div metal:fill-slot="body">
<div metal:use-macro="view/generated_form/macros/body">
<table metal:fill-slot="extra_info">
<tr>
<td>Name</td>
<td tal:content="context/name">foo</td>
</tr>
<tr>
<td>Path</td>
<td>
<a href="."
tal:content="context/path"
tal:attributes="href context/path">foo/bar</a>
</td>
</tr>
</table>
</div>
</div>
</body>
</html>
=== Added File Zope3/lib/python/Zope/App/Workflow/Browser/pd_config_edit_part.pt ===
<div metal:use-macro="view/generated_form/macros/formbody">
<h5 metal:fill-slot="heading">
Workflow process definition "<span tal:replace="context/name">foo</span>"
</h5>
<table>
<tr metal:fill-slot="extra_top">
<td>Path</td>
<td>
<a href="."
tal:content="context/path"
tal:attributes="href context/path">foo/bar</a>
</td>
</tr>
</table>
</div>
=== Zope3/lib/python/Zope/App/Workflow/Browser/configure.zcml 1.1.2.1 => 1.1.2.2 ===
--- Zope3/lib/python/Zope/App/Workflow/Browser/configure.zcml:1.1.2.1 Thu Dec 5 08:28:42 2002
+++ Zope3/lib/python/Zope/App/Workflow/Browser/configure.zcml Thu Dec 5 11:44:39 2002
@@ -8,18 +8,18 @@
<!-- Workflow Process Definition -->
<defaultView
- for=".IWorkflowProcessDefinition."
+ for=".IProcessDefinition."
name="contents.html"
/>
<view
- for=".IWorkflowProcessDefinition."
+ for=".IProcessDefinition."
permission="Zope.ManageServices"
name="contents.html"
template="Browser/pd.pt"
/>
-<menuItems menu="zmi_views" for=".IWorkflowProcessDefinition.">
+<menuItems menu="zmi_views" for=".IProcessDefinition.">
<menuItem title="Main"
action="@@contents.html"/>
<menuItem title="Meta Data"
@@ -31,12 +31,12 @@
<view
for="Zope.App.OFS.Container.IAdding."
- name="WorkflowProcessDefinitionConfiguration"
- factory=".Browser.AddWorkflowProcessDefinitionConfiguration."
+ name="ProcessDefinitionConfiguration"
+ factory=".Browser.AddProcessDefinitionConfiguration."
permission="Zope.ManageServices"
>
- <page name="index.html" template="Browser/add_workflow_pd_config.pt" />
+ <page name="index.html" template="Browser/add_pd_config.pt" />
<page name="action.html" attribute="action" />
</view>
@@ -44,72 +44,37 @@
<menuItem
for="Zope.App.OFS.Container.IAdding."
menu="add_configuration"
- action="WorkflowProcessDefinitionConfiguration"
+ action="ProcessDefinitionConfiguration"
title="Workflow process definition"
/>
<defaultView
- for=".IWorkflowProcessDefinitionConfiguration."
+ for=".IProcessDefinitionConfiguration."
name="index.html"
/>
-<menuItems menu="zmi_views" for=".IWorkflowProcessDefinitionConfiguration.">
+<menuItems menu="zmi_views" for=".IProcessDefinitionConfiguration.">
<menuItem title="Edit"
action="index.html"/>
</menuItems>
<form:edit
- for = ".IWorkflowProcessDefinitionConfiguration."
+ for = ".IProcessDefinitionConfiguration."
name = "index.html"
- schema = ".IWorkflowProcessDefinitionConfiguration."
+ schema = ".IProcessDefinitionConfiguration."
label = "Workflow process definition configuration"
permission = "Zope.ManageServices"
- template = "Browser/workflow_pd_config_edit.pt"
+ template = "Browser/pd_config_edit.pt"
/>
<form:edit
- for = ".IWorkflowProcessDefinitionConfiguration."
+ for = ".IProcessDefinitionConfiguration."
name = "ItemEdit"
schema =
"Zope.App.OFS.Services.ConfigurationInterfaces.IConfigurationSummary"
label = "Workflow process definition configuration"
- template = "Browser/workflow_pd_config_edit_part.pt"
+ template = "Browser/pd_config_edit_part.pt"
permission = "Zope.ManageServices"
/>
</zope:zopeConfigure>
-
-
-
-
-<!--
- <form:edit
- for = ".IWorkflowConfiguration."
- name = "index.html"
- schema = "Zope.App.OFS.Services.ConfigurationInterfaces.IConfiguration."
- label = "Workflow Configuration"
- permission = "Zope.ManageServices"
- template = "Browser/WorkflowConfigEdit.pt"
- />
-
- <form:edit
- for = ".IWorkflowConfiguration."
- name = "ItemEdit"
- schema =
- "Zope.App.OFS.Services.ConfigurationInterfaces.IConfigurationSummary."
- label = "Workflow Configuration"
- template = "Browser/WorkflowConfigEditPart.pt"
- class = ".Browser.WorkflowConfigURL."
- permission = "Zope.ManageServices"
- />
-
- <view
- for = ".IWorkflowConfiguration."
- name = "ConfigurationSummary"
- template = "Browser/WorkflowConfigSummary.pt"
- class = ".Browser.WorkflowConfigURL."
- permission="Zope.ManageServices"
- />
-
--->
-
=== Removed File Zope3/lib/python/Zope/App/Workflow/Browser/AddWorkflowProcessDefinitionConfiguration.py ===
=== Removed File Zope3/lib/python/Zope/App/Workflow/Browser/add_workflow_pd_config.pt ===
=== Removed File Zope3/lib/python/Zope/App/Workflow/Browser/workflow_pd_config_edit.pt ===
=== Removed File Zope3/lib/python/Zope/App/Workflow/Browser/workflow_pd_config_edit_part.pt ===