bug fixing algorithm calling

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/performfish-analytics-portlet@179317 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2019-05-08 15:35:31 +00:00
parent fcfcf9ff83
commit 2def65fef9
4 changed files with 1158 additions and 45 deletions

View File

@ -27,6 +27,7 @@ import org.gcube.portlets.user.performfishanalytics.client.event.SelectedPopulat
import org.gcube.portlets.user.performfishanalytics.client.event.SubmitRequestEvent;
import org.gcube.portlets.user.performfishanalytics.client.event.SubmitRequestEventHandler;
import org.gcube.portlets.user.performfishanalytics.client.view.LoaderIcon;
import org.gcube.portlets.user.performfishanalytics.client.viewannualbinder.AnalyticsAnnualPanelResult;
import org.gcube.portlets.user.performfishanalytics.client.viewbinder.AnalyticsPanelResult;
import org.gcube.portlets.user.performfishanalytics.client.viewbinder.ShowResult;
import org.gcube.portlets.user.performfishanalytics.client.viewbinder.SubmitRequestPanel;
@ -248,7 +249,6 @@ public class PerformFishAnnualAnalyticsController {
focusValue = row.getListValues().get(indexOfFARM);
if(focusValue!=null && !focusValue.isEmpty())
break;
}
if(focusValue==null) {
@ -335,38 +335,8 @@ public class PerformFishAnnualAnalyticsController {
* @param performFishResponse the perform fish response
* @param performFishRequestParameters the perform fish request parameters
*/
private void callDataMinerServiceForChartTypeCorrelation(String focusID, List<KPI> inputKPI, final List<KPI> outputKPI) {
private void callDataMinerServiceForChartTypeCorrelation(String focusID, final List<KPI> inputKPI, final List<KPI> outputKPI) {
/*GWT.log("Read perform fish response: "+performFishResponse);
String batchTableURL = performFishResponse.getMapParameters().get(PerformFishAnalyticsConstant.BATCHES_TABLE);
if(batchTableURL==null || batchTableURL.isEmpty())
Window.alert("Something seems wrong. No batches tables matching with parameter "+PerformFishAnalyticsConstant.BATCHES_TABLE+" returned from service");
final Map<String, List<String>> mapParameters = new HashMap<String, List<String>>();
StringBuilder dataInputsFormatter = new StringBuilder();
dataInputsFormatter.append(PerformFishAnalyticsConstant.DM_SCALEP_PARAM+"=BATCH;");
String theBatchType = viewAnnualController.getForm().getBatchType();
theBatchType = theBatchType.replace("_CLOSED_BATCHES", ""); //REMOVING SUFFIX _CLOSED_BATCHES FOR DATAMINER CALL
dataInputsFormatter.append(PerformFishAnalyticsConstant.DM_BATCHTYPE_PARAM+"="+theBatchType+";");
dataInputsFormatter.append(PerformFishAnalyticsConstant.DM_CHARTTYPE_PARAM+"="+ DataMinerAlgorithms.CORRELATION+";");
dataInputsFormatter.append(PerformFishAnalyticsConstant.DM_FARMFILE_PARAM+"="+batchTableURL+";");
dataInputsFormatter.append(PerformFishAnalyticsConstant.DM_FOCUS_PARAM+"=ID;");
String kpiCodes = "";
for (KPI kpi : viewAnnualController.getSelectedKPIs()) {
kpiCodes+=kpi.getCode()+"|";
}
//remove last |
kpiCodes = kpiCodes.substring(0, kpiCodes.length()-1);
dataInputsFormatter.append("inputKPI="+kpiCodes+";");
//dataInputsFormatter.append("outputKPI=;");
String dataInParameters = dataInputsFormatter.toString();*/
DataMinerInputParameters dmInputParameters = new DataMinerInputParameters(thePerformFishResponse, viewAnnualController.getSelectedYears(), inputKPI, outputKPI, DataMinerAlgorithms.CORRELATION, focusID);
GWT.log("Building DM request with input parameters: "+dmInputParameters);
@ -435,16 +405,12 @@ public class PerformFishAnnualAnalyticsController {
public void onSuccess(DataMinerResponse dmResponse) {
submitRequestPanel.showLoader(false, null);
checkTabSpinner(submitRequestPanel, tab);
AnalyticsPanelResult analyticsPanelResult = new AnalyticsPanelResult();
AnalyticsAnnualPanelResult analyticsPanelResult = new AnalyticsAnnualPanelResult(eventBus);
//analyticsPanelResult.addSelectedAreas(performFishRequestParameters.get(PerformFishAnalyticsConstant.PERFORM_FISH_AREA_PARAM));
analyticsPanelResult.addSelectedKPIs(viewAnnualController.getSelectedKPIs());
analyticsPanelResult.addSelectedKPIs(inputKPI);
//TODO COMMENTED NOW
//analyticsPanelResult.addListBatchIds(viewController.getListBatchesID());
analyticsPanelResult.addListBatchIds(Arrays.asList(theFocusValue));
analyticsPanelResult.addParameters(PerformFishAnalyticsConstant.DATA_INPUTS, mapParameters, viewAnnualController.getForm().getBatchType());
analyticsPanelResult.addResults(dmResponse);
@ -464,7 +430,7 @@ public class PerformFishAnnualAnalyticsController {
analyticsPanelResult.addSelectedKPIs(viewAnnualController.getSelectedKPIs());
//TODO COMMENTED NOW
//analyticsPanelResult.addListBatchIds(viewController.getListBatchesID());
analyticsPanelResult.addListBatchIds(Arrays.asList(theFocusValue));
analyticsPanelResult.addParameters(PerformFishAnalyticsConstant.DATA_INPUTS, mapParameters, viewAnnualController.getForm().getBatchType());

View File

@ -3,6 +3,7 @@
*/
package org.gcube.portlets.user.performfishanalytics.client.controllers;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
@ -344,7 +345,9 @@ public class PerformFishAnalyticsController {
submitRequestPanel.showLoader(true, "Submitting "+DataMinerAlgorithms.CORRELATION.getName()+" request to DM Service...");
String tabTitle = DataMinerAlgorithms.CORRELATION.getName().substring(0,1).toUpperCase()+DataMinerAlgorithms.CORRELATION.getName().toLowerCase().substring(1, DataMinerAlgorithms.CORRELATION.getName().length()); //CAMEL CASE
final Tab tab = viewController.createTab(submitRequestPanel, tabTitle+" #"+(viewController.currentNumberOfTab()+1));
final List<KPI> selectedKPI = new ArrayList<KPI>(viewController.getSelectedKPIs());
final List<String> batchIDs = new ArrayList<String>(viewController.getListBatchesID());
PerformFishAnalyticsServiceAsync.Util.getInstance().callingDataMinerPerformFishCorrelationAnalysis(performFishResponse, mapParameters, new AsyncCallback<DataMinerResponse>() {
@Override
@ -353,8 +356,8 @@ public class PerformFishAnalyticsController {
checkTabSpinner(submitRequestPanel, tab);
AnalyticsPanelResult analyticsPanelResult = new AnalyticsPanelResult();
analyticsPanelResult.addSelectedAreas(performFishRequestParameters.get(PerformFishAnalyticsConstant.PERFORM_FISH_AREA_PARAM));
analyticsPanelResult.addSelectedKPIs(viewController.getSelectedKPIs());
analyticsPanelResult.addListBatchIds(viewController.getListBatchesID());
analyticsPanelResult.addSelectedKPIs(selectedKPI);
analyticsPanelResult.addListBatchIds(batchIDs);
analyticsPanelResult.addParameters(PerformFishAnalyticsConstant.DATA_INPUTS, mapParameters, viewController.getForm().getBatchType());
analyticsPanelResult.addResults(dmResponse);
submitRequestPanel.addWidget(analyticsPanelResult);
@ -370,8 +373,8 @@ public class PerformFishAnalyticsController {
try {
AnalyticsPanelResult analyticsPanelResult = new AnalyticsPanelResult();
analyticsPanelResult.addSelectedAreas(performFishRequestParameters.get(PerformFishAnalyticsConstant.PERFORM_FISH_AREA_PARAM));
analyticsPanelResult.addSelectedKPIs(viewController.getSelectedKPIs());
analyticsPanelResult.addListBatchIds(viewController.getListBatchesID());
analyticsPanelResult.addSelectedKPIs(selectedKPI);
analyticsPanelResult.addListBatchIds(batchIDs);
analyticsPanelResult.addParameters(PerformFishAnalyticsConstant.DATA_INPUTS, mapParameters, viewController.getForm().getBatchType());
submitRequestPanel.addWidget(analyticsPanelResult);
}catch (Exception e) {

View File

@ -0,0 +1,104 @@
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
xmlns:g="urn:import:com.google.gwt.user.client.ui" xmlns:b="urn:import:com.github.gwtbootstrap.client.ui">
<ui:style>
.paddingLeft {
padding-left: 10px;
}
</ui:style>
<g:HTMLPanel ui:field="field_html_panel" addStyleNames="the_margin">
<g:VerticalPanel ui:field="field_parameters">
<g:VerticalPanel ui:field="field_parameters_container"
addStyleNames="the_margin_top_bottom">
<b:Label text="Parameters"></b:Label>
</g:VerticalPanel>
</g:VerticalPanel>
<g:VerticalPanel ui:field="field_results"
addStyleNames="the_margin_top_bottom">
<b:Label text="CORRELATION Matrix"></b:Label>
<g:HorizontalPanel addStyleNames="the_margin_top">
<g:Label ui:field="uib_label_focus_id">Focus ID</g:Label>
<b:ControlGroup ui:field="cg_focus_id_correlation">
<b:Controls>
<b:ListBox name="Select Focus ID" b:id="field_list_focus_id_correlation"
ui:field="field_list_focus_id_correlation" multipleSelect="false"
addStyleNames="the_margin_left">
</b:ListBox>
</b:Controls>
</b:ControlGroup>
</g:HorizontalPanel>
<g:VerticalPanel ui:field="uib_vp_correlation_results_container"
addStyleNames="the_margin_left">
</g:VerticalPanel>
<g:VerticalPanel ui:field="field_deanalanlysis_algorithm_request"
addStyleNames="the_margin_top_bottom" visible="false">
<b:Label text="DEA ANALYSIS Request"></b:Label>
<g:HorizontalPanel ui:field="uib_vp_deanalanlysis_request_container"
addStyleNames="the_margin_top_bottom the_margin_left">
<g:Label>Input KPI</g:Label>
<b:ControlGroup ui:field="cg_list_dea_input_kpi">
<b:Controls>
<b:InputAddOn>
<b:ListBox ui:field="list_dea_input_kpi"
multipleSelect="true" addStyleNames="the_margin_left the_select_custom"
height="100px">
</b:ListBox>
<b:appendWidget>
<b:CheckBox ui:field="uib_check_all_input_kpi"
title="Select/Unselect All" />
</b:appendWidget>
</b:InputAddOn>
</b:Controls>
</b:ControlGroup>
<g:Label addStyleNames="the_margin_left" styleName="{style.paddingLeft}">Output
KPI</g:Label>
<b:ControlGroup ui:field="cg_list_dea_output_kpi">
<b:Controls>
<b:InputAddOn>
<b:ListBox addStyleNames="the_margin_left the_select_custom"
ui:field="list_dea_output_kpi" multipleSelect="true" height="100px">
</b:ListBox>
<b:appendWidget>
<b:CheckBox ui:field="uib_check_all_output_kpi"
title="Select/Unselect All" />
</b:appendWidget>
</b:InputAddOn>
</b:Controls>
</b:ControlGroup>
<b:Button type="DEFAULT" text="Submit DEA Analysis Request"
ui:field="button_dea_analys_request" addStyleNames="the_margin_left">
</b:Button>
</g:HorizontalPanel>
</g:VerticalPanel>
<g:VerticalPanel ui:field="field_unary_algorithm"
addStyleNames="the_margin_top_bottom" visible="false">
<b:Label text="BOXPLOT and SPEEDOMETER Results" type="INFO"></b:Label>
<g:VerticalPanel ui:field="field_unary_algorithm_container"
addStyleNames="the_margin">
</g:VerticalPanel>
</g:VerticalPanel>
<g:VerticalPanel ui:field="field_binary_algorithm"
addStyleNames="the_margin_top_bottom" visible="false">
<b:Label text="SCATTER and DEA_CHART Results" type="INFO"></b:Label>
<g:VerticalPanel ui:field="field_binary_algorithm_container"
addStyleNames="the_margin">
</g:VerticalPanel>
</g:VerticalPanel>
<g:VerticalPanel ui:field="uib_vp_deanalanlysis_algorithm"
addStyleNames="the_margin_top_bottom" visible="false">
<b:Label text="DEA ANALYSIS Results" type="INFO"></b:Label>
<g:VerticalPanel ui:field="uib_vp_deanalanlysis_algorithm_container"
addStyleNames="the_margin">
</g:VerticalPanel>
</g:VerticalPanel>
</g:VerticalPanel>
</g:HTMLPanel>
</ui:UiBinder>