X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=server%2Forg.argeo.slc.ria%2Fsrc%2Fargeo-ria-lib%2Fslc-web%2Fclass%2Forg%2Fargeo%2Fslc%2Fweb%2FTestList.js;h=31f97165dff9b4d96cbca7e049876465a005e2c6;hb=2c926f13b24a7a35b4af44da6e32b48e0dfad786;hp=28a9f193cad876b9e93e7cc67b9553cd9563add5;hpb=d8e9131cdd34b663a03008df8eb97616694259ce;p=gpl%2Fargeo-slc.git diff --git a/server/org.argeo.slc.ria/src/argeo-ria-lib/slc-web/class/org/argeo/slc/web/TestList.js b/server/org.argeo.slc.ria/src/argeo-ria-lib/slc-web/class/org/argeo/slc/web/TestList.js index 28a9f193c..31f97165d 100644 --- a/server/org.argeo.slc.ria/src/argeo-ria-lib/slc-web/class/org/argeo/slc/web/TestList.js +++ b/server/org.argeo.slc.ria/src/argeo-ria-lib/slc-web/class/org/argeo/slc/web/TestList.js @@ -9,7 +9,19 @@ qx.Class.define("org.argeo.slc.web.TestList", { extend : qx.ui.container.Composite, implement : [org.argeo.ria.components.IView], + include : [org.argeo.ria.session.MPrefHolder], + statics : { + riaPreferences : { + "slc.web.TestList.DefaultAction" : { + label : "Test List : Double Click default action", + type : "list", + list : ["Open","Download Xls"], + defaultValue : "Open" + } + } + }, + construct : function(){ this.base(arguments, new qx.ui.layout.VBox()); var model = new qx.ui.table.model.Simple(); @@ -56,7 +68,7 @@ qx.Class.define("org.argeo.slc.web.TestList", init : { "loadtestlist" : { label : "Load Collection", - icon : "resource/slc/view-refresh.png", + icon : "org.argeo.slc.ria/view-refresh.png", shortcut : "Control+l", enabled : true, menu : "Collection", @@ -68,7 +80,7 @@ qx.Class.define("org.argeo.slc.web.TestList", }, "polllistloading" : { label : "Auto load", - icon : "resource/slc/document-open-recent.png", + icon : "org.argeo.slc.ria/document-open-recent.png", shortcut : "Control+l", enabled : true, toggle : true, @@ -82,7 +94,7 @@ qx.Class.define("org.argeo.slc.web.TestList", /* "copyfullcollection" : { label : "Copy to...", - icon : "resource/slc/edit-copy.png", + icon : "org.argeo.slc.ria/edit-copy.png", shortcut : null, enabled : false, menu : "Collection", @@ -108,7 +120,7 @@ qx.Class.define("org.argeo.slc.web.TestList", */ "opentest" : { label : "Open", - icon : "resource/slc/media-playback-start.png", + icon : "org.argeo.slc.ria/media-playback-start.png", shortcut : "Control+o", enabled : false, menu : "Selection", @@ -130,7 +142,7 @@ qx.Class.define("org.argeo.slc.web.TestList", }, "download" : { label : "Download as...", - icon : "resource/slc/go-down.png", + icon : "org.argeo.slc.ria/go-down.png", shortcut : null, enabled : false, menu : "Selection", @@ -138,10 +150,10 @@ qx.Class.define("org.argeo.slc.web.TestList", callback : function(e){ }, command : null, submenu : [ - {'label':"Xsl", 'icon':'resource/slc/mime-xsl.png', 'commandId':'xsl'}, - {'label':"Xml", 'icon':'resource/slc/mime-xml.png', 'commandId':'xml'}, - {'label':"Excel", 'icon':'resource/slc/mime-xls.png', 'commandId':'xls'}, - {'label':"Pdf", 'icon':'resource/slc/mime-pdf.png', 'commandId':'pdf'} + {'label':"Xsl", 'icon':'org.argeo.slc.ria/mime-xsl.png', 'commandId':'xsl'}, + {'label':"Xml", 'icon':'org.argeo.slc.ria/mime-xml.png', 'commandId':'xml'}, + {'label':"Excel", 'icon':'org.argeo.slc.ria/mime-xls.png', 'commandId':'xls'}, + {'label':"Pdf", 'icon':'org.argeo.slc.ria/mime-pdf.png', 'commandId':'pdf'} ], submenuCallback : function(commandId){ var uuid = this.extractTestUuid(); @@ -166,9 +178,51 @@ qx.Class.define("org.argeo.slc.web.TestList", this.setEnabled(true); } }, + "attachments" : { + label : "Attachments", + icon : "org.argeo.slc.ria/document-save-as.png", + shortcut : null, + enabled : false, + menu : "Selection", + toolbar : "selection", + callback : function(e){ }, + command : null, + submenu : [], + submenuCallback : function(commandId){ + var split = commandId.split("__commandseparator__"); + var uuid = split[0]; + var contentType = split[1]; + var name = split[2]; + var url = org.argeo.slc.ria.SlcApi.buildGetAttachmentUrl(uuid, contentType, name); + var win = window.open(url); + }, + selectionChange : function(viewId, xmlNodes){ + if(viewId!="list")return; + this.clearMenus(); + this.setEnabled(false); + if(xmlNodes == null || !xmlNodes.length || xmlNodes.length != 1) return; + // Check slc:simple-attachment tags + var attachs = org.argeo.ria.util.Element.selectNodes(xmlNodes[0], "slc:attachments/slc:simple-attachment"); + if(attachs && attachs.length){ + var submenus = []; + for(var i=0;i