Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repro vip add support public exec #418

Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
8fd5b08
adding option right click in simulations tab
alexcornier Apr 20, 2023
250b1b9
email send to the admins for the request to make an execution
alexcornier Apr 27, 2023
0dfeb80
form creation of make an execution public
alexcornier May 24, 2023
4b09aab
New execution tab in DAO created
alexcornier Jun 5, 2023
33902d9
email sent when user wants to make execution public after filling for…
alexcornier Jun 12, 2023
9eaf7c9
Creating a ReproVIP app on VIP home page
alexcornier Jun 26, 2023
ed7e758
grid creation list executions reproVIP
alexcornier Jun 27, 2023
ad4050b
added right-click context menu for ReproVipTab
alexcornier Jun 28, 2023
364981b
linked workflowID with an execution
alexcornier Jun 29, 2023
6b81275
added jackson-databind
alexcornier Jun 30, 2023
2e5d512
update status of an Exectuion when it's public
alexcornier Jul 5, 2023
33e75f2
Pass SessionUser to executionOutputData function
alexcornier Jul 11, 2023
475742d
download output files from VIP
alexcornier Jul 12, 2023
4752963
parse the execution pop up to get only the path for ouput
alexcornier Jul 27, 2023
c51a07a
creation of new class for input & ouput data print them together in t…
alexcornier Aug 23, 2023
87a4fc2
adding json download button on ReproVIP popup
alexcornier Aug 25, 2023
c32fba1
Merge branch 'develop' into reproVIP_add_support_public_exec
alexcornier Aug 25, 2023
68f30c6
Saved json file inside workflow folder
alexcornier Aug 28, 2023
b66c607
retrieve all job related information frome one execution
alexcornier Aug 31, 2023
c41b6d9
change checkbox outputfile
alexcornier Oct 2, 2023
654876f
created reproVIP repository
alexcornier Oct 5, 2023
dcdd092
copy files app descriptor & provenance file to ReproVip directory
alexcornier Oct 17, 2023
e7e6fae
copied app descriptor in ReproVip directory is working
alexcornier Oct 18, 2023
741b0d6
created structured json file with url + metadata
alexcornier Oct 19, 2023
2dc0177
Merge 'Create ReproVIP Directory' and 'Create Structured JSON' functi…
alexcornier Oct 24, 2023
aea03f1
added file to upload in structuredjson file
alexcornier Oct 26, 2023
5c948c1
linked comments from reproVIP form with structured json
alexcornier Oct 27, 2023
82f03f5
Copy provenance files to subfolders
alexcornier Nov 2, 2023
306bbd1
create subfolder named with invocationID
alexcornier Nov 6, 2023
3d0ad77
added loading in reproVIP form
alexcornier Nov 6, 2023
dd6bcde
Merge remote-tracking branch 'upstream/develop' into reproVIP_add_sup…
alexcornier Nov 6, 2023
e3d5f7a
map invocatioID + output & subfolder name with invocationID
alexcornier Nov 7, 2023
472449e
changes for workflowMetadata.json added boutique_descriptor_url & wor…
alexcornier Nov 9, 2023
949637a
changed status executions when creating the reproVIP directory
alexcornier Nov 13, 2023
17a5268
item deleteting ReproVIP directory
alexcornier Nov 15, 2023
6fad8f5
checked if execution already exists before accessing to the ReproVIP …
alexcornier Nov 16, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cp vip-portal/target/vip-portal-2.6-SNAPSHOT-local.war /home/cornier/workspace/tools/apache-tomcat-9.0.70/webapps/ROOT.war
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ knowledge of the CeCILL-B license and that you accept its terms.

