[rhmessaging-commits] rhmessaging commits: r1841 - in mgmt: notes and 1 other directory.

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Mon Apr 7 10:04:01 EDT 2008


Author: justi9
Date: 2008-04-07 10:04:01 -0400 (Mon, 07 Apr 2008)
New Revision: 1841

Modified:
   mgmt/cumin/python/cumin/broker.py
   mgmt/cumin/python/cumin/broker.strings
   mgmt/cumin/python/cumin/brokergroup.py
   mgmt/cumin/python/cumin/brokergroup.strings
   mgmt/cumin/python/cumin/client.py
   mgmt/cumin/python/cumin/client.strings
   mgmt/cumin/python/cumin/exchange.py
   mgmt/cumin/python/cumin/exchange.strings
   mgmt/cumin/python/cumin/model.py
   mgmt/cumin/python/cumin/queue.py
   mgmt/cumin/python/cumin/queue.strings
   mgmt/cumin/python/cumin/widgets.py
   mgmt/cumin/python/cumin/widgets.strings
   mgmt/notes/justin-todo.txt
Log:
Drive object summaries off of metadata.  This includes properties and
actions for now, and it can eventually include stats.



Modified: mgmt/cumin/python/cumin/broker.py
===================================================================
--- mgmt/cumin/python/cumin/broker.py	2008-04-04 16:48:11 UTC (rev 1840)
+++ mgmt/cumin/python/cumin/broker.py	2008-04-07 14:04:01 UTC (rev 1841)
@@ -236,49 +236,48 @@
     def __init__(self, app, name):
         super(BrokerView, self).__init__(app, name)
 
-        self.status = BrokerStatus(app, "status")
-        self.add_child(self.status)
+        status = BrokerStatus(app, "status")
+        self.add_child(status)
 
-        self.body = ModeSet(app, "body")
-        self.add_child(self.body)
+        self.__body = ModeSet(app, "body")
+        self.add_child(self.__body)
 
-        self.tabs = TabbedModeSet(app, "tabs")
-        self.body.add_mode(self.tabs)
+        self.__tabs = TabbedModeSet(app, "tabs")
+        self.__body.add_mode(self.__tabs)
 
-        self.tabs.add_tab(self.BrokerQueueTab(app, "queues"))
-        self.tabs.add_tab(self.BrokerExchangeTab(app, "exchanges"))
-        self.tabs.add_tab(self.BrokerClientTab(app, "clients"))
-        self.tabs.add_tab(PeerSet(app, "links"))
+        self.__tabs.add_tab(self.BrokerQueueTab(app, "queues"))
+        self.__tabs.add_tab(self.BrokerExchangeTab(app, "exchanges"))
+        self.__tabs.add_tab(self.BrokerClientTab(app, "clients"))
+        self.__tabs.add_tab(PeerSet(app, "links"))
 
-        self.missing = self.BrokerMissing(app, "missing")
-        self.body.add_mode(self.missing)
+        self.__missing = self.BrokerMissing(app, "missing")
+        self.__body.add_mode(self.__missing)
 
-        self.vhost = Attribute(app, "vhost")
-        self.add_attribute(self.vhost)
+        self.__vhost = Attribute(app, "vhost")
+        self.add_attribute(self.__vhost)
 
     class BrokerMissing(Widget):
         pass
 
-    def show_config(self, session):
-        return self.tabs.show_mode(session, self.config)
-
-    def render_title(self, session, reg):
-        return "Broker '%s'" % reg.name
-
     def do_process(self, session, reg):
         if reg.broker:
-            self.vhost.set(session, reg.getDefaultVhost())
+            self.__vhost.set(session, reg.getDefaultVhost())
         else:
-            self.body.show_mode(session, self.missing)
+            self.__body.show_mode(session, self.__missing)
 
         super(BrokerView, self).do_process(session, reg)
 
