Introduced collections, start event refactoring

This commit is contained in:
Fabio Sinibaldi 2022-08-05 18:06:09 +02:00
parent 052aa44675
commit f29a8c3ef0
32 changed files with 475 additions and 462 deletions

View File

@ -1,51 +1,29 @@
package org.gcube.portlets.user.geoportaldataviewer.client; package org.gcube.portlets.user.geoportaldataviewer.client;
import java.util.ArrayList; import java.util.*;
import java.util.Arrays;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import org.gcube.application.geoportalcommon.shared.GNADataViewerConfigProfile; import org.gcube.application.geoportalcommon.shared.GNADataViewerConfigProfile;
import org.gcube.application.geoportalcommon.shared.GeoNaItemRef;
import org.gcube.application.geoportalcommon.shared.ItemField;
import org.gcube.application.geoportalcommon.shared.LayerItem;
import org.gcube.application.geoportalcommon.shared.SearchingFilter;
import org.gcube.application.geoportalcommon.shared.SearchingFilter.ORDER;
import org.gcube.application.geoportalcommon.shared.products.ConcessioneDV; import org.gcube.application.geoportalcommon.shared.products.ConcessioneDV;
import org.gcube.application.geoportalcommon.shared.products.model.RecordDV; import org.gcube.application.geoportalcommon.shared.products.model.RecordDV;
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants.MAP_PROJECTION; import org.gcube.portlets.user.geoportaldataviewer.client.events.application.AddedLayerToMapEvent;
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants.MapEventType; import org.gcube.portlets.user.geoportaldataviewer.client.events.application.AddedLayerToMapEvent.LAYER_TYPE;
import org.gcube.portlets.user.geoportaldataviewer.client.events.AddedLayerToMapEvent; import org.gcube.portlets.user.geoportaldataviewer.client.events.application.AddedLayerToMapEventHandler;
import org.gcube.portlets.user.geoportaldataviewer.client.events.AddedLayerToMapEvent.LAYER_TYPE; import org.gcube.portlets.user.geoportaldataviewer.client.events.application.ChangeBaseMapLayerEvent;
import org.gcube.portlets.user.geoportaldataviewer.client.events.AddedLayerToMapEventHandler; import org.gcube.portlets.user.geoportaldataviewer.client.events.application.ClosedViewDetailsEvent;
import org.gcube.portlets.user.geoportaldataviewer.client.events.ChangeMapLayerEvent; import org.gcube.portlets.user.geoportaldataviewer.client.events.application.DoActionOnDetailLayersEvent;
import org.gcube.portlets.user.geoportaldataviewer.client.events.ChangeMapLayerEventHandler; import org.gcube.portlets.user.geoportaldataviewer.client.events.application.DoActionOnDetailLayersEvent.DO_LAYER_ACTION;
import org.gcube.portlets.user.geoportaldataviewer.client.events.ClosedViewDetailsEvent; import org.gcube.portlets.user.geoportaldataviewer.client.events.application.DoActionOnDetailLayersEvent.SwapLayer;
import org.gcube.portlets.user.geoportaldataviewer.client.events.ClosedViewDetailsEventHandler; import org.gcube.portlets.user.geoportaldataviewer.client.events.application.MapExtentToEvent;
import org.gcube.portlets.user.geoportaldataviewer.client.events.DoActionOnDetailLayersEvent; import org.gcube.portlets.user.geoportaldataviewer.client.events.application.SearchPerformedEvent;
import org.gcube.portlets.user.geoportaldataviewer.client.events.DoActionOnDetailLayersEvent.DO_LAYER_ACTION; import org.gcube.portlets.user.geoportaldataviewer.client.events.application.ShowDetailsEvent;
import org.gcube.portlets.user.geoportaldataviewer.client.events.DoActionOnDetailLayersEvent.SwapLayer; import org.gcube.portlets.user.geoportaldataviewer.client.events.application.ShowPopupOnCentroiEvent;
import org.gcube.portlets.user.geoportaldataviewer.client.events.DoActionOnDetailLayersEventHandler; import org.gcube.portlets.user.geoportaldataviewer.client.events.application.ZoomOutOverMinimumEvent;
import org.gcube.portlets.user.geoportaldataviewer.client.events.MapExtentToEvent;
import org.gcube.portlets.user.geoportaldataviewer.client.events.MapExtentToEventHandler;
import org.gcube.portlets.user.geoportaldataviewer.client.events.QueryDataEvent;
import org.gcube.portlets.user.geoportaldataviewer.client.events.SearchPerformedEvent;
import org.gcube.portlets.user.geoportaldataviewer.client.events.SearchPerformedEventHandler;
import org.gcube.portlets.user.geoportaldataviewer.client.events.ShowDetailsEvent;
import org.gcube.portlets.user.geoportaldataviewer.client.events.ShowDetailsEventHandler;
import org.gcube.portlets.user.geoportaldataviewer.client.events.ShowPopupOnCentroiEvent;
import org.gcube.portlets.user.geoportaldataviewer.client.events.ShowPopupOnCentroiEventHandler;
import org.gcube.portlets.user.geoportaldataviewer.client.events.ZoomOutOverMinimumEvent;
import org.gcube.portlets.user.geoportaldataviewer.client.events.ZoomOutOverMinimumEventHandler;
import org.gcube.portlets.user.geoportaldataviewer.client.gis.ExtentWrapped;
import org.gcube.portlets.user.geoportaldataviewer.client.gis.MapUtils;
import org.gcube.portlets.user.geoportaldataviewer.client.gis.OpenLayerMap; import org.gcube.portlets.user.geoportaldataviewer.client.gis.OpenLayerMap;
import org.gcube.portlets.user.geoportaldataviewer.client.ui.GeonaDataViewMainPanel; import org.gcube.portlets.user.geoportaldataviewer.client.ui.GeonaDataViewMainPanel;
import org.gcube.portlets.user.geoportaldataviewer.client.util.LoaderIcon; import org.gcube.portlets.user.geoportaldataviewer.client.util.LoaderIcon;
import org.gcube.portlets.user.geoportaldataviewer.client.util.URLUtil; import org.gcube.portlets.user.geoportaldataviewer.client.util.OGCUtils;
import org.gcube.portlets.user.geoportaldataviewer.shared.GCubeCollection;
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.BaseMapLayer; import org.gcube.portlets.user.geoportaldataviewer.shared.gis.BaseMapLayer;
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.GeoQuery;
import com.google.gwt.core.client.EntryPoint; import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT; import com.google.gwt.core.client.GWT;
@ -61,7 +39,6 @@ import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.HTML; import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.RootPanel; import com.google.gwt.user.client.ui.RootPanel;
import ol.Coordinate;
import ol.layer.Image; import ol.layer.Image;
/** /**
@ -82,23 +59,13 @@ public class GeoportalDataViewer implements EntryPoint {
/** The main panel. */ /** The main panel. */
private GeonaDataViewMainPanel mainPanel; private GeonaDataViewMainPanel mainPanel;
/** The param wms request. */ private StartParameters startParameters = null;
private String paramWmsRequest;
/** The param UUID. */
// private String paramUUID;
private String paramGeonaItemType;
/** The param layer title. */
private String paramLayerTitle;
private HandlerManager applicationBus = new HandlerManager(""); private HandlerManager applicationBus = new HandlerManager("");
/** The layer manager. */ /** The layer manager. */
private LayerManager layerManager = new LayerManager(applicationBus); private LayerManager layerManager = new LayerManager(applicationBus);
private String paramGeonaItemID;
private GNADataViewerConfigProfile geonaDataViewerProfile; private GNADataViewerConfigProfile geonaDataViewerProfile;
@ -112,9 +79,10 @@ public class GeoportalDataViewer implements EntryPoint {
private static List<BaseMapLayer> listBaseMapLayers = null; private static List<BaseMapLayer> listBaseMapLayers = null;
private List<ItemField> displayFields = new ArrayList<ItemField>(); // Configuration by UCD
private List<ItemField> sortByFields = new ArrayList<ItemField>(); // Map : UCID -> Collection description
private List<ItemField> searchByFields = new ArrayList<ItemField>(); private Map<String, GCubeCollection> openedCollections=new HashMap<>();
/** /**
* This is the entry point method. * This is the entry point method.
@ -124,57 +92,14 @@ public class GeoportalDataViewer implements EntryPoint {
loaderApp.getElement().addClassName("loader-gna-app"); loaderApp.getElement().addClassName("loader-gna-app");
RootPanel.get(APP_DIV).add(loaderApp); RootPanel.get(APP_DIV).add(loaderApp);
paramWmsRequest = Window.Location.getParameter(GeoportalDataViewerConstants.GET_WMS_PARAMETER); startParameters = new StartParameters(Window.Location.getParameterMap());
paramGeonaItemType = Window.Location.getParameter(GeoportalDataViewerConstants.GET_GEONA_ITEM_TYPE);
paramGeonaItemID = Window.Location.getParameter(GeoportalDataViewerConstants.GET_GEONA_ITEM_ID);
paramLayerTitle = Window.Location.getParameter(GeoportalDataViewerConstants.GET_LAYER_TITLE);
GWT.log(GeoportalDataViewerConstants.GET_WMS_PARAMETER + " = " + paramWmsRequest);
GWT.log(GeoportalDataViewerConstants.GET_GEONA_ITEM_TYPE + " = " + paramGeonaItemType);
GWT.log(GeoportalDataViewerConstants.GET_GEONA_ITEM_ID + " = " + paramGeonaItemID);
GWT.log(GeoportalDataViewerConstants.GET_LAYER_TITLE + " = " + paramLayerTitle);
RootPanel.get(APP_DIV).add(loaderApp); // Fields configurations are read on open collection event
GeoportalDataViewerServiceAsync.Util.getInstance().listOfFieldsForSearching(new AsyncCallback<List<ItemField>>() { mainPanel = new GeonaDataViewMainPanel(applicationBus, getClientHeight(),null,null,null);
@Override
public void onFailure(Throwable caught) {
Window.alert(caught.getMessage());
}
@Override
public void onSuccess(List<ItemField> result) {
GWT.log("Loaded item fields: "+result);
for (ItemField itemField : result) {
if(itemField.isDisplayAsResult()) {
displayFields.add(itemField);
}
if(itemField.isSearchable()) {
searchByFields.add(itemField);
}
if(itemField.isSortable()) {
sortByFields.add(itemField);
}
}
GWT.log("List display fields: "+result);
SearchingFilter initialSortFilter = new SearchingFilter();
initialSortFilter.setOrder(ORDER.ASC);
initialSortFilter.setOrderByFields(Arrays.asList(new ItemField("Name", Arrays.asList("name"), true, true, true)));
mainPanel = new GeonaDataViewMainPanel(applicationBus, getClientHeight(),sortByFields,searchByFields,initialSortFilter);
RootPanel.get(APP_DIV).add(mainPanel); RootPanel.get(APP_DIV).add(mainPanel);
initApplication(); initApplication();
}
});
} }
@ -196,14 +121,16 @@ public class GeoportalDataViewer implements EntryPoint {
@Override @Override
public void onSuccess(List<BaseMapLayer> listBaseMapLayers) { public void onSuccess(List<BaseMapLayer> listBaseMapLayers) {
// ?? Maybe remove after load collection / project?
try { try {
RootPanel.get(APP_DIV).remove(loaderApp); RootPanel.get(APP_DIV).remove(loaderApp);
}catch (Exception e) { }catch (Exception e) {
loaderApp.setVisible(false); loaderApp.setVisible(false);
} }
GeoportalDataViewer.listBaseMapLayers = listBaseMapLayers;
//now the map is loaded and I'm sure that I can load the GeonaDataViewer Profile //now the map is loaded and I'm sure that I can load the GeonaDataViewer Profile
loadGeonaDataViewerProfile(); GeoportalDataViewer.listBaseMapLayers = listBaseMapLayers;
mainPanel.setBaseLayers(listBaseMapLayers); mainPanel.setBaseLayers(listBaseMapLayers);
BaseMapLayer firstBaseLayer = listBaseMapLayers.get(0); BaseMapLayer firstBaseLayer = listBaseMapLayers.get(0);
@ -218,6 +145,20 @@ public class GeoportalDataViewer implements EntryPoint {
ScriptInjector.fromUrl("//cdnjs.cloudflare.com/ajax/libs/nanogallery2/3.0.5/jquery.nanogallery2.min.js") ScriptInjector.fromUrl("//cdnjs.cloudflare.com/ajax/libs/nanogallery2/3.0.5/jquery.nanogallery2.min.js")
.setWindow(ScriptInjector.TOP_WINDOW).inject(); .setWindow(ScriptInjector.TOP_WINDOW).inject();
if(!startParameters.toOpenCollections().isEmpty()){
// Fire
}
if(!startParameters.toOpenProjects().isEmpty()){
// open projects by projectID list
}
if(!startParameters.toOpenLayers().isEmpty()){
}
} }
@ -243,65 +184,65 @@ public class GeoportalDataViewer implements EntryPoint {
return listBaseMapLayers; return listBaseMapLayers;
} }
private void loadGeonaDataViewerProfile() { // private void loadGeonaDataViewerProfile() {
//
Scheduler.get().scheduleDeferred(new ScheduledCommand() { // Scheduler.get().scheduleDeferred(new ScheduledCommand() {
//
@Override // @Override
public void execute() { // public void execute() {
GeoportalDataViewerServiceAsync.Util.getInstance() // GeoportalDataViewerServiceAsync.Util.getInstance()
.getGeoNaDataViewProfile(new AsyncCallback<GNADataViewerConfigProfile>() { // .getGeoNaDataViewProfile(new AsyncCallback<GNADataViewerConfigProfile>() {
//
@Override // @Override
public void onFailure(Throwable caught) { // public void onFailure(Throwable caught) {
Window.alert(caught.getMessage()); // Window.alert(caught.getMessage());
//
} // }
//
@Override // @Override
public void onSuccess(GNADataViewerConfigProfile profile) { // public void onSuccess(GNADataViewerConfigProfile profile) {
geonaDataViewerProfile = profile; // geonaDataViewerProfile = profile;
GWT.log("Profile: " + geonaDataViewerProfile); // GWT.log("Profile: " + geonaDataViewerProfile);
Iterator<String> it; // Iterator<String> it;
String theItemType = paramGeonaItemType; // String theItemType = paramGeonaItemType;
if (theItemType == null) { // if (theItemType == null) {
it = geonaDataViewerProfile.getMapLayers().keySet().iterator(); // it = geonaDataViewerProfile.getMapLayers().keySet().iterator();
it.hasNext(); // it.hasNext();
theItemType = it.next(); // theItemType = it.next();
} // }
//
LayerItem layerItem = geonaDataViewerProfile.getMapLayers().get(theItemType); // LayerItem layerItem = geonaDataViewerProfile.getMapLayers().get(theItemType);
//
if (layerItem == null) { // if (layerItem == null) {
Window.alert("Not detected any layer with type: " + theItemType); // Window.alert("Not detected any layer with type: " + theItemType);
return; // return;
} // }
//
GWT.log("ON module load The layerItem is: " + layerItem); // GWT.log("ON module load The layerItem is: " + layerItem);
String layerName = URLUtil.getValueOfParameter("layers", layerItem.getWmsLink()); // String layerName = URLUtil.getValueOfParameter("layers", layerItem.getWmsLink());
layerItem.setName(layerName); // layerItem.setName(layerName);
layerManager.setBaseLayerFromIsProfile(layerItem); // layerManager.setBaseLayerFromIsProfile(layerItem);
layerManager.addLayer(theItemType, null, null, layerItem.getWmsLink(), false, false, // layerManager.addLayer(theItemType, null, null, layerItem.getWmsLink(), false, false,
null, false, null, null, null); // null, false, null, null, null);
//
if (paramGeonaItemID != null) { // if (paramGeonaItemID != null) {
if (paramGeonaItemType == null) { // if (paramGeonaItemType == null) {
Window.alert( // Window.alert(
"Missing parameter " + GeoportalDataViewerConstants.GET_GEONA_ITEM_TYPE // "Missing parameter " + GeoportalDataViewerConstants.GET_GEONA_ITEM_TYPE
+ " (GeoNa Data Type) where to search the item id: " // + " (GeoNa Data Type) where to search the item id: "
+ paramGeonaItemID); // + paramGeonaItemID);
return; // return;
} // }
GeoNaItemRef gir = new GeoNaItemRef(paramGeonaItemID, paramGeonaItemType); // GeoNaItemRef gir = new GeoNaItemRef(paramGeonaItemID, paramGeonaItemType);
applicationBus.fireEvent(new ShowDetailsEvent(gir, null, null)); // applicationBus.fireEvent(new ShowDetailsEvent(gir, null, null));
} // }
//
} // }
}); // });
} // }
}); // });
//
} // }
/** /**
* Update window size. * Update window size.
@ -322,15 +263,19 @@ public class GeoportalDataViewer implements EntryPoint {
return rootHeight; return rootHeight;
} }
//************************************************************************************************************************
/** /**
* Bind events. * Bind events.
*/ */
private void bindEvents() { private void bindEvents() {
applicationBus.addHandler(ShowDetailsEvent.TYPE, new ShowDetailsEventHandler() {
@Override //
public void onShowDetails(ShowDetailsEvent showDetailsEvent) { applicationBus.addHandler(ShowDetailsEvent.TYPE, showDetailsEvent -> {
GWT.log("Fired event: " + showDetailsEvent); GWT.log("Fired event: " + showDetailsEvent);
String geonaMongoId = showDetailsEvent.getGeonaMongoID(); String geonaMongoId = showDetailsEvent.getGeonaMongoID();
@ -346,65 +291,60 @@ public class GeoportalDataViewer implements EntryPoint {
if (!found) { if (!found) {
if (showDetailsEvent.getGeonaItemType().equalsIgnoreCase("Concessione")) { // if (showDetailsEvent.getGeonaItemType().equalsIgnoreCase("Concessione")) {
//
GeoportalDataViewerServiceAsync.Util.getInstance().getConcessioneForId(geonaMongoId, // GeoportalDataViewerServiceAsync.Util.getInstance().getConcessioneForId(geonaMongoId,
new AsyncCallback<ConcessioneDV>() { // new AsyncCallback<ConcessioneDV>() {
//
@Override // @Override
public void onFailure(Throwable caught) { // public void onFailure(Throwable caught) {
Window.alert(caught.getMessage()); // Window.alert(caught.getMessage());
mainPanel.hidePanelDetails(); // mainPanel.hidePanelDetails();
//
} // }
//
@Override // @Override
public void onSuccess(ConcessioneDV concessioneDV) { // public void onSuccess(ConcessioneDV concessioneDV) {
GWT.log("Showing: " + concessioneDV); // GWT.log("Showing: " + concessioneDV);
mainPanel.showAsDetails(concessioneDV, showDetailsEvent.getGeonaItemRef()); // mainPanel.showAsDetails(concessioneDV, showDetailsEvent.getGeonaItemRef());
// }
// });
// }
} }
}); });
}
}
}
}); applicationBus.addHandler(AddedLayerToMapEvent.TYPE, addedLayerToMapEvent -> {
applicationBus.addHandler(AddedLayerToMapEvent.TYPE, new AddedLayerToMapEventHandler() {
@Override
public void onLayerRendered(AddedLayerToMapEvent addedLayerToMapEvent) {
GWT.log("Fired AddedLayerToMapEvent " + addedLayerToMapEvent.getLayerItem() + "layer type: "+addedLayerToMapEvent.getLayerType()); GWT.log("Fired AddedLayerToMapEvent " + addedLayerToMapEvent.getLayerItem() + "layer type: "+addedLayerToMapEvent.getLayerType());
try { try {
attempt = 0; attempt = 0;
if (paramGeonaItemID != null) { // if (paramGeonaItemID != null) {
// waiting for record retrieved by service before calling the WFS // // waiting for record retrieved by service before calling the WFS
final int MAX_RETRY = 15; // final int MAX_RETRY = 15;
Timer timer = new com.google.gwt.user.client.Timer() { // Timer timer = new com.google.gwt.user.client.Timer() {
@Override // @Override
public void run() { // public void run() {
attempt++; // attempt++;
GWT.log("waiting get record: " + attempt); // GWT.log("waiting get record: " + attempt);
RecordDV record = mainPanel.getDisplayedRecord(); // RecordDV record = mainPanel.getDisplayedRecord();
if (record != null) { // if (record != null) {
this.cancel(); // this.cancel();
GWT.log("cancelled timer"); // GWT.log("cancelled timer");
performWFSQueryOnCentroid(record); // OGCUtils.performWFSQueryOnCentroid(record);
} // }
//
if (attempt > MAX_RETRY) { // if (attempt > MAX_RETRY) {
GWT.log("MAX_RETRY reached, cancelled timer"); // GWT.log("MAX_RETRY reached, cancelled timer");
this.cancel(); // this.cancel();
} // }
//
} // }
}; // };
timer.scheduleRepeating(1000); // timer.scheduleRepeating(1000);
//
} // }
} catch (Exception e) { } catch (Exception e) {
// TODO: handle exception // TODO: handle exception
} }
@ -426,48 +366,27 @@ public class GeoportalDataViewer implements EntryPoint {
} }
} }
}
}); });
applicationBus.addHandler(ZoomOutOverMinimumEvent.TYPE, new ZoomOutOverMinimumEventHandler() { applicationBus.addHandler(ZoomOutOverMinimumEvent.TYPE, zoomOutEvent -> {
@Override
public void onZoomOut(ZoomOutOverMinimumEvent zoomOutEvent) {
if (mainPanel.getDisplayedRecord() == null && !olMapMng.isQueryPointActive()) { if (mainPanel.getDisplayedRecord() == null && !olMapMng.isQueryPointActive()) {
olMapMng.hidePopInfo(); olMapMng.hidePopInfo();
layerManager.removeAllDetailLayers(); layerManager.removeAllDetailLayers();
} }
mainPanel.hideOverlayLayers(); mainPanel.hideOverlayLayers();
// layerManager.getOverlayLayerManager().hide(); // layerManager.getOverlayLayerManager().hide();
// hidePopupLayers(); // hidePopupLayers();
}
}); });
applicationBus.addHandler(ClosedViewDetailsEvent.TYPE, new ClosedViewDetailsEventHandler() {
@Override applicationBus.addHandler(ClosedViewDetailsEvent.TYPE, closedViewDetailsEvent -> olMapMng.hidePopInfo());
public void onClosed(ClosedViewDetailsEvent closedViewDetailsEvent) {
olMapMng.hidePopInfo(); applicationBus.addHandler(MapExtentToEvent.TYPE, mapExtentToEvent -> {// TODO Auto-generated method stub
}
}); });
applicationBus.addHandler(MapExtentToEvent.TYPE, new MapExtentToEventHandler() { applicationBus.addHandler(DoActionOnDetailLayersEvent.TYPE, doLayerActionEvent -> {
@Override
public void onExtentEvent(MapExtentToEvent mapExtentToEvent) {
// TODO Auto-generated method stub
}
});
applicationBus.addHandler(DoActionOnDetailLayersEvent.TYPE, new DoActionOnDetailLayersEventHandler() {
@Override
public void onDoActionOnDetailLayers(DoActionOnDetailLayersEvent doLayerActionEvent) {
DO_LAYER_ACTION doAction = doLayerActionEvent.getDoAction(); DO_LAYER_ACTION doAction = doLayerActionEvent.getDoAction();
GWT.log("event: "+doAction); GWT.log("event: "+doAction);
@ -499,14 +418,10 @@ public class GeoportalDataViewer implements EntryPoint {
break; break;
} }
}
}); });
applicationBus.addHandler(ChangeMapLayerEvent.TYPE, new ChangeMapLayerEventHandler() { applicationBus.addHandler(ChangeBaseMapLayerEvent.TYPE, changeMapLayerEvent -> {
@Override
public void onChangeBaseMapLayer(ChangeMapLayerEvent changeMapLayerEvent) {
BaseMapLayer baseLayer = changeMapLayerEvent.getBaseMapLayer(); BaseMapLayer baseLayer = changeMapLayerEvent.getBaseMapLayer();
@ -523,29 +438,19 @@ public class GeoportalDataViewer implements EntryPoint {
} else } else
attributionDiv.setHTML(""); attributionDiv.setHTML("");
}
}); });
applicationBus.addHandler(ShowPopupOnCentroiEvent.TYPE, new ShowPopupOnCentroiEventHandler() { applicationBus.addHandler(ShowPopupOnCentroiEvent.TYPE, showPopupOnCentroiEvent -> {
@Override
public void onShowPopup(ShowPopupOnCentroiEvent showPopupOnCentroiEvent) {
if(showPopupOnCentroiEvent.getRecord()!=null) if(showPopupOnCentroiEvent.getRecord()!=null)
performWFSQueryOnCentroid(showPopupOnCentroiEvent.getRecord()); OGCUtils.performWFSQueryOnCentroid(showPopupOnCentroiEvent.getRecord());
}
}); });
applicationBus.addHandler(SearchPerformedEvent.TYPE, new SearchPerformedEventHandler() { applicationBus.addHandler(SearchPerformedEvent.TYPE, searchPerformedEvent -> {
@Override
public void onSearchDone(SearchPerformedEvent searchPerformedEvent) {
if(searchPerformedEvent!=null) { if(searchPerformedEvent!=null) {
LinkedHashMap<String, Image> wmsMap = olMapMng.getOLMap().getWmsLayerMap(); LinkedHashMap<String, Image> wmsMap = olMapMng.getOLMap().getWmsLayerMap();
String firstWMSKey = wmsMap.keySet().iterator().next(); String firstWMSKey = wmsMap.keySet().iterator().next();
List<ConcessioneDV> result = searchPerformedEvent.getData(); List<ConcessioneDV> result = searchPerformedEvent.getData();
@ -569,55 +474,9 @@ public class GeoportalDataViewer implements EntryPoint {
} }
}
}); });
} }
// /**
// * Handler popu closer.
// *
// * @param divId the div id
// * @param overlayId the overlay id
// */
// public static native void handlerPopuCloser(String divId, String overlayId) /*-{
// var closer = $doc.getElementById(divId);
// var overlay = $doc.getElementById(overlayId);
// closer.onclick = function() {
// overlay.setPosition(undefined);
// closer.blur();
// return false;
// };
//
// }-*/;
private void performWFSQueryOnCentroid(RecordDV record) {
if (record != null) {
GWT.log("record instanceof ConcessioneDV: " + (record instanceof ConcessioneDV) + " with mongo item id: "
+ record.getItemId());
// GeoportalDataViewerConstants.print("record instanceof ConcessioneDV: "
// +(record instanceof ConcessioneDV));
if (record instanceof ConcessioneDV) {
ConcessioneDV concessioneDV = (ConcessioneDV) record;
Double x = concessioneDV.getCentroidLong();
Double y = concessioneDV.getCentroidLat();
GWT.log("X: " + x + ", Y:" + y);
if (x != null && y != null) {
Coordinate transfCoord = MapUtils.transformCoordiante(new Coordinate(x, y),
MAP_PROJECTION.EPSG_4326.getName(), MAP_PROJECTION.EPSG_3857.getName());
GeoQuery select = olMapMng.toDataPointQuery(transfCoord, false);
GWT.log("GeoQuery: " + select);
// GeoportalDataViewerConstants.print("fireEvent QueryDataEvent");
ExtentWrapped toExt = new ExtentWrapped(transfCoord.getX(), transfCoord.getY(), transfCoord.getX(),
transfCoord.getY());
layerManager.getLayerManagerBus().fireEvent(new QueryDataEvent(select, toExt, record.getItemId(),
true, MapEventType.ADDED_CENTROID_LAYER_TO_MAP));
} else {
GeoportalDataViewerConstants.printJs(
"I cannot select the point one or both coordiantes are null. X: " + x + ", Y:" + y);
}
}
}
}
} }

