/**
* @author Charles
*/
qx.Class.define("org.argeo.slc.web.Applet",
{
extend : qx.ui.container.Composite,
implement : [org.argeo.ria.components.IView],
construct : function(){
this.base(arguments);
this.setLayout(new qx.ui.layout.VBox());
this.passedStatus = "
";
this.failedStatus = "";
},
properties :
{
view : {
init : null
},
commands : {
init : {
"close" : {
label : "Close Result",
icon : "resource/slc/window-close.png",
shortcut : "Control+w",
enabled : true,
menu : "Test",
toolbar : "result",
callback : function(e){
// Call service to delete
//org.argeo.slc.web.components.ViewsManager.getInstance().getViewPaneById("applet").empty();
this.getView().empty();
},
selectionChange : function(viewId, xmlNode){
if(viewId != "applet") return;
/*
if(xmlNode){
this.setEnabled(true);
}else{
this.setEnabled(false);
}
*/
},
command : null
}
}
}
},
/*
*****************************************************************************
MEMBERS
*****************************************************************************
*/
members :
{
init : function(viewPane){
this.setView(viewPane);
},
load : function(xmlNode){
this.data = xmlNode;
if(!xmlNode) return;
// Load XML or Whatever
//var testType = qx.dom.Node.getText(qx.xml.Element.selectSingleNode(this.data, "param[@name='testType']"));
var service;
var testId = qx.dom.Node.getText(org.argeo.ria.util.Element.selectSingleNode(this.data, "param[@name='uuid']"));
this.info("Opening test "+testId);
this.getView().setViewTitle("Test "+testId);
service = "../resultViewXml.xslt?uuid="+testId;
var serviceManager = org.argeo.ria.remote.RequestManager.getInstance();
var request = serviceManager.getRequest(service, "GET", "application/xml");
request.addListener("completed", function(response){
this.createXmlGui(response.getContent());
this.getView().setOnLoad(false);
}, this);
this.getView().setOnLoad(true);
request.send();
},
addScroll : function(){
return false;
},
createXmlGui : function(responseXml){
var NSMap = {
"slc" : "http://argeo.org/projects/slc/schemas"
}
if(!qx.Class.hasMixin(qx.ui.treevirtual.TreeVirtual, qx.ui.treevirtual.MNode)){
qx.Class.include(qx.ui.treevirtual.TreeVirtual,qx.ui.treevirtual.MNode);
}
this.tree = new qx.ui.treevirtual.TreeVirtual(["Test", "State", "Message", "Id"]);
this.tree.getTableColumnModel().setDataCellRenderer(0, new org.argeo.ria.util.TreeDataCellRenderer());
this.tree.setRowHeight(18);
this.tree.setStatusBarVisible(false);
this.tree.setDecorator(new qx.ui.decoration.Background("#fff"));
var model = this.tree.getDataModel();
var resNodes = org.argeo.ria.util.Element.selectNodes(responseXml, "//slc:result-part", NSMap);
window.result = responseXml;
var resultParts = {};
var addedPaths = {};
for(var i=0;i