ref 10187: Enhance SAI

https://support.d4science.org/issues/10187

Delete the Create button, only publish button is now available.

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/statistical-algorithms-importer@160309 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2017-12-11 18:24:42 +00:00
parent 4bf8783918
commit 2a2eabfce7
11 changed files with 31 additions and 76 deletions

View File

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<classpath> <classpath>
<classpathentry kind="src" output="target/statistical-algorithms-importer-1.8.0-SNAPSHOT/WEB-INF/classes" path="src/main/java"> <classpathentry kind="src" output="target/statistical-algorithms-importer-1.9.0-SNAPSHOT/WEB-INF/classes" path="src/main/java">
<attributes> <attributes>
<attribute name="optional" value="true"/> <attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry excluding="**" kind="src" output="target/statistical-algorithms-importer-1.8.0-SNAPSHOT/WEB-INF/classes" path="src/main/resources"> <classpathentry excluding="**" kind="src" output="target/statistical-algorithms-importer-1.9.0-SNAPSHOT/WEB-INF/classes" path="src/main/resources">
<attributes> <attributes>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
@ -45,5 +45,5 @@
</classpathentry> </classpathentry>
<classpathentry kind="lib" path="/home/giancarlo/gwt/gwt-2.6.1/validation-api-1.0.0.GA.jar" sourcepath="/home/giancarlo/gwt/gwt-2.6.1/validation-api-1.0.0.GA-sources.jar"/> <classpathentry kind="lib" path="/home/giancarlo/gwt/gwt-2.6.1/validation-api-1.0.0.GA.jar" sourcepath="/home/giancarlo/gwt/gwt-2.6.1/validation-api-1.0.0.GA-sources.jar"/>
<classpathentry kind="lib" path="/home/giancarlo/gwt/gwt-2.6.1/validation-api-1.0.0.GA-sources.jar"/> <classpathentry kind="lib" path="/home/giancarlo/gwt/gwt-2.6.1/validation-api-1.0.0.GA-sources.jar"/>
<classpathentry kind="output" path="target/statistical-algorithms-importer-1.8.0-SNAPSHOT/WEB-INF/classes"/> <classpathentry kind="output" path="target/statistical-algorithms-importer-1.9.0-SNAPSHOT/WEB-INF/classes"/>
</classpath> </classpath>

View File