-    def render_data_url(self, session, reg):
-        return "model.xml"
+    def render_title(self, session, reg):
+        return "Broker '%s'" % reg.name
 
-    def render_address(self, session, reg):
-        return reg.host + (reg.port and ":%i" % reg.port or "")
+    def render_script(self, session, reg):
+        if reg.broker:
+            data = "model.xml?class=broker;id=%i" % reg.broker.id
+            return "wooly.setIntervalUpdate('%s', updateBroker, 3000)" % data
 
+    def render_icon_resource(self, session, reg):
+        return "broker-36.png"
+
     def render_group_links(self, session, reg):
         links = list()
 
@@ -290,26 +289,6 @@
 
         return ", ".join(links)
 
-    def render_cluster_link(self, session, reg):
-        cluster = reg.cluster
-        
-        if cluster:
-            branch = session.branch()
-            self.page.show_broker_cluster(branch, cluster).show_view(branch)
-            return fmt_olink(branch, cluster)
-        else:
-            return fmt_none()
-
-    def render_profile_link(self, session, reg):
-        profile = reg.profile
-
-        if profile:
-            branch = session.branch()
-            self.page.show_broker_profile(branch, profile).show_view(branch)
-            return fmt_olink(branch, profile)
-        else:
-            return fmt_none()
-
     class BrokerQueueTab(Widget):
         def __init__(self, app, name):
             super(BrokerView.BrokerQueueTab, self).__init__(app, name)

Modified: mgmt/cumin/python/cumin/broker.strings
===================================================================
--- mgmt/cumin/python/cumin/broker.strings	2008-04-04 16:48:11 UTC (rev 1840)
+++ mgmt/cumin/python/cumin/broker.strings	2008-04-07 14:04:01 UTC (rev 1841)
@@ -70,24 +70,14 @@
 
 [BrokerView.html]
 <script>
-  wooly.setIntervalUpdate("{data_url}", updateBroker, 3000);
+{script}
 </script>
 
 {status}
 
-<h1><img src="resource?name=broker-36.png"/>{title}</h1>
+<h1><img src="resource?name={icon_resource}"/>{title}</h1>
 
-<table class="props">
-  <tr><th>Address</th><td>{address}</td></tr>
-  <tr><th>Groups</th><td>{group_links}</td></tr>
-  <tr>
-    <th class="actions" colspan="2">
-      <h2>Act on This Broker:</h2>
-      <a class="nav" href="{edit_href}">Edit</a>
-      <a href="{remove_href}">Unregister</a>
-    </th>
-  </tr>
-</table>
+{summary}
 
 {body}
 

Modified: mgmt/cumin/python/cumin/brokergroup.py
===================================================================
--- mgmt/cumin/python/cumin/brokergroup.py	2008-04-04 16:48:11 UTC (rev 1840)
+++ mgmt/cumin/python/cumin/brokergroup.py	2008-04-07 14:04:01 UTC (rev 1841)
@@ -36,7 +36,8 @@
         def render_content(self, session, data):
             group = Identifiable(data["id"])
             branch = session.branch()
-            self.app.model.broker_group.show(branch, group).show_view(branch)
+            frame = self.app.model.broker_group.show_object(branch, group)
+            frame = frame.show_view(branch)
             return fmt_olink(branch, group, name=data["name"])
 
 class BrokerGroupInputSet(CheckboxInputSet):
@@ -113,20 +114,20 @@
     def __init__(self, app, name):
         super(BrokerGroupView, self).__init__(app, name)
 
-        self.status = BrokerGroupStatus(app, "status")
-        self.add_child(self.status)
+        status = BrokerGroupStatus(app, "status")
+        self.add_child(status)
 
         self.tabs = TabbedModeSet(app, "tabs")
         self.add_child(self.tabs)
 
         self.tabs.add_tab(self.GroupBrokerTab(app, "brokers"))
 