<!-- Servlets -->
<servlet class="fr.insalyon.creatis.vip.application.server.rpc.ApplicationServiceImpl" path="/applicationservice"/>
<servlet class="fr.insalyon.creatis.vip.application.server.rpc.ExecutionsServiceImpl" path="/executionsservice"/>
<servlet class="fr.insalyon.creatis.vip.application.server.rpc.WorkflowServiceImpl" path="/workflowservice"/>
<servlet class="fr.insalyon.creatis.vip.application.server.rpc.JobServiceImpl" path="/jobservice"/>
<servlet class="fr.insalyon.creatis.vip.application.server.rpc.LoggerServlet" path="/remote_logging"/>
<servlet class="fr.insalyon.creatis.vip.application.server.rpc.ReproVipServiceImpl" path="/reprovipservice"/>
</module>
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public class ApplicationConstants {
public final static String TAB_MANAGE_ENGINE = "manage_engine_tab";
public final static String TAB_MONITOR = "monitor_tab";
public final static String TAB_STATS = "stats_tab";
public final static String TAB_REPROVIP = "reproVip_tab";
// Icons
private static final String IMG_FOLDER = "application/";
public static final String ICON_APPLICATION = IMG_FOLDER + "icon-application.png";
Expand Down Expand Up @@ -107,6 +108,7 @@ public class ApplicationConstants {
public static final String APP_SIMULATION_ERROR = "Error File";
public static final String APP_SIMULATION_OUT = "Output File";
public static final String APP_PUBLIC_APPLICATION = "Applications";
public static final String APP_REPRO_VIP = "ReproVIP";
// Application Images
public static final String APP_IMG_APPLICATION = IMG_FOLDER + "app-application.png";
public static final String APP_IMG_CLASSES = IMG_FOLDER + "app-classes.png";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package fr.insalyon.creatis.vip.application.client.rpc;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.ServiceDefTarget;
import fr.insalyon.creatis.vip.application.client.view.ApplicationException;
import fr.insalyon.creatis.vip.core.client.bean.Execution;

import java.util.List;

public interface ExecutionsService extends RemoteService {

public static final String SERVICE_URI = "/executionsservice";

public static class Util {
public static ExecutionsServiceAsync getInstance() {
ExecutionsServiceAsync instance = (ExecutionsServiceAsync) GWT.create(ExecutionsService.class);
ServiceDefTarget target = (ServiceDefTarget) instance;
target.setServiceEntryPoint(GWT.getModuleBaseURL() + SERVICE_URI);
return instance;
}
}
public List<Execution> getExecutions() throws ApplicationException;
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package fr.insalyon.creatis.vip.application.client.rpc;

import com.google.gwt.user.client.rpc.AsyncCallback;
import fr.insalyon.creatis.vip.core.client.bean.Execution;

import java.util.List;

public interface ExecutionsServiceAsync {
void getExecutions(AsyncCallback<List<Execution>> callback);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package fr.insalyon.creatis.vip.application.client.rpc;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.ServiceDefTarget;
import fr.insalyon.creatis.vip.application.client.view.ApplicationException;
import fr.insalyon.creatis.vip.core.client.bean.Execution;
import fr.insalyon.creatis.vip.core.client.bean.User;
import fr.insalyon.creatis.vip.core.client.view.CoreException;

public interface ReproVipService extends RemoteService {

public static final String SERVICE_URI = "/reprovipservice";

public static class Util {

public static ReproVipServiceAsync getInstance() {
ReproVipServiceAsync instance = (ReproVipServiceAsync) GWT.create(ReproVipService.class);
ServiceDefTarget target = (ServiceDefTarget) instance;
target.setServiceEntryPoint(GWT.getModuleBaseURL() + SERVICE_URI);
return instance;
}
}
public void executionAdminEmail(Execution execution);
void addExecution(Execution execution) throws CoreException;
void updateExecution(String executionID, String newStatus) throws CoreException;
void executionOutputData(String executionID) throws CoreException;
String downloadJsonOutputData(String executionID) throws CoreException;
void createReproVipDirectory(String executionName, String executionID, String version) throws CoreException;
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package fr.insalyon.creatis.vip.application.client.rpc;

import com.google.gwt.user.client.rpc.AsyncCallback;
import fr.insalyon.creatis.vip.core.client.bean.Execution;
import fr.insalyon.creatis.vip.core.client.bean.User;

public interface ReproVipServiceAsync {
void executionAdminEmail(Execution execution, AsyncCallback<Void> callback);
void addExecution(Execution execution, AsyncCallback<Void> asyncCallback);
void updateExecution(String executionID, String newStatus, AsyncCallback<Void> asyncCallback);
void executionOutputData(String executionID, AsyncCallback<Void> callback);
void downloadJsonOutputData(String executionID, AsyncCallback<String> callback);
void createReproVipDirectory(String executionName, String execution, String version, AsyncCallback<Void> callback);
}

Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import fr.insalyon.creatis.vip.application.client.ApplicationConstants;
import fr.insalyon.creatis.vip.application.client.view.monitor.SimulationsTab;
import fr.insalyon.creatis.vip.application.client.view.system.application.ManageApplicationsTab;
import fr.insalyon.creatis.vip.application.client.view.system.application.ReproVipTab;
import fr.insalyon.creatis.vip.core.client.CoreModule;
import fr.insalyon.creatis.vip.core.client.bean.User;
import fr.insalyon.creatis.vip.core.client.view.CoreConstants;
Expand All @@ -56,6 +57,9 @@ public void loadApplications() {

addApplication(ApplicationConstants.APP_PUBLIC_APPLICATION,
ApplicationConstants.APP_IMG_APPLICATION);

addApplication(ApplicationConstants.APP_REPRO_VIP,
ApplicationConstants.APP_IMG_APPLICATION);
}

@Override
Expand All @@ -72,6 +76,12 @@ public boolean parse(String applicationName, String applicationVersion) {
() -> new ManageApplicationsTab(true));
return true;
}
if (applicationName.equals(ApplicationConstants.APP_REPRO_VIP)) {
Layout.getInstance().addTab(
ApplicationConstants.TAB_REPROVIP,
() -> new ReproVipTab());
return true;
}
return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,33 @@ public void onClick(ClickEvent event) {
}
});
toolStrip.addButton(downloadButton);

if (!file) {
ToolStripButton jsonDownloadButton = new ToolStripButton();
jsonDownloadButton.setTitle("Download JSON");
jsonDownloadButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
downloadJsonContent();
}
});
toolStrip.addButton(jsonDownloadButton);
}
}