View File

@ -17,13 +17,13 @@ import org.gcube.application.geoportalcommon.shared.products.model.UploadedImage
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants.LayerType; import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants.LayerType;
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants.MAP_PROJECTION; import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants.MAP_PROJECTION;
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants.MapEventType; import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants.MapEventType;
import org.gcube.portlets.user.geoportaldataviewer.client.events.AddedLayerToMapEvent; import org.gcube.portlets.user.geoportaldataviewer.client.events.application.AddedLayerToMapEvent;
import org.gcube.portlets.user.geoportaldataviewer.client.events.AddedLayerToMapEventHandler; import org.gcube.portlets.user.geoportaldataviewer.client.events.application.AddedLayerToMapEventHandler;
import org.gcube.portlets.user.geoportaldataviewer.client.events.QueryDataEvent; import org.gcube.portlets.user.geoportaldataviewer.client.events.QueryDataEvent;
import org.gcube.portlets.user.geoportaldataviewer.client.events.QueryDataEventHandler; import org.gcube.portlets.user.geoportaldataviewer.client.events.QueryDataEventHandler;
import org.gcube.portlets.user.geoportaldataviewer.client.events.ShowDetailsEvent; import org.gcube.portlets.user.geoportaldataviewer.client.events.application.ShowDetailsEvent;
import org.gcube.portlets.user.geoportaldataviewer.client.events.ZoomOutOverMinimumEvent; import org.gcube.portlets.user.geoportaldataviewer.client.events.application.ZoomOutOverMinimumEvent;
import org.gcube.portlets.user.geoportaldataviewer.client.events.ZoomOutOverMinimumEventHandler; import org.gcube.portlets.user.geoportaldataviewer.client.events.application.ZoomOutOverMinimumEventHandler;
import org.gcube.portlets.user.geoportaldataviewer.client.gis.ExtentWrapped; import org.gcube.portlets.user.geoportaldataviewer.client.gis.ExtentWrapped;
import org.gcube.portlets.user.geoportaldataviewer.client.gis.MapUtils; import org.gcube.portlets.user.geoportaldataviewer.client.gis.MapUtils;
import org.gcube.portlets.user.geoportaldataviewer.client.gis.OpenLayerMap; import org.gcube.portlets.user.geoportaldataviewer.client.gis.OpenLayerMap;

