[rhmessaging-commits] rhmessaging commits: r2304 - mgmt/trunk/cumin/python/cumin.
rhmessaging-commits at lists.jboss.org
rhmessaging-commits at lists.jboss.org
Thu Aug 14 09:44:04 EDT 2008
Author: eallen
Date: 2008-08-14 09:44:04 -0400 (Thu, 14 Aug 2008)
New Revision: 2304
Modified:
mgmt/trunk/cumin/python/cumin/brokerlink.py
mgmt/trunk/cumin/python/cumin/brokerlink.strings
Log:
Added a state switch to the Add Route page to show Active/All exchanges
Modified: mgmt/trunk/cumin/python/cumin/brokerlink.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/brokerlink.py 2008-08-14 13:43:12 UTC (rev 2303)
+++ mgmt/trunk/cumin/python/cumin/brokerlink.py 2008-08-14 13:44:04 UTC (rev 2304)
@@ -1,4 +1,4 @@
-from cumin.binding import ExchangeKeysField
+from cumin.binding import ExchangeKeysField, ExchangeState
from cumin.exchange import ExchangeInfo
from formats import *
from model import *
@@ -280,6 +280,13 @@
self.exchange_tmpl = Template(self, "exchange_html")
+ self.state = ExchangeState(app, "phase")
+ self.add_child(self.state)
+
+ self.phase = Parameter(app, "phase")
+ self.add_parameter(self.phase)
+ form.add_form_parameter(self.phase)
+
def get(self, session):
return self.exchange_param.get(session)
@@ -304,6 +311,9 @@
def render_checked(self, session, exchange):
return self.exchange_param.get(session) == str(exchange.id) and "checked=\"checked\"" or ""
+ def render_phase_path(self, session, *args):
+ return self.phase.path
+
def render_exchanges(self, session, *args):
#reg = self.frame.frame.frame.get_object(session)
@@ -314,7 +324,8 @@
writer = Writer()
for exchange in sortedExchanges:
- if ExchangeInfo.is_builtin(exchange) or is_active(exchange):
+ if ExchangeInfo.is_builtin(exchange) or \
+ not (self.state.is_active(session) and not is_active(exchange)):
if not exchange.name in ["qpid.management", ""]:
if not self.get(session):
self.exchange_param.set(session, str(exchange.id))
@@ -322,6 +333,11 @@
return writer.to_string()
+ def pre_process(self, session, *args):
+ phase = self.phase.get(session)
+ if phase:
+ self.state.set(session, phase)
+
class BridgeAdd(CuminFieldForm):
def __init__(self, app, name):
super(BridgeAdd, self).__init__(app, name)
@@ -349,7 +365,10 @@
def render_title(self, session, link):
return "Add Route to '%s:%d'" % (link.host, link.port)
-
+
+ def pre_process(self, session, *args):
+ self.__exchange.pre_process(session, *args)
+
def process_cancel(self, session, *args):
self.__key.set(session, "")
self.__tag.set(session, "")
Modified: mgmt/trunk/cumin/python/cumin/brokerlink.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/brokerlink.strings 2008-08-14 13:43:12 UTC (rev 2303)
+++ mgmt/trunk/cumin/python/cumin/brokerlink.strings 2008-08-14 13:44:04 UTC (rev 2304)
@@ -131,6 +131,7 @@
<div class="head">{title}</div>
<div class="body">
<div class="field multiple">
+ <div class="rfloat">{phase}</div>
<div class="title">Source Broker</div>
<div class="inputs"><div class="input_prompt">Address</div><input type="text" name="{broker_name_path}" value="{broker_name_value}" tabindex="100" size="32"/>{broker_name_error}</div>
<div class="optional">
@@ -144,7 +145,6 @@
</div>
{fields}
</div>
- {form_error}
<div class="foot">
{help}
{submit}
@@ -163,6 +163,7 @@
</div>
[ExchangeRadioField.html]
+ <div class="rfloat">{phase}</div> <input id="phase_state" type="hidden" name="{phase_path}" value="" />
<span class="legend">Choose an Exchange</span>
<fieldset>
{exchanges}
More information about the rhmessaging-commits
mailing list