Skip to content
Snippets Groups Projects
Commit dcdf1ae1 authored by juanf's avatar juanf
Browse files

SSDM-4223 : Lab notebooks get created and open after creation, even if...

SSDM-4223 : Lab notebooks get created and open after creation, even if filenames collide and the server renames then in sequence

SVN: 38654
parent f9cfe769
No related branches found
No related tags found
No related merge requests found
...@@ -18,9 +18,10 @@ var JupyterUtil = new function() { ...@@ -18,9 +18,10 @@ var JupyterUtil = new function() {
this.createJupyterNotebookAndOpen = function(dataSetIds) { this.createJupyterNotebookAndOpen = function(dataSetIds) {
var folder = "openbis"; var folder = "openbis";
var fileName = dataSetIds[0]; var fileName = dataSetIds[0] + ".ipynb";
var jupyterURL = profile.jupyterIntegrationServerEndpoint + "?token=" + mainController.serverFacade.openbisServer.getSession() + "&folder=" + folder + "&filename=" + fileName + ".ipynb"; var jupyterURL = profile.jupyterIntegrationServerEndpoint + "?token=" + mainController.serverFacade.openbisServer.getSession() + "&folder=" + folder + "&filename=" + fileName;
var newJupyterNotebook = this.createJupyterNotebookContent(dataSetIds); var newJupyterNotebook = this.createJupyterNotebookContent(dataSetIds);
var jupyterNotebookURL = profile.jupyterEndpoint + "user/" + mainController.serverFacade.getUserId() + "/notebooks/" + folder + "/";
$.ajax({ $.ajax({
url : jupyterURL, url : jupyterURL,
...@@ -31,7 +32,9 @@ var JupyterUtil = new function() { ...@@ -31,7 +32,9 @@ var JupyterUtil = new function() {
// contentType: 'application/json', // contentType: 'application/json',
data : JSON.stringify(newJupyterNotebook), data : JSON.stringify(newJupyterNotebook),
success : function(result) { success : function(result) {
alert("success:" + JSON.stringify(result)); //alert("success:" + JSON.stringify(result));
var win = window.open(jupyterNotebookURL + result.fileName, '_blank');
win.focus();
}, },
error : function(result) { error : function(result) {
alert("error: " + JSON.stringify(result)); alert("error: " + JSON.stringify(result));
...@@ -49,7 +52,7 @@ var JupyterUtil = new function() { ...@@ -49,7 +52,7 @@ var JupyterUtil = new function() {
}, },
"outputs": [], "outputs": [],
"source": [ "source": [
"Initialize Openbis API\n", "#Initialize Openbis API\n",
"o = Openbis(url='" + profile.jupyterOpenbisEndpoint + "', verify_certificates=False)" "o = Openbis(url='" + profile.jupyterOpenbisEndpoint + "', verify_certificates=False)"
] ]
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment