rhmessaging commits: r3613 - store/trunk/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb.
by rhmessaging-commits@lists.jboss.org
Author: ritchiem
Date: 2009-09-02 10:03:11 -0400 (Wed, 02 Sep 2009)
New Revision: 3613
Modified:
store/trunk/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStore.java
Log:
Update to Logging to ensure that recovered empty queues receive the required MST-1005 log entry
Modified: store/trunk/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStore.java
===================================================================
--- store/trunk/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStore.java 2009-09-01 21:49:25 UTC (rev 3612)
+++ store/trunk/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStore.java 2009-09-02 14:03:11 UTC (rev 3613)
@@ -130,6 +130,8 @@
private QueueTupleBindingFactory _queueTupleBindingFactory;
private BindingTupleBindingFactory _bindingTupleBindingFactory;
+ Map<AMQShortString, Integer> _queueRecoveries = new TreeMap<AMQShortString, Integer>();
+
/** The data version this store should run with */
private int _version;
private enum State
@@ -1240,6 +1242,8 @@
for (AMQQueue q : queues.values())
{
CurrentActor.get().message(_logSubject,MessageStoreMessages.MST_1004(String.valueOf(q.getName()), true));
+ //Record that we have a queue for recovery
+ _queueRecoveries.put(q.getName(), 0);
q.configure(virtualHost.getConfiguration().getQueueConfiguration(q.getName().asString()));
@@ -1623,7 +1627,6 @@
Map<Long, AMQMessage> msgMap = new HashMap<Long, AMQMessage>();
List<ProcessAction> actions = new ArrayList<ProcessAction>();
- Map<AMQShortString, Integer> queueRecoveries = new TreeMap<AMQShortString, Integer>();
Cursor cursor = null;
try
@@ -1674,13 +1677,13 @@
_log.debug("On recovery, delivering Message ID:" + message.getMessageId() + " to " + queue.getName());
}
- Integer count = queueRecoveries.get(queueName);
+ Integer count = _queueRecoveries.get(queueName);
if (count == null)
{
count = 0;
}
- queueRecoveries.put(queueName, ++count);
+ _queueRecoveries.put(queueName, ++count);
actions.add(new ProcessAction(queue, context, message));
@@ -1713,15 +1716,18 @@
if (_log.isInfoEnabled())
{
- _log.info("Recovered message counts: " + queueRecoveries);
+ _log.info("Recovered message counts: " + _queueRecoveries);
}
- for(Map.Entry<AMQShortString,Integer> entry : queueRecoveries.entrySet())
+ for(Map.Entry<AMQShortString,Integer> entry : _queueRecoveries.entrySet())
{
CurrentActor.get().message(_logSubject, MessageStoreMessages.MST_1005(entry.getValue(), String.valueOf(entry.getKey())));
CurrentActor.get().message(_logSubject, MessageStoreMessages.MST_1006(String.valueOf(entry.getKey()), true));
}
+
+ //Free the memory
+ _queueRecoveries = null;
}
QueueRegistry getQueueRegistry()
15 years, 3 months
rhmessaging commits: r3612 - in mgmt/trunk/cumin/python/cumin: grid and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2009-09-01 17:49:25 -0400 (Tue, 01 Sep 2009)
New Revision: 3612
Modified:
mgmt/trunk/cumin/python/cumin/grid/submission.py
mgmt/trunk/cumin/python/cumin/widgets.strings
Log:
Truncate the submitter column, and fix some truncation css
Modified: mgmt/trunk/cumin/python/cumin/grid/submission.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/grid/submission.py 2009-09-01 21:25:28 UTC (rev 3611)
+++ mgmt/trunk/cumin/python/cumin/grid/submission.py 2009-09-01 21:49:25 UTC (rev 3612)
@@ -64,7 +64,7 @@
(session, data["scheduler_id"])
return fmt_link(href, data["scheduler_name"])
- class SubmitterColumn(SqlTableColumn):
+ class SubmitterColumn(ClientTruncateColumn):
def render_title(self, session, data):
return "Submitter"
Modified: mgmt/trunk/cumin/python/cumin/widgets.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/widgets.strings 2009-09-01 21:25:28 UTC (rev 3611)
+++ mgmt/trunk/cumin/python/cumin/widgets.strings 2009-09-01 21:49:25 UTC (rev 3612)
@@ -494,7 +494,7 @@
min-width: 600px;
}
-table.truncate td.truncate {
+div.truncate > table td.truncate {
white-space: nowrap;
overflow: hidden;
}
15 years, 3 months
rhmessaging commits: r3611 - in mgmt/trunk/cumin/python/cumin: grid and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2009-09-01 17:25:28 -0400 (Tue, 01 Sep 2009)
New Revision: 3611
Modified:
mgmt/trunk/cumin/python/cumin/grid/submission.py
mgmt/trunk/cumin/python/cumin/widgets.py
mgmt/trunk/cumin/python/cumin/widgets.strings
Log:
* Restore column truncation, though there's still a rendering problem
* Put "links" on CuminTable, for adding navigation buttons
* Make submission set an ordinary CuminTable, since it has no
selection actions
* Make the links widget set not render at all if there are no links
associated with it
Modified: mgmt/trunk/cumin/python/cumin/grid/submission.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/grid/submission.py 2009-09-01 18:28:36 UTC (rev 3610)
+++ mgmt/trunk/cumin/python/cumin/grid/submission.py 2009-09-01 21:25:28 UTC (rev 3611)
@@ -9,10 +9,9 @@
strings = StringCatalog(__file__)
log = logging.getLogger("cumin.grid.submission")
-class SubmissionSet(CuminSelectionTable):
+class SubmissionSet(CuminTable):
def __init__(self, app, name):
- item = SubmissionParameter(app, "item")
- super(SubmissionSet, self).__init__(app, name, item)
+ super(SubmissionSet, self).__init__(app, name)
col = self.NameColumn(app, "name")
self.add_column(col)
Modified: mgmt/trunk/cumin/python/cumin/widgets.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/widgets.py 2009-09-01 18:28:36 UTC (rev 3610)
+++ mgmt/trunk/cumin/python/cumin/widgets.py 2009-09-01 21:25:28 UTC (rev 3611)
@@ -745,11 +745,20 @@
def __init__(self, app, name):
super(CuminTable, self).__init__(app, name)
+ self.update_enabled = True
+
self.paginator = Paginator(app, "page")
self.add_child(self.paginator)
- self.update_enabled = True
+ self.links = self.Links(app, "links")
+ self.links.html_class = "actions" # XXX fix this
+ self.add_child(self.links)
+ class Links(WidgetSet):
+ def do_render(self, session):
+ if len(self.children):
+ return super(CuminTable.Links, self).do_render(session)
+
def get_connection(self, session):
return self.app.model.get_sql_connection()
@@ -814,10 +823,6 @@
self.buttons.html_class = "buttons"
self.add_child(self.buttons)
- self.links = WidgetSet(app, "links")
- self.links.html_class = "actions" # XXX fix this
- self.add_child(self.links)
-
class CuminQMFSelectionTable(CuminSelectionTable):
def filter_item(self, session, item):
return True
Modified: mgmt/trunk/cumin/python/cumin/widgets.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/widgets.strings 2009-09-01 18:28:36 UTC (rev 3610)
+++ mgmt/trunk/cumin/python/cumin/widgets.strings 2009-09-01 21:25:28 UTC (rev 3611)
@@ -485,11 +485,11 @@
clear: both;
}
-table.CuminTable td {
+div.CuminTable > table td {
text-overflow:ellipsis;
}
-table.truncate {
+div.truncate > table {
table-layout: fixed;
min-width: 600px;
}
@@ -503,21 +503,27 @@
wooly.addPageUpdateListener(cumin.restoreTableCheckboxes);
[CuminTable.html]
-<table id="{id}" class="CuminTable mobjects {extra_class}">
- <thead>
- <tr>
- <th class="setnav" colspan="{column_count}">
- <div class="rfloat">{page}</div>
- {count}
- </th>
- </tr>
- <tr>{headers}</tr>
- </thead>
- <tbody>{items}</tbody>
-</table>
+<div id="{id}" class="CuminTable {extra_class}">
+ {links}
+ <table class="mobjects">
+ <thead>
+ <tr>
+ <th class="setnav" colspan="{column_count}">
+ <div class="rfloat">{page}</div>
+ {count}
+ </th>
+ </tr>
+ <tr>{headers}</tr>
+ </thead>
+ <tbody>{items}</tbody>
+ </table>
+</div>
+
[CuminTableWithControls.html]
<div id="{id}" class="CuminTable {extra_class}">
+ {links}
+
{filters}
{switches}
15 years, 3 months
rhmessaging commits: r3610 - mgmt/trunk/cumin/python/cumin/grid.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2009-09-01 14:28:36 -0400 (Tue, 01 Sep 2009)
New Revision: 3610
Modified:
mgmt/trunk/cumin/python/cumin/grid/main.py
mgmt/trunk/cumin/python/cumin/grid/pool.py
mgmt/trunk/cumin/python/cumin/grid/pool.strings
Log:
Revamp the pool set query in light of the one-collector-per-pool rule, and add pool stat columns; remove some unused classes
Modified: mgmt/trunk/cumin/python/cumin/grid/main.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/grid/main.py 2009-09-01 17:50:19 UTC (rev 3609)
+++ mgmt/trunk/cumin/python/cumin/grid/main.py 2009-09-01 18:28:36 UTC (rev 3610)
@@ -88,9 +88,12 @@
heading = self.Heading(app, "heading")
self.add_child(heading)
- pools = PoolSet(app, "pools")
- self.add_child(pools)
+ self.tabs = TabbedModeSet(app, "tabs")
+ self.add_child(self.tabs)
+ self.pools = PoolSet(app, "pools")
+ self.tabs.add_tab(self.pools)
+
class Heading(CuminHeading):
def render_title(self, session):
return "Grid"
Modified: mgmt/trunk/cumin/python/cumin/grid/pool.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/grid/pool.py 2009-09-01 17:50:19 UTC (rev 3609)
+++ mgmt/trunk/cumin/python/cumin/grid/pool.py 2009-09-01 18:28:36 UTC (rev 3610)
@@ -36,14 +36,15 @@
col = self.NameColumn(app, "name")
self.add_column(col)
- self.set_default_column(col)
-
- col = self.JobsColumn(app, "jobs")
+ col = self.JobsRunningColumn(app, "running_jobs")
self.add_column(col)
- col = self.StatusColumn(app, "status")
+ col = self.JobsIdleColumn(app, "idle_jobs")
self.add_column(col)
+ col = self.SlotsColumn(app, "slots")
+ self.add_column(col)
+
def render_title(self, session):
count = self.get_item_count(session)
return "Pools %s" % fmt_count(count)
@@ -59,20 +60,18 @@
return fmt_link(href, data["name"])
- class JobsColumn(SqlTableColumn):
+ class JobsRunningColumn(SqlTableColumn):
def render_title(self, session, data):
- return "Jobs"
+ return "Running Jobs"
- def render_content(self, session, data):
- return data["jobs"]
+ class JobsIdleColumn(SqlTableColumn):
+ def render_title(self, session, data):
+ return "Idle Jobs"
- class StatusColumn(SqlTableColumn):
+ class SlotsColumn(SqlTableColumn):
def render_title(self, session, data):
- return "Status"
+ return "Slots"
- def render_content(self, session, data):
- return "Active"
-
class PoolFrame(CuminFrame):
def __init__(self, app, name):
super(PoolFrame, self).__init__(app, name)
@@ -89,10 +88,6 @@
self.job = JobFrame(app, "job")
self.add_mode(self.job)
- # XXX
- #self.job_group = JobGroupFrame(app, "jobgroup", self.object)
- #self.add_mode(self.job_group)
-
self.slot = SlotFrame(app, "slot")
self.add_mode(self.slot)
@@ -345,16 +340,6 @@
if grid:
return super(GridStats.GridStatSet, self).do_render(session)
-class PoolJobStats(CuminTable):
- def render_sql_where(self, session, pool):
- elems = list()
- elems.append("s.pool = %(pool)s")
- return "where %s" % " and ".join(elems)
-
- def get_sql_values(self, session, pool):
- values = {"pool": pool.id}
- return values
-
class PoolSlotMap(SlotMap):
def __init__(self, app, name, pool):
super(PoolSlotMap, self).__init__(app, name)
Modified: mgmt/trunk/cumin/python/cumin/grid/pool.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/grid/pool.strings 2009-09-01 17:50:19 UTC (rev 3609)
+++ mgmt/trunk/cumin/python/cumin/grid/pool.strings 2009-09-01 18:28:36 UTC (rev 3610)
@@ -1,38 +1,19 @@
[PoolSet.sql]
-select p.pool as id, p.name, j.jobs
-from
- (select pool, name
- from collector
- group by pool, name) as p
-left outer join
- (select s.pool, count(*) as jobs
- from job j
- left outer join scheduler as s on j.scheduler_id = s.id
- group by s.pool) as j
- on j.pool = p.pool
+select
+ p.pool as id,
+ p.name,
+ c.running_jobs,
+ c.idle_jobs,
+ c.hosts_total as slots
+from collector as p
+left outer join collector_stats as c on c.id = p.stats_curr_id
+{sql_where}
[PoolSet.count_sql]
select count(*)
-from
- (select 1 from collector group by pool) as l
-
-[PoolJobStats.sql]
-select
- sum(case when job_status=2 then 1 else 0 end) as running,
- sum(case when job_status=4 then 1 else 0 end) as completed,
- sum(case when job_status=5 then 1 else 0 end) as held,
- sum(case when job_status=1 and j.qmf_delete_time is null then 1 else 0 end) as idle,
- sum(case when job_status=3 or (job_status=1 and j.qmf_delete_time is not null) then 1 else 0 end) as removed,
- sum(1) as total,
- s.pool
-from job as j
-left outer join scheduler as s on s.id = j.scheduler_id
+from collector as p
{sql_where}
-group by s.pool
-[PoolJobStats.count_sql]
-1
-
[PoolOverview.css]
div#PoolOverview div.col1, div#PoolOverview div.col2 {
float: left;
15 years, 3 months
rhmessaging commits: r3609 - in mgmt/trunk/cumin/python/cumin: messaging and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2009-09-01 13:50:19 -0400 (Tue, 01 Sep 2009)
New Revision: 3609
Modified:
mgmt/trunk/cumin/python/cumin/messaging/broker.py
mgmt/trunk/cumin/python/cumin/messaging/queue.py
mgmt/trunk/cumin/python/cumin/parameters.py
Log:
Repair the broker summary view; remove some unnecessary classes
Modified: mgmt/trunk/cumin/python/cumin/messaging/broker.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/messaging/broker.py 2009-09-01 15:30:49 UTC (rev 3608)
+++ mgmt/trunk/cumin/python/cumin/messaging/broker.py 2009-09-01 17:50:19 UTC (rev 3609)
@@ -122,10 +122,7 @@
self.object = BrokerParameter(app, "id")
self.add_parameter(self.object)
- self.vhost = self.VhostAttribute(app, "vhost")
- self.add_attribute(self.vhost)
-
- self.view = BrokerView(app, "view", self.vhost)
+ self.view = BrokerView(app, "view", self.object)
self.add_mode(self.view)
self.queue = QueueFrame(app, "queue")
@@ -140,99 +137,60 @@
self.link = LinkFrame(app, "link")
self.add_mode(self.link)
- class VhostAttribute(Attribute):
- def get_default(self, session):
- broker = self.widget.object.get(session)
-
- for vhost in Vhost.selectBy(broker=broker, name="/"):
- return vhost
-
class BrokerView(CuminView):
- def __init__(self, app, name, vhost):
- super(BrokerView, self).__init__(app, name, vhost)
+ def __init__(self, app, name, broker):
+ super(BrokerView, self).__init__(app, name, broker)
- tabs = TabbedModeSet(app, "tabs")
- self.add_child(tabs)
+ self.vhost = BrokerVhostAttribute(app, "vhost", broker)
+ self.add_attribute(self.vhost)
- #tabs.add_tab(BrokerStats(app, "stats"))
- tabs.add_tab(self.BrokerQueueTab(app, "queues", vhost))
- tabs.add_tab(ExchangeSet(app, "exchanges", vhost))
- tabs.add_tab(ConnectionSet(app, "conns", vhost))
- tabs.add_tab(LinkSet(app, "links", vhost))
- tabs.add_tab(BrokerAccessControl(app, "access", vhost))
- tabs.add_tab(BrokerClustering(app, "cluster", vhost))
- tabs.add_tab(self.BrokerDetailsTab(app, "details", vhost))
+ self.tabs = TabbedModeSet(app, "tabs")
+ self.add_child(self.tabs)
- def render_group_links(self, session, object):
- return "XXX"
+ self.tabs.add_tab(QueueSet(app, "queues", self.vhost))
+ self.tabs.add_tab(ExchangeSet(app, "exchanges", self.vhost))
+ self.tabs.add_tab(ConnectionSet(app, "conns", self.vhost))
+ self.tabs.add_tab(LinkSet(app, "links", self.vhost))
+ self.tabs.add_tab(BrokerAccessControl(app, "access", self.vhost))
+ self.tabs.add_tab(BrokerClustering(app, "cluster", self.vhost))
+ self.tabs.add_tab(BrokerDetails(app, "details", self.vhost))
- links = list()
+class BrokerDetails(Widget):
+ def __init__(self, app, name, vhost):
+ super(BrokerDetails, self).__init__(app, name)
- for group in reg.groups:
- branch = session.branch()
- self.frame.frame.show_broker_group(branch, group).view.show \
- (branch)
- links.append(fmt_olink(branch, group))
+ props = self.Properties(app, "properties", vhost)
+ self.add_child(props)
- return ", ".join(links)
+ tasks = self.Tasks(app, "tasks", vhost)
+ self.add_child(tasks)
- # XXX see if we can't get rid of this
- class BrokerQueueTab(Widget):
- def __init__(self, app, name, vhost):
- super(BrokerView.BrokerQueueTab, self).__init__(app, name)
+ def render_title(self, session):
+ return "Details"
- self.__queues = QueueSet(app, "items", vhost)
- self.add_child(self.__queues)
+ class Properties(CuminProperties):
+ def do_get_items(self, session):
+ broker = self.object.get(session).broker
+ cls = self.app.model.get_class_by_object(broker)
- def render_title(self, session):
- vhost = self.frame.vhost.get(session)
- return "Queues %s" % fmt_count(vhost.queues.count())
+ props = [(x.get_title(session), x.value(session, broker))
+ for x in cls.properties]
- def render_add_queue_href(self, session):
- branch = session.branch()
- self.frame.queue.add.show(branch, None)
- return branch.marshal()
+ return props
- class BrokerLogTab(Widget):
- def render_title(self, session):
- return "Log Messages"
+ class Tasks(CuminTasks):
+ def do_get_items(self, session):
+ broker = self.object.get(session).broker
+ cls = self.app.model.get_class_by_object(broker)
- class BrokerDetailsTab(Widget):
- def __init__(self, app, name, vhost):
- super(BrokerView.BrokerDetailsTab, self).__init__(app, name)
+ tasks = [(x.get_href(session, broker),
+ x.get_title(session),
+ x.get_enabled(session, broker))
+ for x in cls.actions # XXX can't be right
+ if x.navigable and not x.aggregate]
- props = self.Properties(app, "properties", vhost)
- self.add_child(props)
+ return tasks
- tasks = self.Tasks(app, "tasks", vhost)
- self.add_child(tasks)
-
- def render_title(self, session):
- return "Details"
-
- class Properties(CuminProperties):
- def do_get_items(self, session):
- broker = self.object.get(session).broker
- cls = self.app.model.get_class_by_object(broker)
-
- props = [(x.get_title(session), x.value(session, broker))
- for x in cls.properties]
-
- return props
-
- class Tasks(CuminTasks):
- def do_get_items(self, session):
- broker = self.object.get(session).broker
- cls = self.app.model.get_class_by_object(broker)
-
- tasks = [(x.get_href(session, broker),
- x.get_title(session),
- x.get_enabled(session, broker))
- for x in cls.actions
- if x.navigable and not x.aggregate]
-
- return tasks
-
class ModuleNotEnabled(Widget):
def do_render(self, session):
return "This module is not enabled"
@@ -317,13 +275,6 @@
stats = StatSet(app, "stats", cluster, "general")
self.add_child(stats)
-class BrokerStats(Widget):
- def __init__(self, app, name):
- super(BrokerStats, self).__init__(app, name)
-
- def render_title(self, session):
- return "Statistics"
-
class BrokerBrowser(Widget):
def __init__(self, app, name):
super(BrokerBrowser, self).__init__(app, name)
Modified: mgmt/trunk/cumin/python/cumin/messaging/queue.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/messaging/queue.py 2009-09-01 15:30:49 UTC (rev 3608)
+++ mgmt/trunk/cumin/python/cumin/messaging/queue.py 2009-09-01 17:50:19 UTC (rev 3609)
@@ -71,7 +71,8 @@
self.buttons.add_child(button)
def render_title(self, session):
- return "Queues %s" % fmt_count(Queue.select().count())
+ vhost = self.vhost.get(session)
+ return "Queues %s" % fmt_count(vhost.queues.count())
def render_sql_where(self, session):
vhost = self.vhost.get(session)
Modified: mgmt/trunk/cumin/python/cumin/parameters.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/parameters.py 2009-09-01 15:30:49 UTC (rev 3608)
+++ mgmt/trunk/cumin/python/cumin/parameters.py 2009-09-01 17:50:19 UTC (rev 3609)
@@ -4,6 +4,16 @@
from model import Pool
from model import Job
+class ObjectAssociateAttribute(Attribute):
+ def __init__(self, app, name, object):
+ super(ObjectAssociateAttribute, self).__init__(app, name)
+
+ self.object = object
+
+ def get(self, session):
+ obj = self.object.get(session)
+ return self.get_associate(session, obj)
+
class CuminObjectParameter(Parameter):
def __init__(self, app, name, cumin_class):
self.cumin_class = cumin_class
@@ -50,6 +60,11 @@
def do_marshal(self, broker):
return str(broker.id)
+class BrokerVhostAttribute(ObjectAssociateAttribute):
+ def get_associate(self, session, broker):
+ for vhost in Vhost.selectBy(broker=broker, name="/"):
+ return vhost
+
class BrokerRegistrationParameter(Parameter):
def do_unmarshal(self, string):
return BrokerRegistration.get(int(string))
@@ -115,25 +130,15 @@
def do_marshal(self, pool):
return str(pool.id)
-class PoolAssociateAttribute(Attribute):
- def __init__(self, app, name, pool):
- super(PoolAssociateAttribute, self).__init__(app, name)
-
- self.pool = pool
-
- def get(self, session):
- pool = self.pool.get(session)
- return self.get_associate(session, pool)
-
-class PoolCollectorAttribute(PoolAssociateAttribute):
+class PoolCollectorAttribute(ObjectAssociateAttribute):
def get_associate(self, session, pool):
return pool.get_collector()
-class PoolGridAttribute(PoolAssociateAttribute):
+class PoolGridAttribute(ObjectAssociateAttribute):
def get_associate(self, session, pool):
return pool.get_grid()
-class PoolNegotiatorAttribute(PoolAssociateAttribute):
+class PoolNegotiatorAttribute(ObjectAssociateAttribute):
def get_associate(self, session, pool):
return pool.get_negotiator()
15 years, 3 months
rhmessaging commits: r3608 - mgmt/trunk/cumin/python/cumin/account.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2009-09-01 11:30:49 -0400 (Tue, 01 Sep 2009)
New Revision: 3608
Modified:
mgmt/trunk/cumin/python/cumin/account/widgets.py
mgmt/trunk/cumin/python/cumin/account/widgets.strings
Log:
Restore the appearance of the login form
Modified: mgmt/trunk/cumin/python/cumin/account/widgets.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/account/widgets.py 2009-08-31 21:01:53 UTC (rev 3607)
+++ mgmt/trunk/cumin/python/cumin/account/widgets.py 2009-09-01 15:30:49 UTC (rev 3608)
@@ -141,27 +141,24 @@
def __init__(self, app, name):
super(LoginForm, self).__init__(app, name)
- self.__login_invalid = Attribute(app, "login_invalid")
- self.add_attribute(self.__login_invalid)
+ self.login_invalid = Attribute(app, "login_invalid")
+ self.add_attribute(self.login_invalid)
- self.fields = FormFieldSet(app, "fields")
- self.add_child(self.fields)
+ self.user_name = StringInput(app, "user_name")
+ self.user_name.size = 20
+ self.add_child(self.user_name)
- self.__name = self.Name(app, "name")
- self.fields.add_field(self.__name)
- self.__name.input.size = 20
+ self.password = PasswordInput(app, "password")
+ self.password.size = 20
+ self.add_child(self.password)
- self.__password = self.Password(app, "password")
- self.fields.add_field(self.__password)
- self.__password.input.size = 20
+ self.submit = self.Submit(app, "submit")
+ self.add_child(self.submit)
- self.__submit = self.Submit(app, "submit")
- self.add_child(self.__submit)
-
def do_process(self, session):
- if self.__submit.get(session):
- name = self.__name.get(session)
- password = self.__password.get(session)
+ if self.submit.get(session):
+ name = self.user_name.get(session)
+ password = self.password.get(session)
self.check(session)
@@ -169,7 +166,7 @@
try:
user = Subject.selectBy(name=name)[0]
except IndexError:
- self.__login_invalid.set(session, True)
+ self.login_invalid.set(session, True)
return
crypted = user.password
@@ -184,7 +181,7 @@
self.page.set_redirect_url(session, url)
else:
- self.__login_invalid.set(session, True)
+ self.login_invalid.set(session, True)
def render_operator_link(self, session):
email = self.app.config.operator_email
@@ -195,17 +192,9 @@
return "site operator"
def render_login_invalid(self, session):
- if self.__login_invalid.get(session):
+ if self.login_invalid.get(session):
return self.get_string("login_invalid")
- class Name(StringField):
- def render_title(self, session):
- return "User Name"
-
- class Password(PasswordField):
- def render_title(self, session):
- return "Password"
-
class Submit(FormButton):
def render_content(self, session):
return "Submit"
Modified: mgmt/trunk/cumin/python/cumin/account/widgets.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/account/widgets.strings 2009-08-31 21:01:53 UTC (rev 3607)
+++ mgmt/trunk/cumin/python/cumin/account/widgets.strings 2009-09-01 15:30:49 UTC (rev 3608)
@@ -24,6 +24,10 @@
margin: 0 0.25em 0 0;
}
+form.LoginForm h2 {
+ font-size: 0.9em;
+}
+
form.LoginForm input {
width: 12em;
}
@@ -51,8 +55,14 @@
{login_invalid}
- {fields}
+ <h2>User Name</h2>
+ <div class="iblock">{user_name}</div>
+
+ <h2>Password</h2>
+
+ <div class="iblock">{password}</div>
+
<div class="buttons">{submit}</div>
<div>{hidden_inputs}</div>
@@ -60,7 +70,6 @@
<script type="text/javascript">
$("{id}").elements[0].focus();
-
</script>
[LoginForm.login_invalid]
15 years, 3 months