1452: Implement a GUI for StatMan Algorithms Importer
Task-Url: https://support.d4science.org/issues/1452 Added open project git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/statistical-algorithms-importer@121825 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
88bf092513
commit
ca6e5ffd61
|
@ -94,7 +94,7 @@ public class StatAlgoImporter implements EntryPoint {
|
|||
|
||||
// Right
|
||||
ToolsPanel toolsPanel = new ToolsPanel(eventBus);
|
||||
BorderLayoutData eastData = new BorderLayoutData(400);
|
||||
BorderLayoutData eastData = new BorderLayoutData(500);
|
||||
eastData.setCollapsible(true);
|
||||
eastData.setSplit(false);
|
||||
eastData.setFloatable(false);
|
||||
|
|
|
@ -200,16 +200,15 @@ public class StatAlgoImporterController {
|
|||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
eventBus.addHandler(InputSaveReadyEvent.TYPE,
|
||||
new InputSaveReadyEvent.InputSaveReadyEventHandler() {
|
||||
|
||||
|
||||
@Override
|
||||
public void onInputSaveReady(InputSaveReadyEvent event) {
|
||||
Log.debug("Catch InputSaveReadyEvent");
|
||||
doInputSaveReadyCommand(event);
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -217,8 +216,6 @@ public class StatAlgoImporterController {
|
|||
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void doMenuCommand(StatAlgoImporterRibbonEvent event) {
|
||||
StatAlgoImporterRibbonType eventType = event.getStatRunnerRibbonType();
|
||||
if (eventType == null) {
|
||||
|
@ -231,6 +228,7 @@ public class StatAlgoImporterController {
|
|||
showCreateProjectDialog();
|
||||
break;
|
||||
case PROJECT_OPEN:
|
||||
showOpenProjectDialog();
|
||||
break;
|
||||
case PROJECT_SAVE:
|
||||
projectSaveRequest();
|
||||
|
@ -247,25 +245,29 @@ public class StatAlgoImporterController {
|
|||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected void doInputSaveReadyCommand(InputSaveReadyEvent event) {
|
||||
pm.saveProject(event.getInputVariables());
|
||||
|
||||
pm.saveProject(event.getInputData());
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void projectSaveRequest() {
|
||||
InputSaveEvent inputSaveEvent=new InputSaveEvent();
|
||||
InputSaveEvent inputSaveEvent = new InputSaveEvent();
|
||||
eventBus.fireEvent(inputSaveEvent);
|
||||
Log.debug("ProjectSaveRequest: "+inputSaveEvent);
|
||||
|
||||
Log.debug("ProjectSaveRequest: " + inputSaveEvent);
|
||||
|
||||
}
|
||||
|
||||
private void showCreateProjectDialog() {
|
||||
pm.createProject();
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void showOpenProjectDialog() {
|
||||
pm.openProject();
|
||||
|
||||
}
|
||||
|
||||
private void showAddResourceDialog() {
|
||||
pm.addResource();
|
||||
}
|
||||
|
@ -277,13 +279,13 @@ public class StatAlgoImporterController {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void doDeleteItemCommand(DeleteItemEvent event) {
|
||||
ItemDescription itemDescription = event.getItemDescription();
|
||||
if (itemDescription != null && itemDescription.getId() != null) {
|
||||
pm.deleteItem(itemDescription);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package org.gcube.portlets.user.statisticalalgorithmsimporter.client.event;
|
||||
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.project.InputVariables;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.project.InputData;
|
||||
|
||||
import com.google.gwt.event.shared.EventHandler;
|
||||
import com.google.gwt.event.shared.GwtEvent;
|
||||
|
@ -19,7 +19,7 @@ public class InputSaveReadyEvent extends
|
|||
GwtEvent<InputSaveReadyEvent.InputSaveReadyEventHandler> {
|
||||
|
||||
public static Type<InputSaveReadyEventHandler> TYPE = new Type<InputSaveReadyEventHandler>();
|
||||
private InputVariables inputVariables;
|
||||
private InputData inputData;
|
||||
|
||||
public interface InputSaveReadyEventHandler extends EventHandler {
|
||||
void onInputSaveReady(InputSaveReadyEvent event);
|
||||
|
@ -30,8 +30,8 @@ public class InputSaveReadyEvent extends
|
|||
InputSaveReadyEventHandler handler);
|
||||
}
|
||||
|
||||
public InputSaveReadyEvent(InputVariables inputVariables) {
|
||||
this.inputVariables = inputVariables;
|
||||
public InputSaveReadyEvent(InputData inputData) {
|
||||
this.inputData = inputData;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -53,13 +53,14 @@ public class InputSaveReadyEvent extends
|
|||
source.fireEvent(inputSaveReadyEvent);
|
||||
}
|
||||
|
||||
public InputVariables getInputVariables() {
|
||||
return inputVariables;
|
||||
public InputData getInputData() {
|
||||
return inputData;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "InputSaveReadyEvent [inputVariables=" + inputVariables + "]";
|
||||
return "InputSaveReadyEvent [inputData=" + inputData + "]";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package org.gcube.portlets.user.statisticalalgorithmsimporter.client.event;
|
||||
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.type.ProjectStatusEventType;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.workspace.ItemDescription;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.project.Project;
|
||||
|
||||
import com.google.gwt.event.shared.EventHandler;
|
||||
import com.google.gwt.event.shared.GwtEvent;
|
||||
|
@ -21,7 +21,7 @@ public class ProjectStatusEvent extends
|
|||
|
||||
public static Type<ProjectStatusEventHandler> TYPE = new Type<ProjectStatusEventHandler>();
|
||||
private ProjectStatusEventType projectStatusEventType;
|
||||
private ItemDescription projectFolder;
|
||||
private Project project;
|
||||
|
||||
public interface ProjectStatusEventHandler extends EventHandler {
|
||||
void onProjectStatus(ProjectStatusEvent event);
|
||||
|
@ -32,9 +32,9 @@ public class ProjectStatusEvent extends
|
|||
ProjectStatusEventHandler handler);
|
||||
}
|
||||
|
||||
public ProjectStatusEvent(ProjectStatusEventType projectStatusEventType,ItemDescription projectFolder) {
|
||||
public ProjectStatusEvent(ProjectStatusEventType projectStatusEventType,Project project) {
|
||||
this.projectStatusEventType = projectStatusEventType;
|
||||
this.projectFolder = projectFolder;
|
||||
this.project = project;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -60,18 +60,19 @@ public class ProjectStatusEvent extends
|
|||
return projectStatusEventType;
|
||||
}
|
||||
|
||||
public ItemDescription getProjectFolder() {
|
||||
return projectFolder;
|
||||
public Project getProject() {
|
||||
return project;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ProjectStatusEvent [projectStatusEventType="
|
||||
+ projectStatusEventType + ", projectFolder=" + projectFolder
|
||||
+ "]";
|
||||
+ projectStatusEventType + ", project=" + project + "]";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -3,22 +3,35 @@ package org.gcube.portlets.user.statisticalalgorithmsimporter.client.maindata;
|
|||
import java.util.ArrayList;
|
||||
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.event.SessionExpiredEvent;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.resource.StatAlgoImporterResources;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.rpc.StatAlgoImporterServiceAsync;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.type.SessionExpiredType;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.utils.UtilsGXT3;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.code.CodeData;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.exception.StatAlgoImporterSessionExpiredException;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.project.Project;
|
||||
|
||||
import com.allen_sauer.gwt.log.client.Log;
|
||||
import com.google.gwt.event.shared.EventBus;
|
||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
import com.sencha.gxt.cell.core.client.ButtonCell.ButtonScale;
|
||||
import com.sencha.gxt.cell.core.client.ButtonCell.IconAlign;
|
||||
import com.sencha.gxt.core.client.util.Margins;
|
||||
import com.sencha.gxt.widget.core.client.ContentPanel;
|
||||
import com.sencha.gxt.widget.core.client.button.TextButton;
|
||||
import com.sencha.gxt.widget.core.client.container.BoxLayoutContainer.BoxLayoutData;
|
||||
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer;
|
||||
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.VerticalLayoutData;
|
||||
import com.sencha.gxt.widget.core.client.event.SelectEvent;
|
||||
import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
|
||||
import com.sencha.gxt.widget.core.client.toolbar.ToolBar;
|
||||
|
||||
import edu.ycp.cs.dh.acegwt.client.ace.AceEditor;
|
||||
import edu.ycp.cs.dh.acegwt.client.ace.AceEditorCursorPosition;
|
||||
import edu.ycp.cs.dh.acegwt.client.ace.AceEditorMode;
|
||||
import edu.ycp.cs.dh.acegwt.client.ace.AceEditorTheme;
|
||||
import edu.ycp.cs.dh.acegwt.client.ace.AceSelection;
|
||||
import edu.ycp.cs.dh.acegwt.client.ace.AceSelectionListener;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -30,15 +43,19 @@ public class CodeEditPanel extends ContentPanel {
|
|||
|
||||
private EventBus eventBus;
|
||||
private AceEditor editor;
|
||||
|
||||
private TextButton btnSave;
|
||||
private TextButton btnAddInput;
|
||||
private TextButton btnAddOutput;
|
||||
|
||||
public CodeEditPanel(EventBus eventBus) {
|
||||
public CodeEditPanel(Project project, EventBus eventBus) {
|
||||
super();
|
||||
Log.debug("CodeEditPanel");
|
||||
this.eventBus = eventBus;
|
||||
|
||||
// msgs = GWT.create(ServiceCategoryMessages.class);
|
||||
init();
|
||||
create();
|
||||
create(project);
|
||||
|
||||
}
|
||||
|
||||
|
@ -51,14 +68,94 @@ public class CodeEditPanel extends ContentPanel {
|
|||
|
||||
}
|
||||
|
||||
private void create() {
|
||||
editor = new AceEditor();
|
||||
VerticalLayoutContainer v = new VerticalLayoutContainer();
|
||||
v.add(editor, new VerticalLayoutData(1, 1));
|
||||
private void create(Project project) {
|
||||
btnSave = new TextButton("Save");
|
||||
btnSave.setIcon(StatAlgoImporterResources.INSTANCE.add16());
|
||||
btnSave.setScale(ButtonScale.SMALL);
|
||||
btnSave.setIconAlign(IconAlign.LEFT);
|
||||
btnSave.setToolTip("Save");
|
||||
btnSave.addSelectHandler(new SelectHandler() {
|
||||
|
||||
@Override
|
||||
public void onSelect(SelectEvent event) {
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
btnAddInput = new TextButton("Input");
|
||||
btnAddInput.setIcon(StatAlgoImporterResources.INSTANCE.add16());
|
||||
btnAddInput.setScale(ButtonScale.SMALL);
|
||||
btnAddInput.setIconAlign(IconAlign.LEFT);
|
||||
btnAddInput.setToolTip("Add input variable from code");
|
||||
btnAddInput.addSelectHandler(new SelectHandler() {
|
||||
|
||||
@Override
|
||||
public void onSelect(SelectEvent event) {
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
btnAddInput.disable();
|
||||
|
||||
btnAddOutput = new TextButton("Output");
|
||||
btnAddOutput.setIcon(StatAlgoImporterResources.INSTANCE.add16());
|
||||
btnAddOutput.setScale(ButtonScale.SMALL);
|
||||
btnAddOutput.setIconAlign(IconAlign.LEFT);
|
||||
btnAddOutput.setToolTip("Add output variable from code");
|
||||
btnAddOutput.addSelectHandler(new SelectHandler() {
|
||||
|
||||
@Override
|
||||
public void onSelect(SelectEvent event) {
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
btnAddOutput.disable();
|
||||
|
||||
ToolBar toolBar = new ToolBar();
|
||||
toolBar.add(btnSave, new BoxLayoutData(new Margins(0)));
|
||||
toolBar.add(btnAddInput, new BoxLayoutData(new Margins(0)));
|
||||
toolBar.add(btnAddOutput, new BoxLayoutData(new Margins(0)));
|
||||
|
||||
|
||||
editor = new AceEditor();
|
||||
|
||||
VerticalLayoutContainer v = new VerticalLayoutContainer();
|
||||
v.add(toolBar, new VerticalLayoutData(1, -1, new Margins(0)));
|
||||
v.add(editor, new VerticalLayoutData(1, 1, new Margins(0)));
|
||||
|
||||
add(v);
|
||||
editor.startEditor();
|
||||
editor.setShowPrintMargin(false);
|
||||
|
||||
|
||||
if (project != null && project.getMainCode() != null) {
|
||||
loadCode();
|
||||
}
|
||||
|
||||
|
||||
editor.getSelection().addSelectionListener(new AceSelectionListener() {
|
||||
|
||||
@Override
|
||||
public void onChangeSelection(AceSelection selection) {
|
||||
if(selection!=null&& !selection.isEmpty()){
|
||||
btnAddInput.enable();
|
||||
btnAddOutput.enable();
|
||||
} else {
|
||||
btnAddInput.disable();
|
||||
btnAddOutput.disable();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void loadCode() {
|
||||
|
@ -104,9 +201,58 @@ public class CodeEditPanel extends ContentPanel {
|
|||
});
|
||||
}
|
||||
|
||||
public void codeUpdate() {
|
||||
loadCode();
|
||||
public void codeUpdate(Project project) {
|
||||
if (project != null && project.getMainCode() != null) {
|
||||
loadCode();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected String getSelectedText() {
|
||||
String selectedText = null;
|
||||
|
||||
AceSelection editorSelection = editor.getSelection();
|
||||
if (!editorSelection.isEmpty()) {
|
||||
AceEditorCursorPosition startPosition;
|
||||
AceEditorCursorPosition endPosition;
|
||||
if (editorSelection.isBackwards()) {
|
||||
startPosition = editorSelection.getSelectionLead();
|
||||
endPosition = editorSelection.getSelectionAnchor();
|
||||
editorSelection.select(startPosition.getRow(),
|
||||
startPosition.getColumn(), endPosition.getRow(),
|
||||
endPosition.getColumn());
|
||||
} else {
|
||||
startPosition = editorSelection.getSelectionAnchor();
|
||||
endPosition = editorSelection.getSelectionLead();
|
||||
|
||||
}
|
||||
|
||||
if (editorSelection.isMultiLine()) {
|
||||
String tempTest;
|
||||
for (int i = startPosition.getRow(); i < endPosition.getRow() + 1; i++) {
|
||||
if (i == startPosition.getRow()) {
|
||||
tempTest = editor.getLine(i);
|
||||
tempTest.substring(startPosition.getColumn());
|
||||
selectedText = tempTest;
|
||||
} else {
|
||||
if (i == endPosition.getRow()) {
|
||||
tempTest = editor.getLine(i);
|
||||
tempTest.substring(0, endPosition.getColumn() + 1);
|
||||
selectedText += tempTest;
|
||||
} else {
|
||||
selectedText += editor.getLine(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
String tempTest;
|
||||
tempTest = editor.getLine(startPosition.getRow());
|
||||
selectedText = tempTest.substring(startPosition.getColumn(), endPosition.getColumn()+1);
|
||||
}
|
||||
}
|
||||
|
||||
Log.debug("Selected Text: " + selectedText);
|
||||
return selectedText;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package org.gcube.portlets.user.statisticalalgorithmsimporter.client.maindata;
|
||||
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.event.ProjectStatusEvent;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.project.Project;
|
||||
|
||||
import com.allen_sauer.gwt.log.client.Log;
|
||||
import com.google.gwt.event.shared.EventBus;
|
||||
|
@ -29,10 +30,9 @@ public class MainDataPanel extends SimpleContainer {
|
|||
|
||||
protected void init() {
|
||||
forceLayoutOnResize = true;
|
||||
//setBodyBorder(false);
|
||||
// setBodyBorder(false);
|
||||
setBorders(false);
|
||||
//setHeaderVisible(false);
|
||||
|
||||
// setHeaderVisible(false);
|
||||
|
||||
}
|
||||
|
||||
|
@ -43,39 +43,44 @@ public class MainDataPanel extends SimpleContainer {
|
|||
private void bindToEvents() {
|
||||
eventBus.addHandler(ProjectStatusEvent.TYPE,
|
||||
new ProjectStatusEvent.ProjectStatusEventHandler() {
|
||||
|
||||
|
||||
@Override
|
||||
public void onProjectStatus(ProjectStatusEvent event) {
|
||||
Log.debug("Catch ProjectStatusEvent");
|
||||
doProjectStatusCommand(event);
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void doProjectStatusCommand(ProjectStatusEvent event) {
|
||||
if(event.getProjectStatusEventType()==null){
|
||||
if (event.getProjectStatusEventType() == null) {
|
||||
return;
|
||||
}
|
||||
switch(event.getProjectStatusEventType()){
|
||||
switch (event.getProjectStatusEventType()) {
|
||||
case OPEN:
|
||||
addCodeEditPanel();
|
||||
addCodeEditPanel(event.getProject());
|
||||
break;
|
||||
case UPDATE:
|
||||
codeEditPanel.codeUpdate();
|
||||
codeEditPanel.codeUpdate(event.getProject());
|
||||
break;
|
||||
case ADD_RESOURCE:
|
||||
case DELETE_RESOURCE:
|
||||
case MAIN_CODE_SET:
|
||||
case SAVE:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void addCodeEditPanel() {
|
||||
codeEditPanel = new CodeEditPanel(eventBus);
|
||||
private void addCodeEditPanel(Project project) {
|
||||
codeEditPanel = new CodeEditPanel(project, eventBus);
|
||||
add(codeEditPanel, new MarginData(new Margins(0)));
|
||||
forceLayout();
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -11,7 +11,10 @@ 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.utils.UtilsGXT3;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.exception.StatAlgoImporterSessionExpiredException;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.project.InputVariables;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.project.InputData;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.project.MainCode;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.project.Project;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.project.ProjectFolder;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.workspace.ItemDescription;
|
||||
import org.gcube.portlets.widgets.wsexplorer.client.notification.WorkspaceExplorerSelectNotification.WorskpaceExplorerSelectNotificationListener;
|
||||
import org.gcube.portlets.widgets.wsexplorer.client.select.WorkspaceExplorerSelectDialog;
|
||||
|
@ -31,10 +34,7 @@ import com.sencha.gxt.core.client.dom.XDOM;
|
|||
*/
|
||||
public class ProjectManager {
|
||||
private EventBus eventBus;
|
||||
private ItemDescription projectFolder;
|
||||
@SuppressWarnings("unused")
|
||||
private ItemDescription mainCodeDescription;
|
||||
|
||||
private Project project;
|
||||
public ProjectManager(EventBus eventBus) {
|
||||
this.eventBus = eventBus;
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ public class ProjectManager {
|
|||
public void onSelectedItem(Item item) {
|
||||
|
||||
if (item.getType() == ItemType.FOLDER) {
|
||||
createProjectOnServer(item);
|
||||
openProjectOnServer(item);
|
||||
|
||||
} else {
|
||||
UtilsGXT3.info("Attention",
|
||||
|
@ -82,6 +82,51 @@ public class ProjectManager {
|
|||
wselectDialog.setZIndex(XDOM.getTopZIndex());
|
||||
wselectDialog.show();
|
||||
}
|
||||
|
||||
public void openProject() {
|
||||
WorkspaceExplorerSelectDialog wselectDialog = new WorkspaceExplorerSelectDialog(
|
||||
"Select Project Folder", true);
|
||||
|
||||
WorskpaceExplorerSelectNotificationListener handler = new WorskpaceExplorerSelectNotificationListener() {
|
||||
|
||||
@Override
|
||||
public void onSelectedItem(Item item) {
|
||||
|
||||
if (item.getType() == ItemType.FOLDER) {
|
||||
openProjectOnServer(item);
|
||||
|
||||
} else {
|
||||
UtilsGXT3.info("Attention",
|
||||
"Select a valid project folder!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(Throwable throwable) {
|
||||
Log.error("Error in create project: "
|
||||
+ throwable.getLocalizedMessage());
|
||||
UtilsGXT3.alert("Error", throwable.getLocalizedMessage());
|
||||
throwable.printStackTrace();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAborted() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNotValidSelection() {
|
||||
UtilsGXT3.info("Attention", "Select a valid project folder!");
|
||||
}
|
||||
};
|
||||
|
||||
wselectDialog.addWorkspaceExplorerSelectNotificationListener(handler);
|
||||
wselectDialog.setZIndex(XDOM.getTopZIndex());
|
||||
wselectDialog.show();
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void addResource() {
|
||||
List<ItemType> selectableTypes = new ArrayList<ItemType>();
|
||||
|
@ -176,15 +221,15 @@ public class ProjectManager {
|
|||
|
||||
protected void createProjectOnServer(Item item) {
|
||||
Log.debug("Create Project Item selected: " + item);
|
||||
projectFolder = new ItemDescription(item.getId(), item.getName(),
|
||||
final ItemDescription newProjectFolder = new ItemDescription(item.getId(), item.getName(),
|
||||
item.getOwner(), item.getPath(), item.getType().name());
|
||||
StatAlgoImporterServiceAsync.INSTANCE.createProjectOnWorkspace(
|
||||
projectFolder, new AsyncCallback<Void>() {
|
||||
newProjectFolder, new AsyncCallback<Void>() {
|
||||
|
||||
@Override
|
||||
public void onSuccess(Void result) {
|
||||
project = new Project(new ProjectFolder(newProjectFolder));
|
||||
fireProjectStatusOpenEvent();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -203,11 +248,44 @@ public class ProjectManager {
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
protected void openProjectOnServer(Item item) {
|
||||
Log.debug("Open Project Item selected: " + item);
|
||||
final ItemDescription newProjectFolder = new ItemDescription(item.getId(), item.getName(),
|
||||
item.getOwner(), item.getPath(), item.getType().name());
|
||||
StatAlgoImporterServiceAsync.INSTANCE.openProjectOnWorkspace(
|
||||
newProjectFolder, new AsyncCallback<Project>() {
|
||||
|
||||
public void saveProject(InputVariables inputVariables) {
|
||||
Log.debug("Save Project: " + inputVariables);
|
||||
@Override
|
||||
public void onSuccess(Project projectOpened) {
|
||||
Log.debug("Open: "+projectOpened);
|
||||
project=projectOpened;
|
||||
fireProjectStatusOpenEvent();
|
||||
|
||||
StatAlgoImporterServiceAsync.INSTANCE.saveProject(inputVariables,
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
if (caught instanceof StatAlgoImporterSessionExpiredException) {
|
||||
eventBus.fireEvent(new SessionExpiredEvent(
|
||||
SessionExpiredType.EXPIREDONSERVER));
|
||||
} else {
|
||||
Log.error("Error in open project: "
|
||||
+ caught.getLocalizedMessage());
|
||||
UtilsGXT3.alert("Error",
|
||||
caught.getLocalizedMessage());
|
||||
}
|
||||
caught.printStackTrace();
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void saveProject(InputData inputData) {
|
||||
Log.debug("Save Project: " + inputData);
|
||||
|
||||
StatAlgoImporterServiceAsync.INSTANCE.saveProject(inputData,
|
||||
new AsyncCallback<Void>() {
|
||||
|
||||
@Override
|
||||
|
@ -233,8 +311,7 @@ public class ProjectManager {
|
|||
});
|
||||
}
|
||||
|
||||
public void setMainCode(ItemDescription itemDescription) {
|
||||
this.mainCodeDescription = itemDescription;
|
||||
public void setMainCode(final ItemDescription itemDescription) {
|
||||
Log.debug("Set Main Code: " + itemDescription);
|
||||
StatAlgoImporterServiceAsync.INSTANCE.setMainCode(itemDescription,
|
||||
new AsyncCallback<Void>() {
|
||||
|
@ -256,6 +333,7 @@ public class ProjectManager {
|
|||
|
||||
@Override
|
||||
public void onSuccess(Void result) {
|
||||
project.setMainCode(new MainCode(itemDescription));
|
||||
fireProjectStatusUpdateEvent();
|
||||
}
|
||||
});
|
||||
|
@ -293,7 +371,7 @@ public class ProjectManager {
|
|||
|
||||
protected void fireProjectStatusOpenEvent() {
|
||||
ProjectStatusEvent projectStatusEvent = new ProjectStatusEvent(
|
||||
ProjectStatusEventType.OPEN, projectFolder);
|
||||
ProjectStatusEventType.OPEN, project);
|
||||
eventBus.fireEvent(projectStatusEvent);
|
||||
Log.debug("ProjectStatusEvent fired! "+projectStatusEvent);
|
||||
|
||||
|
@ -301,7 +379,7 @@ public class ProjectManager {
|
|||
|
||||
protected void fireProjectStatusSaveProjectEvent() {
|
||||
ProjectStatusEvent projectStatusEvent = new ProjectStatusEvent(
|
||||
ProjectStatusEventType.SAVE, projectFolder);
|
||||
ProjectStatusEventType.SAVE, project);
|
||||
eventBus.fireEvent(projectStatusEvent);
|
||||
Log.debug("ProjectStatusEvent fired! "+projectStatusEvent);
|
||||
}
|
||||
|
@ -309,7 +387,7 @@ public class ProjectManager {
|
|||
|
||||
protected void fireProjectStatusAddResourceEvent() {
|
||||
ProjectStatusEvent projectStatusEvent = new ProjectStatusEvent(
|
||||
ProjectStatusEventType.ADD_RESOURCE, projectFolder);
|
||||
ProjectStatusEventType.ADD_RESOURCE, project);
|
||||
eventBus.fireEvent(projectStatusEvent);
|
||||
Log.debug("ProjectStatusEvent fired! "+projectStatusEvent);
|
||||
}
|
||||
|
@ -317,16 +395,18 @@ public class ProjectManager {
|
|||
protected void fireProjectStatusDeleteEvent() {
|
||||
// TODO Auto-generated method stub
|
||||
ProjectStatusEvent projectStatusEvent = new ProjectStatusEvent(
|
||||
ProjectStatusEventType.DELETE_RESOURCE, projectFolder);
|
||||
ProjectStatusEventType.DELETE_RESOURCE, project);
|
||||
eventBus.fireEvent(projectStatusEvent);
|
||||
Log.debug("ProjectStatusEvent fired! "+projectStatusEvent);
|
||||
}
|
||||
|
||||
protected void fireProjectStatusUpdateEvent() {
|
||||
ProjectStatusEvent projectStatusEvent = new ProjectStatusEvent(
|
||||
ProjectStatusEventType.UPDATE, projectFolder);
|
||||
ProjectStatusEventType.UPDATE, project);
|
||||
eventBus.fireEvent(projectStatusEvent);
|
||||
Log.debug("ProjectStatusEvent fired! "+projectStatusEvent);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package org.gcube.portlets.user.statisticalalgorithmsimporter.client.properties;
|
||||
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.input.InputType;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.input.DataType;
|
||||
|
||||
import com.google.gwt.editor.client.Editor.Path;
|
||||
import com.sencha.gxt.data.shared.LabelProvider;
|
||||
|
@ -14,11 +14,11 @@ import com.sencha.gxt.data.shared.PropertyAccess;
|
|||
*
|
||||
*/
|
||||
|
||||
public interface InputTypePropertiesCombo extends PropertyAccess<InputType> {
|
||||
public interface DataTypePropertiesCombo extends PropertyAccess<DataType> {
|
||||
|
||||
@Path("id")
|
||||
ModelKeyProvider<InputType> id();
|
||||
ModelKeyProvider<DataType> id();
|
||||
|
||||
LabelProvider<InputType> label();
|
||||
LabelProvider<DataType> label();
|
||||
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
package org.gcube.portlets.user.statisticalalgorithmsimporter.client.properties;
|
||||
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.input.EnvironmentVariables;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.input.InputType;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.input.DataType;
|
||||
|
||||
import com.sencha.gxt.core.client.ValueProvider;
|
||||
import com.sencha.gxt.data.shared.ModelKeyProvider;
|
||||
|
@ -22,7 +22,7 @@ public interface EnvironmentVariablesProperties extends
|
|||
|
||||
ValueProvider<EnvironmentVariables, String> description();
|
||||
|
||||
ValueProvider<EnvironmentVariables, InputType> inputType();
|
||||
ValueProvider<EnvironmentVariables, DataType> dataType();
|
||||
|
||||
ValueProvider<EnvironmentVariables, String> defaultValue();
|
||||
}
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
package org.gcube.portlets.user.statisticalalgorithmsimporter.client.properties;
|
||||
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.input.IOType;
|
||||
|
||||
import com.google.gwt.editor.client.Editor.Path;
|
||||
import com.sencha.gxt.data.shared.LabelProvider;
|
||||
import com.sencha.gxt.data.shared.ModelKeyProvider;
|
||||
import com.sencha.gxt.data.shared.PropertyAccess;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author giancarlo email: <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
|
||||
public interface IOTypePropertiesCombo extends PropertyAccess<IOType> {
|
||||
|
||||
@Path("id")
|
||||
ModelKeyProvider<IOType> id();
|
||||
|
||||
LabelProvider<IOType> label();
|
||||
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
package org.gcube.portlets.user.statisticalalgorithmsimporter.client.properties;
|
||||
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.input.IOType;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.input.SelectedRowsVariables;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.input.DataType;
|
||||
|
||||
import com.sencha.gxt.core.client.ValueProvider;
|
||||
import com.sencha.gxt.data.shared.ModelKeyProvider;
|
||||
import com.sencha.gxt.data.shared.PropertyAccess;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author giancarlo email: <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public interface SelectedRowsVariablesProperties extends
|
||||
PropertyAccess<SelectedRowsVariables> {
|
||||
|
||||
ModelKeyProvider<SelectedRowsVariables> id();
|
||||
|
||||
ValueProvider<SelectedRowsVariables, String> name();
|
||||
|
||||
ValueProvider<SelectedRowsVariables, String> description();
|
||||
|
||||
ValueProvider<SelectedRowsVariables, DataType> dataType();
|
||||
|
||||
ValueProvider<SelectedRowsVariables, String> defaultValue();
|
||||
|
||||
ValueProvider<SelectedRowsVariables, IOType> ioType();
|
||||
|
||||
}
|
|
@ -5,7 +5,8 @@ import java.util.ArrayList;
|
|||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.code.CodeData;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.exception.StatAlgoImporterServiceException;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.file.FileUploadMonitor;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.project.InputVariables;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.project.InputData;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.project.Project;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.session.UserInfo;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.workspace.ItemDescription;
|
||||
|
||||
|
@ -51,12 +52,14 @@ public interface StatAlgoImporterService extends RemoteService {
|
|||
|
||||
public void addResourceToProject(ItemDescription itemDescription)
|
||||
throws StatAlgoImporterServiceException;
|
||||
|
||||
|
||||
public void deleteResourceOnProject(ItemDescription itemDescription)
|
||||
throws StatAlgoImporterServiceException;
|
||||
|
||||
public void saveProject(InputVariables inputVariables)
|
||||
public void saveProject(InputData inputData)
|
||||
throws StatAlgoImporterServiceException;
|
||||
|
||||
public Project openProjectOnWorkspace(ItemDescription newProjectFolder)
|
||||
throws StatAlgoImporterServiceException;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -7,7 +7,8 @@ import java.util.ArrayList;
|
|||
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.code.CodeData;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.file.FileUploadMonitor;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.project.InputVariables;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.project.InputData;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.project.Project;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.session.UserInfo;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.workspace.ItemDescription;
|
||||
|
||||
|
@ -43,10 +44,13 @@ public interface StatAlgoImporterServiceAsync {
|
|||
void addResourceToProject(ItemDescription itemDescription,
|
||||
AsyncCallback<Void> asyncCallback);
|
||||
|
||||
void saveProject(InputVariables inputVariables,
|
||||
void saveProject(InputData inputData,
|
||||
AsyncCallback<Void> asyncCallback);
|
||||
|
||||
void deleteResourceOnProject(ItemDescription itemDescription,
|
||||
AsyncCallback<Void> asyncCallback);
|
||||
|
||||
void openProjectOnWorkspace(ItemDescription newProjectFolder,
|
||||
AsyncCallback<Project> asyncCallback);
|
||||
|
||||
}
|
||||
|
|
|
@ -83,7 +83,7 @@ public class ExplorerProjectPanel extends ContentPanel {
|
|||
setResize(true);
|
||||
setAnimCollapse(false);
|
||||
setHeadingText("Project Explorer");
|
||||
;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -144,7 +144,7 @@ public class ExplorerProjectPanel extends ContentPanel {
|
|||
try {
|
||||
|
||||
wsResourcesExplorerPanel = new WorkspaceResourcesExplorerPanel(
|
||||
event.getProjectFolder().getId(), false);
|
||||
event.getProject().getProjectFolder().getItemDescription().getId(), false);
|
||||
|
||||
WorskpaceExplorerSelectNotificationListener wsResourceExplorerListener = new WorskpaceExplorerSelectNotificationListener() {
|
||||
@Override
|
||||
|
@ -183,7 +183,7 @@ public class ExplorerProjectPanel extends ContentPanel {
|
|||
// DND
|
||||
|
||||
dnd = new MultipleDNDUpload();
|
||||
dnd.setParameters(event.getProjectFolder().getId(), UPLOAD_TYPE.File);
|
||||
dnd.setParameters(event.getProject().getProjectFolder().getItemDescription().getId(), UPLOAD_TYPE.File);
|
||||
dnd.addUniqueContainer(vResourcesExplorerContainer);
|
||||
WorskpaceUploadNotificationListener workspaceUploaderListener = new WorskpaceUploadNotificationListener() {
|
||||
|
||||
|
|
|
@ -3,10 +3,11 @@ package org.gcube.portlets.user.statisticalalgorithmsimporter.client.tools.input
|
|||
import java.util.ArrayList;
|
||||
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.properties.EnvironmentVariablesProperties;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.properties.InputTypePropertiesCombo;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.properties.DataTypePropertiesCombo;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.resource.StatAlgoImporterResources;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.input.EnvironmentVariables;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.input.InputType;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.input.DataType;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.project.Project;
|
||||
|
||||
import com.allen_sauer.gwt.log.client.Log;
|
||||
import com.google.gwt.cell.client.AbstractCell;
|
||||
|
@ -60,8 +61,8 @@ public class EnvironmentVariablesPanel extends ContentPanel {
|
|||
private EventBus eventBus;
|
||||
private ListStore<EnvironmentVariables> storeEnvironmentVariable;
|
||||
private Grid<EnvironmentVariables> gridEnvironmentVariable;
|
||||
private ListStore<InputType> storeComboInputType;
|
||||
private ComboBox<InputType> comboInputType;
|
||||
private ListStore<DataType> storeComboInputType;
|
||||
private ComboBox<DataType> comboInputType;
|
||||
private GridRowEditing<EnvironmentVariables> gridEnvironmentVariableEditing;
|
||||
private TextButton btnAdd;
|
||||
private boolean addStatus;
|
||||
|
@ -72,7 +73,7 @@ public class EnvironmentVariablesPanel extends ContentPanel {
|
|||
SafeHtml format(String value);
|
||||
}
|
||||
|
||||
public EnvironmentVariablesPanel(EventBus eventBus) {
|
||||
public EnvironmentVariablesPanel(Project project, EventBus eventBus) {
|
||||
super();
|
||||
Log.debug("EnvironmentVariablesPanel");
|
||||
this.eventBus = eventBus;
|
||||
|
@ -80,7 +81,7 @@ public class EnvironmentVariablesPanel extends ContentPanel {
|
|||
// msgs = GWT.create(ServiceCategoryMessages.class);
|
||||
try {
|
||||
init();
|
||||
create();
|
||||
create(project);
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
@ -94,7 +95,7 @@ public class EnvironmentVariablesPanel extends ContentPanel {
|
|||
forceLayoutOnResize = true;
|
||||
}
|
||||
|
||||
private void create() {
|
||||
private void create(Project project) {
|
||||
// Grid
|
||||
EnvironmentVariablesProperties props = GWT
|
||||
.create(EnvironmentVariablesProperties.class);
|
||||
|
@ -107,13 +108,13 @@ public class EnvironmentVariablesPanel extends ContentPanel {
|
|||
props.name(), 100, "Description");
|
||||
// descriptionColumn.setMenuDisabled(true);
|
||||
|
||||
ColumnConfig<EnvironmentVariables, InputType> inputTypeColumn = new ColumnConfig<EnvironmentVariables, InputType>(
|
||||
props.inputType(), 100, "Type");
|
||||
ColumnConfig<EnvironmentVariables, DataType> inputTypeColumn = new ColumnConfig<EnvironmentVariables, DataType>(
|
||||
props.dataType(), 100, "Type");
|
||||
// inputTypeColumn.setMenuDisabled(true);
|
||||
inputTypeColumn.setCell(new AbstractCell<InputType>() {
|
||||
inputTypeColumn.setCell(new AbstractCell<DataType>() {
|
||||
|
||||
@Override
|
||||
public void render(Context context, InputType inputType,
|
||||
public void render(Context context, DataType inputType,
|
||||
SafeHtmlBuilder sb) {
|
||||
InputTypeTemplates inputTypeTemplates = GWT
|
||||
.create(InputTypeTemplates.class);
|
||||
|
@ -131,19 +132,15 @@ public class EnvironmentVariablesPanel extends ContentPanel {
|
|||
l.add(inputTypeColumn);
|
||||
l.add(defaultValueColumn);
|
||||
|
||||
ColumnModel<EnvironmentVariables> columns = new ColumnModel<EnvironmentVariables>(
|
||||
l);
|
||||
ColumnModel<EnvironmentVariables> columns = new ColumnModel<EnvironmentVariables>(l);
|
||||
|
||||
storeEnvironmentVariable = new ListStore<EnvironmentVariables>(
|
||||
props.id());
|
||||
storeEnvironmentVariable = new ListStore<EnvironmentVariables>(props.id());
|
||||
|
||||
/*
|
||||
* ArrayList<EnvironmentVariables> list = new ArrayList<>(); for (int i
|
||||
* = 0; i < 10; i++) { list.add(new EnvironmentVariables(i, "Test" + i,
|
||||
* "Desc", "defaultValue", InputType.STRING)); }
|
||||
*
|
||||
* storeEnvironmentVariable.addAll(list);
|
||||
*/
|
||||
if (project != null && project.getInputData() != null
|
||||
&& project.getInputData().getListSelectedRows() != null) {
|
||||
storeEnvironmentVariable.addAll(project.getInputData()
|
||||
.getListEnvironmentVariables());
|
||||
}
|
||||
|
||||
final GridSelectionModel<EnvironmentVariables> sm = new GridSelectionModel<EnvironmentVariables>();
|
||||
sm.setSelectionMode(SelectionMode.SINGLE);
|
||||
|
@ -177,13 +174,13 @@ public class EnvironmentVariablesPanel extends ContentPanel {
|
|||
// EDITING //
|
||||
// Key
|
||||
|
||||
InputTypePropertiesCombo inputTypePropertiesCombo = GWT
|
||||
.create(InputTypePropertiesCombo.class);
|
||||
DataTypePropertiesCombo inputTypePropertiesCombo = GWT
|
||||
.create(DataTypePropertiesCombo.class);
|
||||
|
||||
storeComboInputType = new ListStore<InputType>(
|
||||
storeComboInputType = new ListStore<DataType>(
|
||||
inputTypePropertiesCombo.id());
|
||||
|
||||
comboInputType = new ComboBox<InputType>(storeComboInputType,
|
||||
comboInputType = new ComboBox<DataType>(storeComboInputType,
|
||||
inputTypePropertiesCombo.label());
|
||||
comboInputType.setClearValueOnParseError(false);
|
||||
comboInputType.setEditable(false);
|
||||
|
@ -300,13 +297,12 @@ public class EnvironmentVariablesPanel extends ContentPanel {
|
|||
|
||||
}
|
||||
|
||||
private void editingBeforeStart(
|
||||
BeforeStartEditEvent<EnvironmentVariables> event) {
|
||||
private void editingBeforeStart(BeforeStartEditEvent<EnvironmentVariables> event) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
private void addHandlersForComboInputType(LabelProvider<InputType> idI18N) {
|
||||
private void addHandlersForComboInputType(LabelProvider<DataType> idI18N) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
@ -314,8 +310,8 @@ public class EnvironmentVariablesPanel extends ContentPanel {
|
|||
private void addEnvironmentVariable(SelectEvent event) {
|
||||
try {
|
||||
seq++;
|
||||
EnvironmentVariables newEnvironmentVariable = new EnvironmentVariables(
|
||||
seq, "", "", "", InputType.STRING);
|
||||
EnvironmentVariables newEnvironmentVariable = new EnvironmentVariables(seq, "",
|
||||
"", "", DataType.STRING);
|
||||
Log.debug("New Environment Variable: " + newEnvironmentVariable);
|
||||
gridEnvironmentVariableEditing.cancelEditing();
|
||||
addStatus = true;
|
||||
|
@ -324,7 +320,7 @@ public class EnvironmentVariablesPanel extends ContentPanel {
|
|||
int row = storeEnvironmentVariable.indexOf(newEnvironmentVariable);
|
||||
|
||||
storeComboInputType.clear();
|
||||
storeComboInputType.addAll(InputType.asList());
|
||||
storeComboInputType.addAll(DataType.asList());
|
||||
storeComboInputType.commitChanges();
|
||||
|
||||
gridEnvironmentVariableEditing.startEditing(new GridCell(row, 0));
|
||||
|
@ -333,8 +329,14 @@ public class EnvironmentVariablesPanel extends ContentPanel {
|
|||
}
|
||||
}
|
||||
|
||||
public void update() {
|
||||
|
||||
public void update(Project project) {
|
||||
if (project != null && project.getInputData() != null
|
||||
&& project.getInputData().getListSelectedRows() != null) {
|
||||
storeEnvironmentVariable.clear();
|
||||
storeEnvironmentVariable.addAll(project.getInputData().getListEnvironmentVariables());
|
||||
storeEnvironmentVariable.commitChanges();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public ArrayList<EnvironmentVariables> getEnvironmentVariables() {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package org.gcube.portlets.user.statisticalalgorithmsimporter.client.tools.input;
|
||||
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.input.InputType;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.input.DataType;
|
||||
|
||||
import com.google.gwt.i18n.client.Messages;
|
||||
|
||||
|
@ -22,7 +22,7 @@ public interface InputTypeMessages extends Messages {
|
|||
"MAP", "Map",
|
||||
"BOOLEAN", "Boolean",
|
||||
"IMAGES", "Images" })
|
||||
String inputType(@Select InputType inputType);
|
||||
String inputType(@Select DataType inputType);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package org.gcube.portlets.user.statisticalalgorithmsimporter.client.tools.input
|
|||
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.event.InputSaveEvent;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.event.ProjectStatusEvent;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.event.UIStateEvent;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.project.Project;
|
||||
|
||||
import com.allen_sauer.gwt.log.client.Log;
|
||||
import com.google.gwt.event.shared.EventBus;
|
||||
|
@ -110,10 +111,10 @@ public class InputVariablePanel extends ContentPanel {
|
|||
+ event.toString());
|
||||
switch (event.getProjectStatusEventType()) {
|
||||
case OPEN:
|
||||
create();
|
||||
create(event.getProject());
|
||||
break;
|
||||
case UPDATE:
|
||||
updatePanel();
|
||||
updatePanel(event.getProject());
|
||||
break;
|
||||
case ADD_RESOURCE:
|
||||
break;
|
||||
|
@ -124,10 +125,10 @@ public class InputVariablePanel extends ContentPanel {
|
|||
}
|
||||
}
|
||||
|
||||
private void create() {
|
||||
private void create(Project project) {
|
||||
inputVariableTabPanel = new InputVariableTabPanel(eventBus, this);
|
||||
add(inputVariableTabPanel);
|
||||
startPanel();
|
||||
startPanel(project);
|
||||
forceLayout();
|
||||
}
|
||||
|
||||
|
@ -136,17 +137,17 @@ public class InputVariablePanel extends ContentPanel {
|
|||
* InputVariablePanelState.CLOSED; }
|
||||
*/
|
||||
|
||||
private void startPanel() {
|
||||
private void startPanel(Project project) {
|
||||
enable();
|
||||
expand();
|
||||
state = InputVariablePanelState.OPENED;
|
||||
inputVariableTabPanel.startTabs();
|
||||
inputVariableTabPanel.startTabs(project);
|
||||
|
||||
}
|
||||
|
||||
private void updatePanel() {
|
||||
private void updatePanel(Project project) {
|
||||
if (state == InputVariablePanelState.OPENED) {
|
||||
inputVariableTabPanel.updateTabs();
|
||||
inputVariableTabPanel.updateTabs(project);
|
||||
Log.debug("ToolBoxPanel Updated");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
package org.gcube.portlets.user.statisticalalgorithmsimporter.client.tools.input;
|
||||
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.event.InputSaveReadyEvent;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.project.InputVariables;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.project.InputData;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.project.Project;
|
||||
|
||||
import com.allen_sauer.gwt.log.client.Log;
|
||||
import com.google.gwt.core.client.GWT;
|
||||
|
@ -29,19 +30,23 @@ public class InputVariableTabPanel extends TabPanel {
|
|||
Log.debug("Create InpuntVariableTabPanel");
|
||||
this.eventBus = eventBus;
|
||||
this.msgs = GWT.create(InputVariableMessages.class);
|
||||
init();
|
||||
|
||||
}
|
||||
|
||||
protected void init(){
|
||||
setId("InputVariableTabPanel");
|
||||
setBodyBorder(false);
|
||||
setBorders(false);
|
||||
setAnimScroll(true);
|
||||
setTabScroll(true);
|
||||
setCloseContextMenu(true);
|
||||
|
||||
}
|
||||
|
||||
public void startTabs() {
|
||||
public void startTabs(Project project) {
|
||||
Log.debug("Start InputVariable Tabs");
|
||||
addEnvironmentVariablesPanel();
|
||||
addSelectedRowsPanel();
|
||||
addEnvironmentVariablesPanel(project);
|
||||
addSelectedRowsPanel(project);
|
||||
|
||||
setActiveWidget(getWidget(0));
|
||||
|
||||
|
@ -67,10 +72,10 @@ public class InputVariableTabPanel extends TabPanel {
|
|||
|
||||
//
|
||||
|
||||
public void updateTabs() {
|
||||
public void updateTabs(Project project) {
|
||||
try {
|
||||
enviromentVariablesPanel.update();
|
||||
selectedRowsPanel.update();
|
||||
enviromentVariablesPanel.update(project);
|
||||
selectedRowsPanel.update(project);
|
||||
|
||||
forceLayout();
|
||||
} catch (Throwable e) {
|
||||
|
@ -81,7 +86,7 @@ public class InputVariableTabPanel extends TabPanel {
|
|||
}
|
||||
|
||||
public void saveInput() {
|
||||
InputVariables inputVariables = new InputVariables();
|
||||
InputData inputVariables = new InputData();
|
||||
if (enviromentVariablesPanel != null) {
|
||||
inputVariables.setListEnvironmentVariables(enviromentVariablesPanel
|
||||
.getEnvironmentVariables());
|
||||
|
@ -100,21 +105,21 @@ public class InputVariableTabPanel extends TabPanel {
|
|||
}
|
||||
|
||||
// Add
|
||||
private void addSelectedRowsPanel() {
|
||||
private void addSelectedRowsPanel(Project project) {
|
||||
TabItemConfig selectedRowsPanelItemConf = new TabItemConfig(
|
||||
msgs.selectedRowsItem(), false);
|
||||
|
||||
selectedRowsPanel = new SelectedRowsPanel(eventBus);
|
||||
selectedRowsPanel = new SelectedRowsPanel(project, eventBus);
|
||||
selectedRowsPanel.setHeaderVisible(false);
|
||||
add(selectedRowsPanel, selectedRowsPanelItemConf);
|
||||
|
||||
}
|
||||
|
||||
private void addEnvironmentVariablesPanel() {
|
||||
private void addEnvironmentVariablesPanel(Project project) {
|
||||
TabItemConfig enviromentVariablePanelItemConf = new TabItemConfig(
|
||||
msgs.environmentVariables(), false);
|
||||
|
||||
enviromentVariablesPanel = new EnvironmentVariablesPanel(eventBus);
|
||||
enviromentVariablesPanel = new EnvironmentVariablesPanel(project, eventBus);
|
||||
enviromentVariablesPanel.setHeaderVisible(false);
|
||||
add(enviromentVariablesPanel, enviromentVariablePanelItemConf);
|
||||
}
|
||||
|
|
|
@ -2,11 +2,14 @@ package org.gcube.portlets.user.statisticalalgorithmsimporter.client.tools.input
|
|||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.properties.EnvironmentVariablesProperties;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.properties.InputTypePropertiesCombo;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.properties.DataTypePropertiesCombo;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.properties.IOTypePropertiesCombo;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.properties.SelectedRowsVariablesProperties;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.resource.StatAlgoImporterResources;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.input.EnvironmentVariables;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.input.InputType;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.input.DataType;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.input.IOType;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.input.SelectedRowsVariables;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.project.Project;
|
||||
|
||||
import com.allen_sauer.gwt.log.client.Log;
|
||||
import com.google.gwt.cell.client.AbstractCell;
|
||||
|
@ -14,7 +17,6 @@ import com.google.gwt.core.client.GWT;
|
|||
import com.google.gwt.event.shared.EventBus;
|
||||
import com.google.gwt.safehtml.shared.SafeHtml;
|
||||
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
|
||||
import com.sencha.gxt.cell.core.client.ButtonCell.IconAlign;
|
||||
import com.sencha.gxt.cell.core.client.form.ComboBoxCell.TriggerAction;
|
||||
import com.sencha.gxt.core.client.Style.SelectionMode;
|
||||
import com.sencha.gxt.core.client.XTemplates;
|
||||
|
@ -57,21 +59,29 @@ public class SelectedRowsPanel extends ContentPanel {
|
|||
|
||||
@SuppressWarnings("unused")
|
||||
private EventBus eventBus;
|
||||
private ListStore<EnvironmentVariables> storeEnvironmentVariable;
|
||||
private Grid<EnvironmentVariables> gridSelectedRows;
|
||||
private ListStore<InputType> storeComboInputType;
|
||||
private ComboBox<InputType> comboInputType;
|
||||
private GridRowEditing<EnvironmentVariables> gridEnvironmentVariableEditing;
|
||||
private ListStore<SelectedRowsVariables> storeSelectedRows;
|
||||
private Grid<SelectedRowsVariables> gridSelectedRows;
|
||||
private ListStore<DataType> storeComboDataType;
|
||||
private ComboBox<DataType> comboDataType;
|
||||
private ListStore<IOType> storeComboIOType;
|
||||
private ComboBox<IOType> comboIOType;
|
||||
private GridRowEditing<SelectedRowsVariables> gridSelectedRowsEditing;
|
||||
private TextButton btnAdd;
|
||||
private boolean addStatus;
|
||||
private int seq = 0;
|
||||
|
||||
interface InputTypeTemplates extends XTemplates {
|
||||
interface DataTypeTemplates extends XTemplates {
|
||||
@XTemplate("<span title=\"{value}\">{value}</span>")
|
||||
SafeHtml format(String value);
|
||||
}
|
||||
|
||||
public SelectedRowsPanel(EventBus eventBus) {
|
||||
interface IOTypeTemplates extends XTemplates {
|
||||
@XTemplate("<span title=\"{value}\">{value}</span>")
|
||||
SafeHtml format(String value);
|
||||
}
|
||||
|
||||
|
||||
public SelectedRowsPanel(Project project, EventBus eventBus) {
|
||||
super();
|
||||
Log.debug("SelectedRowsPanel");
|
||||
this.eventBus = eventBus;
|
||||
|
@ -79,7 +89,7 @@ public class SelectedRowsPanel extends ContentPanel {
|
|||
// msgs = GWT.create(ServiceCategoryMessages.class);
|
||||
try {
|
||||
init();
|
||||
create();
|
||||
create(project);
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
@ -93,62 +103,85 @@ public class SelectedRowsPanel extends ContentPanel {
|
|||
forceLayoutOnResize = true;
|
||||
}
|
||||
|
||||
private void create() {
|
||||
private void create(Project project) {
|
||||
// Grid
|
||||
EnvironmentVariablesProperties props = GWT
|
||||
.create(EnvironmentVariablesProperties.class);
|
||||
SelectedRowsVariablesProperties props = GWT
|
||||
.create(SelectedRowsVariablesProperties.class);
|
||||
|
||||
ColumnConfig<EnvironmentVariables, String> nameColumn = new ColumnConfig<EnvironmentVariables, String>(
|
||||
ColumnConfig<SelectedRowsVariables, String> nameColumn = new ColumnConfig<SelectedRowsVariables, String>(
|
||||
props.name(), 100, "Name");
|
||||
// nameColumn.setMenuDisabled(true);
|
||||
|
||||
ColumnConfig<EnvironmentVariables, String> descriptionColumn = new ColumnConfig<EnvironmentVariables, String>(
|
||||
ColumnConfig<SelectedRowsVariables, String> descriptionColumn = new ColumnConfig<SelectedRowsVariables, String>(
|
||||
props.name(), 100, "Description");
|
||||
// descriptionColumn.setMenuDisabled(true);
|
||||
|
||||
ColumnConfig<EnvironmentVariables, InputType> inputTypeColumn = new ColumnConfig<EnvironmentVariables, InputType>(
|
||||
props.inputType(), 100, "Type");
|
||||
ColumnConfig<SelectedRowsVariables, DataType> dataTypeColumn = new ColumnConfig<SelectedRowsVariables, DataType>(
|
||||
props.dataType(), 100, "Type");
|
||||
// inputTypeColumn.setMenuDisabled(true);
|
||||
inputTypeColumn.setCell(new AbstractCell<InputType>() {
|
||||
dataTypeColumn.setCell(new AbstractCell<DataType>() {
|
||||
|
||||
@Override
|
||||
public void render(Context context, InputType inputType,
|
||||
public void render(Context context, DataType inputType,
|
||||
SafeHtmlBuilder sb) {
|
||||
InputTypeTemplates inputTypeTemplates = GWT
|
||||
.create(InputTypeTemplates.class);
|
||||
DataTypeTemplates inputTypeTemplates = GWT
|
||||
.create(DataTypeTemplates.class);
|
||||
sb.append(inputTypeTemplates.format(inputType.getLabel()));
|
||||
}
|
||||
});
|
||||
|
||||
ColumnConfig<EnvironmentVariables, String> defaultValueColumn = new ColumnConfig<EnvironmentVariables, String>(
|
||||
ColumnConfig<SelectedRowsVariables, String> defaultValueColumn = new ColumnConfig<SelectedRowsVariables, String>(
|
||||
props.defaultValue(), 100, "Default");
|
||||
// defaColumn.setMenuDisabled(true);
|
||||
|
||||
|
||||
ColumnConfig<SelectedRowsVariables, IOType> ioTypeColumn = new ColumnConfig<SelectedRowsVariables, IOType>(
|
||||
props.ioType(), 100, "I/O");
|
||||
// inputTypeColumn.setMenuDisabled(true);
|
||||
ioTypeColumn.setCell(new AbstractCell<IOType>() {
|
||||
|
||||
ArrayList<ColumnConfig<EnvironmentVariables, ?>> l = new ArrayList<ColumnConfig<EnvironmentVariables, ?>>();
|
||||
@Override
|
||||
public void render(Context context, IOType ioType,
|
||||
SafeHtmlBuilder sb) {
|
||||
IOTypeTemplates ioTypeTemplates = GWT
|
||||
.create(IOTypeTemplates.class);
|
||||
sb.append(ioTypeTemplates.format(ioType.getLabel()));
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
ArrayList<ColumnConfig<SelectedRowsVariables, ?>> l = new ArrayList<ColumnConfig<SelectedRowsVariables, ?>>();
|
||||
l.add(nameColumn);
|
||||
l.add(descriptionColumn);
|
||||
l.add(inputTypeColumn);
|
||||
l.add(dataTypeColumn);
|
||||
l.add(defaultValueColumn);
|
||||
l.add(ioTypeColumn);
|
||||
|
||||
ColumnModel<EnvironmentVariables> columns = new ColumnModel<EnvironmentVariables>(
|
||||
ColumnModel<SelectedRowsVariables> columns = new ColumnModel<SelectedRowsVariables>(
|
||||
l);
|
||||
|
||||
storeEnvironmentVariable = new ListStore<EnvironmentVariables>(
|
||||
storeSelectedRows = new ListStore<SelectedRowsVariables>(
|
||||
props.id());
|
||||
|
||||
/*ArrayList<EnvironmentVariables> list = new ArrayList<>();
|
||||
for (int i = 0; i < 10; i++) {
|
||||
list.add(new EnvironmentVariables(i, "Test" + i, "Desc",
|
||||
"defaultValue", InputType.STRING));
|
||||
/*
|
||||
* ArrayList<SelectedRowsVariables> list = new ArrayList<>(); for (int i
|
||||
* = 0; i < 10; i++) { list.add(new SelectedRowsVariables(i, "Test" + i,
|
||||
* "Desc", "defaultValue", InputType.STRING)); }
|
||||
*
|
||||
* storeEnvironmentVariable.addAll(list);
|
||||
*/
|
||||
|
||||
if (project != null && project.getInputData() != null
|
||||
&& project.getInputData().getListSelectedRows() != null) {
|
||||
storeSelectedRows.addAll(project.getInputData().getListSelectedRows());
|
||||
}
|
||||
|
||||
storeEnvironmentVariable.addAll(list);*/
|
||||
|
||||
final GridSelectionModel<EnvironmentVariables> sm = new GridSelectionModel<EnvironmentVariables>();
|
||||
final GridSelectionModel<SelectedRowsVariables> sm = new GridSelectionModel<SelectedRowsVariables>();
|
||||
sm.setSelectionMode(SelectionMode.SINGLE);
|
||||
|
||||
gridSelectedRows = new Grid<EnvironmentVariables>(
|
||||
storeEnvironmentVariable, columns);
|
||||
gridSelectedRows = new Grid<SelectedRowsVariables>(
|
||||
storeSelectedRows, columns);
|
||||
gridSelectedRows.setSelectionModel(sm);
|
||||
gridSelectedRows.getView().setStripeRows(true);
|
||||
gridSelectedRows.getView().setColumnLines(true);
|
||||
|
@ -156,60 +189,81 @@ public class SelectedRowsPanel extends ContentPanel {
|
|||
gridSelectedRows.getView().setAutoFill(true);
|
||||
gridSelectedRows.setBorders(false);
|
||||
gridSelectedRows.setColumnReordering(false);
|
||||
|
||||
|
||||
/*
|
||||
* GridDragSource<EnvironmentVariables> ds = new
|
||||
* GridDragSource<EnvironmentVariables>( gridEnvironmentVariable);
|
||||
* GridDragSource<SelectedRowsVariables> ds = new
|
||||
* GridDragSource<SelectedRowsVariables>( gridEnvironmentVariable);
|
||||
* ds.addDragStartHandler(new DndDragStartHandler() {
|
||||
*
|
||||
* @Override public void onDragStart(DndDragStartEvent event) {
|
||||
*
|
||||
* @SuppressWarnings("unchecked") ArrayList<EnvironmentVariables>
|
||||
* draggingSelection = (ArrayList<EnvironmentVariables>) event
|
||||
* @SuppressWarnings("unchecked") ArrayList<SelectedRowsVariables>
|
||||
* draggingSelection = (ArrayList<SelectedRowsVariables>) event
|
||||
* .getData(); Log.debug("Start Drag: " + draggingSelection);
|
||||
*
|
||||
* } }); GridDropTarget<EnvironmentVariables> dt = new
|
||||
* GridDropTarget<EnvironmentVariables>( gridEnvironmentVariable);
|
||||
* } }); GridDropTarget<SelectedRowsVariables> dt = new
|
||||
* GridDropTarget<SelectedRowsVariables>( gridEnvironmentVariable);
|
||||
* dt.setFeedback(Feedback.BOTH); dt.setAllowSelfAsSource(true);
|
||||
*/
|
||||
|
||||
// EDITING //
|
||||
// Key
|
||||
|
||||
// DataType
|
||||
DataTypePropertiesCombo dataTypePropertiesCombo = GWT
|
||||
.create(DataTypePropertiesCombo.class);
|
||||
|
||||
InputTypePropertiesCombo inputTypePropertiesCombo = GWT
|
||||
.create(InputTypePropertiesCombo.class);
|
||||
storeComboDataType = new ListStore<DataType>(
|
||||
dataTypePropertiesCombo.id());
|
||||
|
||||
storeComboInputType = new ListStore<InputType>(
|
||||
inputTypePropertiesCombo.id());
|
||||
comboDataType = new ComboBox<DataType>(storeComboDataType,
|
||||
dataTypePropertiesCombo.label());
|
||||
comboDataType.setClearValueOnParseError(false);
|
||||
comboDataType.setEditable(false);
|
||||
|
||||
comboInputType = new ComboBox<InputType>(storeComboInputType,
|
||||
inputTypePropertiesCombo.label());
|
||||
comboInputType.setClearValueOnParseError(false);
|
||||
comboInputType.setEditable(false);
|
||||
comboDataType.setTriggerAction(TriggerAction.ALL);
|
||||
addHandlersForComboDataType(dataTypePropertiesCombo.label());
|
||||
|
||||
// IOType
|
||||
IOTypePropertiesCombo ioTypePropertiesCombo = GWT
|
||||
.create(IOTypePropertiesCombo.class);
|
||||
|
||||
comboInputType.setTriggerAction(TriggerAction.ALL);
|
||||
addHandlersForComboInputType(inputTypePropertiesCombo.label());
|
||||
storeComboIOType = new ListStore<IOType>(
|
||||
ioTypePropertiesCombo.id());
|
||||
|
||||
gridEnvironmentVariableEditing = new GridRowEditing<EnvironmentVariables>(
|
||||
comboIOType = new ComboBox<IOType>(storeComboIOType,
|
||||
ioTypePropertiesCombo.label());
|
||||
comboIOType.setClearValueOnParseError(false);
|
||||
comboIOType.setEditable(false);
|
||||
|
||||
comboIOType.setTriggerAction(TriggerAction.ALL);
|
||||
addHandlersForComboIOType(ioTypePropertiesCombo.label());
|
||||
|
||||
|
||||
//
|
||||
|
||||
gridSelectedRowsEditing = new GridRowEditing<SelectedRowsVariables>(
|
||||
gridSelectedRows);
|
||||
gridEnvironmentVariableEditing.addEditor(nameColumn, new TextField());
|
||||
gridEnvironmentVariableEditing.addEditor(descriptionColumn,
|
||||
gridSelectedRowsEditing.addEditor(nameColumn, new TextField());
|
||||
gridSelectedRowsEditing.addEditor(descriptionColumn,
|
||||
new TextField());
|
||||
gridEnvironmentVariableEditing
|
||||
.addEditor(inputTypeColumn, comboInputType);
|
||||
gridEnvironmentVariableEditing.addEditor(defaultValueColumn,
|
||||
gridSelectedRowsEditing.addEditor(dataTypeColumn,
|
||||
comboDataType);
|
||||
gridSelectedRowsEditing.addEditor(defaultValueColumn,
|
||||
new TextField());
|
||||
|
||||
gridSelectedRowsEditing.addEditor(ioTypeColumn,
|
||||
comboIOType);
|
||||
|
||||
|
||||
btnAdd = new TextButton();
|
||||
btnAdd.setIcon(StatAlgoImporterResources.INSTANCE.add16());
|
||||
//btnAdd.setIconAlign(IconAlign.);
|
||||
// btnAdd.setIconAlign(IconAlign.);
|
||||
btnAdd.setToolTip("Add Environment Variable");
|
||||
btnAdd.addSelectHandler(new SelectHandler() {
|
||||
|
||||
@Override
|
||||
public void onSelect(SelectEvent event) {
|
||||
addEnvironmentVariable(event);
|
||||
addSelectedRow(event);
|
||||
}
|
||||
|
||||
});
|
||||
|
@ -217,62 +271,62 @@ public class SelectedRowsPanel extends ContentPanel {
|
|||
TextButton btnDelete = new TextButton("Delete");
|
||||
btnDelete.addSelectHandler(new SelectEvent.SelectHandler() {
|
||||
public void onSelect(SelectEvent event) {
|
||||
GridCell cell = gridEnvironmentVariableEditing.getActiveCell();
|
||||
GridCell cell = gridSelectedRowsEditing.getActiveCell();
|
||||
int rowIndex = cell.getRow();
|
||||
|
||||
gridEnvironmentVariableEditing.cancelEditing();
|
||||
gridSelectedRowsEditing.cancelEditing();
|
||||
|
||||
storeEnvironmentVariable.remove(rowIndex);
|
||||
storeEnvironmentVariable.commitChanges();
|
||||
storeSelectedRows.remove(rowIndex);
|
||||
storeSelectedRows.commitChanges();
|
||||
|
||||
gridEnvironmentVariableEditing.getCancelButton()
|
||||
.setVisible(true);
|
||||
gridSelectedRowsEditing.getCancelButton().setVisible(
|
||||
true);
|
||||
btnAdd.setEnabled(true);
|
||||
if (addStatus) {
|
||||
addStatus = false;
|
||||
}
|
||||
}
|
||||
});
|
||||
ButtonBar buttonBar = gridEnvironmentVariableEditing.getButtonBar();
|
||||
ButtonBar buttonBar = gridSelectedRowsEditing.getButtonBar();
|
||||
buttonBar.add(btnDelete);
|
||||
|
||||
gridEnvironmentVariableEditing
|
||||
.addBeforeStartEditHandler(new BeforeStartEditHandler<EnvironmentVariables>() {
|
||||
gridSelectedRowsEditing
|
||||
.addBeforeStartEditHandler(new BeforeStartEditHandler<SelectedRowsVariables>() {
|
||||
|
||||
@Override
|
||||
public void onBeforeStartEdit(
|
||||
BeforeStartEditEvent<EnvironmentVariables> event) {
|
||||
BeforeStartEditEvent<SelectedRowsVariables> event) {
|
||||
editingBeforeStart(event);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
gridEnvironmentVariableEditing
|
||||
.addCancelEditHandler(new CancelEditHandler<EnvironmentVariables>() {
|
||||
gridSelectedRowsEditing
|
||||
.addCancelEditHandler(new CancelEditHandler<SelectedRowsVariables>() {
|
||||
|
||||
@Override
|
||||
public void onCancelEdit(
|
||||
CancelEditEvent<EnvironmentVariables> event) {
|
||||
storeEnvironmentVariable.rejectChanges();
|
||||
CancelEditEvent<SelectedRowsVariables> event) {
|
||||
storeSelectedRows.rejectChanges();
|
||||
btnAdd.setEnabled(true);
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
gridEnvironmentVariableEditing
|
||||
.addCompleteEditHandler(new CompleteEditHandler<EnvironmentVariables>() {
|
||||
gridSelectedRowsEditing
|
||||
.addCompleteEditHandler(new CompleteEditHandler<SelectedRowsVariables>() {
|
||||
|
||||
@Override
|
||||
public void onCompleteEdit(
|
||||
CompleteEditEvent<EnvironmentVariables> event) {
|
||||
CompleteEditEvent<SelectedRowsVariables> event) {
|
||||
try {
|
||||
if (addStatus) {
|
||||
addStatus = false;
|
||||
}
|
||||
storeEnvironmentVariable.commitChanges();
|
||||
storeSelectedRows.commitChanges();
|
||||
|
||||
gridEnvironmentVariableEditing.getCancelButton()
|
||||
gridSelectedRowsEditing.getCancelButton()
|
||||
.setVisible(true);
|
||||
btnAdd.setEnabled(true);
|
||||
|
||||
|
@ -290,57 +344,72 @@ public class SelectedRowsPanel extends ContentPanel {
|
|||
VerticalLayoutContainer vlc = new VerticalLayoutContainer();
|
||||
vlc.setAdjustForScroll(false);
|
||||
vlc.setScrollMode(ScrollMode.NONE);
|
||||
|
||||
|
||||
vlc.add(toolBar, new VerticalLayoutData(1, -1, new Margins(0)));
|
||||
vlc.add(gridSelectedRows, new VerticalLayoutData(1, 1,
|
||||
new Margins(0)));
|
||||
|
||||
vlc.add(gridSelectedRows, new VerticalLayoutData(1, 1, new Margins(0)));
|
||||
|
||||
add(vlc, new MarginData(new Margins(0)));
|
||||
|
||||
}
|
||||
|
||||
private void editingBeforeStart(
|
||||
BeforeStartEditEvent<EnvironmentVariables> event) {
|
||||
BeforeStartEditEvent<SelectedRowsVariables> event) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
private void addHandlersForComboInputType(LabelProvider<InputType> idI18N) {
|
||||
private void addHandlersForComboDataType(LabelProvider<DataType> idI18N) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
private void addEnvironmentVariable(SelectEvent event) {
|
||||
private void addHandlersForComboIOType(LabelProvider<IOType> idI18N) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void addSelectedRow(SelectEvent event) {
|
||||
try {
|
||||
seq++;
|
||||
EnvironmentVariables newEnvironmentVariable = new EnvironmentVariables(
|
||||
seq, "", "", "", InputType.STRING);
|
||||
SelectedRowsVariables newEnvironmentVariable = new SelectedRowsVariables(
|
||||
seq, "", "", "", DataType.STRING, IOType.INPUT);
|
||||
Log.debug("New Environment Variable: " + newEnvironmentVariable);
|
||||
gridEnvironmentVariableEditing.cancelEditing();
|
||||
addStatus = true;
|
||||
gridEnvironmentVariableEditing.getCancelButton().setVisible(false);
|
||||
storeEnvironmentVariable.add(newEnvironmentVariable);
|
||||
int row = storeEnvironmentVariable.indexOf(newEnvironmentVariable);
|
||||
gridSelectedRowsEditing.cancelEditing();
|
||||
addStatus = true;
|
||||
gridSelectedRowsEditing.getCancelButton().setVisible(false);
|
||||
storeSelectedRows.add(newEnvironmentVariable);
|
||||
int row = storeSelectedRows.indexOf(newEnvironmentVariable);
|
||||
|
||||
storeComboInputType.clear();
|
||||
storeComboInputType.addAll(InputType.asList());
|
||||
storeComboInputType.commitChanges();
|
||||
storeComboDataType.clear();
|
||||
storeComboDataType.addAll(DataType.asList());
|
||||
storeComboDataType.commitChanges();
|
||||
|
||||
storeComboIOType.clear();
|
||||
storeComboIOType.addAll(IOType.asList());
|
||||
storeComboIOType.commitChanges();
|
||||
|
||||
gridEnvironmentVariableEditing.startEditing(new GridCell(row, 0));
|
||||
gridSelectedRowsEditing.startEditing(new GridCell(row, 0));
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public void update() {
|
||||
public void update(Project project) {
|
||||
if (project != null && project.getInputData() != null
|
||||
&& project.getInputData().getListSelectedRows() != null) {
|
||||
storeSelectedRows.clear();
|
||||
storeSelectedRows.addAll(project.getInputData().getListSelectedRows());
|
||||
storeSelectedRows.commitChanges();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public ArrayList<EnvironmentVariables> getSelectedRows() {
|
||||
ArrayList<EnvironmentVariables> listEnviromentVarialbles = new ArrayList<>(
|
||||
|
||||
public ArrayList<SelectedRowsVariables> getSelectedRows() {
|
||||
ArrayList<SelectedRowsVariables> listEnviromentVarialbles = new ArrayList<>(
|
||||
gridSelectedRows.getStore().getAll());
|
||||
return listEnviromentVarialbles;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ import org.gcube.portlets.user.statisticalalgorithmsimporter.server.storage.Proj
|
|||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.code.CodeData;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.exception.StatAlgoImporterServiceException;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.file.FileUploadMonitor;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.project.InputVariables;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.project.InputData;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.project.MainCode;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.project.Project;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.project.ProjectFolder;
|
||||
|
@ -146,13 +146,13 @@ public class StatAlgoImporterServiceImpl extends RemoteServiceServlet implements
|
|||
*
|
||||
*/
|
||||
@Override
|
||||
public void createProjectOnWorkspace(ItemDescription itemDescription)
|
||||
public void createProjectOnWorkspace(ItemDescription newProjectFolder)
|
||||
throws StatAlgoImporterServiceException {
|
||||
try {
|
||||
HttpSession session = this.getThreadLocalRequest().getSession();
|
||||
SessionUtil.getAslSession(session);
|
||||
logger.debug("createProjectOnWorkspace()");
|
||||
ProjectFolder projectFolder = new ProjectFolder(itemDescription);
|
||||
ProjectFolder projectFolder = new ProjectFolder(newProjectFolder);
|
||||
Project projectSession = new Project(projectFolder);
|
||||
SessionUtil.setProjectSession(session, projectSession);
|
||||
|
||||
|
@ -167,6 +167,32 @@ public class StatAlgoImporterServiceImpl extends RemoteServiceServlet implements
|
|||
throw new StatAlgoImporterServiceException(e.getLocalizedMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Project openProjectOnWorkspace(ItemDescription newProjectFolder)
|
||||
throws StatAlgoImporterServiceException {
|
||||
try {
|
||||
HttpSession session = this.getThreadLocalRequest().getSession();
|
||||
ASLSession aslSession=SessionUtil.getAslSession(session);
|
||||
logger.debug("openProjectOnWorkspace()");
|
||||
|
||||
Project project=ProjectArchiver.readProject(newProjectFolder,aslSession);
|
||||
SessionUtil.setProjectSession(session, project);
|
||||
|
||||
return project;
|
||||
} catch (StatAlgoImporterServiceException e) {
|
||||
e.printStackTrace();
|
||||
throw e;
|
||||
} catch (Throwable e) {
|
||||
logger.error(
|
||||
"openProjectOnWorkspace(): " + e.getLocalizedMessage(), e);
|
||||
e.printStackTrace();
|
||||
throw new StatAlgoImporterServiceException(e.getLocalizedMessage());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setMainCode(ItemDescription itemDescription)
|
||||
|
@ -268,15 +294,15 @@ public class StatAlgoImporterServiceImpl extends RemoteServiceServlet implements
|
|||
}
|
||||
|
||||
@Override
|
||||
public void saveProject(InputVariables inputVariables)
|
||||
public void saveProject(InputData inputData)
|
||||
throws StatAlgoImporterServiceException {
|
||||
try {
|
||||
HttpSession session = this.getThreadLocalRequest().getSession();
|
||||
ASLSession aslSession=SessionUtil.getAslSession(session);
|
||||
logger.debug("saveProject():"+inputVariables);
|
||||
logger.debug("saveProject():"+inputData);
|
||||
Project project = SessionUtil.getProjectSession(session);
|
||||
if (project != null) {
|
||||
project.setInputVariable(inputVariables);
|
||||
project.setInputData(inputData);
|
||||
SessionUtil.setProjectSession(session, project);
|
||||
ProjectArchiver.archive(project, aslSession);
|
||||
} else {
|
||||
|
@ -296,4 +322,6 @@ public class StatAlgoImporterServiceImpl extends RemoteServiceServlet implements
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -113,7 +113,42 @@ public class FilesStorage {
|
|||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public InputStream retrieveProjectItemOnWorkspace(String user, String folderId)
|
||||
throws StatAlgoImporterServiceException {
|
||||
Workspace ws;
|
||||
try {
|
||||
ws = HomeLibrary.getUserWorkspace(user);
|
||||
|
||||
WorkspaceItem workSpaceItem = ws.getItem(folderId);
|
||||
if (!workSpaceItem.isFolder()) {
|
||||
throw new StatAlgoImporterServiceException(
|
||||
"Folder is not valid item!");
|
||||
}
|
||||
|
||||
WorkspaceItem projectItem=ws.find(STATISTICAL_ALGORITHM_PROJECT_FILE_NAME, folderId);
|
||||
|
||||
if(projectItem==null){
|
||||
throw new StatAlgoImporterServiceException(
|
||||
"No project found in this folder!");
|
||||
}
|
||||
|
||||
return retrieveImputStream(user, projectItem);
|
||||
|
||||
} catch (WorkspaceFolderNotFoundException | InternalErrorException
|
||||
| HomeNotFoundException | ItemNotFoundException | WrongItemTypeException e) {
|
||||
e.printStackTrace();
|
||||
throw new StatAlgoImporterServiceException(e.getLocalizedMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
|
|
@ -1,12 +1,15 @@
|
|||
package org.gcube.portlets.user.statisticalalgorithmsimporter.server.storage;
|
||||
|
||||
import java.beans.XMLDecoder;
|
||||
import java.beans.XMLEncoder;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.InputStream;
|
||||
|
||||
import org.gcube.application.framework.core.session.ASLSession;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.exception.StatAlgoImporterServiceException;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.project.Project;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.workspace.ItemDescription;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -17,24 +20,37 @@ import org.slf4j.LoggerFactory;
|
|||
*
|
||||
*/
|
||||
public class ProjectArchiver {
|
||||
|
||||
|
||||
public static final Logger logger = LoggerFactory
|
||||
.getLogger(ProjectArchiver.class);
|
||||
|
||||
|
||||
public static void archive(Project project, ASLSession aslSession)
|
||||
throws StatAlgoImporterServiceException {
|
||||
throws StatAlgoImporterServiceException {
|
||||
|
||||
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
|
||||
XMLEncoder xmlEncoder = new XMLEncoder(byteArrayOutputStream);
|
||||
xmlEncoder.writeObject(project);
|
||||
xmlEncoder.close();
|
||||
logger.debug("Archived:" + byteArrayOutputStream);
|
||||
|
||||
ByteArrayInputStream byteArrayInputStream=new ByteArrayInputStream(byteArrayOutputStream.toByteArray());
|
||||
FilesStorage filesStorage=new FilesStorage();
|
||||
filesStorage.saveItemOnFolder(aslSession.getUsername(), byteArrayInputStream, project.getProjectFolder().getItemDescription().getId());
|
||||
|
||||
|
||||
ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(
|
||||
byteArrayOutputStream.toByteArray());
|
||||
FilesStorage filesStorage = new FilesStorage();
|
||||
filesStorage.saveItemOnFolder(aslSession.getUsername(),
|
||||
byteArrayInputStream, project.getProjectFolder()
|
||||
.getItemDescription().getId());
|
||||
|
||||
}
|
||||
|
||||
public static Project readProject(ItemDescription newProjectFolder,
|
||||
ASLSession aslSession) throws StatAlgoImporterServiceException {
|
||||
FilesStorage filesStorage = new FilesStorage();
|
||||
InputStream inputStream = filesStorage.retrieveProjectItemOnWorkspace(
|
||||
aslSession.getUsername(), newProjectFolder.getId());
|
||||
|
||||
XMLDecoder xmlDecoder = new XMLDecoder(inputStream);
|
||||
Project project = (Project) xmlDecoder.readObject();
|
||||
xmlDecoder.close();
|
||||
return project;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ import java.util.List;
|
|||
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public enum InputType {
|
||||
public enum DataType {
|
||||
STRING("String"),
|
||||
NUMBER("Number"),
|
||||
ENUMERATED("Enumerated"),
|
||||
|
@ -33,7 +33,7 @@ public enum InputType {
|
|||
}
|
||||
}*/
|
||||
|
||||
private InputType(String id) {
|
||||
private DataType(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
@ -51,8 +51,8 @@ public enum InputType {
|
|||
}
|
||||
|
||||
|
||||
public static List<InputType> asList() {
|
||||
List<InputType> list = Arrays.asList(values());
|
||||
public static List<DataType> asList() {
|
||||
List<DataType> list = Arrays.asList(values());
|
||||
return list;
|
||||
}
|
||||
|
|
@ -15,7 +15,7 @@ public class EnvironmentVariables implements Serializable {
|
|||
private String name;
|
||||
private String description;
|
||||
private String defaultValue;
|
||||
private InputType inputType;
|
||||
private DataType dataType;
|
||||
|
||||
public EnvironmentVariables() {
|
||||
super();
|
||||
|
@ -27,16 +27,16 @@ public class EnvironmentVariables implements Serializable {
|
|||
* @param name
|
||||
* @param description
|
||||
* @param defaultValue
|
||||
* @param inputType
|
||||
* @param dataType
|
||||
*/
|
||||
public EnvironmentVariables(int id, String name, String description,
|
||||
String defaultValue, InputType inputType) {
|
||||
String defaultValue, DataType dataType) {
|
||||
super();
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.description = description;
|
||||
this.defaultValue = defaultValue;
|
||||
this.inputType = inputType;
|
||||
this.dataType = dataType;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
|
@ -71,21 +71,20 @@ public class EnvironmentVariables implements Serializable {
|
|||
this.defaultValue = defaultValue;
|
||||
}
|
||||
|
||||
public InputType getInputType() {
|
||||
return inputType;
|
||||
public DataType getDataType() {
|
||||
return dataType;
|
||||
}
|
||||
|
||||
public void setInputType(InputType inputType) {
|
||||
this.inputType = inputType;
|
||||
public void setDataType(DataType dataType) {
|
||||
this.dataType = dataType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "EnvironmentVariables [id=" + id + ", name=" + name
|
||||
+ ", description=" + description + ", defaultValue="
|
||||
+ defaultValue + ", inputType=" + inputType + "]";
|
||||
+ defaultValue + ", dataType=" + dataType + "]";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,57 @@
|
|||
package org.gcube.portlets.user.statisticalalgorithmsimporter.shared.input;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author "Giancarlo Panichi"
|
||||
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public enum IOType {
|
||||
INPUT("Input"),
|
||||
OUTPUT("Output");
|
||||
|
||||
|
||||
//private static IOTypeMessages msgs=GWT.create(IOTypeMessages.class);
|
||||
private String id;
|
||||
|
||||
//private static List<String> inputTypeI18NList;
|
||||
|
||||
/*static {
|
||||
ioTypeI18NList = new ArrayList<String>();
|
||||
for (IOType iotype : values()) {
|
||||
ioI18NList.add(msgs.ioType(iotype));
|
||||
}
|
||||
}*/
|
||||
|
||||
private IOType(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getLabel(){
|
||||
//return msgs.ioType(this);
|
||||
return id;
|
||||
}
|
||||
|
||||
|
||||
public static List<IOType> asList() {
|
||||
List<IOType> list = Arrays.asList(values());
|
||||
return list;
|
||||
}
|
||||
|
||||
/*public static List<String> asI18NList() {
|
||||
return ioTypeI18NList;
|
||||
|
||||
}*/
|
||||
|
||||
}
|
|
@ -0,0 +1,95 @@
|
|||
package org.gcube.portlets.user.statisticalalgorithmsimporter.shared.input;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author giancarlo email: <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class SelectedRowsVariables implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -2519686355634242523L;
|
||||
private int id;
|
||||
private String name;
|
||||
private String description;
|
||||
private String defaultValue;
|
||||
private DataType dataType;
|
||||
private IOType ioType;
|
||||
|
||||
public SelectedRowsVariables() {
|
||||
super();
|
||||
}
|
||||
|
||||
public SelectedRowsVariables(int id, String name, String description,
|
||||
String defaultValue, DataType dataType, IOType ioType) {
|
||||
super();
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.description = description;
|
||||
this.defaultValue = defaultValue;
|
||||
this.dataType = dataType;
|
||||
this.ioType = ioType;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getDefaultValue() {
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
public void setDefaultValue(String defaultValue) {
|
||||
this.defaultValue = defaultValue;
|
||||
}
|
||||
|
||||
public DataType getDataType() {
|
||||
return dataType;
|
||||
}
|
||||
|
||||
public void setDataType(DataType dataType) {
|
||||
this.dataType = dataType;
|
||||
}
|
||||
|
||||
public IOType getIoType() {
|
||||
return ioType;
|
||||
}
|
||||
|
||||
public void setIoType(IOType ioType) {
|
||||
this.ioType = ioType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SelectedRowsVariables [id=" + id + ", name=" + name
|
||||
+ ", description=" + description + ", defaultValue="
|
||||
+ defaultValue + ", dataType=" + dataType + ", ioType="
|
||||
+ ioType + "]";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -4,6 +4,7 @@ import java.io.Serializable;
|
|||
import java.util.ArrayList;
|
||||
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.input.EnvironmentVariables;
|
||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.input.SelectedRowsVariables;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -11,19 +12,18 @@ import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.input.Enviro
|
|||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class InputVariables implements Serializable {
|
||||
public class InputData implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -2405068429998054485L;
|
||||
private ArrayList<EnvironmentVariables> listEnvironmentVariables;
|
||||
private ArrayList<EnvironmentVariables> listSelectedRows;
|
||||
private ArrayList<SelectedRowsVariables> listSelectedRows;
|
||||
|
||||
public InputVariables() {
|
||||
public InputData() {
|
||||
super();
|
||||
}
|
||||
|
||||
public InputVariables(
|
||||
ArrayList<EnvironmentVariables> listEnvironmentVariables,
|
||||
ArrayList<EnvironmentVariables> listSelectedRows) {
|
||||
public InputData(ArrayList<EnvironmentVariables> listEnvironmentVariables,
|
||||
ArrayList<SelectedRowsVariables> listSelectedRows) {
|
||||
super();
|
||||
this.listEnvironmentVariables = listEnvironmentVariables;
|
||||
this.listSelectedRows = listSelectedRows;
|
||||
|
@ -38,20 +38,23 @@ public class InputVariables implements Serializable {
|
|||
this.listEnvironmentVariables = listEnvironmentVariables;
|
||||
}
|
||||
|
||||
public ArrayList<EnvironmentVariables> getListSelectedRows() {
|
||||
public ArrayList<SelectedRowsVariables> getListSelectedRows() {
|
||||
return listSelectedRows;
|
||||
}
|
||||
|
||||
public void setListSelectedRows(
|
||||
ArrayList<EnvironmentVariables> listSelectedRows) {
|
||||
ArrayList<SelectedRowsVariables> listSelectedRows) {
|
||||
this.listSelectedRows = listSelectedRows;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "InputVariables [listEnvironmentVariables="
|
||||
return "InputData [listEnvironmentVariables="
|
||||
+ listEnvironmentVariables + ", listSelectedRows="
|
||||
+ listSelectedRows + "]";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -14,7 +14,7 @@ public class Project implements Serializable {
|
|||
|
||||
private ProjectFolder projectFolder;
|
||||
private MainCode mainCode;
|
||||
private InputVariables inputVariable;
|
||||
private InputData inputData;
|
||||
|
||||
public Project(){
|
||||
super();
|
||||
|
@ -42,18 +42,18 @@ public class Project implements Serializable {
|
|||
this.projectFolder = projectFolder;
|
||||
}
|
||||
|
||||
public InputVariables getInputVariable() {
|
||||
return inputVariable;
|
||||
public InputData getInputData() {
|
||||
return inputData;
|
||||
}
|
||||
|
||||
public void setInputVariable(InputVariables inputVariable) {
|
||||
this.inputVariable = inputVariable;
|
||||
public void setInputData(InputData inputData) {
|
||||
this.inputData = inputData;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Project [projectFolder=" + projectFolder + ", mainCode="
|
||||
+ mainCode + ", inputVariable=" + inputVariable + "]";
|
||||
+ mainCode + ", inputData=" + inputData + "]";
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue