|
37 | 37 | import org.broad.igv.ui.IGV;
|
38 | 38 | import org.broad.igv.ui.util.MessageUtils;
|
39 | 39 | import org.broad.igv.ui.util.UIUtilities;
|
| 40 | +import org.broad.igv.util.LongRunningTask; |
40 | 41 | import org.broad.igv.util.StringUtils;
|
41 | 42 |
|
42 | 43 | import java.awt.*;
|
@@ -77,7 +78,7 @@ public class CommandListener implements Runnable {
|
77 | 78 | public static Set<String> indexParams;
|
78 | 79 |
|
79 | 80 | static {
|
80 |
| - String[] fps = new String[]{"file", "bigDataURL", "sessionURL", "dataURL"}; |
| 81 | + String[] fps = new String[]{"file", "bigDataURL", "sessionURL", "dataURL", "hubURL"}; |
81 | 82 | fileParams = new LinkedHashSet<String>(Arrays.asList(fps));
|
82 | 83 | fileParams = Collections.unmodifiableSet(fileParams);
|
83 | 84 |
|
@@ -182,9 +183,8 @@ private void processClientSession(CommandExecutor cmdExe) throws IOException {
|
182 | 183 | String cmd = inputLine;
|
183 | 184 | if (!cmd.contains("/oauthCallback")) {
|
184 | 185 | if (cmd.startsWith("SetAccessToken")) {
|
185 |
| - log.info(cmd.substring(0,14) + " *****"); |
186 |
| - } |
187 |
| - else { |
| 186 | + log.info(cmd.substring(0, 14) + " *****"); |
| 187 | + } else { |
188 | 188 | log.info(cmd);
|
189 | 189 | }
|
190 | 190 | }
|
@@ -224,7 +224,6 @@ private void processClientSession(CommandExecutor cmdExe) throws IOException {
|
224 | 224 | } else {
|
225 | 225 |
|
226 | 226 | if (command != null) {
|
227 |
| - |
228 | 227 | // Detect oauth callback
|
229 | 228 | if (command.equals("/oauthCallback")) {
|
230 | 229 | OAuthProvider provider = OAuthUtils.getInstance().getProviderForState(params.get("state"));
|
@@ -376,8 +375,18 @@ private String processGet(String command, Map<String, String> params, CommandExe
|
376 | 375 | mainFrame.setAlwaysOnTop(true);
|
377 | 376 | mainFrame.setAlwaysOnTop(false);
|
378 | 377 |
|
379 |
| - |
380 |
| - if (command.equals("/load")) { |
| 378 | + if (command.equals("/")) { |
| 379 | + if (params.containsKey("hubURL")) { |
| 380 | + final String hubURL = URLDecoder.decode(params.get("hubURL")); // what if not encoded? Usually its not |
| 381 | + LongRunningTask.submit(() -> { |
| 382 | + try { |
| 383 | + GenomeManager.getInstance().loadGenome(hubURL, null); |
| 384 | + } catch (IOException e) { |
| 385 | + throw new RuntimeException(e); |
| 386 | + } |
| 387 | + }); |
| 388 | + } |
| 389 | + } else if (command.equals("/load")) { |
381 | 390 | String file = null;
|
382 | 391 | for (String fp : fileParams) {
|
383 | 392 | file = params.get(fp);
|
|
0 commit comments