View File

@ -3,7 +3,7 @@ package org.gcube.portlets.user.geoportaldataviewer.client;
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants.MAP_PROJECTION; import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants.MAP_PROJECTION;
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants.MapEventType; import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants.MapEventType;
import org.gcube.portlets.user.geoportaldataviewer.client.events.QueryDataEvent; import org.gcube.portlets.user.geoportaldataviewer.client.events.QueryDataEvent;
import org.gcube.portlets.user.geoportaldataviewer.client.events.ZoomOutOverMinimumEvent; import org.gcube.portlets.user.geoportaldataviewer.client.events.application.ZoomOutOverMinimumEvent;
import org.gcube.portlets.user.geoportaldataviewer.client.gis.ExtentWrapped; import org.gcube.portlets.user.geoportaldataviewer.client.gis.ExtentWrapped;
import org.gcube.portlets.user.geoportaldataviewer.client.gis.MapUtils; import org.gcube.portlets.user.geoportaldataviewer.client.gis.MapUtils;
import org.gcube.portlets.user.geoportaldataviewer.client.gis.OpenLayerMap; import org.gcube.portlets.user.geoportaldataviewer.client.gis.OpenLayerMap;

View File

@ -0,0 +1,69 @@
package org.gcube.portlets.user.geoportaldataviewer.client;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.Window;
import lombok.Getter;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Set;
@Getter
class StartParameters {
public StartParameters(Map<String, List<String>> parameters) {
if (parameters == null || parameters.isEmpty())
GWT.log("!!!! NB : NO QUERY PARAMETERS");
else {
paramWmsRequest = getFirst(parameters, GeoportalDataViewerConstants.GET_WMS_PARAMETER);
paramLayerTitle = Window.Location.getParameter(GeoportalDataViewerConstants.GET_LAYER_TITLE);
paramGeonaItemType = Window.Location.getParameter(GeoportalDataViewerConstants.GET_GEONA_ITEM_TYPE);
paramGeonaItemID = Window.Location.getParameter(GeoportalDataViewerConstants.GET_GEONA_ITEM_ID);
}
}
// retro usage?
/** WMS Link -> Layer Name [optional]*/
public Map<String,String> toOpenLayers() {
return Collections.emptyMap();
}
public Set<String> toOpenCollections(){
return Collections.emptySet();
}
public Set<String> toOpenProjects(){
return Collections.emptySet();
}
private String getFirst(Map<String, List<String>> parameters, String key) {
List<String> values = parameters.get(key);
if (values != null && !values.isEmpty()) {
GWT.log("Param " + key + "Getting First value of : " + values);
return values.get(0);
} else return null;
}
/**
* The param wms request.
*/
private String paramWmsRequest;
/**
* The param UUID.
*/
// private String paramUUID;
private String paramGeonaItemType;
/**
* The param layer title.
*/
private String paramLayerTitle;
private String paramGeonaItemID;
}

