Release gCube 4.3

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/statistical-algorithms-importer@144104 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2017-02-22 11:56:39 +00:00
parent c5d0bda36c
commit c1a7add41b
6 changed files with 80 additions and 20 deletions

View File

@ -296,11 +296,13 @@ public class InterpreterInfoPanel extends ContentPanel {
} }
FieldLabel interpreterPackagesLabel = new FieldLabel(null, "Packages");
ToolBar toolBar = new ToolBar(); ToolBar toolBar = new ToolBar();
toolBar.add(btnAdd, new BoxLayoutData(new Margins(0))); toolBar.add(btnAdd, new BoxLayoutData(new Margins(0)));
FieldLabel interpreterPackagesLabel = new FieldLabel(toolBar, "Packages");
VerticalLayoutContainer vlc = new VerticalLayoutContainer(); VerticalLayoutContainer vlc = new VerticalLayoutContainer();
vlc.setAdjustForScroll(false); vlc.setAdjustForScroll(false);
vlc.setScrollMode(ScrollMode.NONE); vlc.setScrollMode(ScrollMode.NONE);
@ -311,7 +313,7 @@ public class InterpreterInfoPanel extends ContentPanel {
vlc.add(interpreterPackagesLabel, new VerticalLayoutData(1, -1, vlc.add(interpreterPackagesLabel, new VerticalLayoutData(1, -1,
new Margins(0))); new Margins(0)));
vlc.add(toolBar, new VerticalLayoutData(1, -1, new Margins(0))); //vlc.add(toolBar, new VerticalLayoutData(1, -1, new Margins(0)));
vlc.add(gridInterpreterPackageInfo, new VerticalLayoutData(1, 1, vlc.add(gridInterpreterPackageInfo, new VerticalLayoutData(1, 1,
new Margins(0))); new Margins(0)));

View File

@ -63,6 +63,7 @@ public class ProjectInfoPanel extends ContentPanel {
private EventBus eventBus; private EventBus eventBus;
private TextField algorithmName; private TextField algorithmName;
private TextField algorithmDescription; private TextField algorithmDescription;
private TextField algorithmCategory;
private ListStore<RequestedVRE> storeRequestedVRE; private ListStore<RequestedVRE> storeRequestedVRE;
private Grid<RequestedVRE> gridRequestedVRE; private Grid<RequestedVRE> gridRequestedVRE;
private GridRowEditing<RequestedVRE> gridRequestedVREEditing; private GridRowEditing<RequestedVRE> gridRequestedVREEditing;
@ -94,6 +95,7 @@ public class ProjectInfoPanel extends ContentPanel {
private void create(Project project) { private void create(Project project) {
//
algorithmName = new TextField(); algorithmName = new TextField();
algorithmName.setAllowBlank(false); algorithmName.setAllowBlank(false);
algorithmName.addValidator(new RegExValidator("^[a-zA-Z0-9_]*$", algorithmName.addValidator(new RegExValidator("^[a-zA-Z0-9_]*$",
@ -111,6 +113,7 @@ public class ProjectInfoPanel extends ContentPanel {
FieldLabel nameLabel = new FieldLabel(algorithmName, "Name"); FieldLabel nameLabel = new FieldLabel(algorithmName, "Name");
nameLabel.setLabelWidth(LABAEL_WIDTH); nameLabel.setLabelWidth(LABAEL_WIDTH);
//
algorithmDescription = new TextField(); algorithmDescription = new TextField();
algorithmDescription.setAllowBlank(false); algorithmDescription.setAllowBlank(false);
algorithmDescription.setEmptyText("Enter description..."); algorithmDescription.setEmptyText("Enter description...");
@ -120,6 +123,15 @@ public class ProjectInfoPanel extends ContentPanel {
"Description"); "Description");
descriptionLabel.setLabelWidth(LABAEL_WIDTH); descriptionLabel.setLabelWidth(LABAEL_WIDTH);
//
algorithmCategory = new TextField();
algorithmCategory.setAllowBlank(false);
algorithmCategory.setEmptyText("Enter description...");
algorithmCategory.addValidator(new RegExValidator("^[^\"]*$",
"Attention character \" is not allowed"));
FieldLabel categoryLabel = new FieldLabel(algorithmCategory, "Category");
categoryLabel.setLabelWidth(LABAEL_WIDTH);
// Grid // Grid
RequestedVREProperties props = GWT.create(RequestedVREProperties.class); RequestedVREProperties props = GWT.create(RequestedVREProperties.class);
@ -152,6 +164,13 @@ public class ProjectInfoPanel extends ContentPanel {
.getProjectInfo().getAlgorithmDescription()); .getProjectInfo().getAlgorithmDescription());
} }
if (project.getInputData().getProjectInfo()
.getAlgorithmCategory() != null) {
algorithmCategory.setValue(project.getInputData()
.getProjectInfo().getAlgorithmCategory());
}
if (project.getInputData().getProjectInfo().getListRequestedVRE() != null) { if (project.getInputData().getProjectInfo().getListRequestedVRE() != null) {
storeRequestedVRE.addAll(project.getInputData() storeRequestedVRE.addAll(project.getInputData()
.getProjectInfo().getListRequestedVRE()); .getProjectInfo().getListRequestedVRE());
@ -305,21 +324,24 @@ public class ProjectInfoPanel extends ContentPanel {
}); });
// / // /
FieldLabel requestedVRELabel = new FieldLabel(null, "Requested VREs");
requestedVRELabel.setLabelWidth(LABAEL_WIDTH);
ToolBar toolBar = new ToolBar(); ToolBar toolBar = new ToolBar();
toolBar.add(btnAdd, new BoxLayoutData(new Margins(0))); toolBar.add(btnAdd, new BoxLayoutData(new Margins(0)));
FieldLabel requestedVRELabel = new FieldLabel(toolBar, "Requested VREs");
requestedVRELabel.setLabelWidth(LABAEL_WIDTH);
VerticalLayoutContainer vlc = new VerticalLayoutContainer(); VerticalLayoutContainer vlc = new VerticalLayoutContainer();
vlc.setAdjustForScroll(false); vlc.setAdjustForScroll(false);
vlc.setScrollMode(ScrollMode.NONE); vlc.setScrollMode(ScrollMode.NONE);
vlc.add(nameLabel, new VerticalLayoutData(1, -1, new Margins(0))); vlc.add(nameLabel, new VerticalLayoutData(1, -1, new Margins(0)));
vlc.add(descriptionLabel, new VerticalLayoutData(1, -1, new Margins(0))); vlc.add(descriptionLabel, new VerticalLayoutData(1, -1, new Margins(0)));
vlc.add(categoryLabel, new VerticalLayoutData(1, -1, new Margins(0)));
vlc.add(requestedVRELabel, vlc.add(requestedVRELabel,
new VerticalLayoutData(1, -1, new Margins(0))); new VerticalLayoutData(1, -1, new Margins(0)));
vlc.add(toolBar, new VerticalLayoutData(1, -1, new Margins(0))); //vlc.add(toolBar, new VerticalLayoutData(1, -1, new Margins(0)));
vlc.add(gridRequestedVRE, new VerticalLayoutData(1, 1, new Margins(0))); vlc.add(gridRequestedVRE, new VerticalLayoutData(1, 1, new Margins(0)));
add(vlc, new MarginData(new Margins(0))); add(vlc, new MarginData(new Margins(0)));
@ -343,6 +365,12 @@ public class ProjectInfoPanel extends ContentPanel {
} else { } else {
algorithmDescription.clear(); algorithmDescription.clear();
} }
if (project.getInputData().getProjectInfo().getAlgorithmCategory() != null) {
algorithmCategory.setValue(project.getInputData()
.getProjectInfo().getAlgorithmCategory());
} else {
algorithmCategory.clear();
}
if (project.getInputData().getProjectInfo().getListRequestedVRE() != null) { if (project.getInputData().getProjectInfo().getListRequestedVRE() != null) {
storeRequestedVRE.clear(); storeRequestedVRE.clear();
@ -361,6 +389,7 @@ public class ProjectInfoPanel extends ContentPanel {
} else { } else {
algorithmName.clear(); algorithmName.clear();
algorithmDescription.clear(); algorithmDescription.clear();
algorithmCategory.clear();
storeRequestedVRE.clear(); storeRequestedVRE.clear();
storeRequestedVRE.commitChanges(); storeRequestedVRE.commitChanges();
seq = 0; seq = 0;
@ -393,9 +422,10 @@ public class ProjectInfoPanel extends ContentPanel {
public ProjectInfo getProjectInfo() { public ProjectInfo getProjectInfo() {
String name = algorithmName.getCurrentValue(); String name = algorithmName.getCurrentValue();
String description = algorithmDescription.getCurrentValue(); String description = algorithmDescription.getCurrentValue();
String category = algorithmCategory.getCurrentValue();
ArrayList<RequestedVRE> listRequestedVRE = new ArrayList<>( ArrayList<RequestedVRE> listRequestedVRE = new ArrayList<>(
gridRequestedVRE.getStore().getAll()); gridRequestedVRE.getStore().getAll());
return new ProjectInfo(name, description, listRequestedVRE); return new ProjectInfo(name, description, category, listRequestedVRE);
} }
} }

View File

@ -114,19 +114,32 @@ public class WPS4RParser {
if (project.getInputData() == null) { if (project.getInputData() == null) {
ProjectInfo projectInfo = new ProjectInfo( ProjectInfo projectInfo = new ProjectInfo(
wpsAlgorithmInfo.getAlgorithmName(), wpsAlgorithmInfo.getAlgorithmName(),
wpsAlgorithmInfo.getDescription(), null); wpsAlgorithmInfo.getDescription(), null, null);
InputData inputData = new InputData(projectInfo, null, null, InputData inputData = new InputData(projectInfo, null, null,
wpsAlgorithmInfo.getInputOutputVariables()); wpsAlgorithmInfo.getInputOutputVariables());
project.setInputData(inputData); project.setInputData(inputData);
} else { } else {
InputData inputData = project.getInputData(); if (project.getInputData().getProjectInfo() == null) {
ProjectInfo projectInfo = new ProjectInfo( InputData inputData = project.getInputData();
wpsAlgorithmInfo.getAlgorithmName(), ProjectInfo projectInfo = new ProjectInfo(
wpsAlgorithmInfo.getDescription(), null); wpsAlgorithmInfo.getAlgorithmName(),
inputData.setProjectInfo(projectInfo); wpsAlgorithmInfo.getDescription(), null, null);
inputData.setListInputOutputVariables(wpsAlgorithmInfo inputData.setProjectInfo(projectInfo);
.getInputOutputVariables()); inputData.setListInputOutputVariables(wpsAlgorithmInfo
inputData.setListGlobalVariables(null); .getInputOutputVariables());
} else {
InputData inputData = project.getInputData();
ProjectInfo projectInfo = new ProjectInfo(
wpsAlgorithmInfo.getAlgorithmName(),
wpsAlgorithmInfo.getDescription(), project
.getInputData().getProjectInfo()
.getAlgorithmCategory(), project
.getInputData().getProjectInfo()
.getListRequestedVRE());
inputData.setProjectInfo(projectInfo);
inputData.setListInputOutputVariables(wpsAlgorithmInfo
.getInputOutputVariables());
}
} }
return project; return project;

View File

@ -72,6 +72,4 @@ public class WPSAlgorithmInfo implements Serializable {
+ ", inputOutputVariables=" + inputOutputVariables + "]"; + ", inputOutputVariables=" + inputOutputVariables + "]";
} }
} }

View File

@ -81,6 +81,14 @@ public class InfoGenerator {
} else { } else {
infos.add("Algorithm Description: "); infos.add("Algorithm Description: ");
} }
if (project.getInputData().getProjectInfo().getAlgorithmCategory() != null) {
infos.add("Algorithm Category: "
+ project.getInputData().getProjectInfo()
.getAlgorithmCategory());
} else {
infos.add("Algorithm Category: ");
}
infos.add(""); infos.add("");
if (project.getInputData().getProjectInfo() if (project.getInputData().getProjectInfo()

View File

@ -14,6 +14,7 @@ public class ProjectInfo implements Serializable {
private static final long serialVersionUID = 7304965177776383842L; private static final long serialVersionUID = 7304965177776383842L;
private String algorithmName; private String algorithmName;
private String algorithmDescription; private String algorithmDescription;
private String algorithmCategory;
private ArrayList<RequestedVRE> listRequestedVRE; private ArrayList<RequestedVRE> listRequestedVRE;
public ProjectInfo() { public ProjectInfo() {
@ -21,10 +22,11 @@ public class ProjectInfo implements Serializable {
} }
public ProjectInfo(String algorithmName, String algorithmDescription, public ProjectInfo(String algorithmName, String algorithmDescription,
ArrayList<RequestedVRE> listRequestedVRE) { String algorithmCategory, ArrayList<RequestedVRE> listRequestedVRE) {
super(); super();
this.algorithmName = algorithmName; this.algorithmName = algorithmName;
this.algorithmDescription = algorithmDescription; this.algorithmDescription = algorithmDescription;
this.algorithmCategory = algorithmCategory;
this.listRequestedVRE = listRequestedVRE; this.listRequestedVRE = listRequestedVRE;
} }
@ -52,6 +54,14 @@ public class ProjectInfo implements Serializable {
this.algorithmDescription = algorithmDescription; this.algorithmDescription = algorithmDescription;
} }
public String getAlgorithmCategory() {
return algorithmCategory;
}
public void setAlgorithmCategory(String algorithmCategory) {
this.algorithmCategory = algorithmCategory;
}
public ArrayList<RequestedVRE> getListRequestedVRE() { public ArrayList<RequestedVRE> getListRequestedVRE() {
return listRequestedVRE; return listRequestedVRE;
} }
@ -64,9 +74,8 @@ public class ProjectInfo implements Serializable {
public String toString() { public String toString() {
return "ProjectInfo [algorithmName=" + algorithmName return "ProjectInfo [algorithmName=" + algorithmName
+ ", algorithmDescription=" + algorithmDescription + ", algorithmDescription=" + algorithmDescription
+ ", algorithmCategory=" + algorithmCategory
+ ", listRequestedVRE=" + listRequestedVRE + "]"; + ", listRequestedVRE=" + listRequestedVRE + "]";
} }
} }