+    def render_icon_resource(self, session, group):
+        return "group-36.png"
+
     def render_title(self, session, group):
         return "Broker Group '%s'" % group.name
 
-    def render_name(self, session, group):
-        return group.name
-
     class GroupBrokerTab(BrokerSet):
         def get_args(self, session):
             return self.frame.get_args(session)

Modified: mgmt/cumin/python/cumin/brokergroup.strings
===================================================================
--- mgmt/cumin/python/cumin/brokergroup.strings	2008-04-04 16:48:11 UTC (rev 1840)
+++ mgmt/cumin/python/cumin/brokergroup.strings	2008-04-07 14:04:01 UTC (rev 1841)
@@ -24,21 +24,3 @@
   </thead>
   <tbody>{items}</tbody>
 </table>
-
-[BrokerGroupView.html]
-{status}
-
-<h1><img src="resource?name=group-36.png"/>{title}</h1>
-
-<table class="props">
-  <tr><th>Name</th><td>{name}</td></tr>
-  <tr>
-    <th class="actions" colspan="2">
-      <h2>Act on This Group:</h2>
-      <a class="nav" href="{edit_href}">Edit</a>
-      <a href="{remove_href}">Remove</a>
-    </th>
-  </tr>
-</table>
-
-{tabs}

Modified: mgmt/cumin/python/cumin/client.py
===================================================================
--- mgmt/cumin/python/cumin/client.py	2008-04-04 16:48:11 UTC (rev 1840)
+++ mgmt/cumin/python/cumin/client.py	2008-04-07 14:04:01 UTC (rev 1841)
@@ -218,24 +218,13 @@
     def show_sessions(self, session):
         return self.tabs.show_mode(session, self.sessions)
 
-    def render_title(self, session, client):
-        return "Client '%s'" % client.address
+    def render_script(self, session, queue):
+        data = "model.xml?class=client;id=%i" % queue.id
+        return "wooly.setIntervalUpdate('%s', updateClient, 3000)" % data
 
-    def render_data_url(self, session, client):
-        return "model.xml?class=client;id=%i" % client.id
-    
-    def render_created_deleted(self, session, client):
-        return "%s &ndash; %s" % (fmt_datetime(client.creationTime),
-                            fmt_datetime(client.deletionTime))
-    
-    def render_updated(self, session, client):
-        return fmt_datetime(client.recTime)
+    def render_icon_resource(self, session, queue):
+        return "client-36.png"
 
-    def render_close_href(self, session, client):
-        branch = session.branch()
-        self.parent.show_close(branch)
-        return branch.marshal()
-
 class ClientStatistics(TabbedModeSet):
     def __init__(self, app, name):
         super(ClientStatistics, self).__init__(app, name)

Modified: mgmt/cumin/python/cumin/client.strings
===================================================================
--- mgmt/cumin/python/cumin/client.strings	2008-04-04 16:48:11 UTC (rev 1840)
+++ mgmt/cumin/python/cumin/client.strings	2008-04-07 14:04:01 UTC (rev 1841)
@@ -113,28 +113,6 @@
     cumin.runObjectListeners(client);
 }
 
-[ClientView.html]
-<script>
-  wooly.setIntervalUpdate("{data_url}", updateClient, 3000);
-</script>
-
-{status}
-
-<h1><img src="resource?name=client-36.png"/>{title}</h1>
-
-<table class="props">
-  <tr><th>Created &ndash; Deleted</th><td>{created_deleted}</td></tr>
-  <tr><th>Updated</th><td>{updated}</td></tr>
-  <tr>
-    <th class="actions" colspan="2">
-      <h2>Act on This Client:</h2>
-      <a href="{close_href}">Close</a>
-    </th>
-  </tr>
-</table>
-
-{tabs}
-
 [ClientStatistics.html]
 <ul class="radiotabs tabs">{tabs}</ul>
 <div class="radiotabs mode">{mode}</div>