View File

@ -0,0 +1,18 @@
package org.gcube.portlets.user.geoportaldataviewer.client.events;
import com.google.gwt.event.shared.GwtEvent;
import org.gcube.portlets.user.geoportaldataviewer.client.events.application.MapExtentToEventHandler;
public class OpenCollectionsEvent extends GwtEvent<OpenCollectionsEventHandler> {
public static Type<MapExtentToEventHandler> TYPE = new Type<MapExtentToEventHandler>();
@Override
public Type<OpenCollectionsEventHandler> getAssociatedType() {
return null;
}
@Override
protected void dispatch(OpenCollectionsEventHandler h) {
h.
}
}

View File

@ -0,0 +1,8 @@
package org.gcube.portlets.user.geoportaldataviewer.client.events;
import com.google.gwt.event.shared.EventHandler;
public interface OpenCollectionsEventHandler extends EventHandler {
}

View File

@ -1,4 +1,4 @@
package org.gcube.portlets.user.geoportaldataviewer.client.events; package org.gcube.portlets.user.geoportaldataviewer.client.events.application;
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.LayerItem; import org.gcube.portlets.user.geoportaldataviewer.shared.gis.LayerItem;

View File

@ -1,4 +1,4 @@
package org.gcube.portlets.user.geoportaldataviewer.client.events; package org.gcube.portlets.user.geoportaldataviewer.client.events.application;
import com.google.gwt.event.shared.EventHandler; import com.google.gwt.event.shared.EventHandler;

