Skip to content

Commit 5573c89

Browse files
author
Mark Robinson
committed
Add link to download the RO bundle to workflow page
1 parent 5bdd6a0 commit 5573c89

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

src/main/java/org/commonwl/viewer/domain/Workflow.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public class Workflow {
4343

4444
// ID for database
4545
@Id
46-
private String id;
46+
public String id;
4747

4848
// Metadata
4949
@Indexed(unique = true)
@@ -83,6 +83,10 @@ public Workflow(String label, String doc, Map<String, CWLElement> inputs, Map<St
8383

8484
public String getID() { return id; }
8585

86+
public void setId(String id) {
87+
this.id = id;
88+
}
89+
8690
public String getLabel() {
8791
return label;
8892
}

src/main/java/org/commonwl/viewer/web/WorkflowController.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ public ModelAndView getWorkflow(@PathVariable String workflowID){
141141
method = RequestMethod.GET,
142142
produces = "application/vnd.wf4ever.robundle+zip")
143143
@ResponseBody
144-
public FileSystemResource getFile(@PathVariable("workflowID") String workflowID,
145-
HttpServletResponse response) {
144+
public FileSystemResource downloadROBundle(@PathVariable("workflowID") String workflowID,
145+
HttpServletResponse response) {
146146

147147
// Get workflow from database
148148
Workflow workflowModel = workflowRepository.findOne(workflowID);

src/main/resources/templates/workflow.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,10 @@ <h2>Workflow: <span th:text="${workflow.label}">Workflow Name</span></h2>
105105
<img id="githubLogo" src="../static/img/GitHub-Mark-32px.png" th:src="@{/img/GitHub-Mark-32px.png}" width="24" height="24" />
106106
</a>
107107
<i>Fetched <span th:text="${{workflow.retrievedOn}}">01/12/16 at 21:00</span></i>
108+
<span th:if="${workflow.roBundle != null}">
109+
- <a th:href="@{'/workflows/' + ${workflow.id} + '/download'}" href="#">Download as Research Object Bundle</a>
110+
<a href="http://www.researchobject.org/" rel="noopener" target="_blank">[?]</a>
111+
</span>
108112
</p>
109113
<p th:text="${workflow.doc}">Workflow Doc</p>
110114
</div>

0 commit comments

Comments
 (0)