]>
git.argeo.org Git - gpl/argeo-slc.git/blob - org.argeo.slc.webapp/src/main/webapp/argeo-ria-lib/slc/class/org/argeo/slc/ria/SlcExecLoggerApplet.js
2 * A simple Hello World applet for documentation purpose.
3 * The only associated command is the "Close" command.
5 qx
.Class
.define("org.argeo.slc.ria.SlcExecLoggerApplet",
7 extend
: qx
.ui
.container
.Composite
,
8 implement
: [org
.argeo
.ria
.components
.IView
],
10 construct : function(){
12 this.setLayout(new qx
.ui
.layout
.Dock());
18 * The viewPane inside which this applet is added.
25 check
:"org.argeo.ria.components.ViewSelection"
27 instanceId
: {init
:""},
28 instanceLabel
: {init
:""},
30 * Commands definition, see {@link org.argeo.ria.event.CommandsManager#definitions}
35 label
: "Reload Logs",
36 icon
: "resource/slc/view-refresh.png",
37 shortcut
: "Control+r",
41 callback : function(e
){
53 * Called at applet creation. Just registers viewPane.
54 * @param viewPane {org.argeo.ria.components.ViewPane} The viewPane.
56 init : function(viewPane
){
57 this.setView(viewPane
);
58 this.setViewSelection(new org
.argeo
.ria
.components
.ViewSelection(viewPane
.getViewId()));
67 this.timer
= new qx
.event
.Timer(15000);
68 this.timer
.addListener("interval", this._reloadLogger
, this);
72 addScroll : function(){
81 * Creates the applet layout
83 _createLayout : function(){
84 this.logModel
= new qx
.ui
.table
.model
.Simple();
85 this.logModel
.setColumns(["Date", "Host", "Id", "Status"]);
86 this.logPane
= new qx
.ui
.table
.Table(this.logModel
, {
87 tableColumnModel: function(obj
){
88 return new qx
.ui
.table
.columnmodel
.Resize(obj
)
91 this.logPane
.setDecorator(null);
93 this.add(this.logPane
, {edge
:'center'});
97 * Initialize the log table.
99 _initLogger : function(){
101 statusBarVisible
: false,
102 showCellFocusIndicator
:false
104 var columnModel
= this.logPane
.getTableColumnModel();
105 columnModel
.getBehavior().setWidth(0, "30%");
106 columnModel
.getBehavior().setWidth(1, "15%");
107 columnModel
.getBehavior().setWidth(3, "12%");
111 * Refresh the data model.
113 _reloadLogger : function(){
114 var request
= org
.argeo
.slc
.ria
.SlcApi
.getListSlcExecutionsService();
115 request
.addListener("completed", function(response
){
116 var messages
= org
.argeo
.ria
.util
.Element
.selectNodes(response
.getContent(), "//slc:slc-execution");
117 this.logModel
.setData([]);
118 for(var i
=0;i
<messages
.length
;i
++){
119 var message
= messages
[i
];
120 var slcExec
= new org
.argeo
.slc
.ria
.SlcExecutionMessage(message
.getAttribute("uuid"));
121 slcExec
.fromXml(message
);
122 this.logModel
.addRows([
123 [slcExec
.getDate(), slcExec
.getHost(), slcExec
.getUuid(), slcExec
.getStatus()]