View File

@ -1,18 +1,18 @@
package org.gcube.portlets.user.geoportaldataviewer.client.events; package org.gcube.portlets.user.geoportaldataviewer.client.events.application;
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.BaseMapLayer; import org.gcube.portlets.user.geoportaldataviewer.shared.gis.BaseMapLayer;
import com.google.gwt.event.shared.GwtEvent; import com.google.gwt.event.shared.GwtEvent;
/** /**
* The Class ChangeMapLayerEvent. * The Class ChangeBaseMapLayerEvent.
* *
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it * @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
* *
* Nov 12, 2021 * Nov 12, 2021
*/ */
public class ChangeMapLayerEvent extends GwtEvent<ChangeMapLayerEventHandler> { public class ChangeBaseMapLayerEvent extends GwtEvent<ChangeBaseMapLayerEventHandler> {
public static Type<ChangeMapLayerEventHandler> TYPE = new Type<ChangeMapLayerEventHandler>(); public static Type<ChangeBaseMapLayerEventHandler> TYPE = new Type<ChangeBaseMapLayerEventHandler>();
private BaseMapLayer baseMapLayer; private BaseMapLayer baseMapLayer;
/** /**
@ -20,7 +20,7 @@ public class ChangeMapLayerEvent extends GwtEvent<ChangeMapLayerEventHandler> {
* *
* @param baseMapLayer the base map layer * @param baseMapLayer the base map layer
*/ */
public ChangeMapLayerEvent(BaseMapLayer baseMapLayer) { public ChangeBaseMapLayerEvent(BaseMapLayer baseMapLayer) {
this.baseMapLayer = baseMapLayer; this.baseMapLayer = baseMapLayer;
} }
@ -31,7 +31,7 @@ public class ChangeMapLayerEvent extends GwtEvent<ChangeMapLayerEventHandler> {
* @return the associated type * @return the associated type
*/ */
@Override @Override
public Type<ChangeMapLayerEventHandler> getAssociatedType() { public Type<ChangeBaseMapLayerEventHandler> getAssociatedType() {
return TYPE; return TYPE;
} }
@ -41,7 +41,7 @@ public class ChangeMapLayerEvent extends GwtEvent<ChangeMapLayerEventHandler> {
* @param handler the handler * @param handler the handler
*/ */
@Override @Override
protected void dispatch(ChangeMapLayerEventHandler handler) { protected void dispatch(ChangeBaseMapLayerEventHandler handler) {
handler.onChangeBaseMapLayer(this); handler.onChangeBaseMapLayer(this);
} }

View File

@ -1,20 +1,20 @@
package org.gcube.portlets.user.geoportaldataviewer.client.events; package org.gcube.portlets.user.geoportaldataviewer.client.events.application;
import com.google.gwt.event.shared.EventHandler; import com.google.gwt.event.shared.EventHandler;
/** /**
* The Interface ChangeMapLayerEventHandler. * The Interface ChangeBaseMapLayerEventHandler.
* *
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it * @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
* *
* Nov 12, 2021 * Nov 12, 2021
*/ */
public interface ChangeMapLayerEventHandler extends EventHandler { public interface ChangeBaseMapLayerEventHandler extends EventHandler {
/** /**
* On change base map layer. * On change base map layer.
* *
* @param changeMapLayerEvent the change map layer event * @param changeMapLayerEvent the change map layer event
*/ */
void onChangeBaseMapLayer(ChangeMapLayerEvent changeMapLayerEvent); void onChangeBaseMapLayer(ChangeBaseMapLayerEvent changeMapLayerEvent);
} }

View File

@ -1,4 +1,4 @@
package org.gcube.portlets.user.geoportaldataviewer.client.events; package org.gcube.portlets.user.geoportaldataviewer.client.events.application;
import com.google.gwt.event.shared.GwtEvent; import com.google.gwt.event.shared.GwtEvent;

View File

@ -1,4 +1,4 @@
package org.gcube.portlets.user.geoportaldataviewer.client.events; package org.gcube.portlets.user.geoportaldataviewer.client.events.application;
import com.google.gwt.event.shared.EventHandler; import com.google.gwt.event.shared.EventHandler;

View File

@ -1,4 +1,4 @@
package org.gcube.portlets.user.geoportaldataviewer.client.events; package org.gcube.portlets.user.geoportaldataviewer.client.events.application;
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.LayerItem; import org.gcube.portlets.user.geoportaldataviewer.shared.gis.LayerItem;

View File

@ -1,4 +1,4 @@
package org.gcube.portlets.user.geoportaldataviewer.client.events; package org.gcube.portlets.user.geoportaldataviewer.client.events.application;
import com.google.gwt.event.shared.EventHandler; import com.google.gwt.event.shared.EventHandler;

View File

@ -1,4 +1,4 @@
package org.gcube.portlets.user.geoportaldataviewer.client.events; package org.gcube.portlets.user.geoportaldataviewer.client.events.application;
import org.gcube.portlets.user.geoportaldataviewer.client.ui.map.ExtentMapUtil.Location; import org.gcube.portlets.user.geoportaldataviewer.client.ui.map.ExtentMapUtil.Location;

View File

@ -1,4 +1,4 @@
package org.gcube.portlets.user.geoportaldataviewer.client.events; package org.gcube.portlets.user.geoportaldataviewer.client.events.application;
import com.google.gwt.event.shared.EventHandler; import com.google.gwt.event.shared.EventHandler;

View File

@ -1,4 +1,4 @@
package org.gcube.portlets.user.geoportaldataviewer.client.events; package org.gcube.portlets.user.geoportaldataviewer.client.events.application;
import java.util.List; import java.util.List;

View File

@ -1,4 +1,4 @@
package org.gcube.portlets.user.geoportaldataviewer.client.events; package org.gcube.portlets.user.geoportaldataviewer.client.events.application;
import com.google.gwt.event.shared.EventHandler; import com.google.gwt.event.shared.EventHandler;

View File

@ -1,4 +1,4 @@
package org.gcube.portlets.user.geoportaldataviewer.client.events; package org.gcube.portlets.user.geoportaldataviewer.client.events.application;
import org.gcube.application.geoportalcommon.shared.GeoNaItemRef; import org.gcube.application.geoportalcommon.shared.GeoNaItemRef;
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.wfs.FeatureRow; import org.gcube.portlets.user.geoportaldataviewer.shared.gis.wfs.FeatureRow;

View File

@ -1,4 +1,4 @@
package org.gcube.portlets.user.geoportaldataviewer.client.events; package org.gcube.portlets.user.geoportaldataviewer.client.events.application;
import com.google.gwt.event.shared.EventHandler; import com.google.gwt.event.shared.EventHandler;
@ -18,4 +18,5 @@ public interface ShowDetailsEventHandler extends EventHandler {
* @param showDetailsEvent the show details event * @param showDetailsEvent the show details event
*/ */
void onShowDetails(ShowDetailsEvent showDetailsEvent); void onShowDetails(ShowDetailsEvent showDetailsEvent);
} }

View File

@ -1,4 +1,4 @@
package org.gcube.portlets.user.geoportaldataviewer.client.events; package org.gcube.portlets.user.geoportaldataviewer.client.events.application;
import org.gcube.application.geoportalcommon.shared.products.model.RecordDV; import org.gcube.application.geoportalcommon.shared.products.model.RecordDV;

View File

@ -1,4 +1,4 @@
package org.gcube.portlets.user.geoportaldataviewer.client.events; package org.gcube.portlets.user.geoportaldataviewer.client.events.application;
import com.google.gwt.event.shared.EventHandler; import com.google.gwt.event.shared.EventHandler;

View File

@ -1,4 +1,4 @@
package org.gcube.portlets.user.geoportaldataviewer.client.events; package org.gcube.portlets.user.geoportaldataviewer.client.events.application;
import com.google.gwt.event.shared.GwtEvent; import com.google.gwt.event.shared.GwtEvent;

View File

@ -1,4 +1,4 @@
package org.gcube.portlets.user.geoportaldataviewer.client.events; package org.gcube.portlets.user.geoportaldataviewer.client.events.application;
import com.google.gwt.event.shared.EventHandler; import com.google.gwt.event.shared.EventHandler;

View File

@ -5,9 +5,9 @@ import java.util.LinkedHashMap;
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants; import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants;
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants.MAP_PROJECTION; import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants.MAP_PROJECTION;
import org.gcube.portlets.user.geoportaldataviewer.client.events.AddedLayerToMapEvent; import org.gcube.portlets.user.geoportaldataviewer.client.events.application.AddedLayerToMapEvent;
import org.gcube.portlets.user.geoportaldataviewer.client.events.AddedLayerToMapEvent.LAYER_TYPE; import org.gcube.portlets.user.geoportaldataviewer.client.events.application.AddedLayerToMapEvent.LAYER_TYPE;
import org.gcube.portlets.user.geoportaldataviewer.client.events.DoActionOnDetailLayersEvent.SwapLayer; import org.gcube.portlets.user.geoportaldataviewer.client.events.application.DoActionOnDetailLayersEvent.SwapLayer;
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.BaseMapLayer; import org.gcube.portlets.user.geoportaldataviewer.shared.gis.BaseMapLayer;
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.LayerItem; import org.gcube.portlets.user.geoportaldataviewer.shared.gis.LayerItem;

View File

@ -3,7 +3,7 @@ package org.gcube.portlets.user.geoportaldataviewer.client.ui;
import org.gcube.application.geoportalcommon.shared.GeoNaItemRef; import org.gcube.application.geoportalcommon.shared.GeoNaItemRef;
import org.gcube.application.geoportalcommon.shared.products.ConcessioneDV; import org.gcube.application.geoportalcommon.shared.products.ConcessioneDV;
import org.gcube.application.geoportalcommon.shared.products.model.RecordDV; import org.gcube.application.geoportalcommon.shared.products.model.RecordDV;
import org.gcube.portlets.user.geoportaldataviewer.client.events.ClosedViewDetailsEvent; import org.gcube.portlets.user.geoportaldataviewer.client.events.application.ClosedViewDetailsEvent;
import org.gcube.portlets.user.geoportaldataviewer.client.ui.products.concessioni.ConcessioneView; import org.gcube.portlets.user.geoportaldataviewer.client.ui.products.concessioni.ConcessioneView;
import com.github.gwtbootstrap.client.ui.Button; import com.github.gwtbootstrap.client.ui.Button;

View File

@ -8,8 +8,8 @@ import org.gcube.application.geoportalcommon.shared.SearchingFilter;
import org.gcube.application.geoportalcommon.shared.products.ConcessioneDV; import org.gcube.application.geoportalcommon.shared.products.ConcessioneDV;
import org.gcube.application.geoportalcommon.shared.products.model.RecordDV; import org.gcube.application.geoportalcommon.shared.products.model.RecordDV;
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants.MAP_PROJECTION; import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants.MAP_PROJECTION;
import org.gcube.portlets.user.geoportaldataviewer.client.events.ChangeMapLayerEvent; import org.gcube.portlets.user.geoportaldataviewer.client.events.application.ChangeBaseMapLayerEvent;
import org.gcube.portlets.user.geoportaldataviewer.client.events.MapExtentToEvent; import org.gcube.portlets.user.geoportaldataviewer.client.events.application.MapExtentToEvent;
import org.gcube.portlets.user.geoportaldataviewer.client.gis.OpenLayerMap; import org.gcube.portlets.user.geoportaldataviewer.client.gis.OpenLayerMap;
import org.gcube.portlets.user.geoportaldataviewer.client.resources.GNAIcons; import org.gcube.portlets.user.geoportaldataviewer.client.resources.GNAIcons;
import org.gcube.portlets.user.geoportaldataviewer.client.resources.GNAImages; import org.gcube.portlets.user.geoportaldataviewer.client.resources.GNAImages;
@ -413,7 +413,7 @@ public class GeonaDataViewMainPanel extends Composite {
@Override @Override
public void onValueChange(ValueChangeEvent<Boolean> event) { public void onValueChange(ValueChangeEvent<Boolean> event) {
applicationBus.fireEvent(new ChangeMapLayerEvent(baseMapLayer)); applicationBus.fireEvent(new ChangeBaseMapLayerEvent(baseMapLayer));
} }
}); });