Modified: mgmt/cumin/python/cumin/exchange.py
===================================================================
--- mgmt/cumin/python/cumin/exchange.py	2008-04-04 16:48:11 UTC (rev 1840)
+++ mgmt/cumin/python/cumin/exchange.py	2008-04-07 14:04:01 UTC (rev 1841)
@@ -212,26 +212,13 @@
     def show_bindings(self, session):
         return self.tabs.show_mode(session, self.bindings);
 
-    def render_data_url(self, session, exchange):
-        return "model.xml?class=exchange;id=%i" % exchange.id
+    def render_script(self, session, queue):
+        data = "model.xml?class=exchange;id=%i" % queue.id
+        return "wooly.setIntervalUpdate('%s', updateExchange, 3000)" % data
 
-    def render_type(self, session, exchange):
-        if exchange.type == "direct":
-            return "Direct"
-        elif exchange.type == "topic":
-            return "Topic"
-        elif exchange.type == "fanout":
-            return "Fan Out"
-        else:
-            return exchange.type
+    def render_icon_resource(self, session, queue):
+        return "exchange-36.png"
 
-    def render_created_deleted(self, session, exchange):
-        return "%s &ndash; %s" % (fmt_datetime(exchange.creationTime),
-                                   fmt_datetime(exchange.deletionTime))
-    
-    def render_updated(self, session, exchange):
-        return fmt_datetime(exchange.recTime)
-
 class ExchangeBindingSet(BindingSet):
     def get_args(self, session):
         return self.frame.get_args(session)

Modified: mgmt/cumin/python/cumin/exchange.strings
===================================================================
--- mgmt/cumin/python/cumin/exchange.strings	2008-04-04 16:48:11 UTC (rev 1840)
+++ mgmt/cumin/python/cumin/exchange.strings	2008-04-07 14:04:01 UTC (rev 1841)
@@ -175,23 +175,6 @@
     cumin.runObjectListeners(exchange);
 }
 
-[ExchangeView.html]
-<script>
-  wooly.setIntervalUpdate("{data_url}", updateExchange, 3000);
-</script>
-
-{status}
-
-<h1><img src="resource?name=exchange-36.png"/>{title}</h1>
-
-<table class="props">
-  <tr><th>Type</th><td>{type}</td></tr>
-  <tr><th>Created &ndash; Deleted</th><td>{created_deleted}</td></tr>
-  <tr><th>Updated</th><td>{updated}</td></tr>
-</table>
-
-{tabs}
-
 [ExchangeBindingSet.html]
 <div class="rfloat">{page}</div>
 <ul class="radiotabs">&nbsp;</ul>

Modified: mgmt/cumin/python/cumin/model.py
===================================================================
--- mgmt/cumin/python/cumin/model.py	2008-04-04 16:48:11 UTC (rev 1840)
+++ mgmt/cumin/python/cumin/model.py	2008-04-07 14:04:01 UTC (rev 1841)
@@ -71,10 +71,14 @@
 
         writer.write("</model>")
 
+    def show_main(self, session):
+        return self.app.main_page.show_main(session)
+
 class CuminProperty(object):
     def __init__(self, cls, name):
-        self.model = cls.model
+        self.cumin_model = cls.cumin_model
         self.cumin_class = cls
+
         self.name = name
         self.title = None
         self.categories = ()
@@ -101,14 +105,24 @@
 
 class CuminAction(object):
     def __init__(self, cls, name):
-        self.model = cls.model
+        self.cumin_model = cls.cumin_model
         self.cumin_class = cls
+
         self.name = name
         self.title = None
         self.summary = False
         
         self.cumin_class.add_action(self)
 
+    def show(self, session, object):
+        raise Exception("Not implemented")
+
+    # XXX we could even cache this if it gets called a lot
+    def get_href(self, session, object):
+        branch = session.branch()
+        self.show(branch, object)
+        return branch.marshal()
+
     def get_title(self, session):
         if self.title:
             return self.title