private void loadString() {
pane.setContents(content.replaceAll("<", "&lt;").replaceAll(">", "&gt;").replaceAll("\n", "<br />"));
}

private void downloadJsonContent() {
String jsonContent = this.content;
String mimeType = "application/json;charset=utf-8;";
String blobData = "data:" + mimeType + ", " + encodeURIComponent(jsonContent);
com.google.gwt.user.client.Window.open(blobData, "_blank", "Download JSON");
}

// This is a helper method for encoding the content
private static native String encodeURIComponent(String content) /*-{
return encodeURIComponent(content);
}-*/;

}
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,19 @@
import fr.insalyon.creatis.vip.application.client.ApplicationConstants;
import fr.insalyon.creatis.vip.application.client.rpc.WorkflowService;
import fr.insalyon.creatis.vip.application.client.view.common.AbstractSimulationTab;
import fr.insalyon.creatis.vip.application.client.view.launch.LaunchTab;
import fr.insalyon.creatis.vip.application.client.view.launch.RelaunchService;
import fr.insalyon.creatis.vip.application.client.view.monitor.ChangeSimulationUserLayout;
import fr.insalyon.creatis.vip.application.client.view.monitor.SimulationStatus;
import fr.insalyon.creatis.vip.application.client.view.monitor.SimulationTab;
import fr.insalyon.creatis.vip.application.client.view.monitor.SimulationsTab;
import fr.insalyon.creatis.vip.core.client.CoreModule;
import fr.insalyon.creatis.vip.core.client.bean.Execution;
import fr.insalyon.creatis.vip.core.client.view.CoreConstants;
import fr.insalyon.creatis.vip.core.client.view.ModalWindow;
import fr.insalyon.creatis.vip.core.client.view.layout.Layout;
import fr.insalyon.creatis.vip.application.client.view.system.application.MakeExecutionPublicTab;
import fr.insalyon.creatis.vip.core.server.business.BusinessException;

import java.util.Map;