View File

@ -16,9 +16,9 @@ import org.gcube.application.geoportalcommon.shared.WhereClause;
import org.gcube.application.geoportalcommon.shared.products.ConcessioneDV; import org.gcube.application.geoportalcommon.shared.products.ConcessioneDV;
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants; import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants;
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerServiceAsync; import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerServiceAsync;
import org.gcube.portlets.user.geoportaldataviewer.client.events.SearchPerformedEvent; import org.gcube.portlets.user.geoportaldataviewer.client.events.application.SearchPerformedEvent;
import org.gcube.portlets.user.geoportaldataviewer.client.events.ShowDetailsEvent; import org.gcube.portlets.user.geoportaldataviewer.client.events.application.ShowDetailsEvent;
import org.gcube.portlets.user.geoportaldataviewer.client.events.ShowPopupOnCentroiEvent; import org.gcube.portlets.user.geoportaldataviewer.client.events.application.ShowPopupOnCentroiEvent;
import org.gcube.portlets.user.geoportaldataviewer.client.util.LoaderIcon; import org.gcube.portlets.user.geoportaldataviewer.client.util.LoaderIcon;
import org.gcube.portlets.user.geoportaldataviewer.client.util.StringUtil; import org.gcube.portlets.user.geoportaldataviewer.client.util.StringUtil;

