diff --git a/vip-application/src/main/java/fr/insalyon/creatis/vip/application/client/rpc/ReproVipService.java b/vip-application/src/main/java/fr/insalyon/creatis/vip/application/client/rpc/ReproVipService.java index ec7a70424..ec7807990 100644 --- a/vip-application/src/main/java/fr/insalyon/creatis/vip/application/client/rpc/ReproVipService.java +++ b/vip-application/src/main/java/fr/insalyon/creatis/vip/application/client/rpc/ReproVipService.java @@ -24,6 +24,6 @@ public static ReproVipServiceAsync getInstance() { public void executionAdminEmail(Execution execution); void addExecution(Execution execution) throws CoreException; void updateExecution(String executionID, String newStatus) throws CoreException; - String createReproVipDirectory(String executionName, String executionID, String version) throws CoreException; + String createReproVipDirectory(String executionName, String executionID, String version, String comments) throws CoreException; } diff --git a/vip-application/src/main/java/fr/insalyon/creatis/vip/application/client/rpc/ReproVipServiceAsync.java b/vip-application/src/main/java/fr/insalyon/creatis/vip/application/client/rpc/ReproVipServiceAsync.java index 300b88250..d1cdf8781 100644 --- a/vip-application/src/main/java/fr/insalyon/creatis/vip/application/client/rpc/ReproVipServiceAsync.java +++ b/vip-application/src/main/java/fr/insalyon/creatis/vip/application/client/rpc/ReproVipServiceAsync.java @@ -8,6 +8,6 @@ public interface ReproVipServiceAsync { void executionAdminEmail(Execution execution, AsyncCallback callback); void addExecution(Execution execution, AsyncCallback asyncCallback); void updateExecution(String executionID, String newStatus, AsyncCallback asyncCallback); - void createReproVipDirectory(String executionName, String execution, String version, AsyncCallback callback); + void createReproVipDirectory(String executionName, String execution, String version, String comments, AsyncCallback callback); } diff --git a/vip-application/src/main/java/fr/insalyon/creatis/vip/application/client/view/system/application/ExecutionsContextMenu.java b/vip-application/src/main/java/fr/insalyon/creatis/vip/application/client/view/system/application/ExecutionsContextMenu.java index dca61c233..cb8078b5a 100644 --- a/vip-application/src/main/java/fr/insalyon/creatis/vip/application/client/view/system/application/ExecutionsContextMenu.java +++ b/vip-application/src/main/java/fr/insalyon/creatis/vip/application/client/view/system/application/ExecutionsContextMenu.java @@ -19,7 +19,7 @@ public class ExecutionsContextMenu extends Menu { private String executionID; private ReproVipServiceAsync reproVipServiceAsync = ReproVipService.Util.getInstance(); private ReproVipService reproVipService; - public ExecutionsContextMenu(ModalWindow modal, String executionName, String executionID, String version){ + public ExecutionsContextMenu(ModalWindow modal, String executionName, String executionID, String version, String comments){ this.modal = modal; this.executionID = executionID; this.setShowShadow(true); @@ -31,7 +31,7 @@ public ExecutionsContextMenu(ModalWindow modal, String executionName, String exe OptionPublicExecutionItem.addClickHandler(new ClickHandler() { @Override public void onClick(MenuItemClickEvent event) { - createReproVipDirectory(executionName, executionID, version); + createReproVipDirectory(executionName, executionID, version, comments); } }); @@ -53,8 +53,8 @@ public void onSuccess(Void result) { modal.show("Make execution public", true); reproVipServiceAsync.updateExecution(executionID, "Public", callback); } - public void createReproVipDirectory(String executionName, String executionID, String version) { - reproVipServiceAsync.createReproVipDirectory(executionName, executionID, version, new AsyncCallback() { + public void createReproVipDirectory(String executionName, String executionID, String version, String comments) { + reproVipServiceAsync.createReproVipDirectory(executionName, executionID, version, comments, new AsyncCallback() { public void onFailure(Throwable caught) { SC.warn("Error creating ReproVip directory: " + caught.getMessage()); } diff --git a/vip-application/src/main/java/fr/insalyon/creatis/vip/application/client/view/system/application/ExecutionsLayout.java b/vip-application/src/main/java/fr/insalyon/creatis/vip/application/client/view/system/application/ExecutionsLayout.java index 75894d34d..fd9421fda 100644 --- a/vip-application/src/main/java/fr/insalyon/creatis/vip/application/client/view/system/application/ExecutionsLayout.java +++ b/vip-application/src/main/java/fr/insalyon/creatis/vip/application/client/view/system/application/ExecutionsLayout.java @@ -57,7 +57,8 @@ public void onRowContextClick(RowContextClickEvent event) { String executionName = selectedRecord.getAttribute("application_name"); String executionId = selectedRecord.getAttribute("id"); String version = selectedRecord.getAttribute("version"); - new ExecutionsContextMenu(modal, executionName, executionId, version).showContextMenu(); + String comments = selectedRecord.getAttribute("comments"); + new ExecutionsContextMenu(modal, executionName, executionId, version, comments).showContextMenu(); } }); diff --git a/vip-application/src/main/java/fr/insalyon/creatis/vip/application/server/business/ReproVipBusiness.java b/vip-application/src/main/java/fr/insalyon/creatis/vip/application/server/business/ReproVipBusiness.java index 2a2b0783b..37e47a8ca 100644 --- a/vip-application/src/main/java/fr/insalyon/creatis/vip/application/server/business/ReproVipBusiness.java +++ b/vip-application/src/main/java/fr/insalyon/creatis/vip/application/server/business/ReproVipBusiness.java @@ -107,7 +107,7 @@ public ExecutionJobTaskData getExecutionJobTaskData(String executionID) throws B } return new ExecutionJobTaskData(jobList); } - public String generateReprovipJson(Path reproVipDir, String executionName, String executionID, String version, User currentUser, List provenanceFiles) + public String generateReprovipJson(Path reproVipDir, String executionName, String executionID, String version, String comments, User currentUser, List provenanceFiles) throws BusinessException { List filesToDownload = getFilesToCopyPaths(executionName, executionID, version); @@ -124,7 +124,7 @@ public String generateReprovipJson(Path reproVipDir, String executionName, Strin metadataInner.put("title", "your title"); metadataInner.put("upload_type", "workflow"); - metadataInner.put("description", "your description"); + metadataInner.put("description", comments); List> creators = new ArrayList<>(); Map creator = new LinkedHashMap<>(); @@ -153,7 +153,7 @@ public String generateReprovipJson(Path reproVipDir, String executionName, Strin public void saveJsonToFile(String jsonContent, Path filePath) throws IOException { Files.writeString(filePath, jsonContent); } - public String createReproVipDirectory(String executionName, String executionID, String version, User currentUser) throws BusinessException { + public String createReproVipDirectory(String executionName, String executionID, String version, String comments, User currentUser) throws BusinessException { Path reproVipDir = Paths.get("/vip/ReproVip/" + executionID); logger.info("Creating reprovip dir : {}", reproVipDir); try { @@ -166,7 +166,7 @@ public String createReproVipDirectory(String executionName, String executionID, throw new RuntimeException(e); } List provenanceFiles = copyProvenanceFiles(reproVipDir, executionID); - return generateReprovipJson(reproVipDir, executionName, executionID, version, currentUser, provenanceFiles); + return generateReprovipJson(reproVipDir, executionName, executionID, version, comments, currentUser, provenanceFiles); } public List copyProvenanceFiles(Path reproVipDir, String executionID) { diff --git a/vip-application/src/main/java/fr/insalyon/creatis/vip/application/server/rpc/ReproVipServiceImpl.java b/vip-application/src/main/java/fr/insalyon/creatis/vip/application/server/rpc/ReproVipServiceImpl.java index d5bcf087a..2cf943b82 100644 --- a/vip-application/src/main/java/fr/insalyon/creatis/vip/application/server/rpc/ReproVipServiceImpl.java +++ b/vip-application/src/main/java/fr/insalyon/creatis/vip/application/server/rpc/ReproVipServiceImpl.java @@ -50,10 +50,10 @@ public void updateExecution(String executionID, String newStatus) throws CoreExc throw new CoreException("Failed to update execution", e); } } - public String createReproVipDirectory(String executionName, String executionID, String version) { + public String createReproVipDirectory(String executionName, String executionID, String version, String comments) { try { User currentUser = getSessionUser(); - return reproVipBusiness.createReproVipDirectory(executionName, executionID, version, currentUser); + return reproVipBusiness.createReproVipDirectory(executionName, executionID, version, comments, currentUser); } catch (Exception e) { throw new RuntimeException(e); }