@@ -132,7 +146,7 @@
 
                 print_exc();
         finally:
-            self.model.invocations.add(invoc)
+            self.cumin_model.invocations.add(invoc)
 
         #invoc.prt()
 
@@ -154,7 +168,7 @@
         verb = self.action.get_title(session)
 
         if self.object:
-            cls = self.action.model.get_class_by_object(self.object)
+            cls = self.action.cumin_model.get_class_by_object(self.object)
             object = cls.get_object_title(session, self.object)
         else:
             object = self.action.cumin_class.get_title(session)
@@ -167,8 +181,9 @@
 
 class CuminStat(object):
     def __init__(self, cls, name):
-        self.model = cls.model
+        self.cumin_model = cls.cumin_model
         self.cumin_class = cls
+
         self.name = name
         self.unit = None
         self.title = None
@@ -278,7 +293,7 @@
 
 class CuminClass(object):
     def __init__(self, model, name, mint_class):
-        self.model = model
+        self.cumin_model = model
         self.cumin_name = name
         self.mint_class = mint_class
 
@@ -286,7 +301,7 @@
         self.stats = list()
         self.actions = list()
 
-        self.model.add_class(self)
+        self.cumin_model.add_class(self)
 
     def add_property(self, prop):
         self.properties.append(prop)
@@ -303,6 +318,14 @@
     def get_title(self, session):
         return "Object"
 
+    def get_object_href(self, session, object):
+        branch = session.branch()
+        self.show_object(branch, object)
+        return branch.marshal()
+
+    def show_object(self, session, object):
+        raise Exception("Not implemented")
+
     def get_object_title(self, session, object):
         title = self.get_title(session)
         name = self.get_object_name(object)
@@ -359,6 +382,13 @@
         self.Remove(self, "remove")
 
     class Add(CuminAction):
+        def __init__(self, cls, name):
+            super(LocalClass.Add, self).__init__(cls, name)
+
+        def show(self, session, object):
+            frame = self.cumin_class.show_object(session, object)
+            return frame.show_add(session)
+
         def get_title(self, session):
             return "Add"
 
@@ -368,7 +398,7 @@
             try:
                 object = self.cumin_class.mint_class(**args)
 
-                self.model.app.broker_connect_thread.prompt()
+                self.cumin_model.app.broker_connect_thread.prompt()
 
                 completion("OK")
 
@@ -377,6 +407,15 @@
                 completion(e.message or "failed")
 
     class Edit(CuminAction):
+        def __init__(self, cls, name):
+            super(LocalClass.Edit, self).__init__(cls, name)
+
+            self.summary = True
+
+        def show(self, session, object):
+            frame = self.cumin_class.show_object(session, object)
+            return frame.show_edit(session)
+
         def get_title(self, session):
             return "Edit"
 
@@ -389,6 +428,15 @@
                 completion(e.message or "failed")
 
     class Remove(CuminAction):
+        def __init__(self, cls, name):
+            super(LocalClass.Remove, self).__init__(cls, name)
+
+            self.summary = True
+
+        def show(self, session, object):
+            frame = self.cumin_class.show_object(session, object)
+            return frame.show_remove(session)
+
         def get_title(self, session):
             return "Remove"
 
@@ -423,10 +471,13 @@
         prop = CuminProperty(self, "machine")
         prop.title = "Architecture"
 
-        action = CuminAction(self, "ping")
-        action.title = "Send Ping"
-        action.summary = True
+        #action = CuminAction(self, "ping")
+        #action.title = "Send Ping"
+        #action.summary = True
 
+    def show(self, session, system):
+        return self.cumin_model.show_main(session).show_system(session, system)
+
 class CuminBroker(RemoteClass):
     def __init__(self, model):
         super(CuminBroker, self).__init__(model, "broker", Broker, BrokerStats)