View File

@ -1,9 +1,9 @@
package org.gcube.portlets.user.geoportaldataviewer.client.ui.dandd; package org.gcube.portlets.user.geoportaldataviewer.client.ui.dandd;
import org.gcube.application.geoportalcommon.shared.products.BaseConcessioneDV; import org.gcube.application.geoportalcommon.shared.products.BaseConcessioneDV;
import org.gcube.portlets.user.geoportaldataviewer.client.events.DoActionOnDetailLayersEvent; import org.gcube.portlets.user.geoportaldataviewer.client.events.application.DoActionOnDetailLayersEvent;
import org.gcube.portlets.user.geoportaldataviewer.client.events.DoActionOnDetailLayersEvent.DO_LAYER_ACTION; import org.gcube.portlets.user.geoportaldataviewer.client.events.application.DoActionOnDetailLayersEvent.DO_LAYER_ACTION;
import org.gcube.portlets.user.geoportaldataviewer.client.events.DoActionOnDetailLayersEvent.SwapLayer; import org.gcube.portlets.user.geoportaldataviewer.client.events.application.DoActionOnDetailLayersEvent.SwapLayer;
import org.gcube.portlets.user.geoportaldataviewer.client.resources.GNAImages; import org.gcube.portlets.user.geoportaldataviewer.client.resources.GNAImages;
import org.gcube.portlets.user.geoportaldataviewer.client.util.StringUtil; import org.gcube.portlets.user.geoportaldataviewer.client.util.StringUtil;
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.LayerItem; import org.gcube.portlets.user.geoportaldataviewer.shared.gis.LayerItem;

