[Zope3-checkins] CVS: Zope3/src/zope/app/browser/services - subscription_control.pt:1.1 configure.zcml:1.61

Anthony Baxter anthony@interlink.com.au
Fri, 11 Jul 2003 01:51:05 -0400


Update of /cvs-repository/Zope3/src/zope/app/browser/services
In directory cvs.zope.org:/tmp/cvs-serv13561/src/zope/app/browser/services

Modified Files:
	configure.zcml 
Added Files:
	subscription_control.pt 
Log Message:
Moved the Registration object from zope.app.index to zope.app.services.hub,
and changed the bootstrap code to add a Registration object if there is not
already one installed. This means that by default the ObjectHub is now 
actually doing something, rather than sitting by itself feeling lonely.

When a Registration object is added by bootstrap, it's subscribed by
default.


=== Added File Zope3/src/zope/app/browser/services/subscription_control.pt ===
<html metal:use-macro="views/standard_macros/page">

  <head>
    <title>Registration "Service" Control Page</title>
  </head>

  <body>

  <div metal:fill-slot="body">

    <h1>Subscription control</h1>

    <span tal:condition="request/callSubscribe|nothing" tal:omit-tag="">
        <span tal:define="dummy context/subscribe" tal:omit-tag=""/>
        Successfully subscribed.
    </span>
    <span tal:condition="request/callUnsubscribe|nothing" tal:omit-tag="">
        <span tal:define="dummy context/unsubscribe" tal:omit-tag=""/>
        Successfully unsubscribed.
    </span>
    <span tal:condition="request/callRegisterExisting|nothing" tal:omit-tag="">
        <span tal:define="dummy context/registerExisting" tal:omit-tag=""/>
        Registration done.
    </span>

    <form action="" method="post">
       <span tal:condition="context/isSubscribed" tal:omit-tag="">
           Subscription state: ON
           <input type="submit" value="Unsubscribe" name="callUnsubscribe" />
       </span>
       <span tal:condition="not:context/isSubscribed" tal:omit-tag="">
           Subscription state: OFF
           <input type="submit" value="Subscribe" name="callSubscribe" />
       </span>
    </form>

    <form action="" method="post">
        <input type="submit" value="Register Existing Objects"
               name="callRegisterExisting" />
    </form>

  </div>

  </body>

</html>


=== Zope3/src/zope/app/browser/services/configure.zcml 1.60 => 1.61 ===
--- Zope3/src/zope/app/browser/services/configure.zcml:1.60	Wed Jul  2 18:10:44 2003
+++ Zope3/src/zope/app/browser/services/configure.zcml	Fri Jul 11 01:50:29 2003
@@ -411,6 +411,25 @@
       for="zope.app.interfaces.services.hub.IObjectHub"
       file="hub.gif" />
 
+<!-- Registration -->
+
+  <menuItem
+    menu="add_component"
+    for="zope.app.interfaces.container.IAdding"
+    action="zope.app.services.hub.Registration"
+    title="Registration subscriber"
+    description="An event subscriber that registers content with the objecthub"
+    />
+
+  <page
+    for="zope.app.services.hub.ISubscriptionControl"
+    permission="zope.ManageServices"
+    name="index.html"
+    menu="zmi_views"
+    title="Control"
+    template="subscription_control.pt"
+    />
+
 <!-- Utility Service --> <include package=".utility" />
 
 <!-- "Add Service" menu -->