@@ -462,8 +513,7 @@
         prop.title = "Data Directory"
 
     def show(self, session, broker):
-        frame = self.model.app.main_page.show_main(session)
-        return frame.show_broker(session, broker)
+        return self.cumin_model.show_main(session).show_broker(session, broker)
 
 class CuminQueue(RemoteClass):
     def __init__(self, model):
@@ -652,17 +702,27 @@
         stat.unit = "byte"
         stat.categories = ("persistent",)
 
-        self.Purge(self, "purge")
+        action = self.Purge(self, "purge")
+        action.summary = True
 
     def get_title(self, session):
         return "Queue"
     
+    def show_object(self, session, queue):
+        frame = self.cumin_model.show_main(session)
+        frame = frame.show_broker(session, queue.vhost.broker)
+        return frame.show_queue(session, queue)
+
     class Purge(CuminAction):
+        def show(self, session, queue):
+            frame = self.cumin_class.show_object(session, queue)
+            return frame.show_purge(session)
+
         def get_title(self, session):
             return "Purge"
 
-        def do_invoke(self, object, args, completion):
-            object.purge(self.model.data, completion)
+        def do_invoke(self, queue, args, completion):
+            queue.purge(self.cumin_model.data, completion)
 
 class CuminExchange(RemoteClass):
     def __init__(self, model):
@@ -674,6 +734,7 @@
 
         prop = CuminProperty(self, "type")
         prop.title = "Type"
+        prop.summary = True
 
         stat = CuminStat(self, "producers")
         stat.title = "Producers"
@@ -717,6 +778,11 @@
         stat.unit = "message"
         stat.categories = ("general",)
 
+    def show_object(self, session, exchange):
+        frame = self.cumin_model.show_main(session)
+        frame = frame.show_broker(exchange.vhost.broker)
+        return frame.show_queue(session, exchange)
+
     def get_title(self, session):
         return "Exchange"
     
@@ -770,8 +836,14 @@
         stat.unit = "frame"
         stat.categories = ("general",)
 
-        self.Close(self, "close")
+        action = self.Close(self, "close")
+        action.summary = True
 
+    def show_object(self, session, client):
+        frame = self.cumin_model.show_main(session)
+        frame = frame.show_broker(session, client.vhost.broker)
+        return frame.show_client(session, client)
+
     def get_title(self, session):
         return "Client"
     
@@ -779,11 +851,15 @@
         return client.address
 
     class Close(CuminAction):
+        def show(self, session, client):
+            frame = self.cumin_class.show_object(session, client)
+            return frame.show_close(session)
+
         def get_title(self, session):
             return "Close"
 
-        def do_invoke(self, object, args, completion):
-            object.close(self.model.data, completion)
+        def do_invoke(self, client, args, completion):
+            client.close(self.cumin_model.data, completion)
 
 class CuminSession(RemoteClass):
     def __init__(self, model):
@@ -825,28 +901,28 @@
             return "Close"
 
         def do_invoke(self, object, args, completion):
-            object.close(self.model.data, completion)
+            object.close(self.cumin_model.data, completion)
 
     class Detach(CuminAction):
         def get_title(self, session):
             return "Detach"
 
         def do_invoke(self, object, args, completion):
-            object.detach(self.model.data, completion)
+            object.detach(self.cumin_model.data, completion)
 
     class ResetLifespan(CuminAction):
         def get_title(self, session):
             return "Reset Lifespan"
 
         def do_invoke(self, object, args, completion):
-            object.resetLifespan(self.model.data, completion)
+            object.resetLifespan(self.cumin_model.data, completion)
 
     class SolicitAck(CuminAction):
         def get_title(self, session):
             return "Solicit Acknowledgment"
 
         def do_invoke(self, object, args, completion):
-            object.solicitAck(self.model.data, completion)
+            object.solicitAck(self.cumin_model.data, completion)
 
 class CuminLink(RemoteClass):
     def __init__(self, model):
