ref 11724: SAI - Update to StorageHUB

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

Updated to StorageHub 

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/statistical-algorithms-importer@173897 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2018-10-30 19:20:11 +00:00
parent 9146a4fe4a
commit 6f3088490b
5 changed files with 151 additions and 142 deletions

View File

@ -18,6 +18,7 @@ import org.gcube.portlets.user.statisticalalgorithmsimporter.client.type.Project
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.type.SessionExpiredType; import org.gcube.portlets.user.statisticalalgorithmsimporter.client.type.SessionExpiredType;
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.type.WorkAreaEventType; import org.gcube.portlets.user.statisticalalgorithmsimporter.client.type.WorkAreaEventType;
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.utils.UtilsGXT3; import org.gcube.portlets.user.statisticalalgorithmsimporter.client.utils.UtilsGXT3;
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.Constants;
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.descriptor.SAIDescriptor; import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.descriptor.SAIDescriptor;
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.exception.StatAlgoImporterSessionExpiredException; import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.exception.StatAlgoImporterSessionExpiredException;
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.project.InputData; import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.project.InputData;
@ -107,15 +108,17 @@ public class ProjectManager {
}; };
final ProjectCreateWizard wizard = new ProjectCreateWizard(); if (Constants.DEBUG_MODE) {
wizard.addWizardEventHandler(handler); project = Constants.TEST_PROJECT;
wizard.setZIndex(XDOM.getTopZIndex()); fireWorkAreaSetupEvent();
wizard.show(); } else {
final ProjectCreateWizard wizard = new ProjectCreateWizard();
wizard.addWizardEventHandler(handler);
wizard.setZIndex(XDOM.getTopZIndex());
wizard.show();
}
} }
public void openProject() { public void openProject() {
WorkspaceExplorerSelectDialog wselectDialog = new WorkspaceExplorerSelectDialog("Select Project Folder", true); WorkspaceExplorerSelectDialog wselectDialog = new WorkspaceExplorerSelectDialog("Select Project Folder", true);
@ -124,8 +127,8 @@ public class ProjectManager {
@Override @Override
public void onSelectedItem(Item item) { public void onSelectedItem(Item item) {
if (item.getType() == ItemType.FOLDER||item.getType() == ItemType.PRIVATE_FOLDER if (item.getType() == ItemType.FOLDER || item.getType() == ItemType.PRIVATE_FOLDER
||item.getType() == ItemType.SHARED_FOLDER||item.getType() == ItemType.VRE_FOLDER) { || item.getType() == ItemType.SHARED_FOLDER || item.getType() == ItemType.VRE_FOLDER) {
openProjectOnServer(item); openProjectOnServer(item);
} else { } else {
@ -205,8 +208,7 @@ public class ProjectManager {
public void addResource() { public void addResource() {
List<ItemType> selectableTypes = new ArrayList<ItemType>(); List<ItemType> selectableTypes = new ArrayList<ItemType>();
selectableTypes.add(ItemType.EXTERNAL_FILE); selectableTypes.add(ItemType.EXTERNAL_FILE);
List<ItemType> showableTypes = new ArrayList<ItemType>(); List<ItemType> showableTypes = new ArrayList<ItemType>();
showableTypes.addAll(Arrays.asList(ItemType.values())); showableTypes.addAll(Arrays.asList(ItemType.values()));
@ -217,8 +219,8 @@ public class ProjectManager {
@Override @Override
public void onSelectedItem(Item item) { public void onSelectedItem(Item item) {
if (item.getType() != ItemType.FOLDER&&item.getType() != ItemType.PRIVATE_FOLDER if (item.getType() != ItemType.FOLDER && item.getType() != ItemType.PRIVATE_FOLDER
&&item.getType() != ItemType.SHARED_FOLDER&&item.getType() != ItemType.VRE_FOLDER) { && item.getType() != ItemType.SHARED_FOLDER && item.getType() != ItemType.VRE_FOLDER) {
String filename = item.getName(); String filename = item.getName();
if (filename != null && !filename.isEmpty()) { if (filename != null && !filename.isEmpty()) {
addResourceToProject(item); addResourceToProject(item);
@ -381,7 +383,7 @@ public class ProjectManager {
Log.info("Software Created!"); Log.info("Software Created!");
project = p; project = p;
softwarePublish(monitor); softwarePublish(monitor);
} }
@Override @Override
@ -439,8 +441,8 @@ public class ProjectManager {
} }
private void saveInputDataForMainSet(final InputData inputData, final ItemDescription itemDescription) { private void saveInputDataForMainSet(final InputData inputData, final ItemDescription itemDescription) {
final StatAlgoImporterMonitor monitor=new StatAlgoImporterMonitor(); final StatAlgoImporterMonitor monitor = new StatAlgoImporterMonitor();
StatAlgoImporterServiceAsync.INSTANCE.saveProject(inputData, new AsyncCallback<Void>() { StatAlgoImporterServiceAsync.INSTANCE.saveProject(inputData, new AsyncCallback<Void>() {
@Override @Override
@ -467,7 +469,7 @@ public class ProjectManager {
}); });
} }
private void setMainCodeOnServer(final ItemDescription itemDescription,final StatAlgoImporterMonitor monitor) { private void setMainCodeOnServer(final ItemDescription itemDescription, final StatAlgoImporterMonitor monitor) {
Log.debug("Set Main Code: " + itemDescription); Log.debug("Set Main Code: " + itemDescription);
StatAlgoImporterServiceAsync.INSTANCE.setMainCode(itemDescription, new AsyncCallback<Project>() { StatAlgoImporterServiceAsync.INSTANCE.setMainCode(itemDescription, new AsyncCallback<Project>() {
@ -537,13 +539,13 @@ public class ProjectManager {
} }
private void saveInputDataForBinarySet(final InputData inputData, final ItemDescription itemDescription) { private void saveInputDataForBinarySet(final InputData inputData, final ItemDescription itemDescription) {
final StatAlgoImporterMonitor monitor=new StatAlgoImporterMonitor(); final StatAlgoImporterMonitor monitor = new StatAlgoImporterMonitor();
StatAlgoImporterServiceAsync.INSTANCE.saveProject(inputData, new AsyncCallback<Void>() { StatAlgoImporterServiceAsync.INSTANCE.saveProject(inputData, new AsyncCallback<Void>() {
@Override @Override
public void onSuccess(Void result) { public void onSuccess(Void result) {
setBinaryCodeOnServer(itemDescription,monitor); setBinaryCodeOnServer(itemDescription, monitor);
} }
@Override @Override
@ -617,26 +619,28 @@ public class ProjectManager {
final ConfirmMessageBox mb = new ConfirmMessageBox("Delete", "Would you like to delete this resource?"); final ConfirmMessageBox mb = new ConfirmMessageBox("Delete", "Would you like to delete this resource?");
mb.addDialogHideHandler(new DialogHideHandler() { mb.addDialogHideHandler(new DialogHideHandler() {
@Override @Override
public void onDialogHide(DialogHideEvent event) { public void onDialogHide(DialogHideEvent event) {
switch (event.getHideButton()) { switch (event.getHideButton()) {
case NO: case NO:
break; break;
case YES: case YES:
deleteItemOnServer(itemDescription, false); deleteItemOnServer(itemDescription, false);
break; break;
default: default:
break; break;
}
}
});
mb.setWidth(300);
mb.show();
} }
} }
});mb.setWidth(300);mb.show();
}
}
private void deleteItemOnServer(ItemDescription itemDescription, final boolean mainCode) { private void deleteItemOnServer(ItemDescription itemDescription, final boolean mainCode) {
final StatAlgoImporterMonitor monitor = new StatAlgoImporterMonitor(); final StatAlgoImporterMonitor monitor = new StatAlgoImporterMonitor();
@ -723,8 +727,8 @@ public class ProjectManager {
private void softwarePublish(final StatAlgoImporterMonitor monitor) { private void softwarePublish(final StatAlgoImporterMonitor monitor) {
if (project != null) { if (project != null) {
softwarePublishOnServer(monitor); softwarePublishOnServer(monitor);
} else { } else {
monitor.hide(); monitor.hide();
Log.error("Project not open: " + project); Log.error("Project not open: " + project);
@ -758,12 +762,14 @@ public class ProjectManager {
monitor.hide(); monitor.hide();
Log.info( Log.info(
"Publish, the software has been published, but no autodeploy on server is enable so some time is required for installation by administrators!"); "Publish, the software has been published, but no autodeploy on server is enable so some time is required for installation by administrators!");
UtilsGXT3.info("Publish", "The software has been published! The Cloud system is being updated. Your process will be available on the DataMiner system within some minutes by administrators."); UtilsGXT3.info("Publish",
"The software has been published! The Cloud system is being updated. Your process will be available on the DataMiner system within some minutes by administrators.");
fireProjectStatusSoftwarePublishEvent(); fireProjectStatusSoftwarePublishEvent();
} }
} else { } else {
monitor.hide(); monitor.hide();
UtilsGXT3.info("Publish", "The software has been published! The Cloud system is being updated. Your process will be available on the DataMiner system within some minutes by administrators."); UtilsGXT3.info("Publish",
"The software has been published! The Cloud system is being updated. Your process will be available on the DataMiner system within some minutes by administrators.");
fireProjectStatusSoftwarePublishEvent(); fireProjectStatusSoftwarePublishEvent();
} }
} }
@ -778,67 +784,64 @@ public class ProjectManager {
@Override @Override
public void onMonitor(MonitorDeployOperationEvent event) { public void onMonitor(MonitorDeployOperationEvent event) {
StatAlgoImporterServiceAsync.INSTANCE.getDeployOperationStatus(operationId, new AsyncCallback<String>() { StatAlgoImporterServiceAsync.INSTANCE.getDeployOperationStatus(operationId,
new AsyncCallback<String>() {
public void onFailure(Throwable caught) { public void onFailure(Throwable caught) {
monitorDeployOperation.stop(); monitorDeployOperation.stop();
monitor.hide(); monitor.hide();
if (caught instanceof StatAlgoImporterSessionExpiredException) { if (caught instanceof StatAlgoImporterSessionExpiredException) {
eventBus.fireEvent(new SessionExpiredEvent(SessionExpiredType.EXPIREDONSERVER)); eventBus.fireEvent(new SessionExpiredEvent(SessionExpiredType.EXPIREDONSERVER));
} else { } else {
UtilsGXT3.alert("Error", caught.getLocalizedMessage()); UtilsGXT3.alert("Error", caught.getLocalizedMessage());
fireProjectStatusExplorerRefreshEvent(); fireProjectStatusExplorerRefreshEvent();
} }
} }
public void onSuccess(String deployOperationStatus) { public void onSuccess(String deployOperationStatus) {
Log.debug("Deploy Operation Status: " + deployOperationStatus); Log.debug("Deploy Operation Status: " + deployOperationStatus);
if(deployOperationStatus==null){ if (deployOperationStatus == null) {
monitorDeployOperation.repeat(); monitorDeployOperation.repeat();
} }
switch(deployOperationStatus){
case "COMPLETED":
monitorDeployOperation.stop();
monitor.hide();
UtilsGXT3.info("Publish", "The software has been published! The Cloud system is being updated. Your process will be available on the DataMiner system within some minutes.");
fireProjectStatusSoftwarePublishEvent();
break;
case "FAILED":
monitorDeployOperation.stop();
retrieveOperationDeployLogs(operationId, monitor);
break;
case "IN PROGRESS":
monitorDeployOperation.repeat();
break;
default:
monitorDeployOperation.repeat();
break;
}
}
switch (deployOperationStatus) {
case "COMPLETED":
}); monitorDeployOperation.stop();
monitor.hide();
UtilsGXT3.info("Publish",
"The software has been published! The Cloud system is being updated. Your process will be available on the DataMiner system within some minutes.");
fireProjectStatusSoftwarePublishEvent();
break;
case "FAILED":
monitorDeployOperation.stop();
retrieveOperationDeployLogs(operationId, monitor);
break;
case "IN PROGRESS":
monitorDeployOperation.repeat();
break;
default:
monitorDeployOperation.repeat();
break;
}
}
});
} }
}; };
monitorDeployOperation.addHandler(handler); monitorDeployOperation.addHandler(handler);
monitorDeployOperation.start(); monitorDeployOperation.start();
} }
private void retrieveOperationDeployLogs(final String operationId, final StatAlgoImporterMonitor monitor) { private void retrieveOperationDeployLogs(final String operationId, final StatAlgoImporterMonitor monitor) {
StatAlgoImporterServiceAsync.INSTANCE.getDeployOperationLogs(operationId, new AsyncCallback<String>() { StatAlgoImporterServiceAsync.INSTANCE.getDeployOperationLogs(operationId, new AsyncCallback<String>() {
public void onFailure(Throwable caught) { public void onFailure(Throwable caught) {
monitor.hide(); monitor.hide();
if (caught instanceof StatAlgoImporterSessionExpiredException) { if (caught instanceof StatAlgoImporterSessionExpiredException) {
eventBus.fireEvent(new SessionExpiredEvent(SessionExpiredType.EXPIREDONSERVER)); eventBus.fireEvent(new SessionExpiredEvent(SessionExpiredType.EXPIREDONSERVER));
@ -851,17 +854,14 @@ public class ProjectManager {
public void onSuccess(String logs) { public void onSuccess(String logs) {
Log.debug("Deploy Operation Logs: " + logs); Log.debug("Deploy Operation Logs: " + logs);
monitor.hide(); monitor.hide();
UtilsGXT3.alert("Error", "Error deploying the algorithm: <a href='"+logs+"'>Logs</a>"); UtilsGXT3.alert("Error", "Error deploying the algorithm: <a href='" + logs + "'>Logs</a>");
fireProjectStatusExplorerRefreshEvent(); fireProjectStatusExplorerRefreshEvent();
} }
}); });
} }
public void startProjectManager() { public void startProjectManager() {
retrieveSAIDescriptor(null); retrieveSAIDescriptor(null);
@ -987,13 +987,14 @@ public class ProjectManager {
} }
/* /*
private void fireProjectStatusSoftwareCreatedEvent() { * private void fireProjectStatusSoftwareCreatedEvent() { ProjectStatusEvent
ProjectStatusEvent projectStatusEvent = new ProjectStatusEvent(ProjectStatusEventType.SOFTWARE_CREATED, * projectStatusEvent = new
project); * ProjectStatusEvent(ProjectStatusEventType.SOFTWARE_CREATED, project);
Log.debug("Project Manager ProjectStatusEvent fire! " + projectStatusEvent); * Log.debug("Project Manager ProjectStatusEvent fire! " +
eventBus.fireEvent(projectStatusEvent); * 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

@ -73,7 +73,7 @@ public class GlobalVariablesPanel extends ContentPanel {
private GridRowEditing<GlobalVariables> gridGlobalVariableEditing; private GridRowEditing<GlobalVariables> gridGlobalVariableEditing;
private TextButton btnAdd; private TextButton btnAdd;
private boolean addStatus; private boolean addStatus;
private int seq = 0; private int seqGlobalVariables = 0;
private ListStore<DataType> storeComboInputType; private ListStore<DataType> storeComboInputType;
private ComboBox<DataType> comboInputType; private ComboBox<DataType> comboInputType;
@ -150,7 +150,7 @@ public class GlobalVariablesPanel extends ContentPanel {
&& project.getInputData().getListGlobalVariables() != null) { && project.getInputData().getListGlobalVariables() != null) {
storeGlobalVariable.addAll(project.getInputData() storeGlobalVariable.addAll(project.getInputData()
.getListGlobalVariables()); .getListGlobalVariables());
seq = project.getInputData().getListGlobalVariables().size(); seqGlobalVariables = project.getInputData().getListGlobalVariables().size();
} }
final GridSelectionModel<GlobalVariables> sm = new GridSelectionModel<GlobalVariables>(); final GridSelectionModel<GlobalVariables> sm = new GridSelectionModel<GlobalVariables>();
@ -281,8 +281,8 @@ public class GlobalVariablesPanel extends ContentPanel {
storeGlobalVariable.addAll(listNewSelected); storeGlobalVariable.addAll(listNewSelected);
storeGlobalVariable.commitChanges(); storeGlobalVariable.commitChanges();
seq = listNewSelected.size(); seqGlobalVariables = listNewSelected.size();
Log.debug("Current Seq: " + seq); Log.debug("Current Seq: " + seqGlobalVariables);
} }
}); });
@ -386,8 +386,8 @@ public class GlobalVariablesPanel extends ContentPanel {
private void addGlobalVariable(SelectEvent event) { private void addGlobalVariable(SelectEvent event) {
try { try {
seq++; seqGlobalVariables++;
GlobalVariables newGlobalVariable = new GlobalVariables(seq, "", GlobalVariables newGlobalVariable = new GlobalVariables(seqGlobalVariables, "",
"", "", DataType.STRING); "", "", DataType.STRING);
Log.debug("New Global Variable: " + newGlobalVariable); Log.debug("New Global Variable: " + newGlobalVariable);
gridGlobalVariableEditing.cancelEditing(); gridGlobalVariableEditing.cancelEditing();
@ -414,12 +414,12 @@ public class GlobalVariablesPanel extends ContentPanel {
storeGlobalVariable.addAll(project.getInputData() storeGlobalVariable.addAll(project.getInputData()
.getListGlobalVariables()); .getListGlobalVariables());
storeGlobalVariable.commitChanges(); storeGlobalVariable.commitChanges();
seq = project.getInputData().getListGlobalVariables().size(); seqGlobalVariables = project.getInputData().getListGlobalVariables().size();
} else { } else {
storeGlobalVariable.clear(); storeGlobalVariable.clear();
storeGlobalVariable.commitChanges(); storeGlobalVariable.commitChanges();
seq = 0; seqGlobalVariables = 0;
} }
} }
@ -432,7 +432,7 @@ public class GlobalVariablesPanel extends ContentPanel {
public void clearVariables(Project project) { public void clearVariables(Project project) {
storeGlobalVariable.clear(); storeGlobalVariable.clear();
storeGlobalVariable.commitChanges(); storeGlobalVariable.commitChanges();
seq = 0; seqGlobalVariables = 0;
forceLayout(); forceLayout();
} }

View File

@ -83,7 +83,7 @@ public class InputOutputVariablesPanel extends ContentPanel {
private TextButton btnAddVariable; private TextButton btnAddVariable;
private TextButton btnAdd; private TextButton btnAdd;
private boolean addStatus; private boolean addStatus;
private int seq = 0; private int seqInputOutputVariables = 0;
interface DataTypeTemplates extends XTemplates { interface DataTypeTemplates extends XTemplates {
@XTemplate("<span title=\"{value}\">{value}</span>") @XTemplate("<span title=\"{value}\">{value}</span>")
@ -119,13 +119,12 @@ public class InputOutputVariablesPanel extends ContentPanel {
private void create(Project project) { private void create(Project project) {
if (project != null && project.getInputData() != null if (project != null && project.getInputData() != null
&& project.getInputData().getListInputOutputVariables() != null && project.getInputData().getListInputOutputVariables() != null) {
&& project.getInputData().getListInputOutputVariables().size() > 0) { seqInputOutputVariables = project.getInputData().getListInputOutputVariables().size();
seq = project.getInputData().getListInputOutputVariables().size();
} else { } else {
seq = 0; seqInputOutputVariables = 0;
} }
Log.debug("List of I/O variables start at: " + seq); Log.debug("List of I/O variables start at: " + seqInputOutputVariables);
// Grid // Grid
InputOutputVariablesProperties props = GWT.create(InputOutputVariablesProperties.class); InputOutputVariablesProperties props = GWT.create(InputOutputVariablesProperties.class);
@ -315,8 +314,8 @@ public class InputOutputVariablesPanel extends ContentPanel {
storeInputOutputVariables.addAll(listNewIOVariables); storeInputOutputVariables.addAll(listNewIOVariables);
storeInputOutputVariables.commitChanges(); storeInputOutputVariables.commitChanges();
seq = listNewIOVariables.size(); seqInputOutputVariables = listNewIOVariables.size();
Log.debug("Current Seq: " + seq); Log.debug("Current Seq: " + seqInputOutputVariables);
} }
}); });
@ -502,9 +501,9 @@ public class InputOutputVariablesPanel extends ContentPanel {
public void addNewInputOutputVariables(InputOutputVariables inputOutputVariable) { public void addNewInputOutputVariables(InputOutputVariables inputOutputVariable) {
try { try {
Log.debug("Current Seq: " + seq); Log.debug("Current Seq: " + seqInputOutputVariables);
seq++; seqInputOutputVariables++;
inputOutputVariable.setId(seq); inputOutputVariable.setId(seqInputOutputVariables);
Log.debug("New Input/Output Variable: " + inputOutputVariable); Log.debug("New Input/Output Variable: " + inputOutputVariable);
storeInputOutputVariables.add(inputOutputVariable); storeInputOutputVariables.add(inputOutputVariable);
@ -522,9 +521,9 @@ public class InputOutputVariablesPanel extends ContentPanel {
private void addInputOutputVariable(SelectEvent event) { private void addInputOutputVariable(SelectEvent event) {
try { try {
Log.debug("Current Seq: " + seq); Log.debug("Current Seq: " + seqInputOutputVariables);
seq++; seqInputOutputVariables++;
InputOutputVariables newInputOutputVariablesVariable = new InputOutputVariables(seq, "", "", "", InputOutputVariables newInputOutputVariablesVariable = new InputOutputVariables(seqInputOutputVariables, "", "", "",
DataType.STRING, IOType.INPUT, ""); DataType.STRING, IOType.INPUT, "");
Log.debug("New Input/Output Variable: " + newInputOutputVariablesVariable); Log.debug("New Input/Output Variable: " + newInputOutputVariablesVariable);
gridInputOutputVariablesEditing.cancelEditing(); gridInputOutputVariablesEditing.cancelEditing();
@ -556,12 +555,12 @@ public class InputOutputVariablesPanel extends ContentPanel {
storeInputOutputVariables.clear(); storeInputOutputVariables.clear();
storeInputOutputVariables.addAll(project.getInputData().getListInputOutputVariables()); storeInputOutputVariables.addAll(project.getInputData().getListInputOutputVariables());
storeInputOutputVariables.commitChanges(); storeInputOutputVariables.commitChanges();
seq = project.getInputData().getListInputOutputVariables().size(); seqInputOutputVariables = project.getInputData().getListInputOutputVariables().size();
} else { } else {
storeInputOutputVariables.clear(); storeInputOutputVariables.clear();
storeInputOutputVariables.commitChanges(); storeInputOutputVariables.commitChanges();
seq = 0; seqInputOutputVariables = 0;
} }
} }
@ -585,7 +584,7 @@ public class InputOutputVariablesPanel extends ContentPanel {
public void clearVariables(Project project) { public void clearVariables(Project project) {
storeInputOutputVariables.clear(); storeInputOutputVariables.clear();
storeInputOutputVariables.commitChanges(); storeInputOutputVariables.commitChanges();
seq = 0; seqInputOutputVariables = 0;
forceLayout(); forceLayout();
} }

View File

@ -61,7 +61,7 @@ public class InterpreterInfoPanel extends ContentPanel {
private GridRowEditing<InterpreterPackageInfo> gridInterpreterPackageInfoEditing; private GridRowEditing<InterpreterPackageInfo> gridInterpreterPackageInfoEditing;
private TextButton btnAdd; private TextButton btnAdd;
private boolean addStatus; private boolean addStatus;
private int seq = 0; private int seqInterpreterPackages = 0;
private TextField interpreterVersion; private TextField interpreterVersion;
public InterpreterInfoPanel(Project project, EventBus eventBus) { public InterpreterInfoPanel(Project project, EventBus eventBus) {
@ -119,9 +119,9 @@ public class InterpreterInfoPanel extends ContentPanel {
&& project.getInputData().getInterpreterInfo().getInterpreterPackagesInfo() != null) { && project.getInputData().getInterpreterInfo().getInterpreterPackagesInfo() != null) {
storeInterpreterPackageInfo storeInterpreterPackageInfo
.addAll(project.getInputData().getInterpreterInfo().getInterpreterPackagesInfo()); .addAll(project.getInputData().getInterpreterInfo().getInterpreterPackagesInfo());
seq = project.getInputData().getInterpreterInfo().getInterpreterPackagesInfo().size(); seqInterpreterPackages = project.getInputData().getInterpreterInfo().getInterpreterPackagesInfo().size();
} else { } else {
seq = 0; seqInterpreterPackages = 0;
} }
final GridSelectionModel<InterpreterPackageInfo> sm = new GridSelectionModel<InterpreterPackageInfo>(); final GridSelectionModel<InterpreterPackageInfo> sm = new GridSelectionModel<InterpreterPackageInfo>();
@ -209,8 +209,8 @@ public class InterpreterInfoPanel extends ContentPanel {
storeInterpreterPackageInfo.addAll(listNewPackages); storeInterpreterPackageInfo.addAll(listNewPackages);
storeInterpreterPackageInfo.commitChanges(); storeInterpreterPackageInfo.commitChanges();
seq = listNewPackages.size(); seqInterpreterPackages = listNewPackages.size();
Log.debug("Current Seq: " + seq); Log.debug("Current Seq: " + seqInterpreterPackages);
} }
}); });
@ -297,9 +297,9 @@ public class InterpreterInfoPanel extends ContentPanel {
public void addNewInterpreterPackageInfo(InterpreterPackageInfo interpreterPackageInfo) { public void addNewInterpreterPackageInfo(InterpreterPackageInfo interpreterPackageInfo) {
try { try {
Log.debug("Current Seq: " + seq); Log.debug("Current Seq: " + seqInterpreterPackages);
seq++; seqInterpreterPackages++;
interpreterPackageInfo.setId(seq); interpreterPackageInfo.setId(seqInterpreterPackages);
Log.debug("New Interpreter Package Info: " + interpreterPackageInfo); Log.debug("New Interpreter Package Info: " + interpreterPackageInfo);
storeInterpreterPackageInfo.add(interpreterPackageInfo); storeInterpreterPackageInfo.add(interpreterPackageInfo);
storeInterpreterPackageInfo.commitChanges(); storeInterpreterPackageInfo.commitChanges();
@ -316,9 +316,9 @@ public class InterpreterInfoPanel extends ContentPanel {
private void addInterpreterPackageInfo(SelectEvent event) { private void addInterpreterPackageInfo(SelectEvent event) {
try { try {
Log.debug("Current Seq: " + seq); Log.debug("Current Seq: " + seqInterpreterPackages);
seq++; seqInterpreterPackages++;
InterpreterPackageInfo newInterpreterPackageInfo = new InterpreterPackageInfo(seq, "", "", ""); InterpreterPackageInfo newInterpreterPackageInfo = new InterpreterPackageInfo(seqInterpreterPackages, "", "", "");
Log.debug("New Interpreter Package Info: " + newInterpreterPackageInfo); Log.debug("New Interpreter Package Info: " + newInterpreterPackageInfo);
gridInterpreterPackageInfoEditing.cancelEditing(); gridInterpreterPackageInfoEditing.cancelEditing();
addStatus = true; addStatus = true;
@ -349,17 +349,17 @@ public class InterpreterInfoPanel extends ContentPanel {
storeInterpreterPackageInfo storeInterpreterPackageInfo
.addAll(project.getInputData().getInterpreterInfo().getInterpreterPackagesInfo()); .addAll(project.getInputData().getInterpreterInfo().getInterpreterPackagesInfo());
storeInterpreterPackageInfo.commitChanges(); storeInterpreterPackageInfo.commitChanges();
seq = project.getInputData().getInterpreterInfo().getInterpreterPackagesInfo().size(); seqInterpreterPackages = project.getInputData().getInterpreterInfo().getInterpreterPackagesInfo().size();
} else { } else {
storeInterpreterPackageInfo.clear(); storeInterpreterPackageInfo.clear();
storeInterpreterPackageInfo.commitChanges(); storeInterpreterPackageInfo.commitChanges();
seq = 0; seqInterpreterPackages = 0;
} }
} else { } else {
interpreterVersion.clear(); interpreterVersion.clear();
storeInterpreterPackageInfo.clear(); storeInterpreterPackageInfo.clear();
storeInterpreterPackageInfo.commitChanges(); storeInterpreterPackageInfo.commitChanges();
seq = 0; seqInterpreterPackages = 0;
} }
} }

View File

@ -1,5 +1,9 @@
package org.gcube.portlets.user.statisticalalgorithmsimporter.shared; package org.gcube.portlets.user.statisticalalgorithmsimporter.shared;
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.project.Project;
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.project.ProjectConfig;
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.project.ProjectSupportBashEdit;
/** /**
* *
* @author Giancarlo Panichi * @author Giancarlo Panichi
@ -17,7 +21,7 @@ public class Constants {
public static final String STATISTICAL_ALGORITHMS_IMPORTER_LANG = "SAILang"; public static final String STATISTICAL_ALGORITHMS_IMPORTER_LANG = "SAILang";
public static final String DEFAULT_USER = "giancarlo.panichi"; public static final String DEFAULT_USER = "giancarlo.panichi";
public final static String DEFAULT_SCOPE = "/gcube/devNext/NextNext"; public final static String DEFAULT_SCOPE = "/gcube/preprod/preVRE";
public final static String DEFAULT_TOKEN = ""; public final static String DEFAULT_TOKEN = "";
public static final String DEFAULT_ROLE = "OrganizationMember"; public static final String DEFAULT_ROLE = "OrganizationMember";
@ -50,5 +54,10 @@ public class Constants {
// DataMiner Pool Manager // DataMiner Pool Manager
public static final int CLIENT_MONITOR_PERIODMILLIS = 2000; public static final int CLIENT_MONITOR_PERIODMILLIS = 2000;
//
public static final Project TEST_PROJECT = new Project(null, new ProjectConfig("", new ProjectSupportBashEdit()));
} }