[rhmessaging-commits] rhmessaging commits: r1334 - in mgmt: cumin/python/cumin and 1 other directories.

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Mon Nov 19 10:10:14 EST 2007


Author: justi9
Date: 2007-11-19 10:10:13 -0500 (Mon, 19 Nov 2007)
New Revision: 1334

Modified:
   mgmt/README
   mgmt/cumin/python/cumin/__init__.py
   mgmt/cumin/python/cumin/broker.py
   mgmt/cumin/python/cumin/brokercluster.py
   mgmt/cumin/python/cumin/brokergroup.py
   mgmt/cumin/python/cumin/brokerprofile.py
   mgmt/cumin/python/cumin/brokerprofile.strings
   mgmt/cumin/python/cumin/widgets.py
   mgmt/mint/python/mint/schema.py
Log:
Adds remove forms for broker groups, profiles, and clusters.  Hooks up the profile remove form.



Modified: mgmt/README
===================================================================
--- mgmt/README	2007-11-19 05:46:53 UTC (rev 1333)
+++ mgmt/README	2007-11-19 15:10:13 UTC (rev 1334)
@@ -77,3 +77,12 @@
   export DEVEL_HOME="${HOME}/mgmt"
 
   exec "${DEVEL_HOME}/bin/devel"
+
+
+SOME GOTCHAS YOU MIGHT RUN INTO
+-------------------------------
+
+1. PostgreSQL "sameuser ident" authentication
+
+   If you get an error about failed ident authentication, make sure
+   you have an ident server installed and running.

Modified: mgmt/cumin/python/cumin/__init__.py
===================================================================
--- mgmt/cumin/python/cumin/__init__.py	2007-11-19 05:46:53 UTC (rev 1333)
+++ mgmt/cumin/python/cumin/__init__.py	2007-11-19 15:10:13 UTC (rev 1334)
@@ -37,7 +37,7 @@
             sys = System.get(1)
         except SQLObjectNotFound:
             sys = System()
-            sys.set(id=0, idOriginal=0)
+            sys.set(sysId=0, idOriginal=0)
 
         self.model.sys = sys
 

Modified: mgmt/cumin/python/cumin/broker.py
===================================================================
--- mgmt/cumin/python/cumin/broker.py	2007-11-19 05:46:53 UTC (rev 1333)
+++ mgmt/cumin/python/cumin/broker.py	2007-11-19 15:10:13 UTC (rev 1334)
@@ -561,7 +561,29 @@
         groups = self.groups.get(session)
 
         for name, addr, group in zip(names, addrs, groups):