@@ -890,16 +966,27 @@
         super(CuminBrokerRegistration, self).__init__ \
             (model, "broker_registration", BrokerRegistration)
 
+        prop = CuminProperty(self, "host")
+        prop.title = "Host"
+        prop.summary = True
+
+        prop = CuminProperty(self, "port")
+        prop.title = "Port"
+        prop.summary = True
+
     def get_title(self, session):
         return "Broker Registration"
 
+    def show_object(self, session, reg):
+        return self.cumin_model.show_main(session).show_broker(session, reg)
+
 class CuminBrokerGroup(LocalClass):
     def __init__(self, model):
         super(CuminBrokerGroup, self).__init__ \
             (model, "broker_group", BrokerGroup)
 
-    def show(self, session, group):
-        frame = self.model.app.main_page.show_main(session)
+    def show_object(self, session, group):
+        frame = self.cumin_model.show_main(session)
         return frame.show_broker_group(session, group)
 
     def get_title(self, session):

Modified: mgmt/cumin/python/cumin/queue.py
===================================================================
--- mgmt/cumin/python/cumin/queue.py	2008-04-04 16:48:11 UTC (rev 1840)
+++ mgmt/cumin/python/cumin/queue.py	2008-04-07 14:04:01 UTC (rev 1841)
@@ -224,8 +224,8 @@
     def __init__(self, app, name):
         super(QueueView, self).__init__(app, name)
 
-        self.status = QueueStatus(app, "status")
-        self.add_child(self.status)
+        status = QueueStatus(app, "status")
+        self.add_child(status)
 
         self.tabs = TabbedModeSet(app, "tabs")
         self.add_child(self.tabs)
@@ -244,30 +244,13 @@
     def show_bindings(self, session):
         self.tabs.show_mode(session, self.bindings);
 
-    def render_title(self, session, queue):
-        return "Queue '%s'" % queue.name
+    def render_script(self, session, queue):
+        data = "model.xml?class=queue;id=%i" % queue.id
+        return "wooly.setIntervalUpdate('%s', updateQueue, 3000)" % data
 
-    def render_data_url(self, session, queue):
-        return "model.xml?class=queue;id=%i" % queue.id
+    def render_icon_resource(self, session, queue):
+        return "queue-36.png"
 
-    def render_durable(self, session, queue):
-        return fmt_predicate(queue.durable)
-
-    def render_exclusive(self, session, queue):
-        return fmt_predicate(queue.exclusive)
-
-    def render_created_deleted(self, session, queue):
-        return "%s &ndash; %s" % (fmt_datetime(queue.creationTime),
-                                   fmt_datetime(queue.deletionTime))
-    
-    def render_updated(self, session, queue):
-        return fmt_datetime(queue.recTime)
-
-    def render_purge_href(self, session, queue):
-        branch = session.branch()
-        self.parent.show_purge(branch)
-        return branch.marshal()
-
 class QueueBindingSet(BindingSet):
     def get_args(self, session):
         return self.frame.get_args(session)

Modified: mgmt/cumin/python/cumin/queue.strings
===================================================================
--- mgmt/cumin/python/cumin/queue.strings	2008-04-04 16:48:11 UTC (rev 1840)
+++ mgmt/cumin/python/cumin/queue.strings	2008-04-07 14:04:01 UTC (rev 1841)
@@ -133,30 +133,6 @@
     //throw new Error();
 }
 
