Changeset 1134 for extensions/net.sf.basedb.genepattern
- Timestamp:
- Jun 22, 2009, 2:00:26 PM (14 years ago)
- Location:
- extensions/net.sf.basedb.genepattern/trunk
- Files:
-
- 6 added
- 5 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
extensions/net.sf.basedb.genepattern/trunk/META-INF/extensions.xml
r1132 r1134 61 61 <extension 62 62 id="net.sf.basedb.genepattern.visualizer" 63 extends="net.sf.basedb.clients.web. menu.extensions"63 extends="net.sf.basedb.clients.web.toolbar.item.bioassayset" 64 64 > 65 <index> 4</index>65 <index>1</index> 66 66 <about> 67 <name> Visualizer test</name>67 <name>GenePattern Visualizer</name> 68 68 <description> 69 A simple test of a visualizer69 Runs a GenePattern visualizer module. 70 70 </description> 71 71 </about> 72 72 <action-factory> 73 73 <factory-class> 74 net.sf.basedb.clients.web.extensions. menu.FixedMenuItemFactory74 net.sf.basedb.clients.web.extensions.toolbar.FixedButtonFactory 75 75 </factory-class> 76 76 <parameters> 77 <title> Visualizer test&hellip;</title>78 <onClick>Main.openPopup('$HOME$/ test_visualizer.jsp?ID='+getSessionId(), 'VisualizerTest', 500, 400)</onClick>77 <title>GenePattern visualizer&hellip;</title> 78 <onClick>Main.openPopup('$HOME$/run_visualizer.jsp?ID='+getSessionId(), 'GPVisualizer', 800, 600)</onClick> 79 79 <icon>~/images/genepattern.gif</icon> 80 <tooltip>Runs a GenePattern visualizer module with data from this bioassay set</tooltip> 80 81 </parameters> 81 82 </action-factory> -
extensions/net.sf.basedb.genepattern/trunk/resources/getFile.jsp
r1132 r1134 1 2 <%@page import="net.sf.basedb.util.FileUtil"%> 3 <%@page import="net.sf.basedb.util.StaticCache"%> 4 <%@page import="net.sf.basedb.core.Application"%><%-- $Id$ 1 <%-- $Id$ 5 2 ------------------------------------------------------------------ 6 3 Copyright (C) 2009 Nicklas Nordborg … … 25 22 ------------------------------------------------------------------ 26 23 27 @author Jari,Nicklas24 @author Nicklas 28 25 --%> 29 26 <%@ page 30 27 pageEncoding="UTF-8" 31 28 session="false" 29 import="net.sf.basedb.core.Application" 30 import="net.sf.basedb.util.StaticCache" 31 import="net.sf.basedb.util.FileUtil" 32 32 %> 33 33 <% -
extensions/net.sf.basedb.genepattern/trunk/resources/run_visualizer.jsp
r1132 r1134 22 22 ------------------------------------------------------------------ 23 23 24 @author Jari,Nicklas24 @author Nicklas 25 25 --%> 26 26 <%@ page … … 31 31 import="net.sf.basedb.core.Presets.Preset" 32 32 import="net.sf.basedb.clients.web.Base" 33 import="net.sf.basedb.clients.web.extensions.ExtensionsControl" 33 34 import="net.sf.basedb.clients.web.util.HTML" 34 35 %> … … 41 42 Presets presets = new Presets(); 42 43 if (presetsXml != null) presets.loadFrom(presetsXml); 43 44 final String homeUrl = ExtensionsControl.getHomeUrl("net.sf.basedb.genepattern.options"); 44 45 %> 45 46 <base:page type="popup" title=""> 46 <base:head >47 <base:head scripts="ajax.js"> 47 48 <script language="JavaScript"> 48 function browseOnClick(callback)49 {50 var frm = document.forms['visualizer'];51 var url = getRoot() + 'filemanager/index.jsp?ID=<%=ID%>&cmd=SelectOne&title=Select+file&callback=' + callback;52 Main.openPopup(url, 'SelectFile', 1000, 700);53 }54 function setGctFileCallback(fileId, path)55 {56 var frm = document.forms['visualizer'];57 frm['dataset.filename'].value = path;58 }59 function setCmsFileCallback(fileId, path)60 {61 var frm = document.forms['visualizer'];62 frm['comparative.marker.selection.filename'].value = path;63 }64 49 function doVisualize() 65 50 { … … 67 52 frm.submit(); 68 53 } 54 function getModuleList() 55 { 56 var frm = document.forms['visualizer']; 57 var url = '<%=homeUrl%>/Ajax.servlet?ID=<%=ID%>&cmd=ListModules'; 58 url += '&server=' + encodeURIComponent(frm['server'].value); 59 var request = Ajax.getXmlHttpRequest(); 60 request.open("GET", url, true); 61 Ajax.setReadyStateHandler(request, getModulesListCallback); 62 request.send(null); 63 document.getElementById('ajaxStatus').innerHTML = 'Please wait. . .'; 64 setTimeout('showProgress()', 250); 65 } 66 function showProgress() 67 { 68 var progress = document.getElementById('ajaxStatus'); 69 if (progress.innerHTML.indexOf('Please wait') == 0) 70 { 71 progress.innerHTML += ' .'; 72 setTimeout('showProgress()', 250); 73 } 74 } 69 75 76 function getModulesListCallback(request) 77 { 78 if (document.getElementById('ajaxStatus').innerHTML.indexOf('Please wait') != 0) return; 79 var frm = document.forms['visualizer']; 80 var responseText = request != null ? 81 request.responseText : 82 'status:error\nstacktrace:No response from server'; 83 var response = Ajax.parseResponse(responseText); 84 if (response.isError()) 85 { 86 var stacktrace = response.getElements()[0]['stacktrace']; 87 document.getElementById('ajaxStatus').innerHTML = 88 '<div class="error stacktrace" style="width: 420px; height: 15em; overflow: auto;">' + stacktrace + '</div>'; 89 } 90 else 91 { 92 var modules = response.getElements(); 93 modules.sort(compareGpModules); 94 var html = '<div style="width: 420px; height: 15em; overflow: auto;">'; 95 for (var i = 0; i < modules.length; i++) 96 { 97 var type = modules[i]['taskType']; 98 if (type == 'Visualizer') 99 { 100 html += '<a id="module.' + i + '" href="javascript:setModule('+i+')" title="' + modules[i]['description'] + '">'; 101 html += modules[i]['name'] + '</a><br>'; 102 } 103 } 104 html += '</div>'; 105 document.getElementById('ajaxStatus').innerHTML = html; 106 } 107 } 108 function compareGpModules(m1, m2) 109 { 110 var type1 = m1['taskType']; 111 var type2 = m2['taskType']; 112 if (type1 < type2) return -1; 113 if (type1 > type2) return 1; 114 var name1 = m1['name']; 115 var name2 = m2['name']; 116 if (name1 < name2) return -1; 117 if (name1 > name2) return 1; 118 return 0; 119 } 120 function setModule(index) 121 { 122 var frm = document.forms['visualizer']; 123 frm['module'].value = document.getElementById('module.'+index).innerHTML; 124 } 70 125 </script> 71 126 </base:head> … … 74 129 <form action="Visualizer.servlet" method="post" name="visualizer"> 75 130 <input type="hidden" name="ID" value="<%=ID%>"> 131 <input type="hidden" name="cmd" value="SelectServerModule"> 76 132 77 <h3>Run visualizer</h3> 133 <h3 class="docked">Run visualizer</h3> 134 <div class="boxedbottom"> 78 135 <table class="form" cellspacing=0> 79 136 <tr> 80 <td class="prompt">GenePattern servers</td> 137 <td></td> 138 <td>Select a GenePattern visualizer module.</td> 139 </tr> 140 <tr> 141 <td class="prompt">GenePattern server</td> 81 142 <td> 82 <select name="server" style="width: 25em;">143 <select name="server" class="required"> 83 144 <% 84 String selected = "selected";85 145 for (Presets.Preset server : presets) 86 146 { 87 147 %> 88 <option <%=selected%>><%=HTML.encodeTags(server.getName())%>148 <option><%=HTML.encodeTags(server.getName())%> 89 149 <% 90 selected = "";91 150 } 92 151 %> … … 94 153 </td> 95 154 </tr> 96 97 155 <tr> 98 <td class="prompt"> Module name</td>156 <td class="prompt">Visualizer module</td> 99 157 <td> 100 <input class="text required" type="text" name="module" size="40" 101 value="ComparativeMarkerSelectionViewer"> 158 <input class="text required" type="text" name="module" size="40" value=""> 102 159 </td> 103 160 </tr> 161 <tr> 162 <td class="prompt">Available modules</td> 163 <td> 164 <table border=0 cellspacing=0><tr><td><base:button 165 title="Get list" onclick="getModuleList()" 166 image="<%=homeUrl + "/images/genepattern.gif" %>" 167 /></td> 168 </tr></table> 169 </td> 170 </tr> 171 <tr> 172 <td class="prompt"></td> 173 <td id="ajaxStatus"></td> 174 </tr> 175 </table> 176 </div> 104 177 105 178 106 <tr>107 <td class="prompt">CMS output file</td>108 <td>109 <table border="0" cellspacing="0" cellpadding="0">110 <tr>111 <td><input type="text" class="text required"112 name="comparative.marker.selection.filename" size="60"113 value="/gp-ComparativeMarkerSelection/2009-06-16/normalized.imputed.comp.marker.odf"> </td>114 <td><base:button115 title="Browse…"116 onclick="browseOnClick('setCmsFileCallback')"117 />118 </td>119 </tr>120 </table>121 </td>122 </tr>123 <tr>124 <td class="prompt">GCT data file</td>125 <td>126 <table border="0" cellspacing="0" cellpadding="0">127 <tr>128 <td><input type="text" class="text required"129 name="dataset.filename" size="60"130 value="/gp-ImputeMissingValuesKNN/2009-06-15/normalized.imputed.gct"> </td>131 <td><base:button132 title="Browse…"133 onclick="browseOnClick('setGctFileCallback')"134 />135 </td>136 </tr>137 </table>138 </td>139 </tr>140 </table>141 179 </form> 142 180 <table align="center"> … … 149 187 </base:body> 150 188 </base:page> 151 <%152 153 %> -
extensions/net.sf.basedb.genepattern/trunk/resources/visualizer_applet.jsp
r1132 r1134 22 22 ------------------------------------------------------------------ 23 23 24 @author Jari,Nicklas24 @author Nicklas 25 25 --%> 26 26 <%@ page 27 27 pageEncoding="UTF-8" 28 28 session="false" 29 import="net.sf.basedb.clients.web.util.HTML" 29 30 import="java.util.Map" 30 31 %> 31 32 <%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> 32 33 <% 33 Map<String, String> appletParameters = (Map<String, String>)request.getAttribute("appletParameters"); 34 final Map<String, String> appletParameters = 35 (Map<String, String>)request.getAttribute("appletParameters"); 36 String module = appletParameters.get("name"); 34 37 %> 35 <base:page type="popup" title=""> 36 <base:head > 37 38 </base:head> 38 <base:page type="popup" title="<%=HTML.encodeTags(module)%>"> 39 <base:head></base:head> 39 40 <base:body> 40 <h3 ><%=appletParameters.get("name")%></h3>41 <h3 class="docked"><%=HTML.encodeTags(module)%></h3> 41 42 <div class="boxedbottom"> 42 43 The visualizer will start in it's own window. It is safe to 43 44 close this window once the visualizer is up and running. 44 45 <p> 45 46 <applet 46 47 code="org.genepattern.visualizer.RunVisualizerApplet" 47 48 archive="runVisualizer.jar,commons-httpclient.jar,commons-codec-1.3.jar" 48 codebase=" downloads"49 codebase="visualizer" 49 50 width="1" height="1" 50 51 alt="Your browser can not run applets" 51 52 > 53 <% 54 for (Map.Entry<String, String> entry : appletParameters.entrySet()) 55 { 56 %> 57 <param name="<%=entry.getKey()%>" value="<%=entry.getValue()%>"> 52 58 <% 53 for (Map.Entry<String, String> entry : appletParameters.entrySet()) 54 { 55 %> 56 <param name="<%=entry.getKey()%>" value="<%=entry.getValue()%>"> 57 <% 58 } 59 %> 59 } 60 %> 60 61 </applet> 61 62 </div> … … 69 70 </base:body> 70 71 </base:page> 71 <%72 73 %> -
extensions/net.sf.basedb.genepattern/trunk/src/net/sf/basedb/genepattern/file/SupportFileTransferGateway.java
r1132 r1134 8 8 import java.util.List; 9 9 10 import org.genepattern.webservice.TaskIntegratorProxy;11 10 import org.genepattern.webservice.WebServiceException; 12 11 13 12 import net.sf.basedb.core.Application; 14 13 import net.sf.basedb.core.ConfigurationException; 14 import net.sf.basedb.genepattern.wrapper.GPClient; 15 15 import net.sf.basedb.genepattern.wrapper.SupportFileInfo; 16 import net.sf.basedb.genepattern.wrapper.TaskInfo; 16 17 import net.sf.basedb.util.StaticCache; 17 18 … … 35 36 { 36 37 37 private List<SupportFileInfo> supportFiles;38 private String lsid; 38 private final TaskInfo ti; 39 39 40 40 41 /** … … 44 45 @param lsid The LSID of a module 45 46 */ 46 public SupportFileTransferGateway( String lsid)47 public SupportFileTransferGateway(TaskInfo ti) 47 48 { 48 this.lsid = lsid; 49 this.supportFiles = new ArrayList<SupportFileInfo>(); 50 } 51 52 /** 53 Add information about a support file for the give module. 54 55 @param fileInfo The file information 56 */ 57 public void addFile(SupportFileInfo fileInfo) 58 { 59 supportFiles.add(fileInfo); 49 this.ti = ti; 60 50 } 61 51 … … 68 58 @throws IOException 69 59 */ 70 public void downloadSupportFiles( TaskIntegratorProxy tiProxy)60 public void downloadSupportFiles(GPClient gp) 71 61 throws WebServiceException, IOException 72 62 { … … 78 68 } 79 69 80 List<String> toDownload = new ArrayList<String>(); 81 String cacheRoot = StaticCache.makeValidKey("gp-integration/" + lsid + "/", "-"); 70 String moduleLsid = ti.getLsid(); 71 String validKey = StaticCache.makeValidKey(moduleLsid, "-"); 72 73 List<SupportFileInfo> toDownload = new ArrayList<SupportFileInfo>(); 74 String cacheRoot = "gp-integration/" + validKey + "/"; 75 SupportFileInfo[] supportFiles = gp.getSupportFiles(moduleLsid); 82 76 for (SupportFileInfo file : supportFiles) 83 77 { 84 78 if (!cache.exists(cacheRoot + file.getFileName())) 85 79 { 86 toDownload.add(file .getFileName());80 toDownload.add(file); 87 81 } 88 82 } 89 File workDir = new File(System.getProperty("java.io.tmpdir")); 90 tiProxy.getSupportFiles(lsid, toDownload.toArray(new String[0]), workDir); 91 for (SupportFileInfo file : supportFiles) 83 File workDir = new File(System.getProperty("java.io.tmpdir"), validKey); 84 workDir.mkdirs(); 85 gp.downloadSupportFiles(moduleLsid, toDownload.toArray(new SupportFileInfo[0]), workDir); 86 for (SupportFileInfo file : toDownload) 92 87 { 93 88 File sf = new File(workDir, file.getFileName()); -
extensions/net.sf.basedb.genepattern/trunk/src/net/sf/basedb/genepattern/servlet/Visualizer.java
r1132 r1134 31 31 import net.sf.basedb.clients.web.Base; 32 32 import net.sf.basedb.clients.web.extensions.ExtensionsControl; 33 import net.sf.basedb.core.PluginParameter; 33 34 import net.sf.basedb.core.SessionControl; 34 35 import net.sf.basedb.genepattern.GPServer; … … 80 81 throws IOException, ServletException 81 82 { 82 String module = request.getParameter("module"); 83 String server = request.getParameter("server"); 84 SessionControl sc = Base.getSessionControl(request, false); 85 String ID = sc.getId(); 86 87 GPServer gpServer = GPServer.get(sc, server); 88 GPClient gp = new GPClient(gpServer); 89 83 String cmd = request.getParameter("cmd"); 84 String forward = null; 90 85 try 91 86 { 92 TaskInfo ti = gp.getTaskInfo(module); 93 ParameterInfo[] parameters = ti.getParameters(null); 94 SupportFileInfo[] supportFiles = gp.getSupportFiles(ti.getLsid()); 95 96 SupportFileTransferGateway sfgw = new SupportFileTransferGateway(ti.getLsid()); 97 98 Map<String, String> appletParameters = new LinkedHashMap<String, String>(); 99 appletParameters.put("name", module); 100 appletParameters.put("gp_os", ti.getOs()); 101 appletParameters.put("gp_cpuType", ti.getCpuType()); 102 appletParameters.put("visualizer_java_flags", "-Xmx512M"); 103 appletParameters.put("context", ExtensionsControl.getHomeUrl("net.sf.basedb.genepattern.options")); 104 List<String> parameterNames = new ArrayList<String>(); 105 List<String> fileParameters = new ArrayList<String>(); 106 for (ParameterInfo pi : parameters) 107 { 108 String name = pi.getName(); 109 String value = request.getParameter(name); 110 if (value != null) 111 { 112 parameterNames.add(name); 113 if (pi.isInputFile()) 114 { 115 fileParameters.add(name); 116 appletParameters.put(name, "http://auster.thep.lu.se:8080/trunk/filemanager/files/view/-" + ID + "-" + value); 117 } 118 else 119 { 120 appletParameters.put(name, value); 121 } 122 } 123 } 124 appletParameters.put("gp_paramNames", Values.getString(parameterNames, ",", true)); 125 appletParameters.put("gp_download", Values.getString(fileParameters, ",", true)); 126 appletParameters.put("commandLine", ti.getCommandLine()); 127 128 List<String> fileNames = new ArrayList<String>(); 129 List<Long> fileDates = new ArrayList<Long>(); 130 for (SupportFileInfo si : supportFiles) 131 { 132 sfgw.addFile(si); 133 fileNames.add(si.getFileName()); 134 fileDates.add(si.getLastModified()); 135 } 136 sfgw.downloadSupportFiles(gp.getTaskIntegratorProxy()); 137 appletParameters.put("gp_filenames", Values.getString(fileNames, ",", true)); 138 appletParameters.put("gp_fileDates", Values.getString(fileDates, ",", true)); 139 appletParameters.put("gp_lsid", ti.getLsid()); 140 141 // response.getWriter().print("appletParameters=" + appletParameters.toString()); 142 request.setAttribute("appletParameters", appletParameters); 143 request.getRequestDispatcher("visualizer.jsp").forward(request, response); 144 87 if ("SelectServerModule".equals(cmd)) 88 { 89 forward = selectServerModule(request, response); 90 } 91 else if ("RunVisualizerApplet".equals(cmd)) 92 { 93 forward = runVisualizerApplet(request, response); 94 } 145 95 } 146 96 catch (WebServiceException ex) 147 97 { 148 98 throw new ServletException(ex); 149 } 99 } 100 if (forward != null) 101 { 102 request.getRequestDispatcher(forward).forward(request, response); 103 } 150 104 } 151 105 … … 158 112 } 159 113 114 private String selectServerModule(HttpServletRequest request, HttpServletResponse response) 115 throws WebServiceException 116 { 117 // Request parameters 118 String server = request.getParameter("server"); 119 String module = request.getParameter("module"); 120 SessionControl sc = Base.getSessionControl(request, false); 121 122 // Get the selected server & a web service connection to it 123 GPServer gpServer = GPServer.get(sc, server); 124 final GPClient gp = new GPClient(gpServer); 125 126 // Get the TaskInfo for the selected module 127 final TaskInfo ti = gp.getTaskInfo(module); 128 129 // Start a thread that downloads the module support files 130 Thread t = new Thread(new Runnable() 131 { 132 @Override 133 public void run() 134 { 135 SupportFileTransferGateway gw = new SupportFileTransferGateway(ti); 136 try 137 { 138 gw.downloadSupportFiles(gp); 139 } 140 catch (Exception ex) 141 {} 142 } 143 }); 144 t.start(); 145 146 147 ParameterInfo[] parameters = ti.getParameters(null); 148 List<PluginParameter> moduleParameters = new ArrayList<PluginParameter>(); 149 150 for (ParameterInfo pi : parameters) 151 { 152 moduleParameters.add(pi.createPluginParameter("gp.", null)); 153 } 154 155 request.setAttribute("moduleParameters", moduleParameters); 156 return "visualizer_parameters.jsp"; 157 } 158 159 private String runVisualizerApplet(HttpServletRequest request, HttpServletResponse response) 160 throws WebServiceException, IOException 161 { 162 163 // Request parameters 164 String server = request.getParameter("server"); 165 String module = request.getParameter("module"); 166 SessionControl sc = Base.getSessionControl(request, false); 167 String ID = sc.getId(); 168 169 // Get the selected server & a web service connection to it 170 GPServer gpServer = GPServer.get(sc, server); 171 GPClient gp = new GPClient(gpServer); 172 173 // Get the TaskInfo and ParameterInfo for the selected module 174 TaskInfo ti = gp.getTaskInfo(module); 175 ParameterInfo[] parameters = ti.getParameters(null); 176 177 // Make sure that all support files have been cached in BASE 178 SupportFileTransferGateway gw = new SupportFileTransferGateway(ti); 179 gw.downloadSupportFiles(gp); 180 181 // Create the applet parameters 182 // 1. Environment parameters 183 Map<String, String> appletParameters = new LinkedHashMap<String, String>(); 184 appletParameters.put("name", module); 185 appletParameters.put("gp_lsid", ti.getLsid()); 186 appletParameters.put("gp_os", ti.getOs()); 187 appletParameters.put("gp_cpuType", ti.getCpuType()); 188 appletParameters.put("visualizer_java_flags", "-Xmx512M"); // TODO - should be configurable 189 appletParameters.put("context", ExtensionsControl.getHomeUrl("net.sf.basedb.genepattern.options")); 190 appletParameters.put("commandLine", ti.getCommandLine()); 191 192 // 2. Module-specific parameters 193 List<String> parameterNames = new ArrayList<String>(); 194 List<String> fileParameters = new ArrayList<String>(); 195 final String scheme = request.getScheme(); 196 final String serverName = request.getServerName(); 197 final int serverPort = request.getServerPort(); 198 final String contextPath = request.getContextPath(); 199 final String baseFileUrl = scheme + "://" + serverName + ":" + serverPort + 200 contextPath + "/filemanager/files/view/-" + ID + "-"; 201 202 for (ParameterInfo pi : parameters) 203 { 204 String name = pi.getName(); 205 String value = Values.getStringOrNull(request.getParameter("gp." + name)); 206 if (value != null) 207 { 208 parameterNames.add(name); 209 if (pi.isInputFile()) 210 { 211 fileParameters.add(name); 212 appletParameters.put(name, baseFileUrl + value); 213 } 214 else 215 { 216 appletParameters.put(name, value); 217 } 218 } 219 } 220 appletParameters.put("gp_paramNames", Values.getString(parameterNames, ",", true)); 221 appletParameters.put("gp_download", Values.getString(fileParameters, ",", true)); 222 223 // 3. Support file information 224 SupportFileInfo[] supportFiles = gp.getSupportFiles(ti.getLsid()); 225 List<String> fileNames = new ArrayList<String>(); 226 List<Long> fileDates = new ArrayList<Long>(); 227 for (SupportFileInfo si : supportFiles) 228 { 229 fileNames.add(si.getFileName()); 230 fileDates.add(si.getLastModified()); 231 } 232 appletParameters.put("gp_filenames", Values.getString(fileNames, ",", true)); 233 appletParameters.put("gp_fileDates", Values.getString(fileDates, ",", true)); 234 235 request.setAttribute("appletParameters", appletParameters); 236 return "visualizer_applet.jsp"; 237 } 238 160 239 } -
extensions/net.sf.basedb.genepattern/trunk/src/net/sf/basedb/genepattern/wrapper/GPClient.java
r1132 r1134 1 1 package net.sf.basedb.genepattern.wrapper; 2 3 import java.io.File; 2 4 3 5 import net.sf.basedb.core.signal.SignalException; … … 103 105 } 104 106 107 /** 108 Get the underlying {@link TaskIntegratorProxy} instance. 109 Use this method to access functionality that is not exposed by this 110 class. 111 */ 105 112 public TaskIntegratorProxy getTaskIntegratorProxy() 106 113 throws WebServiceException … … 150 157 } 151 158 159 /** 160 Get information about a specific module that is installed on the 161 current GenePattern server. 162 @param module The name of LSID of the module 163 @return A TaskInfo object 164 @throws WebServiceException If there is a problem retreiving the information 165 */ 152 166 public TaskInfo getTaskInfo(String module) 153 167 throws WebServiceException … … 157 171 } 158 172 173 /** 174 Get information about the support files that are required by 175 a (visualizer) module. 176 177 @param module The LSID of the module (the name will not work) 178 @return An array with SupprtFileInfo objects 179 @throws WebServiceException If there is a problem retreiving the information 180 */ 159 181 public SupportFileInfo[] getSupportFiles(String module) 160 182 throws WebServiceException 161 183 { 162 184 TaskIntegratorProxy tiProxy = getTaskIntegratorProxy(); 163 164 185 String[] fileNames = tiProxy.getSupportFileNames(module); 165 186 long[] dates = tiProxy.getLastModificationTimes(module, fileNames); … … 172 193 } 173 194 195 /** 196 Download support files required by a (visualizer) module. NOTE! 197 Existing files in the specified directory are overwritten! 198 199 @param module The LSID of the module (the name will not work) 200 @param files An array with the files to download, or null to 201 download all support files 202 @param toDir The directory to download the files to 203 @throws WebServiceException If there is a problem downloading the files 204 */ 205 public void downloadSupportFiles(String module, SupportFileInfo[] files, File toDir) 206 throws WebServiceException 207 { 208 TaskIntegratorProxy tiProxy = getTaskIntegratorProxy(); 209 if (files == null) files = getSupportFiles(module); 210 String[] fileNames = new String[files.length]; 211 for (int i = 0; i < files.length; ++i) 212 { 213 fileNames[i] = files[i].getFileName(); 214 } 215 tiProxy.getSupportFiles(module, fileNames, toDir); 216 } 174 217 175 218 /**
Note: See TracChangeset
for help on using the changeset viewer.