From 335cfe9d28698a07beffb3d5b5a472057b6a9a22 Mon Sep 17 00:00:00 2001 From: Ziheng Sun Date: Wed, 15 Sep 2021 11:17:39 -0400 Subject: [PATCH 01/44] update --- src/main/java/com/gw/utils/GmailAPI.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/gw/utils/GmailAPI.java b/src/main/java/com/gw/utils/GmailAPI.java index 97d2d0924..242325cc4 100644 --- a/src/main/java/com/gw/utils/GmailAPI.java +++ b/src/main/java/com/gw/utils/GmailAPI.java @@ -96,7 +96,7 @@ public static void getMailBody(String searchString) throws IOException { public static Gmail getGmailService() throws IOException, GeneralSecurityException { - String credentials = "{\"web\":{\"client_id\":\"471690502756-7inelnnpit9mp4dofk5sda2op0105d9u.apps.googleusercontent.com\",\"project_id\":\"watersmart-1614386745314\",\"auth_uri\":\"https://accounts.google.com/o/oauth2/auth\",\"token_uri\":\"https://oauth2.googleapis.com/token\",\"auth_provider_x509_cert_url\":\"https://www.googleapis.com/oauth2/v1/certs\",\"client_secret\":\"fmqHZjd4H9VOeOymUfwY-O6V\",\"redirect_uris\":[\"http://localhost:8070/Geoweaver\"]}}"; + String credentials = "{\"web\":{\"client_id\":\"471690502756-7inelnnpit9mp4dofk5sda2op0105d9u.apps.googleusercontent.com\",\"project_id\":\"watersmart-1614386745314\",\"auth_uri\":\"https://accounts.google.com/o/oauth2/auth\",\"token_uri\":\"https://oauth2.googleapis.com/token\",\"auth_provider_x509_cert_url\":\"https://www.googleapis.com/oauth2/v1/certs\",\"client_secret\":\"fmqHZjd4H9VOe\",\"redirect_uris\":[\"http://localhost:8070/Geoweaver\"]}}"; InputStream in = new ByteArrayInputStream(credentials.getBytes()); GoogleClientSecrets clientSecrets = GoogleClientSecrets.load(JSON_FACTORY, new InputStreamReader(in)); @@ -131,7 +131,7 @@ private static String getAccessToken() { Map params = new LinkedHashMap<>(); params.put("grant_type", "refresh_token"); params.put("client_id", "471690502756-7inelnnpit9mp4dofk5sda2op0105d9u.apps.googleusercontent.com"); //Replace this - params.put("client_secret", "fmqHZjd4H9VOeOymUfwY-O6V"); + params.put("client_secret", "fmqHZjd4H9VO"); params.put("refresh_token", "1//04xhq952D9aCfCgYIARAAGAQSNwF-L9IrHfxJgvKwZDiIHKSkIORtB3uxMmnKTQRUMoJhhYzQkukS731bRDtMEcWfFJJISYWVUNI"); //Replace this From 32eb255a76a6531785956601def150583ca5cc93 Mon Sep 17 00:00:00 2001 From: Ziheng Sun Date: Wed, 15 Sep 2021 16:38:57 -0400 Subject: [PATCH 02/44] update --- .../com/gw/local/LocalSessionNixImpl.java | 2 +- .../java/com/gw/ssh/SSHCmdSessionOutput.java | 20 +-- .../java/com/gw/ssh/SSHLiveSessionOutput.java | 120 +++++------------- src/main/java/com/gw/ssh/SSHSessionImpl.java | 6 +- src/main/java/com/gw/workers/Worker.java | 10 ++ 5 files changed, 60 insertions(+), 98 deletions(-) diff --git a/src/main/java/com/gw/local/LocalSessionNixImpl.java b/src/main/java/com/gw/local/LocalSessionNixImpl.java index 65226983f..9f5d19f4b 100644 --- a/src/main/java/com/gw/local/LocalSessionNixImpl.java +++ b/src/main/java/com/gw/local/LocalSessionNixImpl.java @@ -152,7 +152,7 @@ public void runBash(String history_id, String script, String processid, boolean tempfile = workspace_folder_path + "/gw-" + token + "-" + history.getHistory_id() + ".sh"; - script += "\necho \"==== Geoweaver Bash Output Finished ====\""; + // script += "\necho \"==== Geoweaver Bash Output Finished ====\""; bt.writeString2File(script, tempfile); diff --git a/src/main/java/com/gw/ssh/SSHCmdSessionOutput.java b/src/main/java/com/gw/ssh/SSHCmdSessionOutput.java index d8e2cdc30..74335798c 100644 --- a/src/main/java/com/gw/ssh/SSHCmdSessionOutput.java +++ b/src/main/java/com/gw/ssh/SSHCmdSessionOutput.java @@ -183,7 +183,7 @@ public void run() { } - log.info("wsout message {}:{}", wsout.getId(), line); + log.debug("wsout message {}:{}", wsout.getId(), line); // out.sendMessage(new TextMessage(line)); sendMessage2WebSocket(line); @@ -222,16 +222,20 @@ public void run() { public void sendMessage2WebSocket(String msg){ - synchronized(wsout){ + if(!bt.isNull(wsout)){ + + synchronized(wsout){ - try { - if(!bt.isNull(wsout) && wsout.isOpen()) - wsout.getBasicRemote().sendText(msg); - } catch (Exception e) { - e.printStackTrace(); + try { + if(wsout.isOpen()) + wsout.getBasicRemote().sendText(msg); + } catch (Exception e) { + e.printStackTrace(); + } + } - } + } diff --git a/src/main/java/com/gw/ssh/SSHLiveSessionOutput.java b/src/main/java/com/gw/ssh/SSHLiveSessionOutput.java index 94b481961..440bc07a5 100644 --- a/src/main/java/com/gw/ssh/SSHLiveSessionOutput.java +++ b/src/main/java/com/gw/ssh/SSHLiveSessionOutput.java @@ -99,102 +99,50 @@ public void run() { int startrecorder = -1; int nullnumber = 0; - - while (run) { + + String line = null; + + try{ + + while ((line = in.readLine())!=null) { - try { - - // readLine will block if nothing to send - - String line = in.readLine(); - -// out.sendMessage(new TextMessage(line)); - -// linenumber++; -// -// //when detected the command is finished, end this process -// if(BaseTool.isNull(line)) { -// -// //if ten consective output lines are null, break this loop -// -// if(startrecorder==-1) -// startrecorder = linenumber; -// else -// nullnumber++; -// -// if(nullnumber==10) { -// -// if((startrecorder+nullnumber)==linenumber) { -// -// System.out.println("null output lines exceed 100. Disconnected."); -// -// GeoweaverController.sshSessionManager.closeByToken(token); -// -// break; -// -// }else { -// -// startrecorder = -1; -// -// nullnumber = 0; -// -// } -// -// } -// -// }else if(line.contains("==== Geoweaver Bash Output Finished ====")) { -// -// SSHSession session = GeoweaverController.sshSessionManager.sshSessionByToken.get(token); -// -// session.saveHistory(logs.toString()); -// -// GeoweaverController.sshSessionManager.closeByToken(token); -// -// break; -// -// } -// - log.info("shell thread output >> " + line); -// -// logs.append(line).append("\n"); - - if(!bt.isNull(wsout) && wsout.isOpen()) { -// -// if(prelog.toString()!=null) { -// -// line = prelog.toString() + line; -// -// prelog = new StringBuffer(); -// -// } - - log.info("wsout message {}:{}", token, line); + try { + + // readLine will block if nothing to send -// out.sendMessage(new TextMessage(line)); // for the SockJS session to deliver it back to the SSH Terminal + // String line = in.readLine(); - wsout.getBasicRemote().sendText(line); // for the All information web socket session + log.debug("shell thread output >> " + line); + + if(!bt.isNull(wsout) && wsout.isOpen()) { + + log.debug("wsout message {}:{}", token, line); + + wsout.getBasicRemote().sendText(line); // for the All information web socket session + + }else { + + wsout = TerminalServlet.findSessionById(token); + + } + + } catch (Exception e) { + + e.printStackTrace(); + + GeoweaverController.sessionManager.closeByToken(token); -// }else { -// -// prelog.append(line).append("\n"); -// - }else { - - wsout = TerminalServlet.findSessionById(token); - } - } catch (Exception e) { - - e.printStackTrace(); - - GeoweaverController.sessionManager.closeByToken(token); - } + log.debug("SSH session output thread ended"); + + }catch(Exception e){ + + e.printStackTrace(); } - log.info("SSH session output thread ended"); } diff --git a/src/main/java/com/gw/ssh/SSHSessionImpl.java b/src/main/java/com/gw/ssh/SSHSessionImpl.java index 22d24780e..b302568d8 100644 --- a/src/main/java/com/gw/ssh/SSHSessionImpl.java +++ b/src/main/java/com/gw/ssh/SSHSessionImpl.java @@ -364,7 +364,7 @@ public void runPython(String history_id, String python, String processid, boolea } - cmdline += "echo \"==== Geoweaver Bash Output Finished ====\""; + // cmdline += "echo \"==== Geoweaver Bash Output Finished ====\""; cmdline += "cd ..; rm -R " + token + "*;"; @@ -462,7 +462,7 @@ public void runJupyter(String history_id, String notebookjson, String processid, cmdline += "rm ./jupyter-" + history.getHistory_id() + ".ipynb; "; // remove the script finally, leave no trace behind - cmdline += "echo \"==== Geoweaver Bash Output Finished ====\""; + // cmdline += "echo \"==== Geoweaver Bash Output Finished ====\""; // cmdline += "./geoweaver-" + token + ".sh;"; @@ -532,7 +532,7 @@ public void runBash(String history_id, String script, String processid, boolean log.info("starting command"); - script += "\n echo \"==== Geoweaver Bash Output Finished ====\""; + // script += "\n echo \"==== Geoweaver Bash Output Finished ====\""; String cmdline = "echo \"" + script.replaceAll("\r\n", "\n").replaceAll("\\$", "\\\\\\$").replaceAll("\"", "\\\\\"") diff --git a/src/main/java/com/gw/workers/Worker.java b/src/main/java/com/gw/workers/Worker.java index f27f6852b..f09ca2e9e 100644 --- a/src/main/java/com/gw/workers/Worker.java +++ b/src/main/java/com/gw/workers/Worker.java @@ -56,9 +56,19 @@ public void setStatus(boolean status) { this.status = status; } + public void printoutCallStack(){ + System.out.println("Printing stack trace:"); + StackTraceElement[] elements = Thread.currentThread().getStackTrace(); + for (int i = 1; i < elements.length; i++) { + StackTraceElement s = elements[i]; + System.out.println("\tnull websocket trace at " + s.getClassName() + "." + s.getMethodName() + "(" + s.getFileName() + ":" + s.getLineNumber() + ")"); + } + } public void setTask(Task t) { + + this.printoutCallStack(); this.t = t; From 07f26b9a6cb84f0369fd54b414ad44400ddcc7fc Mon Sep 17 00:00:00 2001 From: ZihengSun Date: Fri, 17 Sep 2021 08:25:43 -0400 Subject: [PATCH 03/44] fix the host missing after editing problem --- src/main/java/com/gw/tools/HostTool.java | 16 +++++++++------- .../java/com/gw/web/GeoweaverController.java | 4 +++- src/main/resources/static/js/gw.host.js | 12 +++++++++++- 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/gw/tools/HostTool.java b/src/main/java/com/gw/tools/HostTool.java index 257e79600..7e7760602 100644 --- a/src/main/java/com/gw/tools/HostTool.java +++ b/src/main/java/com/gw/tools/HostTool.java @@ -850,15 +850,15 @@ public String getEnvironments(String hid) { * @param object * @return */ - public String update(String hostid, String hostname, String hostip, String hostport, String username, String type, String owner, String url) { + public String update(String hostid, String hostname, String hostip, String hostport, String username, String type, String owner, String url, String confidential) { String resp = null; try { - Host h = new Host(); + Host h = this.getHostById(hostid); - h.setId(hostid); + // h.setId(hostid); h.setName(hostname); @@ -866,13 +866,15 @@ public String update(String hostid, String hostname, String hostip, String hostp if(!bt.isNull(hostport)) h.setPort(hostport); - h.setUsername(username); + if(!bt.isNull(username)) h.setUsername(username); - h.setType(type); + if(!bt.isNull(type)) h.setType(type); - h.setOwner(owner); + if(!bt.isNull(owner)) h.setOwner(owner); - h.setUrl(url); + if(!bt.isNull(url)) h.setUrl(url); + + if(!bt.isNull(confidential)) h.setConfidential(confidential); hostrepository.save(h); diff --git a/src/main/java/com/gw/web/GeoweaverController.java b/src/main/java/com/gw/web/GeoweaverController.java index c1093347e..12306dc31 100644 --- a/src/main/java/com/gw/web/GeoweaverController.java +++ b/src/main/java/com/gw/web/GeoweaverController.java @@ -956,12 +956,14 @@ public ResponseEntity fileGetter(ModelMap model, @PathVariable(value=" String username = request.getParameter("username"); String hosttype = request.getParameter("hosttype"); + + String confidential = request.getParameter("confidential"); String url = request.getParameter("url"); // String owner = request.getParameter("owner"); - ht.update(hostid, hostname, hostip, hostport, username, hosttype, null, url); + ht.update(hostid, hostname, hostip, hostport, username, hosttype, null, url, confidential); resp = "{ \"hostid\" : \"" + hostid + "\", \"hostname\" : \""+ hostname + "\" }"; diff --git a/src/main/resources/static/js/gw.host.js b/src/main/resources/static/js/gw.host.js index 655269f56..d7618c074 100644 --- a/src/main/resources/static/js/gw.host.js +++ b/src/main/resources/static/js/gw.host.js @@ -1083,6 +1083,14 @@ GW.host = { jupyter_url = $("#_host_url").val() } + + var confidential = "FALSE"; //default is public + + if(typeof $('input[name="confidential"]:checked').val() != "undefined"){ + + confidential = $('input[name="confidential"]:checked').val() + + } var req = { @@ -1100,7 +1108,9 @@ GW.host = { username: hostusername, - hostid: hostid + hostid: hostid, + + confidential: confidential } From aafc2ac4331c293567c45cc89aade06408ceeb23 Mon Sep 17 00:00:00 2001 From: ZihengSun Date: Fri, 17 Sep 2021 08:40:05 -0400 Subject: [PATCH 04/44] update --- src/main/resources/static/js/gw.workflow.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/main/resources/static/js/gw.workflow.js b/src/main/resources/static/js/gw.workflow.js index e66090754..2762e4e8e 100644 --- a/src/main/resources/static/js/gw.workflow.js +++ b/src/main/resources/static/js/gw.workflow.js @@ -237,6 +237,15 @@ GW.workflow = { '
'+ ' '+ '
'+ + ' '+ + '
'+ + ' '+ + '
'+ + ' '+ + ' '+ + ' '+ + ' '+ + '
'+ '
'+ ''; @@ -249,6 +258,14 @@ GW.workflow = { $("#new-workflow-confirm").click(function(){ $("#new-workflow-confirm").prop('disabled', true); + + var confidential = "FALSE"; //default is public + + if(typeof $('input[name="confidential"]:checked').val() != "undefined"){ + + confidential = $('input[name="confidential"]:checked').val() + + } //save the new workflow @@ -257,6 +274,8 @@ GW.workflow = { "name": $("#workflow_name").val(), "type": "workflow", + + "confidential": confidential, "nodes": JSON.stringify(GW.workspace.theGraph.nodes), From 3dca208ddd6e4e98a4fd3fc39ee98d4ba64648a5 Mon Sep 17 00:00:00 2001 From: Ziheng Sun Date: Fri, 17 Sep 2021 21:05:46 -0400 Subject: [PATCH 05/44] update --- .../java/com/gw/local/LocalSessionNixImpl.java | 6 ++++-- src/main/java/com/gw/utils/BaseTool.java | 14 ++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/gw/local/LocalSessionNixImpl.java b/src/main/java/com/gw/local/LocalSessionNixImpl.java index 9f5d19f4b..3747b6ca8 100644 --- a/src/main/java/com/gw/local/LocalSessionNixImpl.java +++ b/src/main/java/com/gw/local/LocalSessionNixImpl.java @@ -156,7 +156,9 @@ public void runBash(String history_id, String script, String processid, boolean bt.writeString2File(script, tempfile); - Runtime.getRuntime().exec(new String[] {"chmod", "+x", tempfile}); + Runtime.getRuntime().exec(new String[] {"chmod", "+x", tempfile}).waitFor(); + + bt.sleep(1000); ProcessBuilder builder = new ProcessBuilder(); @@ -229,7 +231,7 @@ public void runJupyter(String history_id, String notebookjson, String processid, // cmdline += "source activate " + env + "; "; //for demo only - Runtime.getRuntime().exec(new String[] {"source", "activate", env}); + Runtime.getRuntime().exec(new String[] {"source", "activate", env}).waitFor(); // cmdline += bin + " " + filename + "; "; diff --git a/src/main/java/com/gw/utils/BaseTool.java b/src/main/java/com/gw/utils/BaseTool.java index 90e7d19e4..55711d149 100644 --- a/src/main/java/com/gw/utils/BaseTool.java +++ b/src/main/java/com/gw/utils/BaseTool.java @@ -287,6 +287,20 @@ public void createWorkspace(String filepath) { } + public void sleep(long timelen){ + + try { + + Thread.sleep(timelen); //1000 milliseconds is one second. + + } catch(InterruptedException ex) { + + // Thread.currentThread().interrupt(); + ex.printStackTrace(); + + } + } + /** * Write string to file * @param content From e939cdc141f5718f2fb8d11b9c9e7f57c840974b Mon Sep 17 00:00:00 2001 From: ZihengSun Date: Sun, 19 Sep 2021 23:38:56 -0400 Subject: [PATCH 06/44] update --- src/main/resources/static/js/gw.workflow.js | 19 +++++++--- src/main/resources/static/js/gw.workspace.js | 39 +++++++++++++++++++- 2 files changed, 51 insertions(+), 7 deletions(-) diff --git a/src/main/resources/static/js/gw.workflow.js b/src/main/resources/static/js/gw.workflow.js index 2762e4e8e..d9e9af41a 100644 --- a/src/main/resources/static/js/gw.workflow.js +++ b/src/main/resources/static/js/gw.workflow.js @@ -233,8 +233,8 @@ GW.workflow = { var content = ''; diff --git a/src/main/resources/static/js/gw.workspace.js b/src/main/resources/static/js/gw.workspace.js index c90c04606..92d1e3e7d 100644 --- a/src/main/resources/static/js/gw.workspace.js +++ b/src/main/resources/static/js/gw.workspace.js @@ -841,6 +841,41 @@ GW.workspace = { GW.workspace.showNonSaved(); } + GW.workspace.GraphCreator.prototype.deleteSelected = function(){ + + if(Object.keys(BootstrapDialog.dialogs).length){ + return; //if there are shown dialogs, key activity will be disconnected from svg + } + var thisGraph = this, + state = thisGraph.state, + consts = thisGraph.consts; + + var selectedNode = state.selectedNode, + selectedEdge = state.selectedEdge; + + if(document.getElementById("workspace").style.display=="block"){ + + if (selectedNode){ + + var pid = selectedNode.id; + console.log("going to remove process: " + pid); + // GW.menu.del(pid, "process"); + thisGraph.removeNode(pid); + + } else if (selectedEdge){ + + //removing an edge is much easier than removing a process + thisGraph.edges.splice(thisGraph.edges.indexOf(selectedEdge), 1); + state.selectedEdge = null; + GW.workspace.showNonSaved(); + thisGraph.updateGraph(); + + } + } + + + } + GW.workspace.GraphCreator.prototype.deleteSelectedOrAll = function(){ if(Object.keys(BootstrapDialog.dialogs).length){ @@ -898,8 +933,8 @@ GW.workspace = { switch(d3.event.keyCode) { case consts.BACKSPACE_KEY: case consts.DELETE_KEY: - d3.event.preventDefault(); - this.deleteSelectedOrAll(); + // d3.event.preventDefault(); + this.deleteSelected(); // if(document.getElementById("workspace").style.display=="block"){ // if (selectedNode){ From 88c790c50db13d854eb301c7e5049dff6334243f Mon Sep 17 00:00:00 2001 From: Ziheng Sun Date: Mon, 20 Sep 2021 16:52:00 -0400 Subject: [PATCH 07/44] add landing page for workflows --- src/main/java/com/gw/tools/UserTool.java | 1 + src/main/java/com/gw/tools/WorkflowTool.java | 29 +- .../java/com/gw/web/LandingController.java | 81 +++ src/main/resources/templates/geoweaver.html | 3 - .../templates/wf_landing_template.html | 639 ++++++++++++++++++ 5 files changed, 744 insertions(+), 9 deletions(-) create mode 100644 src/main/java/com/gw/web/LandingController.java create mode 100644 src/main/resources/templates/wf_landing_template.html diff --git a/src/main/java/com/gw/tools/UserTool.java b/src/main/java/com/gw/tools/UserTool.java index 6b2bf518a..1523abc5c 100644 --- a/src/main/java/com/gw/tools/UserTool.java +++ b/src/main/java/com/gw/tools/UserTool.java @@ -107,6 +107,7 @@ public void cleanExpiredAuth(){ } + public boolean isAuth(String jssessionid, String ipaddress){ boolean isauth = false; diff --git a/src/main/java/com/gw/tools/WorkflowTool.java b/src/main/java/com/gw/tools/WorkflowTool.java index bdcaecd9d..ac1c61fb7 100644 --- a/src/main/java/com/gw/tools/WorkflowTool.java +++ b/src/main/java/com/gw/tools/WorkflowTool.java @@ -16,6 +16,7 @@ import com.gw.tasks.GeoweaverWorkflowTask; import com.gw.tasks.TaskManager; import com.gw.utils.RandomString; +import com.gw.utils.BaseTool; import org.apache.log4j.Logger; import org.json.simple.JSONArray; @@ -52,6 +53,12 @@ public class WorkflowTool { @Autowired HistoryTool tool; + + @Autowired + UserTool ut; + + @Autowired + BaseTool bt; @Autowired GeoweaverWorkflowTask task; @@ -659,17 +666,27 @@ public String one_history(String hid) { } - public static void main(String[] args) throws ParseException { + // public static void main(String[] args) throws ParseException { - String jsonarray = "[{\"name\": \"1\"}, {\"name\": \"2\"}]"; + // String jsonarray = "[{\"name\": \"1\"}, {\"name\": \"2\"}]"; - JSONParser parser = new JSONParser(); + // JSONParser parser = new JSONParser(); - JSONArray obj = (JSONArray)parser.parse(jsonarray); + // JSONArray obj = (JSONArray)parser.parse(jsonarray); - System.out.println("parsed json objects: " + obj.size()); + // System.out.println("parsed json objects: " + obj.size()); - } + // } + + public String getOwnerNameByID(String ownerid) { + + String ownername = "Public User"; + + if(!bt.isNull(ownerid)) + ownername = ut.getUserById(ownerid).getUsername(); + + return ownername; + } } diff --git a/src/main/java/com/gw/web/LandingController.java b/src/main/java/com/gw/web/LandingController.java new file mode 100644 index 000000000..fe2f320ff --- /dev/null +++ b/src/main/java/com/gw/web/LandingController.java @@ -0,0 +1,81 @@ +package com.gw.web; + +import com.gw.jpa.Workflow; +import com.gw.search.GWSearchTool; +import com.gw.tools.DashboardTool; +import com.gw.tools.FileTool; +import com.gw.tools.HistoryTool; +import com.gw.tools.HostTool; +import com.gw.tools.ProcessTool; +import com.gw.tools.WorkflowTool; +import com.gw.utils.BaseTool; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; + +@Controller +@RequestMapping(value="/landing") +public class LandingController { + + Logger logger = LoggerFactory.getLogger(getClass()); + + @Autowired + ProcessTool pt; + + @Autowired + WorkflowTool wt; + + @Autowired + HostTool ht; + + @Autowired + BaseTool bt; + + @Autowired + GWSearchTool st; + + @Autowired + FileTool ft; + + @Autowired + HistoryTool hist; + + @Autowired + DashboardTool dbt; + + @RequestMapping(value="/{wf_id}", method= RequestMethod.GET) + public String workflow_landingpage(@PathVariable(value="wf_id") final String workflow_id, final ModelMap model){ + + //check if the workflow is public. Private workflows have no public landing page. + // + Workflow wf = wt.getById(workflow_id); + + if(!bt.isNull(wf)){ + + if("FALSE".equals(wf.getConfidential())){ + + String ownername = wt.getOwnerNameByID(wf.getOwner()); + + model.addAttribute("workflow", wf); + + model.addAttribute("username", ownername); + + }else{ + + + + } + + } + + return "wf_landing_template"; + + } + +} diff --git a/src/main/resources/templates/geoweaver.html b/src/main/resources/templates/geoweaver.html index aaff76472..41a2b6883 100644 --- a/src/main/resources/templates/geoweaver.html +++ b/src/main/resources/templates/geoweaver.html @@ -596,9 +596,6 @@