View File

@ -1,7 +1,7 @@
package org.gcube.portlets.user.geoportaldataviewer.client.ui.dandd; package org.gcube.portlets.user.geoportaldataviewer.client.ui.dandd;
import org.gcube.portlets.user.geoportaldataviewer.client.events.DoActionOnDetailLayersEvent; import org.gcube.portlets.user.geoportaldataviewer.client.events.application.DoActionOnDetailLayersEvent;
import org.gcube.portlets.user.geoportaldataviewer.client.events.DoActionOnDetailLayersEvent.DO_LAYER_ACTION; import org.gcube.portlets.user.geoportaldataviewer.client.events.application.DoActionOnDetailLayersEvent.DO_LAYER_ACTION;
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.LayerItem; import org.gcube.portlets.user.geoportaldataviewer.shared.gis.LayerItem;
import com.google.gwt.core.client.GWT; import com.google.gwt.core.client.GWT;

View File

@ -0,0 +1,46 @@
package org.gcube.portlets.user.geoportaldataviewer.client.util;
import com.google.gwt.core.client.GWT;
import ol.Coordinate;
import org.gcube.application.geoportalcommon.shared.products.ConcessioneDV;
import org.gcube.application.geoportalcommon.shared.products.model.RecordDV;
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants;
import org.gcube.portlets.user.geoportaldataviewer.client.events.QueryDataEvent;
import org.gcube.portlets.user.geoportaldataviewer.client.gis.ExtentWrapped;
import org.gcube.portlets.user.geoportaldataviewer.client.gis.MapUtils;
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.GeoQuery;
public class OGCUtils {
public static void performWFSQueryOnCentroid(RecordDV record) {
GWT.log("WFS Query for : "+record);
if (record != null) {
// GWT.log("record instanceof ConcessioneDV: " + (record instanceof ConcessioneDV) + " with mongo item id: "
// + record.getItemId());
// GeoportalDataViewerConstants.print("record instanceof ConcessioneDV: "
// +(record instanceof ConcessioneDV));
// if (record instanceof ConcessioneDV) {
// ConcessioneDV concessioneDV = (ConcessioneDV) record;
// Double x = concessioneDV.getCentroidLong();
// Double y = concessioneDV.getCentroidLat();
// GWT.log("X: " + x + ", Y:" + y);
// if (x != null && y != null) {
// Coordinate transfCoord = MapUtils.transformCoordiante(new Coordinate(x, y),
// GeoportalDataViewerConstants.MAP_PROJECTION.EPSG_4326.getName(), GeoportalDataViewerConstants.MAP_PROJECTION.EPSG_3857.getName());
// GeoQuery select = olMapMng.toDataPointQuery(transfCoord, false);
// GWT.log("GeoQuery: " + select);
// // GeoportalDataViewerConstants.print("fireEvent QueryDataEvent");
// ExtentWrapped toExt = new ExtentWrapped(transfCoord.getX(), transfCoord.getY(), transfCoord.getX(),
// transfCoord.getY());
// layerManager.getLayerManagerBus().fireEvent(new QueryDataEvent(select, toExt, record.getItemId(),
// true, GeoportalDataViewerConstants.MapEventType.ADDED_CENTROID_LAYER_TO_MAP));
// } else {
// GeoportalDataViewerConstants.printJs(
// "I cannot select the point one or both coordiantes are null. X: " + x + ", Y:" + y);
// }
// }
}
}
}

View File

@ -0,0 +1,12 @@
package org.gcube.portlets.user.geoportaldataviewer.shared;
import lombok.Data;
import java.io.Serializable;
//@Data
public class GCubeCollection implements Serializable {
// private Document ucd;
// private List<IndexLayer> indexes;
}