/**
Expand All @@ -69,8 +72,8 @@ public class SimulationsContextMenu extends Menu {
private String simulationUser;

public SimulationsContextMenu(ModalWindow modal, final String simulationID,
final String title, final SimulationStatus status, String applicationName,
String applicationVersion, String applicationClass, String simulationUser) {
final String title, final SimulationStatus status, String applicationName,
String applicationVersion, String applicationClass, String simulationUser) {

this.modal = modal;
this.simulationID = simulationID;
Expand All @@ -90,8 +93,8 @@ public SimulationsContextMenu(ModalWindow modal, final String simulationID,
@Override
public void onClick(MenuItemClickEvent event) {
Layout.getInstance().addTab(
AbstractSimulationTab.tabIdFrom(simulationID),
() -> new SimulationTab(simulationID, title, status));
AbstractSimulationTab.tabIdFrom(simulationID),
() -> new SimulationTab(simulationID, title, status));
}
});

Expand Down Expand Up @@ -181,28 +184,46 @@ public void onClick(MenuItemClickEvent event) {
}
});

MenuItem makePublicExecutionItem = new MenuItem("Make this execution public");
makePublicExecutionItem.setIcon(ApplicationConstants.ICON_SIMULATION_VIEW);
makePublicExecutionItem.addClickHandler(new ClickHandler() {
@Override
public void onClick(MenuItemClickEvent event) {
SC.ask("Do you really want to make this execution public: ("
+ title + ")?", new BooleanCallback() {
@Override
public void execute(Boolean value) {
if (value) {
Execution execution = new Execution(simulationID, simulationName, applicationName, applicationVersion, "Pending", simulationUser, "comments");
Layout.getInstance().addTab(CoreConstants.TAB_MAKE_EXECUTION_PUBLIC, () -> new MakeExecutionPublicTab(execution));
}
}
});
}
});

MenuItemSeparator separator = new MenuItemSeparator();

switch (status) {
case Running:
if (CoreModule.user.isSystemAdministrator()) {
this.setItems(viewItem, killItem, separator, relauchItem, separator, changeUserItem);
this.setItems(viewItem, killItem, separator, relauchItem, separator, changeUserItem, separator, makePublicExecutionItem);
} else {
this.setItems(viewItem, killItem, separator, relauchItem);
this.setItems(viewItem, killItem, separator, relauchItem, separator, makePublicExecutionItem);
}
break;

case Completed:
if (CoreModule.user.isSystemAdministrator()) {
this.setItems(viewItem, cleanItem, separator, relauchItem, separator, changeUserItem);
this.setItems(viewItem, cleanItem, separator, relauchItem, separator, changeUserItem, separator, makePublicExecutionItem);
} else {
this.setItems(viewItem, cleanItem, separator, relauchItem);
this.setItems(viewItem, cleanItem, separator, relauchItem, separator, makePublicExecutionItem);
}
break;

case Cleaned:
if (CoreModule.user.isSystemAdministrator()) {
this.setItems(viewItem, purgeItem, separator, changeUserItem);
this.setItems(viewItem, purgeItem, separator, changeUserItem, separator, makePublicExecutionItem);
} else {
this.setItems(viewItem);
}
Expand All @@ -211,9 +232,9 @@ public void onClick(MenuItemClickEvent event) {
case Failed:
case Killed:
if (CoreModule.user.isSystemAdministrator()) {
this.setItems(viewItem, markCompletedItem, cleanItem, separator, relauchItem, separator, changeUserItem);
this.setItems(viewItem, markCompletedItem, cleanItem, separator, relauchItem, separator, changeUserItem, separator, makePublicExecutionItem);
} else {
this.setItems(viewItem, cleanItem, separator, relauchItem);
this.setItems(viewItem, cleanItem, separator, relauchItem, separator, makePublicExecutionItem);
}
}
}
Expand Down Expand Up @@ -318,7 +339,7 @@ public void onFailure(Throwable caught) {
public void onSuccess(final Map<String, String> result) {
modal.hide();
String tabId =
ApplicationConstants.getLaunchTabID(applicationName);
ApplicationConstants.getLaunchTabID(applicationName);
Layout.getInstance().removeTab(tabId);
RelaunchService.getInstance().relaunch(
applicationName, applicationVersion, applicationClass, simulationName, result, tabId);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
package fr.insalyon.creatis.vip.application.client.view.system.application;

import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.util.SC;
import com.smartgwt.client.widgets.menu.Menu;
import com.smartgwt.client.widgets.menu.MenuItem;
import com.smartgwt.client.widgets.menu.events.ClickHandler;
import com.smartgwt.client.widgets.menu.events.MenuItemClickEvent;
import fr.insalyon.creatis.vip.application.client.rpc.ReproVipService;
import fr.insalyon.creatis.vip.application.client.rpc.ReproVipServiceAsync;
import fr.insalyon.creatis.vip.application.client.view.monitor.ViewerWindow;
import fr.insalyon.creatis.vip.core.client.bean.Execution;
import fr.insalyon.creatis.vip.core.client.bean.User;
import fr.insalyon.creatis.vip.core.client.view.CoreConstants;
import fr.insalyon.creatis.vip.core.client.view.ModalWindow;

public class ExecutionsContextMenu extends Menu {
private ModalWindow modal;
private String executionID;
private ReproVipServiceAsync reproVipServiceAsync = ReproVipService.Util.getInstance();
private ReproVipService reproVipService;
Fixed Show fixed Hide fixed
Fixed Show fixed Hide fixed

Check warning

Code scanning / PMD

Avoid unused private fields such as 'classBusiness'. Warning

Avoid unused private fields such as 'reproVipService'.
public ExecutionsContextMenu(ModalWindow modal, String executionName, String executionID, String version){
this.modal = modal;
this.executionID = executionID;
this.setShowShadow(true);
this.setShadowDepth(10);
this.setWidth(90);

MenuItem OptionPublicExecutionItem = new MenuItem("Option make it public");
OptionPublicExecutionItem.setIcon(CoreConstants.ICON_SUCCESS);
OptionPublicExecutionItem.addClickHandler(new ClickHandler() {
@Override
public void onClick(MenuItemClickEvent event) {
createReproVipDirectory(executionName, executionID, version);
//MakexExecutionPublic();
}
});

MenuItem DownloadOutputDataItem = new MenuItem("Donwload outputs");
DownloadOutputDataItem.setIcon(CoreConstants.ICON_INFO);
DownloadOutputDataItem.addClickHandler(new ClickHandler() {
@Override
public void onClick(MenuItemClickEvent event) {
DownloadOutputDataExecution();
}
});

this.setItems(OptionPublicExecutionItem, DownloadOutputDataItem);
}
private void MakexExecutionPublic() {
Fixed Show fixed Hide fixed
final AsyncCallback<Void> callback = new AsyncCallback<Void>() {
@Override
public void onFailure(Throwable caught) {
modal.hide();
SC.warn("Unable to make this execution public:<br />" + caught.getMessage());
}
@Override
public void onSuccess(Void result) {
modal.hide();
SC.say("Execution made public successfully");
}
};
modal.show("Make execution public", true);
reproVipServiceAsync.updateExecution(executionID, "Public", callback);
}
private void DownloadOutputDataExecution() {
final AsyncCallback<String> callback = new AsyncCallback<String>() {
@Override
public void onFailure(Throwable caught) {
modal.hide();
SC.warn("Unable to download outputs of this execution public:<br />" + caught.getMessage());
}
@Override
public void onSuccess(String s) {
modal.hide();
new ViewerWindow("Execution Output Data", executionID, s).show();
}
};
modal.show("Download Outputs", true);
reproVipServiceAsync.downloadJsonOutputData(executionID, callback);
}
public void createReproVipDirectory(String executionName, String executionID, String version) {
reproVipServiceAsync.createReproVipDirectory(executionName, executionID, version, new AsyncCallback<Void>() {
public void onFailure(Throwable caught) {
SC.warn("Error creating ReproVip directory: " + caught.getMessage());
}
public void onSuccess(Void result) {
SC.say("ReproVip directory successfully created");
}
});
}
}
Loading
Loading