|
|
|
@ -38,6 +38,7 @@ import org.gcube.portlets.user.performfishanalytics.client.viewbinder.ShowResult
|
|
|
|
|
import org.gcube.portlets.user.performfishanalytics.client.viewbinder.SubmitRequestPanel;
|
|
|
|
|
import org.gcube.portlets.user.performfishanalytics.shared.KPI;
|
|
|
|
|
import org.gcube.portlets.user.performfishanalytics.shared.OutputFile;
|
|
|
|
|
import org.gcube.portlets.user.performfishanalytics.shared.Population;
|
|
|
|
|
import org.gcube.portlets.user.performfishanalytics.shared.PopulationType;
|
|
|
|
|
import org.gcube.portlets.user.performfishanalytics.shared.csv.CSVFile;
|
|
|
|
|
import org.gcube.portlets.user.performfishanalytics.shared.dataminer.DataMinerResponse;
|
|
|
|
@ -147,7 +148,12 @@ public class PerformFishAnalyticsController {
|
|
|
|
|
PopulationType opt = selectedPopulationTypeEvent.getSelectedPopulationType();
|
|
|
|
|
viewController.setRootPopulationTypeForKPIs(selectedPopulationTypeEvent.getSelectedPopulationType());
|
|
|
|
|
|
|
|
|
|
if (opt.getName().equalsIgnoreCase(PerformFishAnalyticsConstant.BATCH_LEVEL.GROW_OUT_INDIVIDUAL_CLOSED_BATCHES.name()) || opt.getName().equalsIgnoreCase(PerformFishAnalyticsConstant.BATCH_LEVEL.GROW_OUT_INDIVIDUAL.name())) {
|
|
|
|
|
if (opt.getName().equalsIgnoreCase(PerformFishAnalyticsConstant.BATCH_LEVEL.GROW_OUT_INDIVIDUAL_CLOSED_BATCHES.name())
|
|
|
|
|
|| opt.getName().equalsIgnoreCase(PerformFishAnalyticsConstant.BATCH_LEVEL.GROW_OUT_INDIVIDUAL.name())
|
|
|
|
|
|| opt.getName().equals(PerformFishAnalyticsConstant.BATCH_LEVEL.HATCHERY_INDIVIDUAL_CLOSED_BATCHES.name())
|
|
|
|
|
|| opt.getName().equals(PerformFishAnalyticsConstant.BATCH_LEVEL.HATCHERY_INDIVIDUAL.name())
|
|
|
|
|
|| opt.getName().equals(PerformFishAnalyticsConstant.BATCH_LEVEL.PRE_ONGROWING.name())
|
|
|
|
|
|| opt.getName().equals(PerformFishAnalyticsConstant.BATCH_LEVEL.PRE_ONGROWING_CLOSED_BATCHES.name())) {
|
|
|
|
|
viewController.visibleSynopticTable(true);
|
|
|
|
|
} else {
|
|
|
|
|
viewController.visibleSynopticTable(false);
|
|
|
|
@ -356,16 +362,33 @@ public class PerformFishAnalyticsController {
|
|
|
|
|
|
|
|
|
|
StringBuilder dataInputsFormatter = new StringBuilder();
|
|
|
|
|
dataInputsFormatter.append(PerformFishAnalyticsConstant.DM_INPUT_TABLE+"="+ batchTableURL +";");
|
|
|
|
|
dataInputsFormatter.append(PerformFishAnalyticsConstant.DM_ZONE_LABELS+"="+PerformFishAnalyticsConstant.DM_VALUE_ALL+";");
|
|
|
|
|
dataInputsFormatter.append(PerformFishAnalyticsConstant.DM_QUARTER_LABELS+"="+PerformFishAnalyticsConstant.DM_VALUE_ALL+";");
|
|
|
|
|
String dataInParameters = dataInputsFormatter.toString();
|
|
|
|
|
|
|
|
|
|
//TODO READ THE INPUT FILE
|
|
|
|
|
String popType = viewController.getForm().getBatchType();
|
|
|
|
|
|
|
|
|
|
DataMinerAlgorithms chartType = null;
|
|
|
|
|
if(popType.equalsIgnoreCase(PerformFishAnalyticsConstant.BATCH_LEVEL.GROW_OUT_INDIVIDUAL_CLOSED_BATCHES.name())
|
|
|
|
|
|| popType.equalsIgnoreCase(PerformFishAnalyticsConstant.BATCH_LEVEL.GROW_OUT_INDIVIDUAL.name())) {
|
|
|
|
|
chartType = DataMinerAlgorithms.PERFORMFISH_SYNOPTICTABLE_BATCH;
|
|
|
|
|
dataInputsFormatter.append(PerformFishAnalyticsConstant.DM_QUARTER_LABELS+"="+PerformFishAnalyticsConstant.DM_VALUE_ALL+";");
|
|
|
|
|
dataInputsFormatter.append(PerformFishAnalyticsConstant.DM_ZONE_LABELS+"="+PerformFishAnalyticsConstant.DM_VALUE_ALL+";");
|
|
|
|
|
}else if(popType.equalsIgnoreCase(PerformFishAnalyticsConstant.BATCH_LEVEL.HATCHERY_INDIVIDUAL_CLOSED_BATCHES.name())
|
|
|
|
|
|| popType.equalsIgnoreCase(PerformFishAnalyticsConstant.BATCH_LEVEL.HATCHERY_INDIVIDUAL.name())) {
|
|
|
|
|
chartType = DataMinerAlgorithms.PERFORMFISH_SYNOPTICTABLE_BATCH_HATCHERY;
|
|
|
|
|
dataInputsFormatter.append(PerformFishAnalyticsConstant.DM_STOCKING_PERIOD+"="+PerformFishAnalyticsConstant.DM_VALUE_ALL+";");
|
|
|
|
|
}else if(popType.equalsIgnoreCase(PerformFishAnalyticsConstant.BATCH_LEVEL.PRE_ONGROWING.name())
|
|
|
|
|
|| popType.equalsIgnoreCase(PerformFishAnalyticsConstant.BATCH_LEVEL.PRE_ONGROWING_CLOSED_BATCHES.name())) {
|
|
|
|
|
chartType = DataMinerAlgorithms.PERFORMFISH_SYNOPTICTABLE_BATCH_PREGROW;
|
|
|
|
|
dataInputsFormatter.append(PerformFishAnalyticsConstant.DM_ZONE_LABELS+"="+PerformFishAnalyticsConstant.DM_VALUE_ALL+";");
|
|
|
|
|
dataInputsFormatter.append(PerformFishAnalyticsConstant.DM_STOCKING_PERIOD+"="+PerformFishAnalyticsConstant.DM_VALUE_ALL+";");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String dataInParameters = dataInputsFormatter.toString();
|
|
|
|
|
mapParameters.put(PerformFishAnalyticsConstant.DATA_INPUTS, Arrays.asList(dataInParameters));
|
|
|
|
|
mapParameters.put("Identifier", Arrays.asList("org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers."+chartType));
|
|
|
|
|
|
|
|
|
|
GWT.log("Calling DM service with client input parameters: "+mapParameters);
|
|
|
|
|
|
|
|
|
|
final DataMinerAlgorithms chartType = DataMinerAlgorithms.PERFORMFISH_SYNOPTICTABLE_BATCH;
|
|
|
|
|
|
|
|
|
|
final SubmitRequestPanel submitRequestPanel = new SubmitRequestPanel("", 1);
|
|
|
|
|
//submitRequestPanel.getElement().addClassName("ext-horizontal-panel");
|
|
|
|
|
String tabTitle = "Synoptic Table"; //CAMEL CASE
|
|
|
|
@ -382,6 +405,7 @@ public class PerformFishAnalyticsController {
|
|
|
|
|
loaderIcon.setFocus(true);
|
|
|
|
|
}});
|
|
|
|
|
|
|
|
|
|
final DataMinerAlgorithms toFinalChartType = chartType;
|
|
|
|
|
PerformFishAnalyticsServiceAsync.Util.getInstance().callDMServiceToLoadSynopticTable(performFishResponse, mapParameters, new AsyncCallback<DataMinerResponse>() {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -390,14 +414,14 @@ public class PerformFishAnalyticsController {
|
|
|
|
|
checkTabSpinner(submitRequestPanel, tab);
|
|
|
|
|
//field_unary_algorithm.setVisible(true);
|
|
|
|
|
GWT.log("I'm displaying: "+dmResponse);
|
|
|
|
|
displayOutputFilesAsStaticEntities(dmResponse, chartType, null, null, null, panelContainer, false);
|
|
|
|
|
displayOutputFilesAsStaticEntities(dmResponse, toFinalChartType, null, null, null, panelContainer, false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onFailure(Throwable caught) {
|
|
|
|
|
loaderIcon.setVisible(false);
|
|
|
|
|
checkTabSpinner(submitRequestPanel, tab);
|
|
|
|
|
displayOutputFilesAsStaticEntities(null, chartType, null, null, null, panelContainer, true);
|
|
|
|
|
displayOutputFilesAsStaticEntities(null, toFinalChartType, null, null, null, panelContainer, true);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
@ -757,6 +781,8 @@ public class PerformFishAnalyticsController {
|
|
|
|
|
case DEA_CHART:
|
|
|
|
|
break;
|
|
|
|
|
case PERFORMFISH_SYNOPTICTABLE_BATCH:
|
|
|
|
|
case PERFORMFISH_SYNOPTICTABLE_BATCH_HATCHERY:
|
|
|
|
|
case PERFORMFISH_SYNOPTICTABLE_BATCH_PREGROW:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -811,6 +837,8 @@ public class PerformFishAnalyticsController {
|
|
|
|
|
case DEA_CHART:
|
|
|
|
|
break;
|
|
|
|
|
case PERFORMFISH_SYNOPTICTABLE_BATCH:
|
|
|
|
|
case PERFORMFISH_SYNOPTICTABLE_BATCH_HATCHERY:
|
|
|
|
|
case PERFORMFISH_SYNOPTICTABLE_BATCH_PREGROW:
|
|
|
|
|
|
|
|
|
|
if(!result.getFileName().contains("legend")) {
|
|
|
|
|
cssTableStyle = "synoptictable-batch";
|
|
|
|
|