-            broker = mint.Broker()
-            broker.set(
+            pass
+            #broker = mint.Broker()
 
         self.process_cancel(session, model)
+
+class BrokerRemove(CuminConfirmForm):
+    def get_title(self, session, broker):
+        return "Remove Broker '%s'" % broker.port
+
+    def process_cancel(self, session, broker):
+        branch = session.branch()
+        self.page().show_broker(branch, broker).show_view(branch)
+        self.page().set_redirect_url(session, branch.marshal())
+
+    def process_submit(self, session, broker):
+        broker.remove()
+
+        branch = session.branch()
+        self.page().show_view(branch)
+        self.page().set_redirect_url(session, branch.marshal())
+
+    def render_submit_content(self, session, broker):
+        return "Yes, Remove Broker '%s'" % broker.port
+
+    def render_cancel_content(self, session, broker):
+        return "No, Cancel"

Modified: mgmt/cumin/python/cumin/brokercluster.py
===================================================================
--- mgmt/cumin/python/cumin/brokercluster.py	2007-11-19 05:46:53 UTC (rev 1333)
+++ mgmt/cumin/python/cumin/brokercluster.py	2007-11-19 15:10:13 UTC (rev 1334)
@@ -145,3 +145,25 @@
 
     def process_display(self, session, cluster):
         self.cluster_name.set(session, cluster.name)
+
+class BrokerClusterRemove(CuminConfirmForm):
+    def get_title(self, session, cluster):
+        return "Remove Broker Cluster '%s'" % cluster.name
+
+    def process_cancel(self, session, cluster):
+        branch = session.branch()
+        self.page().show_broker_cluster(branch, cluster).show_view(branch)
+        self.page().set_redirect_url(session, branch.marshal())
+
+    def process_submit(self, session, cluster):
+        cluster.remove()
+
+        branch = session.branch()
+        self.page().show_view(branch)
+        self.page().set_redirect_url(session, branch.marshal())
+
+    def render_submit_content(self, session, cluster):
+        return "Yes, Remove Broker Cluster '%s'" % cluster.name
+
+    def render_cancel_content(self, session, cluster):
+        return "No, Cancel"

Modified: mgmt/cumin/python/cumin/brokergroup.py
===================================================================
--- mgmt/cumin/python/cumin/brokergroup.py	2007-11-19 05:46:53 UTC (rev 1333)
+++ mgmt/cumin/python/cumin/brokergroup.py	2007-11-19 15:10:13 UTC (rev 1334)
@@ -153,3 +153,25 @@
 
     def render_item_selected_attr(self, session, group):
         return None
+
+class BrokerGroupRemove(CuminConfirmForm):
+    def get_title(self, session, group):
+        return "Remove Broker Group '%s'" % group.name
+
+    def process_cancel(self, session, group):
+        branch = session.branch()
+        self.page().show_broker_group(branch, group).show_view(branch)
+        self.page().set_redirect_url(session, branch.marshal())
+
+    def process_submit(self, session, group):
+        group.remove()
+
+        branch = session.branch()
+        self.page().show_view(branch)
+        self.page().set_redirect_url(session, branch.marshal())
+
+    def render_submit_content(self, session, group):
+        return "Yes, Remove Broker Group '%s'" % group.name
+
+    def render_cancel_content(self, session, group):
+        return "No, Cancel"

Modified: mgmt/cumin/python/cumin/brokerprofile.py
===================================================================
--- mgmt/cumin/python/cumin/brokerprofile.py	2007-11-19 05:46:53 UTC (rev 1333)
+++ mgmt/cumin/python/cumin/brokerprofile.py	2007-11-19 15:10:13 UTC (rev 1334)
@@ -39,10 +39,14 @@
         self.add_mode(self.edit)
         self.set_edit_mode(self.edit)
 
+        self.remove = BrokerProfileRemove(app, "remove")
+        self.add_mode(self.remove)
+        self.set_remove_mode(self.remove)
+        
     def get_title(self, session, profile):
         return "Broker Profile '%s'" % profile.name
 
-class BrokerProfileView(Widget):
+class BrokerProfileView(CuminView):
     def __init__(self, app, name):
         super(BrokerProfileView, self).__init__(app, name)
 
@@ -58,11 +62,6 @@
     def render_name(self, session, profile):
         return profile.name
 
-    def render_edit_href(self, session, profile):
-        branch = session.branch()
-        self.page().show_broker_profile(branch, profile).show_edit(branch)
-        return branch.marshal()
-
     class ProfileConfigTab(ConfigPropertySet):
         def get_items(self, session, profile):
             return sorted_by(profile.config_property_items())
@@ -142,3 +141,25 @@
 
     def process_display(self, session, profile):
         self.profile_name.set(session, profile.name)
+
+class BrokerProfileRemove(CuminConfirmForm):
+    def get_title(self, session, profile):
+        return "Remove Broker Profile '%s'" % profile.name
+
+    def process_cancel(self, session, profile):
+        branch = session.branch()
+        self.page().show_broker_profile(branch, profile).show_view(branch)
+        self.page().set_redirect_url(session, branch.marshal())
+
+    def process_submit(self, session, profile):
+        profile.remove()
+
+        branch = session.branch()
+        self.page().show_view(branch)
+        self.page().set_redirect_url(session, branch.marshal())
+
+    def render_submit_content(self, session, profile):
+        return "Yes, Remove Broker Profile '%s'" % profile.name
+
+    def render_cancel_content(self, session, profile):
+        return "No, Cancel"

Modified: mgmt/cumin/python/cumin/brokerprofile.strings
===================================================================
--- mgmt/cumin/python/cumin/brokerprofile.strings	2007-11-19 05:46:53 UTC (rev 1333)
+++ mgmt/cumin/python/cumin/brokerprofile.strings	2007-11-19 15:10:13 UTC (rev 1334)
@@ -25,7 +25,7 @@
     <th class="actions" colspan="2">
       <h2>Act on This Profile:</h2>
       <a class="nav" href="{edit_href}">Edit</a>
-      <a href="{href}">Remove</a>
+      <a href="{remove_href}">Remove</a>
     </th>
   </tr>
 </table>

Modified: mgmt/cumin/python/cumin/widgets.py
===================================================================
--- mgmt/cumin/python/cumin/widgets.py	2007-11-19 05:46:53 UTC (rev 1333)
+++ mgmt/cumin/python/cumin/widgets.py	2007-11-19 15:10:13 UTC (rev 1334)
@@ -37,6 +37,12 @@
     def show_edit(self, session):
         return self.show_mode(session, self.__edit_mode)
 
+    def set_remove_mode(self, mode):
+        self.__remove_mode = mode
+
+    def show_remove(self, session):
+        return self.show_mode(session, self.__remove_mode)
+
     def do_process(self, session, object):
         self.page().get_frames(session).append(self)
 
@@ -48,6 +54,17 @@
         self.show_view(branch)
         return branch.marshal()
 
+class CuminView(Widget):
+    def render_edit_href(self, session, object):
+        branch = session.branch()
+        self.parent().show_edit(branch)
+        return branch.marshal()
+
+    def render_remove_href(self, session, object):
+        branch = session.branch()
+        self.parent().show_remove(branch)
+        return branch.marshal()
+
 class CuminForm(Form):
     def __init__(self, app, name):
         super(CuminForm, self).__init__(app, name)

Modified: mgmt/mint/python/mint/schema.py
===================================================================
--- mgmt/mint/python/mint/schema.py	2007-11-19 05:46:53 UTC (rev 1333)
+++ mgmt/mint/python/mint/schema.py	2007-11-19 15:10:13 UTC (rev 1334)
@@ -1,8 +1,8 @@
 from sqlobject import *
 from datetime import datetime
-conn = connectionForURI("postgresql://localhost/")
-sqlhub.processConnection = conn
 
+#conn = connectionForURI("postgresql://localhost/")
+#sqlhub.processConnection = conn
 
 class System(SQLObject):
   idOriginal = BigIntCol(default=None)




More information about the rhmessaging-commits mailing list