2021-08-05 16:49:04 +02:00
|
|
|
package org.gcube.portlets.user.geoportaldataentry.client.ui;
|
|
|
|
|
2022-08-31 12:45:01 +02:00
|
|
|
import java.util.ArrayList;
|
2021-12-06 17:24:27 +01:00
|
|
|
import java.util.Arrays;
|
2021-12-01 11:54:39 +01:00
|
|
|
import java.util.HashMap;
|
2021-09-15 16:14:27 +02:00
|
|
|
import java.util.List;
|
2021-12-01 11:54:39 +01:00
|
|
|
import java.util.Map;
|
2021-09-15 16:14:27 +02:00
|
|
|
|
2021-12-06 17:24:27 +01:00
|
|
|
import org.gcube.application.geoportalcommon.shared.SearchingFilter;
|
2021-12-15 15:43:36 +01:00
|
|
|
import org.gcube.application.geoportalcommon.shared.SearchingFilter.LOGICAL_OP;
|
2021-12-06 17:24:27 +01:00
|
|
|
import org.gcube.application.geoportalcommon.shared.SearchingFilter.ORDER;
|
2021-12-15 15:43:36 +01:00
|
|
|
import org.gcube.application.geoportalcommon.shared.WhereClause;
|
2022-09-13 13:52:44 +02:00
|
|
|
import org.gcube.application.geoportalcommon.shared.config.OPERATION_ON_ITEM;
|
2022-03-17 18:08:58 +01:00
|
|
|
import org.gcube.application.geoportalcommon.shared.geoportal.ConfigurationDV;
|
2022-08-08 17:43:13 +02:00
|
|
|
import org.gcube.application.geoportalcommon.shared.geoportal.DocumentDV;
|
2022-09-13 13:52:44 +02:00
|
|
|
import org.gcube.application.geoportalcommon.shared.geoportal.config.ActionDefinitionDV;
|
2022-03-17 18:08:58 +01:00
|
|
|
import org.gcube.application.geoportalcommon.shared.geoportal.config.GcubeProfileDV;
|
|
|
|
import org.gcube.application.geoportalcommon.shared.geoportal.config.ItemFieldDV;
|
2022-08-11 12:07:07 +02:00
|
|
|
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.GEOPORTAL_DATA_HANDLER;
|
|
|
|
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.HandlerDeclarationDV;
|
|
|
|
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.UseCaseDescriptorDV;
|
2022-08-31 12:45:01 +02:00
|
|
|
import org.gcube.portlets.user.geoportaldataentry.client.GeoPortalClientCaches.CacheSearchingFilterParametersFromConfig;
|
2021-08-05 16:49:04 +02:00
|
|
|
import org.gcube.portlets.user.geoportaldataentry.client.events.CreateNewProjectEvent;
|
2022-08-08 17:43:13 +02:00
|
|
|
import org.gcube.portlets.user.geoportaldataentry.client.events.GetListOfRecordsEvent;
|
2022-09-13 13:52:44 +02:00
|
|
|
import org.gcube.portlets.user.geoportaldataentry.client.events.OperationOnItemEvent;
|
|
|
|
import org.gcube.portlets.user.geoportaldataentry.client.ui.action.ActionListPanel;
|
2021-08-05 16:49:04 +02:00
|
|
|
import org.gcube.portlets.user.geoportaldataentry.client.ui.form.GeonaDataEntryMainForm;
|
2022-03-04 14:40:43 +01:00
|
|
|
import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.DialogInform;
|
2021-08-05 16:49:04 +02:00
|
|
|
import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.LoaderIcon;
|
2022-08-08 17:43:13 +02:00
|
|
|
import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.UCD_Util;
|
2021-08-05 16:49:04 +02:00
|
|
|
|
2021-12-02 12:25:05 +01:00
|
|
|
import com.github.gwtbootstrap.client.ui.Alert;
|
2021-12-01 11:54:39 +01:00
|
|
|
import com.github.gwtbootstrap.client.ui.Button;
|
2021-08-06 16:23:17 +02:00
|
|
|
import com.github.gwtbootstrap.client.ui.Dropdown;
|
2022-03-04 17:09:46 +01:00
|
|
|
import com.github.gwtbootstrap.client.ui.Hero;
|
2021-08-05 16:49:04 +02:00
|
|
|
import com.github.gwtbootstrap.client.ui.NavLink;
|
2022-03-04 14:40:43 +01:00
|
|
|
import com.github.gwtbootstrap.client.ui.PageHeader;
|
2021-08-05 16:49:04 +02:00
|
|
|
import com.github.gwtbootstrap.client.ui.Tab;
|
2021-11-26 16:05:05 +01:00
|
|
|
import com.github.gwtbootstrap.client.ui.TabPanel;
|
2021-08-06 16:23:17 +02:00
|
|
|
import com.github.gwtbootstrap.client.ui.TextBox;
|
2021-12-02 12:25:05 +01:00
|
|
|
import com.github.gwtbootstrap.client.ui.constants.AlertType;
|
2021-12-01 11:54:39 +01:00
|
|
|
import com.github.gwtbootstrap.client.ui.constants.ButtonType;
|
|
|
|
import com.github.gwtbootstrap.client.ui.constants.IconSize;
|
2021-08-05 16:49:04 +02:00
|
|
|
import com.google.gwt.core.client.GWT;
|
2022-03-04 16:44:51 +01:00
|
|
|
import com.google.gwt.core.client.Scheduler;
|
|
|
|
import com.google.gwt.core.client.Scheduler.ScheduledCommand;
|
2021-08-05 16:49:04 +02:00
|
|
|
import com.google.gwt.event.dom.client.ClickEvent;
|
|
|
|
import com.google.gwt.event.dom.client.ClickHandler;
|
2021-12-01 11:54:39 +01:00
|
|
|
import com.google.gwt.event.dom.client.KeyPressEvent;
|
|
|
|
import com.google.gwt.event.dom.client.KeyPressHandler;
|
2021-08-05 16:49:04 +02:00
|
|
|
import com.google.gwt.event.shared.HandlerManager;
|
|
|
|
import com.google.gwt.uibinder.client.UiBinder;
|
|
|
|
import com.google.gwt.uibinder.client.UiField;
|
2021-12-01 11:54:39 +01:00
|
|
|
import com.google.gwt.user.client.Window;
|
2021-08-05 16:49:04 +02:00
|
|
|
import com.google.gwt.user.client.ui.Composite;
|
2022-09-13 13:52:44 +02:00
|
|
|
import com.google.gwt.user.client.ui.FlowPanel;
|
2021-08-05 16:49:04 +02:00
|
|
|
import com.google.gwt.user.client.ui.HTMLPanel;
|
2021-12-13 11:27:03 +01:00
|
|
|
import com.google.gwt.user.client.ui.Label;
|
2021-08-05 16:49:04 +02:00
|
|
|
import com.google.gwt.user.client.ui.VerticalPanel;
|
|
|
|
import com.google.gwt.user.client.ui.Widget;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The Class GeonaMainTabPanel.
|
|
|
|
*
|
|
|
|
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
|
|
|
|
*
|
|
|
|
* Aug 5, 2021
|
|
|
|
*/
|
|
|
|
public class GeonaMainTabPanel extends Composite {
|
|
|
|
|
2021-08-06 16:23:17 +02:00
|
|
|
private static final String LABEL_FILTER_SEPARATOR = " - ";
|
|
|
|
|
2021-12-01 11:54:39 +01:00
|
|
|
protected static final int MIN_LENGHT_SERCHING_STRING = 3;
|
|
|
|
|
2021-08-05 16:49:04 +02:00
|
|
|
private static GeonaMainTabPanelUiBinder uiBinder = GWT.create(GeonaMainTabPanelUiBinder.class);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The Interface GeonaMainTabPanelUiBinder.
|
|
|
|
*
|
|
|
|
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
|
|
|
|
*
|
|
|
|
* Aug 5, 2021
|
|
|
|
*/
|
|
|
|
interface GeonaMainTabPanelUiBinder extends UiBinder<Widget, GeonaMainTabPanel> {
|
|
|
|
}
|
|
|
|
|
|
|
|
/** The geona main form panel. */
|
|
|
|
@UiField
|
|
|
|
HTMLPanel geonaMainFormPanel;
|
|
|
|
|
|
|
|
@UiField
|
2022-03-04 14:40:43 +01:00
|
|
|
HTMLPanel geonaListOfRecordsPanel;
|
2021-08-05 16:49:04 +02:00
|
|
|
|
2021-09-15 16:14:27 +02:00
|
|
|
/** The geona main form panel. */
|
|
|
|
@UiField
|
|
|
|
HTMLPanel contTabNewProject;
|
|
|
|
|
|
|
|
@UiField
|
|
|
|
HTMLPanel contTabGetListOfProjects;
|
|
|
|
|
2021-08-05 16:49:04 +02:00
|
|
|
/** The loader. */
|
|
|
|
@UiField
|
|
|
|
LoaderIcon loader;
|
|
|
|
|
2022-03-04 14:40:43 +01:00
|
|
|
// @UiField
|
|
|
|
// NavLink buttCreateNewProject;
|
2021-08-05 16:49:04 +02:00
|
|
|
|
|
|
|
@UiField
|
2022-09-13 16:18:40 +02:00
|
|
|
NavLink buttonReloadProjects;
|
2021-08-05 16:49:04 +02:00
|
|
|
|
2021-11-26 16:05:05 +01:00
|
|
|
@UiField
|
|
|
|
TabPanel tabPanel;
|
|
|
|
|
2021-08-05 16:49:04 +02:00
|
|
|
@UiField
|
|
|
|
Tab tabNewProject;
|
|
|
|
|
|
|
|
@UiField
|
|
|
|
Tab tabGetListOfProjects;
|
|
|
|
|
2021-08-06 16:23:17 +02:00
|
|
|
@UiField
|
|
|
|
Dropdown dropdownSortBy;
|
2021-12-06 17:24:27 +01:00
|
|
|
|
2021-12-02 12:25:05 +01:00
|
|
|
@UiField
|
|
|
|
Dropdown dropdownSearchFor;
|
2021-08-06 16:23:17 +02:00
|
|
|
|
|
|
|
@UiField
|
2021-12-02 12:25:05 +01:00
|
|
|
Alert alertSortBy;
|
2021-12-06 17:24:27 +01:00
|
|
|
|
2022-08-31 12:45:01 +02:00
|
|
|
@UiField
|
|
|
|
Alert alertProjectType;
|
|
|
|
|
2021-12-02 12:25:05 +01:00
|
|
|
@UiField
|
|
|
|
Alert alertSearchFor;
|
2021-08-06 16:23:17 +02:00
|
|
|
|
2021-09-15 16:14:27 +02:00
|
|
|
@UiField
|
|
|
|
NavLink navShowOnMap;
|
|
|
|
|
|
|
|
@UiField
|
|
|
|
NavLink navShowReport;
|
|
|
|
|
|
|
|
@UiField
|
|
|
|
NavLink navEditMode;
|
|
|
|
|
|
|
|
@UiField
|
|
|
|
NavLink navDelete;
|
|
|
|
|
2021-12-01 11:54:39 +01:00
|
|
|
@UiField
|
|
|
|
TextBox searchField;
|
|
|
|
|
|
|
|
@UiField
|
|
|
|
Button resetSearch;
|
2022-03-04 14:40:43 +01:00
|
|
|
|
2021-12-13 11:27:03 +01:00
|
|
|
@UiField
|
|
|
|
Label roleLabel;
|
2021-12-01 11:54:39 +01:00
|
|
|
|
2022-03-04 14:40:43 +01:00
|
|
|
@UiField
|
|
|
|
Dropdown ddCreateNewProject;
|
|
|
|
|
2022-08-08 17:43:13 +02:00
|
|
|
@UiField
|
|
|
|
Dropdown ddProjectType;
|
|
|
|
|
2022-03-04 14:40:43 +01:00
|
|
|
@UiField
|
|
|
|
PageHeader pageHeaderDataEntry;
|
2022-09-13 13:52:44 +02:00
|
|
|
|
|
|
|
@UiField
|
|
|
|
FlowPanel actionListMainPanel;
|
|
|
|
|
2022-03-04 17:09:46 +01:00
|
|
|
@UiField
|
|
|
|
Hero introGNAHero;
|
2022-03-04 14:40:43 +01:00
|
|
|
|
2021-08-05 16:49:04 +02:00
|
|
|
private HandlerManager appManagerBus;
|
|
|
|
|
2022-08-31 12:45:01 +02:00
|
|
|
private SearchingFilter currentSearchingFilter;
|
2021-08-06 16:23:17 +02:00
|
|
|
|
2021-09-15 16:14:27 +02:00
|
|
|
private GeonaRecordsPaginatedView grpw = null;
|
|
|
|
|
2022-08-31 12:45:01 +02:00
|
|
|
private List<UseCaseDescriptorDV> ucdProjectTypesForListingDataView = new ArrayList<UseCaseDescriptorDV>();
|
2022-09-13 13:52:44 +02:00
|
|
|
|
|
|
|
private ActionListPanel actionListPanel;
|
2021-12-06 17:24:27 +01:00
|
|
|
|
2022-08-31 12:45:01 +02:00
|
|
|
private CacheSearchingFilterParametersFromConfig cacheSearchingFilterParameters;
|
2022-03-04 14:40:43 +01:00
|
|
|
|
2021-08-05 16:49:04 +02:00
|
|
|
/**
|
|
|
|
* Instantiates a new geona main tab panel.
|
|
|
|
*
|
2022-08-31 12:45:01 +02:00
|
|
|
* @param appManagerBus the app manager bus
|
2021-08-05 16:49:04 +02:00
|
|
|
*/
|
2022-08-31 12:45:01 +02:00
|
|
|
public GeonaMainTabPanel(HandlerManager appManagerBus) {
|
2021-08-05 16:49:04 +02:00
|
|
|
initWidget(uiBinder.createAndBindUi(this));
|
|
|
|
this.appManagerBus = appManagerBus;
|
2022-08-31 12:45:01 +02:00
|
|
|
// setFilteringParameters(defaultItemField, defaultItemField, defaultItemField,
|
|
|
|
// initialSortFilter);
|
2021-12-02 12:25:05 +01:00
|
|
|
alertSortBy.setType(AlertType.INFO);
|
|
|
|
alertSortBy.setClose(false);
|
|
|
|
|
|
|
|
alertSearchFor.setType(AlertType.INFO);
|
|
|
|
alertSearchFor.setClose(false);
|
2021-12-06 17:24:27 +01:00
|
|
|
|
2022-08-31 12:45:01 +02:00
|
|
|
alertProjectType.setType(AlertType.INFO);
|
|
|
|
alertProjectType.setClose(false);
|
|
|
|
|
2021-08-05 16:49:04 +02:00
|
|
|
bindEvents();
|
2021-12-01 11:54:39 +01:00
|
|
|
resetSearch.setIconSize(IconSize.TWO_TIMES);
|
|
|
|
resetSearch.setType(ButtonType.LINK);
|
2022-03-04 14:40:43 +01:00
|
|
|
setLoaderVisible("", false);
|
2021-08-05 16:49:04 +02:00
|
|
|
}
|
|
|
|
|
2022-08-08 17:43:13 +02:00
|
|
|
/**
|
|
|
|
* Sets the filtering parameters.
|
|
|
|
*
|
2022-09-13 13:52:44 +02:00
|
|
|
* @param sfp the sfp
|
2022-08-08 17:43:13 +02:00
|
|
|
*/
|
2022-08-31 12:45:01 +02:00
|
|
|
public void setFilteringParameters(CacheSearchingFilterParametersFromConfig sfp) {
|
|
|
|
GWT.log("setFilteringParameters instancied");
|
|
|
|
this.cacheSearchingFilterParameters = sfp;
|
|
|
|
List<ItemFieldDV> sortByFields = sfp.getOrderByFields();
|
|
|
|
List<ItemFieldDV> searchForFields = sfp.getSearchByFields();
|
|
|
|
// currentSearchingFilter = new SearchingFilter(sortByFields, null);
|
2022-08-08 17:43:13 +02:00
|
|
|
|
2022-08-09 16:37:09 +02:00
|
|
|
alertSearchFor.clear();
|
|
|
|
dropdownSearchFor.clear();
|
2022-08-31 12:45:01 +02:00
|
|
|
|
|
|
|
alertSearchFor.setText(searchForFields.get(0).getDisplayName());
|
|
|
|
alertSortBy.setText(toLabelFilter((sortByFields.get(0)), SearchingFilter.ORDER.ASC));
|
|
|
|
|
2022-08-09 16:37:09 +02:00
|
|
|
for (ItemFieldDV record_FIELD : searchForFields) {
|
2021-08-05 16:49:04 +02:00
|
|
|
|
2022-08-09 16:37:09 +02:00
|
|
|
NavLink nav = new NavLink(record_FIELD.getDisplayName());
|
|
|
|
dropdownSearchFor.add(nav);
|
2021-08-05 16:49:04 +02:00
|
|
|
|
2022-08-09 16:37:09 +02:00
|
|
|
nav.addClickHandler(new ClickHandler() {
|
2021-08-05 16:49:04 +02:00
|
|
|
|
2022-08-09 16:37:09 +02:00
|
|
|
@Override
|
|
|
|
public void onClick(ClickEvent event) {
|
|
|
|
alertSearchFor.setText(record_FIELD.getDisplayName());
|
2021-12-01 11:54:39 +01:00
|
|
|
|
2022-08-09 16:37:09 +02:00
|
|
|
if (searchField.getText().length() >= MIN_LENGHT_SERCHING_STRING) {
|
|
|
|
doSearchEvent();
|
|
|
|
}
|
2021-08-05 16:49:04 +02:00
|
|
|
|
2022-08-09 16:37:09 +02:00
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
2022-08-31 12:45:01 +02:00
|
|
|
|
2022-08-09 16:37:09 +02:00
|
|
|
dropdownSortBy.clear();
|
2022-08-31 12:45:01 +02:00
|
|
|
|
2022-03-17 18:08:58 +01:00
|
|
|
for (ItemFieldDV record_FIELD : sortByFields) {
|
2021-08-06 16:23:17 +02:00
|
|
|
|
2021-12-02 11:33:01 +01:00
|
|
|
// if (record_FIELD.equals(RECORD_FIELD.RECORD_STATUS))
|
|
|
|
// continue;
|
2021-12-01 11:54:39 +01:00
|
|
|
|
2021-08-06 16:23:17 +02:00
|
|
|
// ASC
|
2022-08-31 12:45:01 +02:00
|
|
|
final String labelASC = toLabelFilter(record_FIELD, ORDER.ASC);
|
|
|
|
final NavLink nav = new NavLink(labelASC);
|
2021-08-06 16:23:17 +02:00
|
|
|
dropdownSortBy.add(nav);
|
|
|
|
|
|
|
|
nav.addClickHandler(new ClickHandler() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onClick(ClickEvent event) {
|
2022-08-31 16:40:09 +02:00
|
|
|
GWT.log("Sort by: " + labelASC);
|
2021-12-02 12:25:05 +01:00
|
|
|
alertSortBy.setText(labelASC);
|
2022-08-31 12:45:01 +02:00
|
|
|
UseCaseDescriptorDV singleUCD = getSelectProjectType();
|
|
|
|
if (singleUCD != null) {
|
2022-09-13 16:18:40 +02:00
|
|
|
appManagerBus.fireEvent(new GetListOfRecordsEvent(false,
|
2022-08-31 16:40:09 +02:00
|
|
|
singleUCD.getProfileID(), getCurrentSearchingFilter(), false));
|
2022-08-31 12:45:01 +02:00
|
|
|
}
|
2021-08-06 16:23:17 +02:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
// //DESC
|
2022-08-31 12:45:01 +02:00
|
|
|
final String labelDESC = toLabelFilter(record_FIELD, ORDER.DESC);
|
|
|
|
final NavLink nav2 = new NavLink(labelDESC);
|
2021-08-06 16:23:17 +02:00
|
|
|
dropdownSortBy.add(nav2);
|
|
|
|
|
|
|
|
nav2.addClickHandler(new ClickHandler() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onClick(ClickEvent event) {
|
2022-08-31 16:40:09 +02:00
|
|
|
GWT.log("Sort by: " + labelDESC);
|
2021-12-02 12:25:05 +01:00
|
|
|
alertSortBy.setText(labelDESC);
|
2022-08-31 12:45:01 +02:00
|
|
|
UseCaseDescriptorDV singleUCD = getSelectProjectType();
|
|
|
|
if (singleUCD != null) {
|
2022-09-13 16:18:40 +02:00
|
|
|
appManagerBus.fireEvent(new GetListOfRecordsEvent(false,
|
2022-08-31 16:40:09 +02:00
|
|
|
singleUCD.getProfileID(), getCurrentSearchingFilter(), false));
|
2022-08-31 12:45:01 +02:00
|
|
|
}
|
2021-08-06 16:23:17 +02:00
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
2022-08-09 16:37:09 +02:00
|
|
|
}
|
2021-12-06 17:24:27 +01:00
|
|
|
|
2022-09-13 13:52:44 +02:00
|
|
|
/**
|
|
|
|
* Gets the select project type.
|
|
|
|
*
|
|
|
|
* @return the select project type
|
|
|
|
*/
|
2022-08-31 12:45:01 +02:00
|
|
|
public UseCaseDescriptorDV getSelectProjectType() {
|
|
|
|
String projectName = alertProjectType.getText();
|
|
|
|
for (UseCaseDescriptorDV usdDV : ucdProjectTypesForListingDataView) {
|
|
|
|
if (usdDV.getName().compareTo(projectName) == 0) {
|
2022-08-31 16:40:09 +02:00
|
|
|
GWT.log("Selected project type is: " + usdDV);
|
2022-08-31 12:45:01 +02:00
|
|
|
return usdDV;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2022-08-09 16:37:09 +02:00
|
|
|
/**
|
|
|
|
* Sets the internal height.
|
|
|
|
*
|
|
|
|
* @param height the new internal height
|
|
|
|
*/
|
|
|
|
public void setInternalHeight(int height) {
|
|
|
|
contTabNewProject.asWidget().setHeight(height + "px");
|
|
|
|
contTabGetListOfProjects.asWidget().setHeight(height + "px");
|
|
|
|
}
|
2021-12-02 12:25:05 +01:00
|
|
|
|
2022-08-09 16:37:09 +02:00
|
|
|
/**
|
|
|
|
* Bind events.
|
|
|
|
*/
|
|
|
|
private void bindEvents() {
|
2021-12-02 12:25:05 +01:00
|
|
|
|
2022-09-13 16:18:40 +02:00
|
|
|
buttonReloadProjects.addClickHandler(new ClickHandler() {
|
2021-12-06 17:24:27 +01:00
|
|
|
|
2022-08-09 16:37:09 +02:00
|
|
|
@Override
|
|
|
|
public void onClick(ClickEvent event) {
|
2022-08-31 17:16:39 +02:00
|
|
|
|
|
|
|
UseCaseDescriptorDV singleUCD = getSelectProjectType();
|
|
|
|
if (singleUCD != null) {
|
2022-09-13 16:18:40 +02:00
|
|
|
appManagerBus.fireEvent(new GetListOfRecordsEvent(false,
|
2022-08-31 17:16:39 +02:00
|
|
|
singleUCD.getProfileID(), getCurrentSearchingFilter(), true));
|
|
|
|
}
|
2021-12-06 17:24:27 +01:00
|
|
|
|
2022-08-09 16:37:09 +02:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
tabGetListOfProjects.addClickHandler(new ClickHandler() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onClick(ClickEvent event) {
|
|
|
|
|
2022-09-13 13:52:44 +02:00
|
|
|
// instanceAndShowListOfProjects(false);
|
2022-08-09 16:37:09 +02:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2021-09-15 16:14:27 +02:00
|
|
|
navShowOnMap.addClickHandler(new ClickHandler() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onClick(ClickEvent event) {
|
2022-09-01 16:43:25 +02:00
|
|
|
List<DocumentDV> listDocuments = null;
|
2021-09-15 16:14:27 +02:00
|
|
|
if (grpw != null && grpw.getSelectItems() != null) {
|
2022-09-01 16:43:25 +02:00
|
|
|
listDocuments = grpw.getSelectItems();
|
2021-09-15 16:14:27 +02:00
|
|
|
}
|
2022-05-20 12:31:58 +02:00
|
|
|
|
2022-09-13 13:52:44 +02:00
|
|
|
appManagerBus.fireEvent(new OperationOnItemEvent<DocumentDV>(listDocuments, OPERATION_ON_ITEM.VIEW_ON_MAP));
|
2021-09-15 16:14:27 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
navShowReport.addClickHandler(new ClickHandler() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onClick(ClickEvent event) {
|
2022-09-01 12:44:00 +02:00
|
|
|
List<DocumentDV> listDocuments = null;
|
2021-09-15 16:14:27 +02:00
|
|
|
if (grpw != null && grpw.getSelectItems() != null) {
|
2022-09-01 12:44:00 +02:00
|
|
|
listDocuments = grpw.getSelectItems();
|
2021-09-15 16:14:27 +02:00
|
|
|
}
|
2022-05-20 12:31:58 +02:00
|
|
|
|
2022-09-13 13:52:44 +02:00
|
|
|
appManagerBus.fireEvent(new OperationOnItemEvent<DocumentDV>(listDocuments, OPERATION_ON_ITEM.VIEW_REPORT));
|
2022-09-01 12:44:00 +02:00
|
|
|
|
2021-09-15 16:14:27 +02:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
navEditMode.addClickHandler(new ClickHandler() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onClick(ClickEvent event) {
|
|
|
|
|
2022-09-01 16:43:25 +02:00
|
|
|
List<DocumentDV> listDocuments = null;
|
2021-09-15 16:14:27 +02:00
|
|
|
if (grpw != null && grpw.getSelectItems() != null) {
|
2022-09-01 16:43:25 +02:00
|
|
|
listDocuments = grpw.getSelectItems();
|
2021-09-15 16:14:27 +02:00
|
|
|
}
|
2022-05-20 12:31:58 +02:00
|
|
|
|
2022-09-13 13:52:44 +02:00
|
|
|
appManagerBus.fireEvent(new OperationOnItemEvent<DocumentDV>(listDocuments, OPERATION_ON_ITEM.EDIT_PROJECT));
|
2021-09-15 16:14:27 +02:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
navDelete.addClickHandler(new ClickHandler() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onClick(ClickEvent event) {
|
2022-09-01 16:43:25 +02:00
|
|
|
List<DocumentDV> listDocuments = null;
|
2021-09-15 16:14:27 +02:00
|
|
|
if (grpw != null && grpw.getSelectItems() != null) {
|
2022-09-01 16:43:25 +02:00
|
|
|
listDocuments = grpw.getSelectItems();
|
2021-09-15 16:14:27 +02:00
|
|
|
}
|
2022-05-20 12:31:58 +02:00
|
|
|
|
2022-09-13 13:52:44 +02:00
|
|
|
appManagerBus
|
|
|
|
.fireEvent(new OperationOnItemEvent<DocumentDV>(listDocuments, OPERATION_ON_ITEM.DELETE_PROJECT));
|
2021-09-15 16:14:27 +02:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2021-12-01 11:54:39 +01:00
|
|
|
searchField.addKeyPressHandler(new KeyPressHandler() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onKeyPress(KeyPressEvent event) {
|
|
|
|
GWT.log("CHAR CODE: " + event.getCharCode());
|
|
|
|
if (com.google.gwt.event.dom.client.KeyCodes.KEY_ENTER == event.getCharCode()) {
|
|
|
|
GWT.log(searchField.getText());
|
2021-12-02 17:13:55 +01:00
|
|
|
doSearchEvent();
|
2021-12-01 11:54:39 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
resetSearch.addClickHandler(new ClickHandler() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onClick(ClickEvent event) {
|
|
|
|
searchField.setText("");
|
2022-08-31 16:40:09 +02:00
|
|
|
|
|
|
|
UseCaseDescriptorDV singleUCD = getSelectProjectType();
|
|
|
|
if (singleUCD != null) {
|
2022-09-13 16:18:40 +02:00
|
|
|
appManagerBus.fireEvent(new GetListOfRecordsEvent(false,
|
2022-08-31 16:40:09 +02:00
|
|
|
singleUCD.getProfileID(), getCurrentSearchingFilter(), false));
|
|
|
|
}
|
|
|
|
|
|
|
|
resetSearch.setVisible(false);
|
|
|
|
|
|
|
|
// Window.alert("resetSearch MUST BE REVISITED");
|
2022-03-17 18:08:58 +01:00
|
|
|
/*
|
2022-05-20 12:31:58 +02:00
|
|
|
* appManagerBus.fireEvent(new GetListOfRecordsEvent(RECORD_TYPE.CONCESSIONE,
|
|
|
|
* getCurrentSortFilter())); resetSearch.setVisible(false);
|
|
|
|
*/
|
2021-12-01 11:54:39 +01:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
2022-03-04 14:40:43 +01:00
|
|
|
|
2022-08-08 17:43:13 +02:00
|
|
|
/**
|
|
|
|
* Sets the role label.
|
|
|
|
*
|
|
|
|
* @param msg the new role label
|
|
|
|
*/
|
2021-12-13 11:27:03 +01:00
|
|
|
public void setRoleLabel(String msg) {
|
|
|
|
roleLabel.setText(msg);
|
|
|
|
}
|
2021-12-06 17:24:27 +01:00
|
|
|
|
2022-08-08 17:43:13 +02:00
|
|
|
/**
|
|
|
|
* Do search event.
|
|
|
|
*/
|
2021-12-02 17:13:55 +01:00
|
|
|
private void doSearchEvent() {
|
|
|
|
String searchText = searchField.getText();
|
|
|
|
if (searchText.length() < MIN_LENGHT_SERCHING_STRING) {
|
2021-12-06 17:24:27 +01:00
|
|
|
Window.alert("Please enter at least " + MIN_LENGHT_SERCHING_STRING + " characters");
|
2021-12-02 17:13:55 +01:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
resetSearch.setVisible(true);
|
2022-05-20 12:31:58 +02:00
|
|
|
|
2022-08-31 16:40:09 +02:00
|
|
|
UseCaseDescriptorDV singleUCD = getSelectProjectType();
|
|
|
|
if (singleUCD != null) {
|
2022-09-13 16:18:40 +02:00
|
|
|
appManagerBus.fireEvent(new GetListOfRecordsEvent(false, singleUCD.getProfileID(),
|
2022-08-31 16:40:09 +02:00
|
|
|
getCurrentSearchingFilter(), false));
|
|
|
|
}
|
2021-12-02 17:13:55 +01:00
|
|
|
}
|
2021-12-01 11:54:39 +01:00
|
|
|
|
2022-08-08 17:43:13 +02:00
|
|
|
/**
|
|
|
|
* To label filter.
|
|
|
|
*
|
|
|
|
* @param itemField the item field
|
|
|
|
* @param direction the direction
|
|
|
|
* @return the string
|
|
|
|
*/
|
2022-03-17 18:08:58 +01:00
|
|
|
private String toLabelFilter(ItemFieldDV itemField, ORDER direction) {
|
2021-12-06 17:24:27 +01:00
|
|
|
String labelFilter = itemField.getDisplayName() + LABEL_FILTER_SEPARATOR + direction.name();
|
2021-12-01 11:54:39 +01:00
|
|
|
return labelFilter;
|
2021-08-05 16:49:04 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Adds the form panel.
|
|
|
|
*
|
|
|
|
* @param formPanel the form panel
|
|
|
|
*/
|
|
|
|
public void addFormPanel(GeonaDataEntryMainForm formPanel) {
|
|
|
|
geonaMainFormPanel.add(formPanel);
|
|
|
|
}
|
|
|
|
|
2021-08-06 16:23:17 +02:00
|
|
|
/**
|
|
|
|
* Show list of concessioni view.
|
|
|
|
*
|
|
|
|
* @param grpw the grpw
|
|
|
|
*/
|
2021-08-05 16:49:04 +02:00
|
|
|
public void showListOfConcessioniView(GeonaRecordsPaginatedView grpw) {
|
2021-09-15 16:14:27 +02:00
|
|
|
this.grpw = grpw;
|
2022-03-04 14:40:43 +01:00
|
|
|
geonaListOfRecordsPanel.clear();
|
2021-08-05 16:49:04 +02:00
|
|
|
VerticalPanel htmllPanel = new VerticalPanel();
|
|
|
|
htmllPanel.add(grpw.getCellPanel());
|
|
|
|
htmllPanel.add(grpw.getPagerPanel());
|
2022-03-04 14:40:43 +01:00
|
|
|
geonaListOfRecordsPanel.add(htmllPanel);
|
2021-08-05 16:49:04 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the loader visible.
|
|
|
|
*
|
|
|
|
* @param txtHTML the txt HTML
|
|
|
|
* @param visible the visible
|
|
|
|
*/
|
|
|
|
public void setLoaderVisible(String txtHTML, boolean visible) {
|
|
|
|
loader.setText(txtHTML);
|
|
|
|
loader.setVisible(visible);
|
|
|
|
}
|
|
|
|
|
2022-08-08 17:43:13 +02:00
|
|
|
/**
|
|
|
|
* To sort filter.
|
|
|
|
*
|
|
|
|
* @param labelFilter the label filter
|
|
|
|
* @return the searching filter
|
|
|
|
*/
|
2021-12-01 11:54:39 +01:00
|
|
|
public SearchingFilter toSortFilter(String labelFilter) {
|
|
|
|
GWT.log("toSortFilter for label " + labelFilter);
|
|
|
|
String[] array = labelFilter.split(LABEL_FILTER_SEPARATOR);
|
|
|
|
|
2022-08-31 16:40:09 +02:00
|
|
|
GWT.log("label filter: " + array[0]);
|
2021-12-01 11:54:39 +01:00
|
|
|
SearchingFilter sortFilter = null;
|
|
|
|
try {
|
2022-03-17 18:08:58 +01:00
|
|
|
ItemFieldDV recordField = null;
|
2022-08-31 16:40:09 +02:00
|
|
|
GWT.log("cacheSearchingFilterParameters.getOrderByFields() is: "
|
|
|
|
+ cacheSearchingFilterParameters.getOrderByFields());
|
2022-08-31 12:45:01 +02:00
|
|
|
for (ItemFieldDV value : cacheSearchingFilterParameters.getOrderByFields()) {
|
2022-08-31 16:40:09 +02:00
|
|
|
if (array[0].trim().compareTo(value.getDisplayName()) == 0) {
|
2021-12-01 11:54:39 +01:00
|
|
|
recordField = value;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2022-08-31 12:45:01 +02:00
|
|
|
ORDER orderField = ORDER.valueOf(array[1].trim());
|
2021-12-06 17:24:27 +01:00
|
|
|
sortFilter = new SearchingFilter(Arrays.asList(recordField), orderField);
|
2021-12-01 11:54:39 +01:00
|
|
|
} catch (Exception e) {
|
2021-08-06 16:23:17 +02:00
|
|
|
|
2021-12-01 11:54:39 +01:00
|
|
|
}
|
2022-08-31 12:45:01 +02:00
|
|
|
GWT.log("toSortFilter got " + sortFilter);
|
2021-12-01 11:54:39 +01:00
|
|
|
return sortFilter;
|
2021-08-06 16:23:17 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2022-08-08 17:43:13 +02:00
|
|
|
/**
|
|
|
|
* Built searching filter.
|
|
|
|
*
|
|
|
|
* @return the searching filter
|
|
|
|
*/
|
2021-12-01 11:54:39 +01:00
|
|
|
private SearchingFilter builtSearchingFilter() {
|
2021-12-02 12:25:05 +01:00
|
|
|
SearchingFilter searchingFilter = toSortFilter(alertSortBy.getText());
|
2021-12-01 11:54:39 +01:00
|
|
|
String searchText = searchField.getText();
|
|
|
|
if (searchText != null && !searchText.isEmpty()) {
|
|
|
|
Map<String, Object> searchInto = new HashMap<String, Object>();
|
2021-12-06 17:24:27 +01:00
|
|
|
|
|
|
|
String searchForField = "";
|
|
|
|
|
2022-08-31 12:45:01 +02:00
|
|
|
for (ItemFieldDV recordField : cacheSearchingFilterParameters.getSearchByFields()) {
|
2021-12-06 17:24:27 +01:00
|
|
|
if (recordField.getDisplayName().equals(alertSearchFor.getText())) {
|
2022-09-12 15:09:43 +02:00
|
|
|
searchForField = recordField.getJsonFields().get(0);
|
2021-12-02 12:25:05 +01:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
searchInto.put(searchForField, searchText);
|
2021-12-15 15:43:36 +01:00
|
|
|
WhereClause where = new WhereClause();
|
|
|
|
where.setSearchInto(searchInto);
|
|
|
|
where.setOperator(LOGICAL_OP.OR);
|
|
|
|
searchingFilter.setConditions(Arrays.asList(where));
|
2021-12-01 11:54:39 +01:00
|
|
|
}
|
2022-08-31 12:45:01 +02:00
|
|
|
|
2021-12-01 11:54:39 +01:00
|
|
|
return searchingFilter;
|
|
|
|
}
|
2021-08-06 16:23:17 +02:00
|
|
|
|
2022-08-08 17:43:13 +02:00
|
|
|
/**
|
|
|
|
* Gets the current sort filter.
|
|
|
|
*
|
|
|
|
* @return the current sort filter
|
|
|
|
*/
|
2022-08-31 12:45:01 +02:00
|
|
|
public SearchingFilter getCurrentSearchingFilter() {
|
|
|
|
currentSearchingFilter = builtSearchingFilter();
|
|
|
|
|
|
|
|
// currentSearchingFilter.setProjection(cacheSearchingFilterParameters.getProjection());
|
|
|
|
GWT.log("getCurrentSearchingFilter: " + currentSearchingFilter);
|
|
|
|
return currentSearchingFilter;
|
2021-08-06 16:23:17 +02:00
|
|
|
}
|
|
|
|
|
2022-08-08 17:43:13 +02:00
|
|
|
/**
|
|
|
|
* Removes the tab.
|
|
|
|
*
|
|
|
|
* @param index the index
|
|
|
|
*/
|
2021-11-26 16:05:05 +01:00
|
|
|
public void removeTab(int index) {
|
|
|
|
tabPanel.remove(index);
|
|
|
|
}
|
|
|
|
|
2022-08-08 17:43:13 +02:00
|
|
|
/**
|
|
|
|
* Sets the tab active.
|
|
|
|
*
|
|
|
|
* @param index the new tab active
|
|
|
|
*/
|
2021-11-26 16:05:05 +01:00
|
|
|
public void setTabActive(int index) {
|
|
|
|
tabPanel.selectTab(index);
|
|
|
|
}
|
2021-12-01 11:54:39 +01:00
|
|
|
|
2021-11-26 16:05:05 +01:00
|
|
|
/**
|
2021-12-01 11:54:39 +01:00
|
|
|
* Dirty solution. I created this one because I had problem on firing click
|
|
|
|
* event for Tab element
|
2021-11-26 16:05:05 +01:00
|
|
|
*
|
|
|
|
*/
|
2022-08-31 12:45:01 +02:00
|
|
|
public void instanceAndShowListOfProjects() {
|
2022-09-01 18:28:26 +02:00
|
|
|
GWT.log("instanceAndShowListOfProjects called");
|
2022-09-13 13:52:44 +02:00
|
|
|
// If the list of UCDProjectType for listing is not empty.. FIRE THE EVENT OF
|
|
|
|
// SELECTION on the first item
|
2022-09-01 18:28:26 +02:00
|
|
|
if (ucdProjectTypesForListingDataView.size() > 0) {
|
2022-08-31 12:45:01 +02:00
|
|
|
UseCaseDescriptorDV singleUCD = ucdProjectTypesForListingDataView.get(0);
|
|
|
|
alertProjectType.setText(singleUCD.getName());
|
|
|
|
// setFilteringParameters(displayFields, sortByFields, searchForFields,
|
|
|
|
// currentSearchingFilter);
|
2022-09-13 16:18:40 +02:00
|
|
|
appManagerBus.fireEvent(new GetListOfRecordsEvent(true, singleUCD.getProfileID(),
|
2022-08-31 12:45:01 +02:00
|
|
|
getCurrentSearchingFilter(), true));
|
|
|
|
}
|
2021-11-26 16:05:05 +01:00
|
|
|
}
|
|
|
|
|
2022-08-08 17:43:13 +02:00
|
|
|
/**
|
2022-08-31 12:45:01 +02:00
|
|
|
* Inits the main according to list use case descriptors.
|
2022-08-08 17:43:13 +02:00
|
|
|
*
|
2022-08-31 12:45:01 +02:00
|
|
|
* @param listUCDescriptors the list UC descriptors
|
2022-08-08 17:43:13 +02:00
|
|
|
*/
|
2022-08-31 12:45:01 +02:00
|
|
|
public void initMainAccordingToListUseCaseDescriptors(List<UseCaseDescriptorDV> listUCDescriptors) {
|
|
|
|
GWT.log("initMainAccordingToListUseCaseDescriptors: " + listUCDescriptors);
|
|
|
|
// this.listUCDescriptors = listUCDescriptors;
|
2022-03-04 14:40:43 +01:00
|
|
|
ddCreateNewProject.clear();
|
2022-08-31 12:45:01 +02:00
|
|
|
ddProjectType.clear();
|
|
|
|
ucdProjectTypesForListingDataView.clear();
|
2022-03-04 14:40:43 +01:00
|
|
|
|
2022-05-20 12:31:58 +02:00
|
|
|
for (final UseCaseDescriptorDV ucd : listUCDescriptors) {
|
2022-03-04 14:40:43 +01:00
|
|
|
|
2022-08-08 17:43:13 +02:00
|
|
|
HandlerDeclarationDV dataEntryHandler = UCD_Util.getHandlerDeclarationFor(ucd,
|
|
|
|
GEOPORTAL_DATA_HANDLER.geoportal_data_entry);
|
2022-03-04 14:40:43 +01:00
|
|
|
|
2022-03-17 18:08:58 +01:00
|
|
|
if (dataEntryHandler != null) {
|
|
|
|
ConfigurationDV<?> config = dataEntryHandler.getConfiguration();
|
|
|
|
List<GcubeProfileDV> listGcubeProfiles = toListGcubeProfiles(config);
|
2022-03-04 14:40:43 +01:00
|
|
|
|
2022-03-17 18:08:58 +01:00
|
|
|
final List<GcubeProfileDV> listProfiles = listGcubeProfiles;
|
|
|
|
|
|
|
|
NavLink link = new NavLink(ucd.getName());
|
|
|
|
link.addClickHandler(new ClickHandler() {
|
2022-03-04 14:40:43 +01:00
|
|
|
|
2022-03-17 18:08:58 +01:00
|
|
|
@Override
|
|
|
|
public void onClick(ClickEvent event) {
|
|
|
|
|
|
|
|
if (listProfiles == null || listProfiles.size() == 0) {
|
|
|
|
DialogInform di = new DialogInform(null, "No configuration found",
|
|
|
|
"No GcubeProfile found in the Configuration for " + config.getConfiguration());
|
|
|
|
di.center();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2022-05-20 12:31:58 +02:00
|
|
|
appManagerBus.fireEvent(
|
|
|
|
new CreateNewProjectEvent(ucd.getProfileID(), dataEntryHandler, listProfiles));
|
2022-03-17 18:08:58 +01:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
ddCreateNewProject.add(link);
|
2022-08-08 17:43:13 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// Setting Project type having HANDLER DATA LIST
|
|
|
|
HandlerDeclarationDV dataListHandler = UCD_Util.getHandlerDeclarationFor(ucd,
|
|
|
|
GEOPORTAL_DATA_HANDLER.geoportal_data_list);
|
|
|
|
|
|
|
|
if (dataListHandler != null) {
|
|
|
|
|
|
|
|
NavLink link = new NavLink(ucd.getName());
|
|
|
|
link.addClickHandler(new ClickHandler() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onClick(ClickEvent event) {
|
|
|
|
|
2022-09-13 16:18:40 +02:00
|
|
|
appManagerBus.fireEvent(new GetListOfRecordsEvent(false, ucd.getProfileID(),
|
2022-08-31 12:45:01 +02:00
|
|
|
getCurrentSearchingFilter(), true));
|
2022-08-08 17:43:13 +02:00
|
|
|
}
|
|
|
|
});
|
2022-08-31 12:45:01 +02:00
|
|
|
ucdProjectTypesForListingDataView.add(ucd);
|
2022-08-08 17:43:13 +02:00
|
|
|
ddProjectType.add(link);
|
2022-03-17 18:08:58 +01:00
|
|
|
|
|
|
|
}
|
2022-09-13 16:18:40 +02:00
|
|
|
|
|
|
|
initActionListPanel(ucd);
|
2022-09-13 13:52:44 +02:00
|
|
|
|
2022-03-04 14:40:43 +01:00
|
|
|
}
|
2022-03-17 18:08:58 +01:00
|
|
|
|
|
|
|
// IF one type of document is available, fire
|
|
|
|
// CreateNewProjectEvent(documentConfigDV));
|
|
|
|
if (listUCDescriptors.size() == 1) {
|
2022-03-04 16:44:51 +01:00
|
|
|
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void execute() {
|
|
|
|
GWT.log("One Config loaded. Firing CreateNewProjectEvent");
|
2022-03-17 18:08:58 +01:00
|
|
|
UseCaseDescriptorDV useCaseDescriptor = listUCDescriptors.get(0);
|
2022-08-08 17:43:13 +02:00
|
|
|
HandlerDeclarationDV dataEntryHandler = UCD_Util.getHandlerDeclarationFor(useCaseDescriptor,
|
|
|
|
GEOPORTAL_DATA_HANDLER.geoportal_data_entry);
|
2022-03-17 18:08:58 +01:00
|
|
|
if (dataEntryHandler != null) {
|
|
|
|
ConfigurationDV<?> config = dataEntryHandler.getConfiguration();
|
|
|
|
List<GcubeProfileDV> listGcubeProfiles = toListGcubeProfiles(config);
|
2022-05-20 12:31:58 +02:00
|
|
|
appManagerBus.fireEvent(new CreateNewProjectEvent(useCaseDescriptor.getProfileID(),
|
|
|
|
dataEntryHandler, listGcubeProfiles));
|
2022-03-17 18:08:58 +01:00
|
|
|
}
|
|
|
|
|
2022-03-04 16:44:51 +01:00
|
|
|
}
|
2022-03-17 18:08:58 +01:00
|
|
|
|
2022-03-04 16:44:51 +01:00
|
|
|
});
|
2022-03-17 18:08:58 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
}
|
2022-09-13 13:52:44 +02:00
|
|
|
|
2022-09-13 16:18:40 +02:00
|
|
|
public void initActionListPanel(UseCaseDescriptorDV ucd) {
|
|
|
|
GWT.log("Init ActionListPanel for UCD: "+ucd);
|
2022-09-13 13:52:44 +02:00
|
|
|
|
2022-09-13 16:18:40 +02:00
|
|
|
// Setting Project type having HANDLER WORKFLOW ACTION
|
|
|
|
HandlerDeclarationDV dataListHandler = UCD_Util.getHandlerDeclarationFor(ucd,
|
|
|
|
GEOPORTAL_DATA_HANDLER.geoportal_workflow_action_list);
|
|
|
|
|
|
|
|
if (dataListHandler != null) {
|
|
|
|
actionListMainPanel.setVisible(true);
|
|
|
|
actionListMainPanel.clear();
|
|
|
|
ConfigurationDV<?> config = dataListHandler.getConfiguration();
|
|
|
|
List<ActionDefinitionDV> listActionDef = toListActionDefinition(config);
|
|
|
|
actionListPanel = new ActionListPanel(appManagerBus, ucd.getName(), ucd.getProfileID(), listActionDef);
|
|
|
|
actionListMainPanel.add(actionListPanel);
|
|
|
|
|
|
|
|
}else {
|
|
|
|
actionListMainPanel.clear();
|
|
|
|
actionListMainPanel.setVisible(false);
|
|
|
|
}
|
2022-09-13 13:52:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public <T> void showActionsOnSelected(List<T> selectItems) {
|
|
|
|
|
|
|
|
actionListPanel.showActionsOnSelected(selectItems);
|
|
|
|
}
|
2022-03-17 18:08:58 +01:00
|
|
|
|
2022-08-08 17:43:13 +02:00
|
|
|
/**
|
|
|
|
* To list gcube profiles.
|
|
|
|
*
|
|
|
|
* @param config the config
|
|
|
|
* @return the list
|
|
|
|
*/
|
|
|
|
private List<GcubeProfileDV> toListGcubeProfiles(ConfigurationDV<?> config) {
|
2022-03-17 18:08:58 +01:00
|
|
|
|
2022-08-08 17:43:13 +02:00
|
|
|
try {
|
|
|
|
return (List<GcubeProfileDV>) config.getConfiguration();
|
|
|
|
} catch (Exception e) {
|
|
|
|
GWT.log("Error on casting " + ConfigurationDV.class.getName() + " to List of "
|
|
|
|
+ GcubeProfileDV.class.getName());
|
2022-03-04 16:44:51 +01:00
|
|
|
}
|
2022-03-17 18:08:58 +01:00
|
|
|
|
|
|
|
return null;
|
2022-03-04 14:40:43 +01:00
|
|
|
}
|
2022-03-17 18:08:58 +01:00
|
|
|
|
2022-09-13 13:52:44 +02:00
|
|
|
/**
|
|
|
|
* To list action definition.
|
|
|
|
*
|
|
|
|
* @param config the config
|
|
|
|
* @return the list
|
|
|
|
*/
|
|
|
|
private List<ActionDefinitionDV> toListActionDefinition(ConfigurationDV<?> config) {
|
|
|
|
|
|
|
|
try {
|
|
|
|
return (List<ActionDefinitionDV>) config.getConfiguration();
|
|
|
|
} catch (Exception e) {
|
|
|
|
GWT.log("Error on casting " + ConfigurationDV.class.getName() + " to List of "
|
|
|
|
+ ActionDefinitionDV.class.getName());
|
|
|
|
}
|
|
|
|
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2022-08-08 17:43:13 +02:00
|
|
|
/**
|
|
|
|
* To list item fields.
|
|
|
|
*
|
|
|
|
* @param config the config
|
|
|
|
* @return the list
|
|
|
|
*/
|
|
|
|
private List<ItemFieldDV> toListItemFields(ConfigurationDV<?> config) {
|
2022-03-17 18:08:58 +01:00
|
|
|
|
|
|
|
try {
|
2022-08-08 17:43:13 +02:00
|
|
|
return (List<ItemFieldDV>) config.getConfiguration();
|
2022-03-17 18:08:58 +01:00
|
|
|
} catch (Exception e) {
|
|
|
|
GWT.log("Error on casting " + ConfigurationDV.class.getName() + " to List of "
|
2022-08-08 17:43:13 +02:00
|
|
|
+ ItemFieldDV.class.getName());
|
2022-03-17 18:08:58 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2022-08-08 17:43:13 +02:00
|
|
|
/**
|
|
|
|
* Sets the page header.
|
|
|
|
*
|
|
|
|
* @param hDV the new page header
|
|
|
|
*/
|
2022-03-17 18:08:58 +01:00
|
|
|
public void setPageHeader(HandlerDeclarationDV hDV) {
|
2022-03-04 17:09:46 +01:00
|
|
|
introGNAHero.setVisible(false);
|
|
|
|
this.pageHeaderDataEntry.setVisible(true);
|
2022-03-04 14:40:43 +01:00
|
|
|
this.pageHeaderDataEntry.setText("");
|
2022-03-17 18:08:58 +01:00
|
|
|
this.pageHeaderDataEntry.setSubtext("New: " + hDV.getItemType());
|
2022-03-04 14:40:43 +01:00
|
|
|
}
|
2022-03-17 18:08:58 +01:00
|
|
|
|
2022-09-13 13:52:44 +02:00
|
|
|
|
|
|
|
|
2021-08-05 16:49:04 +02:00
|
|
|
}
|