@ -1,4 +1,8 @@
<ReleaseNotes> <ReleaseNotes>
<Changeset component="${groupId}.${artifactId}.1-9-0" date="2017-12-13">
<Change>Fixed Set Main behavior in case of R [ticket #10523]</Change>
<Change>Only publish button is available [ticket #10187]</Change>
</Changeset>
<Changeset component="${groupId}.${artifactId}.1-8-0" date="2017-11-09"> <Changeset component="${groupId}.${artifactId}.1-8-0" date="2017-11-09">
<Change>Updated Tools panel</Change> <Change>Updated Tools panel</Change>
</Changeset> </Changeset>

View File

@ -13,7 +13,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.gcube.portlets.user</groupId> <groupId>org.gcube.portlets.user</groupId>
<artifactId>statistical-algorithms-importer</artifactId> <artifactId>statistical-algorithms-importer</artifactId>
<version>1.8.0-SNAPSHOT</version> <version>1.9.0-SNAPSHOT</version>
<packaging>war</packaging> <packaging>war</packaging>

View File

@ -275,11 +275,8 @@ public class StatAlgoImporterController {
case RESOURCE_GITHUB: case RESOURCE_GITHUB:
showGitHubWizard(); showGitHubWizard();
break; break;
case SOFTWARE_CREATE:
softwareCreateRequest();
break;
case SOFTWARE_PUBLISH: case SOFTWARE_PUBLISH:
softwarePublish(); softwareCreateRequest();
break; break;
case SOFTWARE_REPACKAGE: case SOFTWARE_REPACKAGE:
softwareRepackage(); softwareRepackage();
@ -360,9 +357,11 @@ public class StatAlgoImporterController {
private void softwareCreateRequest() { private void softwareCreateRequest() {
final ConfirmMessageBox mb = new ConfirmMessageBox("Warning", final ConfirmMessageBox mb = new ConfirmMessageBox("Attention",
"The creation of new software will overwrite the possible" "The creation of new software will overwrite the possible previous version, moreover"
+ " previous version and will require publication again." + " Do you want to proceed anyway?"); + " the compiled software will be notified to the Infrastructure Administrators"
+ " and will be published in the suggested VREs. The source code will not be shared."
+ " Do you confirm the submission?");
mb.addDialogHideHandler(new DialogHideHandler() { mb.addDialogHideHandler(new DialogHideHandler() {
@Override @Override
@ -387,10 +386,7 @@ public class StatAlgoImporterController {
mb.show(); mb.show();
} }
private void softwarePublish() {
pm.softwarePublish();
}
private void softwareRepackage() { private void softwareRepackage() {
pm.softwareRepackage(); pm.softwareRepackage();

View File

@ -74,7 +74,6 @@ public class MainDataPanel extends SimpleContainer {
case SAVE: case SAVE:
case START: case START:
case UPDATE: case UPDATE:
case SOFTWARE_CREATED:
case SOFTWARE_PUBLISH: case SOFTWARE_PUBLISH:
case SOFTWARE_REPACKAGE: case SOFTWARE_REPACKAGE:
case ADD_RESOURCE: case ADD_RESOURCE:

View File

@ -412,10 +412,9 @@ public class ProjectManager {
@Override @Override
public void onSuccess(Project p) { public void onSuccess(Project p) {
Log.info("Software Created!");
project = p; project = p;
monitor.hide(); softwarePublish(monitor);
fireProjectStatusSoftwareCreatedEvent();
UtilsGXT3.info("Create Software", "Software Created!");
} }
@ -756,30 +755,12 @@ public class ProjectManager {
}); });
} }
public void softwarePublish() { private void softwarePublish(final StatAlgoImporterMonitor monitor) {
if (project != null) { if (project != null) {
final ConfirmMessageBox mb = new ConfirmMessageBox("Attention", softwarePublishOnServer(monitor);
"The compiled software will be notified to the Infrastructure Administrators and will be published in the suggested VREs. The source code will not be shared. Do you confirm the submission?");
mb.addDialogHideHandler(new DialogHideHandler() {
@Override
public void onDialogHide(DialogHideEvent event) {
switch (event.getHideButton()) {
case NO:
break;
case YES:
softwarePublishOnServer();
break;
default:
break;
}
}
});
mb.setWidth(300);
mb.show();
} else { } else {
monitor.hide();
Log.error("Project not open: " + project); Log.error("Project not open: " + project);
UtilsGXT3.alert("Error", "Project not open!"); UtilsGXT3.alert("Error", "Project not open!");
} }
@ -787,8 +768,7 @@ public class ProjectManager {
} }
// TODO // TODO
private void softwarePublishOnServer() { private void softwarePublishOnServer(final StatAlgoImporterMonitor monitor) {
final StatAlgoImporterMonitor monitor = new StatAlgoImporterMonitor();
StatAlgoImporterServiceAsync.INSTANCE.publishSoftware(new AsyncCallback<String>() { StatAlgoImporterServiceAsync.INSTANCE.publishSoftware(new AsyncCallback<String>() {
public void onFailure(Throwable caught) { public void onFailure(Throwable caught) {
@ -1040,13 +1020,14 @@ public class ProjectManager {
eventBus.fireEvent(projectStatusEvent); eventBus.fireEvent(projectStatusEvent);
} }
/*
private void fireProjectStatusSoftwareCreatedEvent() { private void fireProjectStatusSoftwareCreatedEvent() {
ProjectStatusEvent projectStatusEvent = new ProjectStatusEvent(ProjectStatusEventType.SOFTWARE_CREATED, ProjectStatusEvent projectStatusEvent = new ProjectStatusEvent(ProjectStatusEventType.SOFTWARE_CREATED,
project); project);
Log.debug("Project Manager ProjectStatusEvent fire! " + projectStatusEvent); Log.debug("Project Manager ProjectStatusEvent fire! " + projectStatusEvent);
eventBus.fireEvent(projectStatusEvent); eventBus.fireEvent(projectStatusEvent);
} }*/
private void fireProjectStatusSoftwarePublishEvent() { private void fireProjectStatusSoftwarePublishEvent() {
ProjectStatusEvent projectStatusEvent = new ProjectStatusEvent(ProjectStatusEventType.SOFTWARE_PUBLISH, ProjectStatusEvent projectStatusEvent = new ProjectStatusEvent(ProjectStatusEventType.SOFTWARE_PUBLISH,

View File

@ -49,7 +49,7 @@ public class HomeToolBar {
//Software //Software
private TextButton btnCreateSoftware; //private TextButton btnCreateSoftware;
private TextButton btnPublishSoftware; private TextButton btnPublishSoftware;
private TextButton btnRepackageSoftware; private TextButton btnRepackageSoftware;
@ -211,26 +211,6 @@ public class HomeToolBar {
FlexTable softwareLayout = new FlexTable(); FlexTable softwareLayout = new FlexTable();
softwareGroup.add(softwareLayout); softwareGroup.add(softwareLayout);
btnCreateSoftware = new TextButton(msgs.btnCreateSoftwareText(),
StatAlgoImporterResources.INSTANCE.algorithm24());
btnCreateSoftware.setId("createSoftwareButton");
btnCreateSoftware.setScale(ButtonScale.SMALL);
btnCreateSoftware.setIconAlign(IconAlign.LEFT);
btnCreateSoftware.setArrowAlign(ButtonArrowAlign.BOTTOM);
btnCreateSoftware.setToolTip(msgs.btnCreateSoftwareToolTip());
btnCreateSoftware.getElement().setMargins(new Margins(0, 4, 0, 0));
btnCreateSoftware.disable();
btnCreateSoftware.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
eventBus.fireEvent(new StatAlgoImporterRibbonEvent(
StatAlgoImporterRibbonType.SOFTWARE_CREATE));
}
});
softwareLayout.setWidget(0, 0, btnCreateSoftware);
softwareLayout.getFlexCellFormatter().setRowSpan(0, 0, 2);
btnPublishSoftware = new TextButton(msgs.btnPublishSoftwareText(), btnPublishSoftware = new TextButton(msgs.btnPublishSoftwareText(),
StatAlgoImporterResources.INSTANCE.publish24()); StatAlgoImporterResources.INSTANCE.publish24());
btnPublishSoftware.setId("publishSofwareButton"); btnPublishSoftware.setId("publishSofwareButton");
@ -248,8 +228,8 @@ public class HomeToolBar {
} }
}); });
softwareLayout.setWidget(0, 1, btnPublishSoftware); softwareLayout.setWidget(0, 0, btnPublishSoftware);
softwareLayout.getFlexCellFormatter().setRowSpan(0, 1, 2); softwareLayout.getFlexCellFormatter().setRowSpan(0, 0, 2);
btnRepackageSoftware = new TextButton(msgs.btnRepackageSoftwareText(), btnRepackageSoftware = new TextButton(msgs.btnRepackageSoftwareText(),
@ -268,8 +248,8 @@ public class HomeToolBar {
} }
}); });
softwareLayout.setWidget(0, 2, btnRepackageSoftware); softwareLayout.setWidget(0, 1, btnRepackageSoftware);
softwareLayout.getFlexCellFormatter().setRowSpan(0, 2, 2); softwareLayout.getFlexCellFormatter().setRowSpan(0, 1, 2);
@ -417,7 +397,6 @@ public class HomeToolBar {
btnSaveProject.disable(); btnSaveProject.disable();
btnAddResource.disable(); btnAddResource.disable();
btnGitHubResource.disable(); btnGitHubResource.disable();
btnCreateSoftware.disable();
btnPublishSoftware.disable(); btnPublishSoftware.disable();
btnRepackageSoftware.disable(); btnRepackageSoftware.disable();
btnHelp.enable(); btnHelp.enable();
@ -433,7 +412,6 @@ public class HomeToolBar {
btnSaveProject.enable(); btnSaveProject.enable();
btnAddResource.enable(); btnAddResource.enable();
btnGitHubResource.enable(); btnGitHubResource.enable();
btnCreateSoftware.enable();
btnPublishSoftware.enable(); btnPublishSoftware.enable();
btnRepackageSoftware.enable(); btnRepackageSoftware.enable();
btnHelp.enable(); btnHelp.enable();

View File

@ -124,7 +124,6 @@ public class ExplorerProjectPanel extends ContentPanel {
case SAVE: case SAVE:
case MAIN_CODE_SET: case MAIN_CODE_SET:
case BINARY_CODE_SET: case BINARY_CODE_SET:
case SOFTWARE_CREATED:
case SOFTWARE_PUBLISH: case SOFTWARE_PUBLISH:
case SOFTWARE_REPACKAGE: case SOFTWARE_REPACKAGE:
case EXPLORER_REFRESH: case EXPLORER_REFRESH:

View File

@ -109,7 +109,6 @@ public class InputVariablePanel extends ContentPanel {
+ event.toString()); + event.toString());
switch (event.getProjectStatusEventType()) { switch (event.getProjectStatusEventType()) {
case SAVE: case SAVE:
case SOFTWARE_CREATED:
case SOFTWARE_PUBLISH: case SOFTWARE_PUBLISH:
case SOFTWARE_REPACKAGE: case SOFTWARE_REPACKAGE:
case START: case START:

View File

@ -8,6 +8,6 @@ package org.gcube.portlets.user.statisticalalgorithmsimporter.client.type;
*/ */
public enum ProjectStatusEventType { public enum ProjectStatusEventType {
START, OPEN, MAIN_CODE_SET, BINARY_CODE_SET, UPDATE, START, OPEN, MAIN_CODE_SET, BINARY_CODE_SET, UPDATE,
ADD_RESOURCE, DELETE_RESOURCE, DELETE_MAIN_CODE,DELETE_BINARY_CODE, SOFTWARE_CREATED, ADD_RESOURCE, DELETE_RESOURCE, DELETE_MAIN_CODE,DELETE_BINARY_CODE,
SOFTWARE_PUBLISH, SOFTWARE_REPACKAGE, EXPLORER_REFRESH, SAVE; SOFTWARE_PUBLISH, SOFTWARE_REPACKAGE, EXPLORER_REFRESH, SAVE;
} }

View File

@ -12,7 +12,6 @@ public enum StatAlgoImporterRibbonType {
PROJECT_SAVE, PROJECT_SAVE,
RESOURCE_ADD, RESOURCE_ADD,
RESOURCE_GITHUB, RESOURCE_GITHUB,
SOFTWARE_CREATE,
SOFTWARE_PUBLISH, SOFTWARE_PUBLISH,
SOFTWARE_REPACKAGE, SOFTWARE_REPACKAGE,
HELP; HELP;