updating GUI
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/performfish-analytics-portlet@178511 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
7b6ef4ddc6
commit
32fd21051c
|
@ -16,6 +16,8 @@ import org.gcube.portlets.user.performfishanalytics.client.event.AddedBatchIdEve
|
||||||
import org.gcube.portlets.user.performfishanalytics.client.event.AddedBatchIdEventHandler;
|
import org.gcube.portlets.user.performfishanalytics.client.event.AddedBatchIdEventHandler;
|
||||||
import org.gcube.portlets.user.performfishanalytics.client.event.CallAlgorithmEvent;
|
import org.gcube.portlets.user.performfishanalytics.client.event.CallAlgorithmEvent;
|
||||||
import org.gcube.portlets.user.performfishanalytics.client.event.CallAlgorithmEventHandler;
|
import org.gcube.portlets.user.performfishanalytics.client.event.CallAlgorithmEventHandler;
|
||||||
|
import org.gcube.portlets.user.performfishanalytics.client.event.LoadBatchesEvent;
|
||||||
|
import org.gcube.portlets.user.performfishanalytics.client.event.LoadBatchesEventHandler;
|
||||||
import org.gcube.portlets.user.performfishanalytics.client.event.LoadPopulationTypeEvent;
|
import org.gcube.portlets.user.performfishanalytics.client.event.LoadPopulationTypeEvent;
|
||||||
import org.gcube.portlets.user.performfishanalytics.client.event.LoadPopulationTypeEventHandler;
|
import org.gcube.portlets.user.performfishanalytics.client.event.LoadPopulationTypeEventHandler;
|
||||||
import org.gcube.portlets.user.performfishanalytics.client.event.PerformFishFieldFormChangedEvent;
|
import org.gcube.portlets.user.performfishanalytics.client.event.PerformFishFieldFormChangedEvent;
|
||||||
|
@ -43,6 +45,7 @@ import com.github.gwtbootstrap.client.ui.Modal;
|
||||||
import com.github.gwtbootstrap.client.ui.Tab;
|
import com.github.gwtbootstrap.client.ui.Tab;
|
||||||
import com.github.gwtbootstrap.client.ui.constants.AlertType;
|
import com.github.gwtbootstrap.client.ui.constants.AlertType;
|
||||||
import com.github.gwtbootstrap.client.ui.constants.ButtonType;
|
import com.github.gwtbootstrap.client.ui.constants.ButtonType;
|
||||||
|
import com.github.gwtbootstrap.client.ui.constants.ControlGroupType;
|
||||||
import com.google.gwt.core.client.Scheduler;
|
import com.google.gwt.core.client.Scheduler;
|
||||||
import com.google.gwt.core.client.Scheduler.ScheduledCommand;
|
import com.google.gwt.core.client.Scheduler.ScheduledCommand;
|
||||||
import com.google.gwt.core.shared.GWT;
|
import com.google.gwt.core.shared.GWT;
|
||||||
|
@ -166,6 +169,64 @@ public class PerformFishAnalyticsController {
|
||||||
viewController.manageAlgorithmsSubmit(selectedKPIsSize);
|
viewController.manageAlgorithmsSubmit(selectedKPIsSize);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
eventBus.addHandler(LoadBatchesEvent.TYPE, new LoadBatchesEventHandler() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onLoadBatches(LoadBatchesEvent loadBatchesEvent) {
|
||||||
|
|
||||||
|
|
||||||
|
viewController.hideErrors();
|
||||||
|
|
||||||
|
final Map<String, List<String>> mapParameters = new HashMap<String, List<String>>();
|
||||||
|
|
||||||
|
String farmId = decryptParameters.getParameters().get(PerformFishAnalyticsConstant.FARMID_PARAM);
|
||||||
|
String batchType = viewController.getForm().getBatchType();
|
||||||
|
String species = viewController.getForm().getSpecies();
|
||||||
|
List<String> listArea = viewController.getForm().getArea();
|
||||||
|
List<String> listPeriod = viewController.getForm().getPeriod();
|
||||||
|
List<String> listQuarter = viewController.getForm().getQuarter();
|
||||||
|
|
||||||
|
mapParameters.put(PerformFishAnalyticsConstant.PERFORM_FISH_FARMID_PARAM, Arrays.asList(farmId));
|
||||||
|
mapParameters.put(PerformFishAnalyticsConstant.PERFORM_FISH_BATCH_TYPE_PARAM, Arrays.asList(batchType));
|
||||||
|
mapParameters.put(PerformFishAnalyticsConstant.PERFORM_FISH_SPECIES_ID_PARAM, Arrays.asList(species));
|
||||||
|
|
||||||
|
if(!listArea.isEmpty()){
|
||||||
|
mapParameters.put(PerformFishAnalyticsConstant.PERFORM_FISH_AREA_PARAM, listArea);
|
||||||
|
}
|
||||||
|
if(!listPeriod.isEmpty()){
|
||||||
|
mapParameters.put(PerformFishAnalyticsConstant.PERFORM_FISH_PERIOD_PARAM, listPeriod);
|
||||||
|
}
|
||||||
|
if(!listQuarter.isEmpty()){
|
||||||
|
mapParameters.put(PerformFishAnalyticsConstant.PERFORM_FISH_QUARTER_PARAM, listQuarter);
|
||||||
|
}
|
||||||
|
|
||||||
|
final Modal modal = new Modal(true);
|
||||||
|
modal.setCloseVisible(false);
|
||||||
|
modal.hide(false);
|
||||||
|
final VerticalPanel vp = new VerticalPanel();
|
||||||
|
LoaderIcon loader = new LoaderIcon("Loading Batches from service, please wait...");
|
||||||
|
vp.add(loader);
|
||||||
|
loader.show(true);
|
||||||
|
modal.add(vp);
|
||||||
|
PerformFishAnalyticsServiceAsync.Util.getInstance().submitRequestToPerformFishService(mapParameters, new AsyncCallback<PerformFishResponse>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Throwable caught) {
|
||||||
|
modal.hide();
|
||||||
|
Window.alert(caught.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess(PerformFishResponse performFishResponse) {
|
||||||
|
modal.hide();
|
||||||
|
viewController.managePerformFishServiceResponse(performFishResponse, mapParameters, POPULATION_LEVEL.BATCH);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
modal.show();
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
eventBus.addHandler(PerformFishFieldFormChangedEvent.TYPE, new PerformFishFieldFormChangedEventHandler() {
|
eventBus.addHandler(PerformFishFieldFormChangedEvent.TYPE, new PerformFishFieldFormChangedEventHandler() {
|
||||||
|
@ -176,8 +237,20 @@ public class PerformFishAnalyticsController {
|
||||||
|
|
||||||
viewController.setReloadPerformFishServiceData(true);
|
viewController.setReloadPerformFishServiceData(true);
|
||||||
boolean isValidForm = viewController.validatePerformFishInputFields();
|
boolean isValidForm = viewController.validatePerformFishInputFields();
|
||||||
|
|
||||||
|
if(isValidForm) {
|
||||||
|
viewController.resetBatchIdStatus();
|
||||||
|
viewController.setBatchIdStatus(ControlGroupType.INFO);
|
||||||
|
viewController.enableLoadBatches(true);
|
||||||
|
viewController.enableAllAlgorithmsForSubmit(false);
|
||||||
|
|
||||||
|
}else {
|
||||||
|
viewController.enableLoadBatches(false);
|
||||||
|
viewController.enableAllAlgorithmsForSubmit(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if(isValidForm){
|
/*if(isValidForm){
|
||||||
|
|
||||||
viewController.hideErrors();
|
viewController.hideErrors();
|
||||||
|
|
||||||
|
@ -241,7 +314,7 @@ public class PerformFishAnalyticsController {
|
||||||
}else{
|
}else{
|
||||||
//IF IT IS NOT A VALID FORM WE NEED TO DISABLE DATAMINER REQUESTS
|
//IF IT IS NOT A VALID FORM WE NEED TO DISABLE DATAMINER REQUESTS
|
||||||
viewController.enableAllAlgorithmsSubmits(false);
|
viewController.enableAllAlgorithmsSubmits(false);
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -40,6 +40,7 @@ import com.google.gwt.user.client.ui.VerticalPanel;
|
||||||
import com.google.gwt.user.client.ui.Widget;
|
import com.google.gwt.user.client.ui.Widget;
|
||||||
|
|
||||||
|
|
||||||
|
// TODO: Auto-generated Javadoc
|
||||||
/**
|
/**
|
||||||
* The Class PerformFishAnalyticsViewController.
|
* The Class PerformFishAnalyticsViewController.
|
||||||
*
|
*
|
||||||
|
@ -48,24 +49,49 @@ import com.google.gwt.user.client.ui.Widget;
|
||||||
*/
|
*/
|
||||||
public class PerformFishAnalyticsViewController {
|
public class PerformFishAnalyticsViewController {
|
||||||
|
|
||||||
/**
|
/** The Constant PERFORM_FISH_ANALYTICS_DIV. */
|
||||||
*
|
|
||||||
*/
|
|
||||||
public static final String PERFORM_FISH_ANALYTICS_DIV = "perform-fish-analytics";
|
public static final String PERFORM_FISH_ANALYTICS_DIV = "perform-fish-analytics";
|
||||||
|
|
||||||
|
/** The base dock layout panel. */
|
||||||
private BaseDockLayoutPanel baseDockLayoutPanel;
|
private BaseDockLayoutPanel baseDockLayoutPanel;
|
||||||
|
|
||||||
|
/** The header page. */
|
||||||
private HeaderPanel headerPage;
|
private HeaderPanel headerPage;
|
||||||
|
|
||||||
|
/** The body page. */
|
||||||
private BodyPanel bodyPage;
|
private BodyPanel bodyPage;
|
||||||
|
|
||||||
|
/** The batch ID and list KPI. */
|
||||||
private BatchIDAndListKPIView batchIDAndListKPI;
|
private BatchIDAndListKPIView batchIDAndListKPI;
|
||||||
|
|
||||||
|
/** The form. */
|
||||||
private PerformFishAnalitycsFormView form;
|
private PerformFishAnalitycsFormView form;
|
||||||
|
|
||||||
|
/** The selected population. */
|
||||||
private Population selectedPopulation;
|
private Population selectedPopulation;
|
||||||
|
|
||||||
|
/** The custom tree model. */
|
||||||
private CustomTreeModel customTreeModel;
|
private CustomTreeModel customTreeModel;
|
||||||
|
|
||||||
|
/** The tree. */
|
||||||
private CellTree tree;
|
private CellTree tree;
|
||||||
|
|
||||||
|
/** The west panel. */
|
||||||
private VerticalPanel westPanel;
|
private VerticalPanel westPanel;
|
||||||
|
|
||||||
|
/** The est panel. */
|
||||||
private VerticalPanel estPanel;
|
private VerticalPanel estPanel;
|
||||||
|
|
||||||
|
/** The recap page. */
|
||||||
private RecapSubmitPage recapPage;
|
private RecapSubmitPage recapPage;
|
||||||
|
|
||||||
|
/** The tab panel. */
|
||||||
private TabPanelView tabPanel;
|
private TabPanelView tabPanel;
|
||||||
|
|
||||||
|
/** The root panel. */
|
||||||
private VerticalPanel rootPanel;
|
private VerticalPanel rootPanel;
|
||||||
|
|
||||||
|
/** The reload perform fish service data. */
|
||||||
private boolean reloadPerformFishServiceData = true;
|
private boolean reloadPerformFishServiceData = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -275,12 +301,13 @@ public class PerformFishAnalyticsViewController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enable all algorithms submits.
|
* Enable all algorithms for submit.
|
||||||
*
|
*
|
||||||
* @param bool the bool
|
* @param bool the bool
|
||||||
*/
|
*/
|
||||||
public void enableAllAlgorithmsSubmits(boolean bool){
|
public void enableAllAlgorithmsForSubmit(boolean bool){
|
||||||
recapPage.activeAllAlgorithms(bool);
|
recapPage.activeAllAlgorithms(bool);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -347,7 +374,26 @@ public class PerformFishAnalyticsViewController {
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reset batch id status.
|
||||||
|
*/
|
||||||
|
public void resetBatchIdStatus() {
|
||||||
|
batchIDAndListKPI.resetBatchIdStatus();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the batch id status.
|
||||||
|
*
|
||||||
|
* @param status the new batch id status
|
||||||
|
*/
|
||||||
|
public void setBatchIdStatus(ControlGroupType status) {
|
||||||
|
ControlGroup cg_batch_id = batchIDAndListKPI.getControlGroupBatchID();
|
||||||
|
cg_batch_id.setType(status);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Validate batch id selection.
|
* Validate batch id selection.
|
||||||
*
|
*
|
||||||
|
@ -380,8 +426,9 @@ public class PerformFishAnalyticsViewController {
|
||||||
return false;*/
|
return false;*/
|
||||||
|
|
||||||
String msgError = "Could not find valid data. Please change the selection (Areas, Periods and so on) parameters";
|
String msgError = "Could not find valid data. Please change the selection (Areas, Periods and so on) parameters";
|
||||||
cg_batch_id.setType(ControlGroupType.ERROR);
|
cg_batch_id.setType(ControlGroupType.INFO);
|
||||||
batchIDAndListKPI.showError(msgError, true);
|
batchIDAndListKPI.showError(msgError, true);
|
||||||
|
batchIDAndListKPI.enableButtonLoadBatches(false);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -400,6 +447,17 @@ public class PerformFishAnalyticsViewController {
|
||||||
return form.validateForm();
|
return form.validateForm();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enable load batches.
|
||||||
|
*
|
||||||
|
* @param enable the enable
|
||||||
|
* @return true, if successful
|
||||||
|
*/
|
||||||
|
public void enableLoadBatches(boolean enable) {
|
||||||
|
batchIDAndListKPI.enableButtonLoadBatches(enable);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resync selected kp is.
|
* Resync selected kp is.
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
package org.gcube.portlets.user.performfishanalytics.client.event;
|
||||||
|
|
||||||
|
import com.google.gwt.event.shared.GwtEvent;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Class LoadPopulationTypeEvent.
|
||||||
|
*
|
||||||
|
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
|
||||||
|
* Jan 22, 2019
|
||||||
|
*/
|
||||||
|
public class LoadBatchesEvent extends GwtEvent<LoadBatchesEventHandler> {
|
||||||
|
public static Type<LoadBatchesEventHandler> TYPE = new Type<LoadBatchesEventHandler>();
|
||||||
|
/**
|
||||||
|
* Instantiates a new load batches event.
|
||||||
|
*/
|
||||||
|
public LoadBatchesEvent() {
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see com.google.gwt.event.shared.GwtEvent#getAssociatedType()
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Type<LoadBatchesEventHandler> getAssociatedType() {
|
||||||
|
return TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see com.google.gwt.event.shared.GwtEvent#dispatch(com.google.gwt.event.shared.EventHandler)
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected void dispatch(LoadBatchesEventHandler handler) {
|
||||||
|
handler.onLoadBatches(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
package org.gcube.portlets.user.performfishanalytics.client.event;
|
||||||
|
|
||||||
|
import com.google.gwt.event.shared.EventHandler;
|
||||||
|
|
||||||
|
// TODO: Auto-generated Javadoc
|
||||||
|
/**
|
||||||
|
* The Interface LoadBatchesEventHandler.
|
||||||
|
*/
|
||||||
|
public interface LoadBatchesEventHandler extends EventHandler {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* On load batches.
|
||||||
|
*
|
||||||
|
* @param loadBatchesEvent the load batches event
|
||||||
|
*/
|
||||||
|
void onLoadBatches(LoadBatchesEvent loadBatchesEvent);
|
||||||
|
}
|
|
@ -9,7 +9,6 @@ import com.google.gwt.user.cellview.client.CellTree;
|
||||||
import com.google.gwt.user.client.ui.RootLayoutPanel;
|
import com.google.gwt.user.client.ui.RootLayoutPanel;
|
||||||
import com.google.gwt.view.client.ListDataProvider;
|
import com.google.gwt.view.client.ListDataProvider;
|
||||||
import com.google.gwt.view.client.TreeViewModel;
|
import com.google.gwt.view.client.TreeViewModel;
|
||||||
import com.google.gwt.view.client.TreeViewModel.DefaultNodeInfo;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -12,17 +12,21 @@ import org.gcube.portlets.user.performfishanalytics.client.PerformFishAnalyticsC
|
||||||
import org.gcube.portlets.user.performfishanalytics.client.PerformFishAnalyticsServiceAsync;
|
import org.gcube.portlets.user.performfishanalytics.client.PerformFishAnalyticsServiceAsync;
|
||||||
import org.gcube.portlets.user.performfishanalytics.client.controllers.PerformFishAnalyticsController;
|
import org.gcube.portlets.user.performfishanalytics.client.controllers.PerformFishAnalyticsController;
|
||||||
import org.gcube.portlets.user.performfishanalytics.client.event.AddedBatchIdEvent;
|
import org.gcube.portlets.user.performfishanalytics.client.event.AddedBatchIdEvent;
|
||||||
|
import org.gcube.portlets.user.performfishanalytics.client.event.LoadBatchesEvent;
|
||||||
import org.gcube.portlets.user.performfishanalytics.client.view.LoaderIcon;
|
import org.gcube.portlets.user.performfishanalytics.client.view.LoaderIcon;
|
||||||
import org.gcube.portlets.user.performfishanalytics.shared.csv.CSVFile;
|
import org.gcube.portlets.user.performfishanalytics.shared.csv.CSVFile;
|
||||||
import org.gcube.portlets.user.performfishanalytics.shared.csv.CSVRow;
|
import org.gcube.portlets.user.performfishanalytics.shared.csv.CSVRow;
|
||||||
import org.gcube.portlets.user.performfishanalytics.shared.performfishservice.PerformFishResponse;
|
import org.gcube.portlets.user.performfishanalytics.shared.performfishservice.PerformFishResponse;
|
||||||
|
|
||||||
import com.github.gwtbootstrap.client.ui.Alert;
|
import com.github.gwtbootstrap.client.ui.Alert;
|
||||||
|
import com.github.gwtbootstrap.client.ui.Button;
|
||||||
import com.github.gwtbootstrap.client.ui.ControlGroup;
|
import com.github.gwtbootstrap.client.ui.ControlGroup;
|
||||||
import com.github.gwtbootstrap.client.ui.ListBox;
|
import com.github.gwtbootstrap.client.ui.ListBox;
|
||||||
import com.github.gwtbootstrap.client.ui.constants.AlertType;
|
import com.github.gwtbootstrap.client.ui.constants.AlertType;
|
||||||
import com.google.gwt.core.client.GWT;
|
import com.google.gwt.core.client.GWT;
|
||||||
import com.google.gwt.dom.client.Style.Unit;
|
import com.google.gwt.dom.client.Style.Unit;
|
||||||
|
import com.google.gwt.event.dom.client.ClickEvent;
|
||||||
|
import com.google.gwt.event.dom.client.ClickHandler;
|
||||||
import com.google.gwt.uibinder.client.UiBinder;
|
import com.google.gwt.uibinder.client.UiBinder;
|
||||||
import com.google.gwt.uibinder.client.UiField;
|
import com.google.gwt.uibinder.client.UiField;
|
||||||
import com.google.gwt.user.client.Window;
|
import com.google.gwt.user.client.Window;
|
||||||
|
@ -34,6 +38,7 @@ import com.google.gwt.user.client.ui.VerticalPanel;
|
||||||
import com.google.gwt.user.client.ui.Widget;
|
import com.google.gwt.user.client.ui.Widget;
|
||||||
|
|
||||||
|
|
||||||
|
// TODO: Auto-generated Javadoc
|
||||||
/**
|
/**
|
||||||
* The Class BatchIDAndListKPIView.
|
* The Class BatchIDAndListKPIView.
|
||||||
*
|
*
|
||||||
|
@ -42,6 +47,7 @@ import com.google.gwt.user.client.ui.Widget;
|
||||||
*/
|
*/
|
||||||
public class BatchIDAndListKPIView extends Composite {
|
public class BatchIDAndListKPIView extends Composite {
|
||||||
|
|
||||||
|
/** The ui binder. */
|
||||||
private static BatchIDAndListKPIViewUiBinder uiBinder =
|
private static BatchIDAndListKPIViewUiBinder uiBinder =
|
||||||
GWT.create(BatchIDAndListKPIViewUiBinder.class);
|
GWT.create(BatchIDAndListKPIViewUiBinder.class);
|
||||||
|
|
||||||
|
@ -56,23 +62,34 @@ public class BatchIDAndListKPIView extends Composite {
|
||||||
extends UiBinder<Widget, BatchIDAndListKPIView> {
|
extends UiBinder<Widget, BatchIDAndListKPIView> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** The the panel container. */
|
||||||
@UiField
|
@UiField
|
||||||
VerticalPanel the_panel_container;
|
VerticalPanel the_panel_container;
|
||||||
|
|
||||||
|
/** The uib list batch id. */
|
||||||
@UiField
|
@UiField
|
||||||
ListBox uib_list_batch_id;
|
ListBox uib_list_batch_id;
|
||||||
|
|
||||||
|
/** The the panel error. */
|
||||||
@UiField
|
@UiField
|
||||||
HorizontalPanel the_panel_error;
|
HorizontalPanel the_panel_error;
|
||||||
|
|
||||||
|
/** The cg batch id. */
|
||||||
@UiField
|
@UiField
|
||||||
ControlGroup cg_batch_id;
|
ControlGroup cg_batch_id;
|
||||||
|
|
||||||
|
/** The uib button load batches. */
|
||||||
|
@UiField
|
||||||
|
Button uib_button_load_batches;
|
||||||
|
|
||||||
|
/** The perform fish response. */
|
||||||
private PerformFishResponse performFishResponse;
|
private PerformFishResponse performFishResponse;
|
||||||
|
|
||||||
|
/** The map parameters. */
|
||||||
private Map<String, List<String>> mapParameters;
|
private Map<String, List<String>> mapParameters;
|
||||||
|
|
||||||
|
|
||||||
|
/** The list batches ID. */
|
||||||
private List<String> listBatchesID = new ArrayList<String>();
|
private List<String> listBatchesID = new ArrayList<String>();
|
||||||
|
|
||||||
|
|
||||||
|
@ -83,6 +100,15 @@ public class BatchIDAndListKPIView extends Composite {
|
||||||
|
|
||||||
initWidget(uiBinder.createAndBindUi(this));
|
initWidget(uiBinder.createAndBindUi(this));
|
||||||
uib_list_batch_id.setEnabled(false);
|
uib_list_batch_id.setEnabled(false);
|
||||||
|
|
||||||
|
|
||||||
|
uib_button_load_batches.addClickHandler(new ClickHandler() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(ClickEvent event) {
|
||||||
|
PerformFishAnalyticsController.eventBus.fireEvent(new LoadBatchesEvent());
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -96,6 +122,11 @@ public class BatchIDAndListKPIView extends Composite {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the all batches ID.
|
||||||
|
*
|
||||||
|
* @return the all batches ID
|
||||||
|
*/
|
||||||
public List<String> getAllBatchesID(){
|
public List<String> getAllBatchesID(){
|
||||||
return listBatchesID;
|
return listBatchesID;
|
||||||
}
|
}
|
||||||
|
@ -151,9 +182,7 @@ public class BatchIDAndListKPIView extends Composite {
|
||||||
GWT.log("BatchesTable_internal is: "+fileURL);
|
GWT.log("BatchesTable_internal is: "+fileURL);
|
||||||
|
|
||||||
//Resetting batch ID and panel error after calling Perform Fish Service
|
//Resetting batch ID and panel error after calling Perform Fish Service
|
||||||
uib_list_batch_id.clear();
|
resetBatchIdStatus();
|
||||||
the_panel_error.clear();
|
|
||||||
listBatchesID.clear();
|
|
||||||
|
|
||||||
//Managing the Perform Fish Service Response
|
//Managing the Perform Fish Service Response
|
||||||
if(fileURL==null){
|
if(fileURL==null){
|
||||||
|
@ -182,6 +211,7 @@ public class BatchIDAndListKPIView extends Composite {
|
||||||
|
|
||||||
if(result==null){
|
if(result==null){
|
||||||
showAlert("No value found for "+PerformFishAnalyticsConstant.BATCHES_TABLE_INTERNAL, AlertType.ERROR, false, the_panel_error);
|
showAlert("No value found for "+PerformFishAnalyticsConstant.BATCHES_TABLE_INTERNAL, AlertType.ERROR, false, the_panel_error);
|
||||||
|
enableButtonLoadBatches(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -216,6 +246,13 @@ public class BatchIDAndListKPIView extends Composite {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void resetBatchIdStatus() {
|
||||||
|
//Resetting batch ID and panel error after calling Perform Fish Service
|
||||||
|
uib_list_batch_id.clear();
|
||||||
|
the_panel_error.clear();
|
||||||
|
listBatchesID.clear();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show alert.
|
* Show alert.
|
||||||
|
@ -280,6 +317,8 @@ public class BatchIDAndListKPIView extends Composite {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Gets the perform fish response.
|
||||||
|
*
|
||||||
* @return the performFishResponse
|
* @return the performFishResponse
|
||||||
*/
|
*/
|
||||||
public PerformFishResponse getPerformFishResponse() {
|
public PerformFishResponse getPerformFishResponse() {
|
||||||
|
@ -289,12 +328,25 @@ public class BatchIDAndListKPIView extends Composite {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Gets the map parameters.
|
||||||
|
*
|
||||||
* @return the mapParameters
|
* @return the mapParameters
|
||||||
*/
|
*/
|
||||||
public Map<String, List<String>> getMapParameters() {
|
public Map<String, List<String>> getMapParameters() {
|
||||||
|
|
||||||
return mapParameters;
|
return mapParameters;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enable button load batches.
|
||||||
|
*
|
||||||
|
* @param enable the enable
|
||||||
|
*/
|
||||||
|
public void enableButtonLoadBatches(boolean enable) {
|
||||||
|
uib_button_load_batches.setEnabled(enable);
|
||||||
|
if(enable)
|
||||||
|
uib_list_batch_id.setTitle("Press on Load Batches");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
|
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
|
||||||
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
|
<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">
|
xmlns:g="urn:import:com.google.gwt.user.client.ui"
|
||||||
|
xmlns:b="urn:import:com.github.gwtbootstrap.client.ui">
|
||||||
<ui:style>
|
<ui:style>
|
||||||
|
|
||||||
</ui:style>
|
</ui:style>
|
||||||
|
@ -10,12 +11,14 @@
|
||||||
<g:Label ui:field="uib_label_batch_id">BATCH ID</g:Label>
|
<g:Label ui:field="uib_label_batch_id">BATCH ID</g:Label>
|
||||||
<b:ControlGroup ui:field="cg_batch_id">
|
<b:ControlGroup ui:field="cg_batch_id">
|
||||||
<b:Controls>
|
<b:Controls>
|
||||||
<b:ListBox name="Select BATCH ID" b:id="uib_list_batch_id"
|
<b:ListBox name="Select BATCH ID"
|
||||||
ui:field="uib_list_batch_id" multipleSelect="false"
|
b:id="uib_list_batch_id" ui:field="uib_list_batch_id"
|
||||||
addStyleNames="the_margin_left">
|
multipleSelect="false" addStyleNames="the_margin_left">
|
||||||
</b:ListBox>
|
</b:ListBox>
|
||||||
</b:Controls>
|
</b:Controls>
|
||||||
</b:ControlGroup>
|
</b:ControlGroup>
|
||||||
|
<b:Button active="false" enabled="false" text="Load Batches"
|
||||||
|
ui:field="uib_button_load_batches" addStyleNames="the_margin_left"></b:Button>
|
||||||
</g:HorizontalPanel>
|
</g:HorizontalPanel>
|
||||||
<g:HorizontalPanel ui:field="the_panel_error"></g:HorizontalPanel>
|
<g:HorizontalPanel ui:field="the_panel_error"></g:HorizontalPanel>
|
||||||
</g:VerticalPanel>
|
</g:VerticalPanel>
|
||||||
|
|
|
@ -366,36 +366,37 @@ public class PerformFishAnalitycsFormView extends Composite {
|
||||||
errorPanel.setVisible(false);
|
errorPanel.setVisible(false);
|
||||||
// cg_remote_path.setType(ControlGroupType.NONE);
|
// cg_remote_path.setType(ControlGroupType.NONE);
|
||||||
if (field_select_quarter.getItemCount()>0 && field_select_quarter.getSelectedIndex() == -1) {
|
if (field_select_quarter.getItemCount()>0 && field_select_quarter.getSelectedIndex() == -1) {
|
||||||
cg_select_quarter.setType(ControlGroupType.ERROR);
|
cg_select_quarter.setType(ControlGroupType.INFO);
|
||||||
showError("You must select a Quarter");
|
showAlert("Please select a Quarter", AlertType.INFO);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (field_select_area.getItemCount()>0 && field_select_area.getSelectedIndex() == -1) {
|
if (field_select_area.getItemCount()>0 && field_select_area.getSelectedIndex() == -1) {
|
||||||
cg_select_area.setType(ControlGroupType.ERROR);
|
cg_select_area.setType(ControlGroupType.INFO);
|
||||||
showError("You must select an Area");
|
showAlert("Please select an Area", AlertType.INFO);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (field_select_period.getItemCount()>0 && field_select_period.getSelectedIndex() == -1) {
|
if (field_select_period.getItemCount()>0 && field_select_period.getSelectedIndex() == -1) {
|
||||||
cg_select_period.setType(ControlGroupType.ERROR);
|
cg_select_period.setType(ControlGroupType.INFO);
|
||||||
showError("You must select a Period");
|
showAlert("Please select a Period", AlertType.INFO);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show error.
|
* Show alert.
|
||||||
*
|
*
|
||||||
* @param txt the txt
|
* @param txt the txt
|
||||||
|
* @param type the type
|
||||||
*/
|
*/
|
||||||
public void showError(String txt) {
|
public void showAlert(String txt, AlertType type) {
|
||||||
errorPanel.clear();
|
errorPanel.clear();
|
||||||
errorPanel.setVisible(true);
|
errorPanel.setVisible(true);
|
||||||
Alert msg = new Alert(txt);
|
Alert msg = new Alert(txt);
|
||||||
msg.setAnimation(true);
|
msg.setAnimation(true);
|
||||||
msg.setClose(false);
|
msg.setClose(false);
|
||||||
msg.setType(AlertType.ERROR);
|
msg.setType(type);
|
||||||
errorPanel.add(msg);
|
errorPanel.add(msg);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,13 +2,13 @@ package org.gcube.portlets.user.performfishanalytics.server.persistence;
|
||||||
|
|
||||||
import javax.persistence.EntityManagerFactory;
|
import javax.persistence.EntityManagerFactory;
|
||||||
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.ToString;
|
|
||||||
|
|
||||||
import org.gcube.portlets.user.performfishanalytics.shared.GenericDao;
|
import org.gcube.portlets.user.performfishanalytics.shared.GenericDao;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.ToString;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the persistence entity.
|
* Gets the persistence entity.
|
||||||
|
|
Loading…
Reference in New Issue