[Zope3-checkins] CVS: Zope3/src/zope/app/browser/services - role.zcml:1.1.2.1 roles.pt:1.1.2.1 configure.zcml:1.55.2.1 role.py:1.2.32.1
Martijn Faassen
m.faassen@vet.uu.nl
Mon, 23 Jun 2003 14:35:14 -0400
Update of /cvs-repository/Zope3/src/zope/app/browser/services
In directory cvs.zope.org:/tmp/cvs-serv25818/src/zope/app/browser/services
Modified Files:
Tag: faassen-roleservice_confusion-branch
configure.zcml role.py
Added Files:
Tag: faassen-roleservice_confusion-branch
role.zcml roles.pt
Log Message:
Work on the local role service. It still doesn't work..
=== Added File Zope3/src/zope/app/browser/services/role.zcml ===
<zopeConfigure xmlns='http://namespaces.zope.org/browser'>
<!-- Browser directives for the role service -->
<!-- "Add service" menu entry to add a role service.
The action attribute matches a factory id defined in
zope/app/services/configure.zcml. -->
<menuItem
menu="add_service"
for="zope.app.interfaces.container.IAdding"
action="LocalRoleService"
permission="zope.ManageServices"
title="Role Service"
description="A Local Role service" />
<!-- ZMI tab named "Roles" for the roles service -->
<page
for="zope.app.interfaces.services.role.ILocalRoleService"
name="index.html"
template="roles.pt"
permission="zope.ManageServices"
menu="zmi_views" title="Roles"
/>
<icon
name="zmi_icon"
for="zope.app.interfaces.services.role.ILocalRoleService"
file="role_service.gif" />
<!-- a menu item for actually adding the role data component -->
<menuItem
menu="add_component"
for="zope.app.interfaces.container.IAdding"
action="zope.app.services.roledata"
title="Role Data"
description="Role Data contains title and description information."
/>
<!-- Browser directives for registering individual role objects -->
<!-- When creating a new role object, you are taken to this
form to configure it. The form lets you choose a name,
an interface, a permission, and a registration status
(Unregistered, Registered or Active). -->
<addform
label="New Role Registration"
for="zope.app.interfaces.services.role.ILocalRoleRegistration"
name="addRegistration.html"
schema="zope.app.interfaces.services.role.ILocalRoleRegistration"
class=".role.AddRoleRegistration"
permission="zope.ManageServices"
content_factory="zope.app.services.role.LocalRoleRegistration"
arguments="name componentPath"
set_after_add="status"
fields="name componentPath permission status"
/>
</zopeConfigure>
=== Added File Zope3/src/zope/app/browser/services/roles.pt ===
<html metal:use-macro="context/@@standard_macros/page">
<div metal:fill-slot="body"
i18n:domain="zope"
>
<p>Roles</p>
</div>
</html>
=== Zope3/src/zope/app/browser/services/configure.zcml 1.55 => 1.55.2.1 ===
--- Zope3/src/zope/app/browser/services/configure.zcml:1.55 Sun Jun 22 16:23:26 2003
+++ Zope3/src/zope/app/browser/services/configure.zcml Mon Jun 23 14:34:43 2003
@@ -73,47 +73,7 @@
file="event_service.gif"
/>
-<!-- Role Service -->
-
- <menuItem
- menu="add_service"
- for="zope.app.interfaces.container.IAdding"
- action="RoleService"
- title="Role Service" />
-
- <icon
- name="zmi_icon"
- for="zope.app.services.role.ILocalRoleService"
- file="role_service.gif" />
-
- <pages
- permission="zope.ManageServices"
- for="zope.app.services.role.IRoleService"
- class="zope.app.browser.services.role.Contents">
-
- <page name="index.html" attribute="contents" />
- <page name="removeObjects.html" attribute="removeObjects" />
-
- </pages>
-
- <pages
- permission="zope.ManageServices"
- for="zope.app.services.role.IRoleService"
- class="zope.app.browser.services.role.Add"
- >
-
- <page name="+" template="addrole.pt"
- menu="zmi_actions" title="Add"
- />
- <page name="action.html" attribute="action" />
-
- </pages>
-
- <menuItems
- menu="zmi_views"
- for="zope.app.services.role.IRoleService">
- <menuItem title="Contents" action="@@index.html"/>
- </menuItems>
+<!-- Role Service --> <include file="role.zcml" />
<!-- Authentication Service -->
=== Zope3/src/zope/app/browser/services/role.py 1.2 => 1.2.32.1 ===
--- Zope3/src/zope/app/browser/services/role.py:1.2 Wed Dec 25 09:12:36 2002
+++ Zope3/src/zope/app/browser/services/role.py Mon Jun 23 14:34:43 2003
@@ -1,27 +1,5 @@
-from zope.publisher.browser import BrowserView
-from zope.app.services.role import Role
-from zope.app.services.role import ILocalRoleService
+from zope.app.browser.services.registration import AddComponentRegistration
-class Add(BrowserView):
- "Provide a user interface for adding a contact"
-
- __used_for__ = ILocalRoleService
-
- def action(self, id, title, description):
- "Add a contact"
- role = Role(id, title, description)
- self.context.setObject(id, role)
- self.request.response.redirect('.')
-
-
-
-""" Define view component for service manager contents.
-
-$Id$
-"""
-
-from zope.app.browser.container.contents import Contents
-
-class Contents(Contents):
+class AddRoleRegistration(AddComponentRegistration):
pass