init : {\r
"loadtestlist" : {\r
label : "Load Collection", \r
- icon : "resource/slc/view-refresh.png",\r
+ icon : "org.argeo.slc.ria/view-refresh.png",\r
shortcut : "Control+l",\r
enabled : true,\r
menu : "Collection",\r
},\r
"polllistloading" : {\r
label : "Auto load", \r
- icon : "resource/slc/document-open-recent.png",\r
+ icon : "org.argeo.slc.ria/document-open-recent.png",\r
shortcut : "Control+l",\r
enabled : true,\r
toggle : true,\r
/*\r
"copyfullcollection" : {\r
label : "Copy to...", \r
- icon : "resource/slc/edit-copy.png",\r
+ icon : "org.argeo.slc.ria/edit-copy.png",\r
shortcut : null,\r
enabled : false,\r
menu : "Collection",\r
*/\r
"opentest" : {\r
label : "Open", \r
- icon : "resource/slc/media-playback-start.png",\r
+ icon : "org.argeo.slc.ria/media-playback-start.png",\r
shortcut : "Control+o",\r
enabled : false,\r
menu : "Selection",\r
},\r
"download" : {\r
label : "Download as...", \r
- icon : "resource/slc/go-down.png",\r
+ icon : "org.argeo.slc.ria/go-down.png",\r
shortcut : null,\r
enabled : false,\r
menu : "Selection",\r
callback : function(e){ },\r
command : null,\r
submenu : [\r
- {'label':"Xsl", 'icon':'resource/slc/mime-xsl.png', 'commandId':'xsl'},\r
- {'label':"Xml", 'icon':'resource/slc/mime-xml.png', 'commandId':'xml'},\r
- {'label':"Excel", 'icon':'resource/slc/mime-xls.png', 'commandId':'xls'},\r
- {'label':"Pdf", 'icon':'resource/slc/mime-pdf.png', 'commandId':'pdf'}\r
+ {'label':"Xsl", 'icon':'org.argeo.slc.ria/mime-xsl.png', 'commandId':'xsl'},\r
+ {'label':"Xml", 'icon':'org.argeo.slc.ria/mime-xml.png', 'commandId':'xml'},\r
+ {'label':"Excel", 'icon':'org.argeo.slc.ria/mime-xls.png', 'commandId':'xls'},\r
+ {'label':"Pdf", 'icon':'org.argeo.slc.ria/mime-pdf.png', 'commandId':'pdf'}\r
],\r
submenuCallback : function(commandId){\r
var uuid = this.extractTestUuid();\r
this.setEnabled(true);\r
}\r
},\r
+ "attachments" : {\r
+ label : "Attachments", \r
+ icon : "org.argeo.slc.ria/document-save-as.png",\r
+ shortcut : null,\r
+ enabled : false,\r
+ menu : "Selection",\r
+ toolbar : "selection",\r
+ callback : function(e){ },\r
+ command : null,\r
+ submenu : [],\r
+ submenuCallback : function(commandId){ \r
+ var split = commandId.split("__commandseparator__");\r
+ var uuid = split[0];\r
+ var contentType = split[1];\r
+ var name = split[2];\r
+ var url = org.argeo.slc.ria.SlcApi.buildGetAttachmentUrl(uuid, contentType, name);\r
+ var win = window.open(url);\r
+ },\r
+ selectionChange : function(viewId, xmlNodes){\r
+ if(viewId!="list")return;\r
+ this.clearMenus();\r
+ this.setEnabled(false);\r
+ if(xmlNodes == null || !xmlNodes.length || xmlNodes.length != 1) return;\r
+ // Check slc:simple-attachment tags\r
+ var attachs = org.argeo.ria.util.Element.selectNodes(xmlNodes[0], "slc:attachments/slc:simple-attachment");\r
+ if(attachs && attachs.length){\r
+ var submenus = [];\r
+ for(var i=0;i<attachs.length;i++){\r
+ var uuid = org.argeo.ria.util.Element.getSingleNodeText(attachs[i], "slc:uuid");\r
+ var contentType = (org.argeo.ria.util.Element.getSingleNodeText(attachs[i], "slc:content-type")||'');\r
+ var name = org.argeo.ria.util.Element.getSingleNodeText(attachs[i], "slc:name");\r
+ submenus.push({\r
+ label:name, \r
+ icon : 'org.argeo.slc.ria/mime-text-plain.png', \r
+ commandId:uuid+'__commandseparator__'+contentType+'__commandseparator__'+name\r
+ });\r
+ }\r
+ this.setMenu(submenus);\r
+ this.setEnabled(true);\r
+ }\r
+ }\r
+ },\r
"copytocollection" : {\r
label : "Copy to...", \r
- icon : "resource/slc/edit-copy.png",\r
+ icon : "org.argeo.slc.ria/edit-copy.png",\r
shortcut : "Control+c",\r
enabled : false,\r
menu : "Selection",\r
},\r
"deletetest" : {\r
label : "Delete", \r
- icon : "resource/slc/edit-delete.png",\r
+ icon : "org.argeo.slc.ria/edit-delete.png",\r
shortcut : "Control+d",\r
enabled : false,\r
menu : "Selection",\r
var collectionList = event.getContent();\r
select.removeAll();\r
for(key in collectionList){\r
- var item = new qx.ui.form.ListItem(collectionList[key], "resource/slc/folder.png", key);\r
+ var item = new qx.ui.form.ListItem(collectionList[key], "org.argeo.slc.ria/folder.png", key);\r
select.add(item);\r
if(key == this.getCollectionId()){\r
select.setSelected(item);\r
if(this.getCollectionId() && key == this.getCollectionId()) continue;\r
submenus.push({\r
"label":collectionList[key], \r
- "icon":"resource/slc/folder.png", \r
+ "icon":"org.argeo.slc.ria/folder.png", \r
"commandId":key\r
});\r
} \r
submenus.push({'separator':true});\r
- submenus.push({"label":"New...", "icon":"resource/slc/folder-new.png", "commandId":"slc.client.create"});\r
+ submenus.push({"label":"New...", "icon":"org.argeo.slc.ria/folder-new.png", "commandId":"slc.client.create"});\r
command.setMenu(submenus);\r
if(checkSelection){\r
var viewSelection = this.getView().getViewSelection();\r
*/\r
copySelectionToCollection:function(collectionId, selectionType){\r
if(collectionId == "slc.client.create"){\r
- var modal = new org.argeo.ria.components.Modal("Create collection", "resource/slc/folder-new.png");\r
+ var modal = new org.argeo.ria.components.Modal("Create collection", "org.argeo.slc.ria/folder-new.png");\r
modal.makePromptForm("Enter the new collection name", function(value){\r
if(value == ""){\r
alert("Please enter a name for the new collection!");\r