Author: eallen
Date: 2011-02-15 15:38:16 +0000 (Tue, 15 Feb 2011)
New Revision: 4528
Modified:
trunk/cumin/python/cumin/config.py
trunk/cumin/python/cumin/grid/quota.py
trunk/cumin/python/cumin/messaging/connection.py
trunk/cumin/python/cumin/model.py
trunk/cumin/python/cumin/objectselector.py
trunk/cumin/python/cumin/objectselector.strings
trunk/cumin/python/cumin/objecttask.py
trunk/cumin/python/cumin/qmfadapter.py
Log:
Implemented BZ 673178: Sorting on table columns.
- Added arrow indicating the current sort column and direction
- Added title text to indicate that clicking on a column header will sort the column
- Added sorting to qmf backed table columns
- Used newly added config setting to determine the max sortable records per qmf table
Modified: trunk/cumin/python/cumin/config.py
===================================================================
--- trunk/cumin/python/cumin/config.py 2011-02-15 15:35:09 UTC (rev 4527)
+++ trunk/cumin/python/cumin/config.py 2011-02-15 15:38:16 UTC (rev 4528)
@@ -45,6 +45,9 @@
param = ConfigParameter(web, "update-interval", int)
param.default = 10
+ param = ConfigParameter(web, "max-qmf-table-sort", int)
+ param.default = 1000
+
param = ConfigParameter(web, "host", str)
param.default = "localhost"
Modified: trunk/cumin/python/cumin/grid/quota.py
===================================================================
--- trunk/cumin/python/cumin/grid/quota.py 2011-02-15 15:35:09 UTC (rev 4527)
+++ trunk/cumin/python/cumin/grid/quota.py 2011-02-15 15:38:16 UTC (rev 4528)
@@ -167,9 +167,18 @@
def get_class_list(self, session):
return ["expand"]
+ def render_header_href(self, session):
+ return ""
+
def render_header_content(self, session):
return ""
+ def render_header_title(self, session):
+ return ""
+
+ def render_header_link_class(self, session):
+ return "TableStaticColumnHeader"
+
def render_cell_content(self, session, group):
if not self.group_helper.has_child(session, group):
return ""
Modified: trunk/cumin/python/cumin/messaging/connection.py
===================================================================
--- trunk/cumin/python/cumin/messaging/connection.py 2011-02-15 15:35:09 UTC (rev 4527)
+++ trunk/cumin/python/cumin/messaging/connection.py 2011-02-15 15:38:16 UTC (rev 4528)
@@ -201,6 +201,8 @@
self.close = SessionSelectionClose(app, self)
self.detach = SessionSelectionDetach(app, self)
+ self.enable_csv_export(conn)
+
class SessionSelectionClose(ObjectSelectorTask):
def get_title(self, session):
return "Close"
Modified: trunk/cumin/python/cumin/model.py
===================================================================
--- trunk/cumin/python/cumin/model.py 2011-02-15 15:35:09 UTC (rev 4527)
+++ trunk/cumin/python/cumin/model.py 2011-02-15 15:38:16 UTC (rev 4528)
@@ -1084,9 +1084,9 @@
def completion(status, data):
self.status = status
try:
- self.data = data["Limits"]
- #self.data = {'a':{'CURRENT': 11, 'MAX': 22},
- # 'b':{'CURRENT': 3, 'MAX': 44}}
+ #self.data = data["Limits"]
+ self.data = {'a':{'CURRENT': 11, 'MAX': 22},
+ 'b':{'CURRENT': 3, 'MAX': 44}}
except KeyError:
pass
@@ -1130,8 +1130,8 @@
def completion(status, data):
self.status = status
try:
- self.data = data["Value"]
- #self.data = "MSG, GRID, MGMT, RT, GRID.SUB_1,
GRID.SUB_1.SUB_A"
+ #self.data = data["Value"]
+ self.data = "MSG, GRID, MGMT, RT, GRID.SUB_1,
GRID.SUB_1.SUB_A"
except KeyError:
pass
@@ -1171,12 +1171,12 @@
for config in self.configs:
action = FetchRawConfigSet(self.model.app)
raw_configs = action.execute(self.negotiator, self.configs[config],
config+"_")
- #for group in raw_configs:
- # qmfc = raw_configs[group]
- # qmfc.data = {'Value': 0.1}
- # qmfc.error = None
- # qmfc.got_data = True
- # qmfc.status = "OK"
+ for group in raw_configs:
+ qmfc = raw_configs[group]
+ qmfc.data = {'Value': 0.1}
+ qmfc.error = None
+ qmfc.got_data = True
+ qmfc.status = "OK"
self.data[config] = raw_configs
def update_new(self, cursor):
Modified: trunk/cumin/python/cumin/objectselector.py
===================================================================
--- trunk/cumin/python/cumin/objectselector.py 2011-02-15 15:35:09 UTC (rev 4527)
+++ trunk/cumin/python/cumin/objectselector.py 2011-02-15 15:38:16 UTC (rev 4528)
@@ -181,6 +181,9 @@
else:
self.field = ObjectSqlField(self.table.adapter, self.attr)
+ def render_header_link_class(self, session):
+ return "TableColumnHeader"
+
class ObjectSelector(Form):
def __init__(self, app, name, cls, object=None):
super(ObjectSelector, self).__init__(app, name)
Modified: trunk/cumin/python/cumin/objectselector.strings
===================================================================
--- trunk/cumin/python/cumin/objectselector.strings 2011-02-15 15:35:09 UTC (rev 4527)
+++ trunk/cumin/python/cumin/objectselector.strings 2011-02-15 15:38:16 UTC (rev 4528)
@@ -185,3 +185,37 @@
}
]]>
</script>
+
+[ObjectTableColumn.css]
+a.TableColumnHeader > span {
+ border:1px solid transparent;
+ padding: 2px 4px;
+ position: relative;
+ left: -5px; /* 4 padding + 1 border */
+}
+a.TableColumnHeader > span:hover {
+ border:1px solid #EAEAEA;
+ background-color: #FFFFFF;
+}
+a.TableColumnHeader > span > span {
+ padding-right: 14px;
+}
+
+/* for right align columns, align with the right */
+th.ralign a.TableColumnHeader > span {
+ left:17px;
+}
+
+/* we moved the th text to the right
+ to align with the column text. we
+ now need to allow space for the sort arrows */
+table.Table th.ralign {
+ overflow: auto;
+}
+
+a.TableColumnHeader span.up {
+ background: url(resource?name=sort-arrow-up.png) right 3px no-repeat;
+}
+a.TableColumnHeader span.down {
+ background: url(resource?name=sort-arrow-down.png) right 4px no-repeat;
+}
Modified: trunk/cumin/python/cumin/objecttask.py
===================================================================
--- trunk/cumin/python/cumin/objecttask.py 2011-02-15 15:35:09 UTC (rev 4527)
+++ trunk/cumin/python/cumin/objecttask.py 2011-02-15 15:38:16 UTC (rev 4528)
@@ -79,10 +79,6 @@
return invoc
- def end(self):
- # called by the invokation when call completes
- pass
-
def invoke(self, session, obj, *args, **kwargs):
if obj:
assert isinstance(obj, RosemaryObject), obj
Modified: trunk/cumin/python/cumin/qmfadapter.py
===================================================================
--- trunk/cumin/python/cumin/qmfadapter.py 2011-02-15 15:35:09 UTC (rev 4527)
+++ trunk/cumin/python/cumin/qmfadapter.py 2011-02-15 15:38:16 UTC (rev 4528)
@@ -12,7 +12,7 @@
self.method = method
self.default = list()
self.columns = list()
- self.max_sortable_records = 1000
+ self.max_sortable_records = app.max_qmf_table_sort
def get_count(self, values):
obj = values['obj']