-[QueueView.html]
-<script>
-  wooly.setIntervalUpdate("{data_url}", updateQueue, 3000);
-</script>
-
-{status}
-
-<h1><img src="resource?name=queue-36.png"/>{title}</h1>
-
-<table class="props">
-  <tr><th>Durable?</th><td>{durable}</td></tr>
-  <tr><th>Exclusive?</th><td>{exclusive}</td></tr>
-  <tr><th>Created &ndash; Deleted</th><td>{created_deleted}</td></tr>
-  <tr><th>Updated</th><td>{updated}</td></tr>
-  <tr>
-    <th class="actions" colspan="2">
-      <h2>Act on This Queue:</h2>
-      <a href="{purge_href}">Purge Messages</a>
-    </th>
-  </tr>
-</table>
-
-{tabs}
-
 [QueueBindingSet.html]
 <div class="rfloat">{page}</div>
 <ul class="radiotabs">&nbsp;</ul>

Modified: mgmt/cumin/python/cumin/widgets.py
===================================================================
--- mgmt/cumin/python/cumin/widgets.py	2008-04-04 16:48:11 UTC (rev 1840)
+++ mgmt/cumin/python/cumin/widgets.py	2008-04-07 14:04:01 UTC (rev 1841)
@@ -81,20 +81,32 @@
         return branch.marshal()
 
 class CuminView(Widget):
+    def __init__(self, app, name):
+        super(CuminView, self).__init__(app, name)
+
+        summary = CuminSummary(app, "summary")
+        self.add_child(summary)
+
     def get_args(self, session):
-        return (self.frame.get_object(session),)
+        return self.frame.get_args(session)
 
+    def render_script(self, session, *args):
+        return None
+
+    def render_icon_resource(self, session, *args):
+        return "action-36.png"
+
     def render_title(self, session, *args):
         return self.frame.render_title(session, *args)
 
     def render_edit_href(self, session, *args):
         branch = session.branch()
-        self.parent.show_edit(branch)
+        self.frame.show_edit(branch)
         return branch.marshal()
 
     def render_remove_href(self, session, *args):
         branch = session.branch()
-        self.parent.show_remove(branch)
+        self.frame.show_remove(branch)
         return branch.marshal()
 
 class CuminForm(Form):
@@ -239,7 +251,8 @@
 
     def do_get_items(self, session, object):
         cls = self.app.model.get_class_by_object(object)
-        return [("", x.get_title(session)) for x in cls.actions]
+        return [(x.get_href(session, object), x.get_title(session))
+                for x in cls.actions]
 
 class CuminDetails(Widget):
     def __init__(self, app, name):
@@ -273,7 +286,7 @@
     class SummaryActions(CuminActions):
         def do_get_items(self, session, object):
             cls = self.app.model.get_class_by_object(object)
-            return [("", x.get_title(session))
+            return [(x.get_href(session, object), x.get_title(session))
                     for x in cls.actions if x.summary]
 
 class StateSwitch(ItemSet):

Modified: mgmt/cumin/python/cumin/widgets.strings
===================================================================
--- mgmt/cumin/python/cumin/widgets.strings	2008-04-04 16:48:11 UTC (rev 1840)
+++ mgmt/cumin/python/cumin/widgets.strings	2008-04-07 14:04:01 UTC (rev 1841)
@@ -1,3 +1,16 @@
+[CuminView.html]
+<script>
+{script}
+</script>
+
+{status}
+
+<h1><img src="resource?name={icon_resource}"/>{title}</h1>
+
+{summary}
+
+{tabs}
+
 [CuminFieldForm.html]
 <form id="{id}" class="mform" method="post" action="?">
   <div class="head">{title}</div>

Modified: mgmt/notes/justin-todo.txt
===================================================================
--- mgmt/notes/justin-todo.txt	2008-04-04 16:48:11 UTC (rev 1840)
+++ mgmt/notes/justin-todo.txt	2008-04-07 14:04:01 UTC (rev 1841)
@@ -16,6 +16,10 @@
 
  * Fix obnoxious HTML resizing bug
 
+ * Bulk register is failing to forget state on cancel
+
+ * client.py:159 calls add_error, which no longer exists
+
 Deferred
 
  * Change the way CuminAction.invoke works




More information about the rhmessaging-commits mailing list