diff --git a/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/tools/input/InterpreterInfoPanel.java b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/tools/input/InterpreterInfoPanel.java index b691840..9edeccc 100644 --- a/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/tools/input/InterpreterInfoPanel.java +++ b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/tools/input/InterpreterInfoPanel.java @@ -296,11 +296,13 @@ public class InterpreterInfoPanel extends ContentPanel { } - FieldLabel interpreterPackagesLabel = new FieldLabel(null, "Packages"); + ToolBar toolBar = new ToolBar(); toolBar.add(btnAdd, new BoxLayoutData(new Margins(0))); + FieldLabel interpreterPackagesLabel = new FieldLabel(toolBar, "Packages"); + VerticalLayoutContainer vlc = new VerticalLayoutContainer(); vlc.setAdjustForScroll(false); vlc.setScrollMode(ScrollMode.NONE); @@ -311,7 +313,7 @@ public class InterpreterInfoPanel extends ContentPanel { vlc.add(interpreterPackagesLabel, 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(gridInterpreterPackageInfo, new VerticalLayoutData(1, 1, new Margins(0))); diff --git a/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/tools/input/ProjectInfoPanel.java b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/tools/input/ProjectInfoPanel.java index 64bafff..743002b 100644 --- a/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/tools/input/ProjectInfoPanel.java +++ b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/tools/input/ProjectInfoPanel.java @@ -63,6 +63,7 @@ public class ProjectInfoPanel extends ContentPanel { private EventBus eventBus; private TextField algorithmName; private TextField algorithmDescription; + private TextField algorithmCategory; private ListStore storeRequestedVRE; private Grid gridRequestedVRE; private GridRowEditing gridRequestedVREEditing; @@ -94,6 +95,7 @@ public class ProjectInfoPanel extends ContentPanel { private void create(Project project) { + // algorithmName = new TextField(); algorithmName.setAllowBlank(false); algorithmName.addValidator(new RegExValidator("^[a-zA-Z0-9_]*$", @@ -111,6 +113,7 @@ public class ProjectInfoPanel extends ContentPanel { FieldLabel nameLabel = new FieldLabel(algorithmName, "Name"); nameLabel.setLabelWidth(LABAEL_WIDTH); + // algorithmDescription = new TextField(); algorithmDescription.setAllowBlank(false); algorithmDescription.setEmptyText("Enter description..."); @@ -120,6 +123,15 @@ public class ProjectInfoPanel extends ContentPanel { "Description"); 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 RequestedVREProperties props = GWT.create(RequestedVREProperties.class); @@ -152,6 +164,13 @@ public class ProjectInfoPanel extends ContentPanel { .getProjectInfo().getAlgorithmDescription()); } + if (project.getInputData().getProjectInfo() + .getAlgorithmCategory() != null) { + algorithmCategory.setValue(project.getInputData() + .getProjectInfo().getAlgorithmCategory()); + } + + if (project.getInputData().getProjectInfo().getListRequestedVRE() != null) { storeRequestedVRE.addAll(project.getInputData() .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.add(btnAdd, new BoxLayoutData(new Margins(0))); + FieldLabel requestedVRELabel = new FieldLabel(toolBar, "Requested VREs"); + requestedVRELabel.setLabelWidth(LABAEL_WIDTH); + VerticalLayoutContainer vlc = new VerticalLayoutContainer(); vlc.setAdjustForScroll(false); vlc.setScrollMode(ScrollMode.NONE); vlc.add(nameLabel, 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, 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))); add(vlc, new MarginData(new Margins(0))); @@ -343,6 +365,12 @@ public class ProjectInfoPanel extends ContentPanel { } else { algorithmDescription.clear(); } + if (project.getInputData().getProjectInfo().getAlgorithmCategory() != null) { + algorithmCategory.setValue(project.getInputData() + .getProjectInfo().getAlgorithmCategory()); + } else { + algorithmCategory.clear(); + } if (project.getInputData().getProjectInfo().getListRequestedVRE() != null) { storeRequestedVRE.clear(); @@ -361,6 +389,7 @@ public class ProjectInfoPanel extends ContentPanel { } else { algorithmName.clear(); algorithmDescription.clear(); + algorithmCategory.clear(); storeRequestedVRE.clear(); storeRequestedVRE.commitChanges(); seq = 0; @@ -393,9 +422,10 @@ public class ProjectInfoPanel extends ContentPanel { public ProjectInfo getProjectInfo() { String name = algorithmName.getCurrentValue(); String description = algorithmDescription.getCurrentValue(); + String category = algorithmCategory.getCurrentValue(); ArrayList listRequestedVRE = new ArrayList<>( gridRequestedVRE.getStore().getAll()); - return new ProjectInfo(name, description, listRequestedVRE); + return new ProjectInfo(name, description, category, listRequestedVRE); } } diff --git a/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/server/annotation/WPS4RParser.java b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/server/annotation/WPS4RParser.java index 4072f1b..56f251b 100644 --- a/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/server/annotation/WPS4RParser.java +++ b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/server/annotation/WPS4RParser.java @@ -114,19 +114,32 @@ public class WPS4RParser { if (project.getInputData() == null) { ProjectInfo projectInfo = new ProjectInfo( wpsAlgorithmInfo.getAlgorithmName(), - wpsAlgorithmInfo.getDescription(), null); + wpsAlgorithmInfo.getDescription(), null, null); InputData inputData = new InputData(projectInfo, null, null, wpsAlgorithmInfo.getInputOutputVariables()); project.setInputData(inputData); } else { - InputData inputData = project.getInputData(); - ProjectInfo projectInfo = new ProjectInfo( - wpsAlgorithmInfo.getAlgorithmName(), - wpsAlgorithmInfo.getDescription(), null); - inputData.setProjectInfo(projectInfo); - inputData.setListInputOutputVariables(wpsAlgorithmInfo - .getInputOutputVariables()); - inputData.setListGlobalVariables(null); + if (project.getInputData().getProjectInfo() == null) { + InputData inputData = project.getInputData(); + ProjectInfo projectInfo = new ProjectInfo( + wpsAlgorithmInfo.getAlgorithmName(), + wpsAlgorithmInfo.getDescription(), null, null); + inputData.setProjectInfo(projectInfo); + inputData.setListInputOutputVariables(wpsAlgorithmInfo + .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; diff --git a/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/server/annotation/WPSAlgorithmInfo.java b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/server/annotation/WPSAlgorithmInfo.java index 6725ea3..249f128 100644 --- a/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/server/annotation/WPSAlgorithmInfo.java +++ b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/server/annotation/WPSAlgorithmInfo.java @@ -72,6 +72,4 @@ public class WPSAlgorithmInfo implements Serializable { + ", inputOutputVariables=" + inputOutputVariables + "]"; } - - } diff --git a/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/server/generator/InfoGenerator.java b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/server/generator/InfoGenerator.java index 249ea62..f12ea1b 100644 --- a/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/server/generator/InfoGenerator.java +++ b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/server/generator/InfoGenerator.java @@ -81,6 +81,14 @@ public class InfoGenerator { } else { 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(""); if (project.getInputData().getProjectInfo() diff --git a/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/shared/input/ProjectInfo.java b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/shared/input/ProjectInfo.java index 80b1326..77a4d31 100644 --- a/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/shared/input/ProjectInfo.java +++ b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/shared/input/ProjectInfo.java @@ -14,6 +14,7 @@ public class ProjectInfo implements Serializable { private static final long serialVersionUID = 7304965177776383842L; private String algorithmName; private String algorithmDescription; + private String algorithmCategory; private ArrayList listRequestedVRE; public ProjectInfo() { @@ -21,10 +22,11 @@ public class ProjectInfo implements Serializable { } public ProjectInfo(String algorithmName, String algorithmDescription, - ArrayList listRequestedVRE) { + String algorithmCategory, ArrayList listRequestedVRE) { super(); this.algorithmName = algorithmName; this.algorithmDescription = algorithmDescription; + this.algorithmCategory = algorithmCategory; this.listRequestedVRE = listRequestedVRE; } @@ -52,6 +54,14 @@ public class ProjectInfo implements Serializable { this.algorithmDescription = algorithmDescription; } + public String getAlgorithmCategory() { + return algorithmCategory; + } + + public void setAlgorithmCategory(String algorithmCategory) { + this.algorithmCategory = algorithmCategory; + } + public ArrayList getListRequestedVRE() { return listRequestedVRE; } @@ -64,9 +74,8 @@ public class ProjectInfo implements Serializable { public String toString() { return "ProjectInfo [algorithmName=" + algorithmName + ", algorithmDescription=" + algorithmDescription + + ", algorithmCategory=" + algorithmCategory + ", listRequestedVRE=" + listRequestedVRE + "]"; } - - }