revisited the init logic
This commit is contained in:
parent
38f6a2da03
commit
9d87dc8299
|
@ -1,7 +1,6 @@
|
|||
package org.gcube.portlets.user.geoportaldataviewer.client;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import org.gcube.portlets.user.geoportaldataviewer.client.events.ShowDetailsEvent;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.client.events.ShowDetailsEventHandler;
|
||||
|
@ -9,9 +8,7 @@ import org.gcube.portlets.user.geoportaldataviewer.client.gis.MapUtils;
|
|||
import org.gcube.portlets.user.geoportaldataviewer.client.gis.OpenLayerOSM;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.client.ui.GeonaDataViewMainPanel;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.GeoNaDataViewerProfile;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.ProductType;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.LayerItem;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.wfs.FeatureRow;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.products.ConcessioneDV;
|
||||
|
||||
import com.github.gwtbootstrap.client.ui.Tab;
|
||||
|
@ -60,8 +57,7 @@ public class GeoportalDataViewer implements EntryPoint {
|
|||
/** The param UUID. */
|
||||
private String paramUUID;
|
||||
|
||||
/** The param UUID. */
|
||||
private String layerType;
|
||||
private String geonaItemType;
|
||||
|
||||
/** The param layer title. */
|
||||
private String paramLayerTitle;
|
||||
|
@ -70,6 +66,10 @@ public class GeoportalDataViewer implements EntryPoint {
|
|||
|
||||
/** The layer manager. */
|
||||
private LayerManager layerManager = new LayerManager(eventBus);
|
||||
|
||||
private String geonaItemID;
|
||||
|
||||
private GeoNaDataViewerProfile geonaDataViewerProfile;
|
||||
|
||||
//https://data.d4science.org/gis-viewer-app/?wmsrequest=https%3A%2F%2Fgeona-proto.d4science.org%2Fgeoserver%2Fconcessioni_conf%2Fwms%3Fservice%3DWMS%26version%3D1.1.0%26request%3DGetMap%26layers%3Dconcessioni_conf%3Acentroids_concessioni%26styles%3D%26bbox%3D8.476%2C39.179%2C17.391%2C45.772%26width%3D768%26height%3D567%26srs%3DEPSG%3A4326%26format%3Dapplication%2Fopenlayers&zoom=6¢ermap=12.45%2C42.98
|
||||
|
||||
|
@ -109,11 +109,13 @@ public class GeoportalDataViewer implements EntryPoint {
|
|||
// });
|
||||
|
||||
paramWmsRequest = Window.Location.getParameter(GeoportalDataViewerConstants.GET_WMS_PARAMETER);
|
||||
layerType = Window.Location.getParameter(GeoportalDataViewerConstants.GET_DISPLAY_LAYER_TYPE);
|
||||
geonaItemType = Window.Location.getParameter(GeoportalDataViewerConstants.GET_GEONA_ITEM_TYPE);
|
||||
paramUUID = Window.Location.getParameter(GeoportalDataViewerConstants.GET_UUID_PARAMETER);
|
||||
geonaItemID = 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_DISPLAY_LAYER_TYPE + " = " + layerType);
|
||||
GWT.log(GeoportalDataViewerConstants.GET_GEONA_ITEM_TYPE + " = " + geonaItemType);
|
||||
GWT.log(GeoportalDataViewerConstants.GET_GEONA_ITEM_ID + " = " + geonaItemID);
|
||||
GWT.log(GeoportalDataViewerConstants.GET_UUID_PARAMETER + " = " + paramUUID);
|
||||
GWT.log(GeoportalDataViewerConstants.GET_LAYER_TITLE + " = " + paramLayerTitle);
|
||||
|
||||
|
@ -131,140 +133,130 @@ public class GeoportalDataViewer implements EntryPoint {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(GeoNaDataViewerProfile result) {
|
||||
GWT.log("Profile: "+result);
|
||||
public void onSuccess(GeoNaDataViewerProfile profile) {
|
||||
geonaDataViewerProfile = profile;
|
||||
GWT.log("Profile: "+geonaDataViewerProfile);
|
||||
Iterator<String> it;
|
||||
if(layerType==null) {
|
||||
it = result.getMapLayers().keySet().iterator();
|
||||
if(geonaItemType==null) {
|
||||
it = geonaDataViewerProfile.getMapLayers().keySet().iterator();
|
||||
it.hasNext();
|
||||
layerType= it.next();
|
||||
geonaItemType= it.next();
|
||||
}
|
||||
|
||||
LayerItem layerItem = result.getMapLayers().get(layerType);
|
||||
LayerItem layerItem = geonaDataViewerProfile.getMapLayers().get(geonaItemType);
|
||||
|
||||
if(layerItem==null) {
|
||||
Window.alert("Not detected any layer with type: "+layerType);
|
||||
Window.alert("Not detected any layer with type: "+geonaItemType);
|
||||
return;
|
||||
}
|
||||
GWT.log("The layerItem is: "+layerItem);
|
||||
layerManager.addLayerByWmsRequest(null, null, layerItem.getWmsLink(), false, false, null, true);
|
||||
layerManager.addLayer(geonaItemType, null, null, layerItem.getWmsLink(), false, false, null, true);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// if (paramWmsRequest != null && !paramWmsRequest.isEmpty()) {
|
||||
//
|
||||
// try {
|
||||
// //wmsRequestConverter.addRequestToGisViewer(paramWmsRequest, paramLayerTitle, paramUUID);
|
||||
// //FIND BASE URL
|
||||
// /*int indexStart = paramWmsRequest.indexOf("?");
|
||||
// String url;
|
||||
// if(indexStart>=0){
|
||||
// url = paramWmsRequest.substring(0, indexStart); //get only base uri
|
||||
// url = url.trim(); //string trim
|
||||
// }else{
|
||||
// Window.alert("Bad wms request '?' not found!");
|
||||
//// throw new Exception("Bad server request '?' not found!");
|
||||
// }
|
||||
//
|
||||
// String layerName = URLUtil.getValueOfParameter("layers", paramWmsRequest);
|
||||
// String displayName = paramLayerTitle==null || paramLayerTitle.isEmpty()?layerName:paramLayerTitle;
|
||||
// Scheduler.get().scheduleDeferred(new ScheduledCommand() {
|
||||
//
|
||||
// @Override
|
||||
// public void execute() {
|
||||
// layerManager.addLayerByWmsRequest(displayName, layerName, paramWmsRequest, false, false, paramUUID, true);
|
||||
//
|
||||
// }
|
||||
// });*/
|
||||
// Scheduler.get().scheduleDeferred(new ScheduledCommand() {
|
||||
//
|
||||
// @Override
|
||||
// public void execute() {
|
||||
// GWT.log("qui");
|
||||
// GeoportalDataViewerServiceAsync.Util.getInstance().getGeoNaDataViewProfile(new AsyncCallback<GeoNaDataViewerProfile>() {
|
||||
//
|
||||
// @Override
|
||||
// public void onFailure(Throwable caught) {
|
||||
// Window.alert(caught.getMessage());
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onSuccess(GeoNaDataViewerProfile result) {
|
||||
// GWT.log("Profile: "+result);
|
||||
// Iterator<String> it;
|
||||
// if(layerType==null) {
|
||||
// it = result.getMapLayers().keySet().iterator();
|
||||
// it.hasNext();
|
||||
// layerType= it.next();
|
||||
// }
|
||||
// layerManager.addLayerByType(layerType);
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// });
|
||||
//
|
||||
//
|
||||
// } catch (Exception e) {
|
||||
// GWT.log("An error occurred on adding wmsrequest :" + paramWmsRequest, e);
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// }
|
||||
|
||||
bindEvents();
|
||||
}
|
||||
|
||||
/**
|
||||
* Bind events.
|
||||
*/
|
||||
private void bindEvents() {
|
||||
// eventBus.addHandler(ShowDetailsEvent.TYPE, new ShowDetailsEventHandler() {
|
||||
//
|
||||
// @Override
|
||||
// public void onShowDetails(ShowDetailsEvent showDetailsEvent) {
|
||||
// GWT.log("Fired event: "+showDetailsEvent);
|
||||
// FeatureRow fRow = showDetailsEvent.getFeatureRow();
|
||||
// if(fRow!=null) {
|
||||
// if(showDetailsEvent.getProductType().equals(ProductType.CONCESSIONE)) {
|
||||
// List<String> productIds = fRow.getMapProperties().get("product_id");
|
||||
// if(productIds!=null && productIds.size()>0) {
|
||||
// long id = Long.parseLong(productIds.get(0));
|
||||
// String tabName = "Dettagli Prodotto";
|
||||
// List<String> listName = fRow.getMapProperties().get("nome");
|
||||
// if(listName!=null && listName.size()>0) {
|
||||
// tabName = listName.get(0);
|
||||
// }
|
||||
//
|
||||
// boolean found = mainPanel.selectTabForProductId(id);
|
||||
// GWT.log("Product with id: "+id+" found? "+found);
|
||||
// if(!found) {
|
||||
//
|
||||
// final Tab theTab = mainPanel.addAsTab(tabName, true, null);
|
||||
// GeoportalDataViewerServiceAsync.Util.getInstance().getConcessioneForId(id, new AsyncCallback<ConcessioneDV>() {
|
||||
//
|
||||
// @Override
|
||||
// public void onFailure(Throwable caught) {
|
||||
// Window.alert(caught.getMessage());
|
||||
// theTab.clear();
|
||||
// theTab.setIcon(IconType.WARNING_SIGN);
|
||||
// theTab.add(new HTML(caught.getMessage()));
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onSuccess(ConcessioneDV result) {
|
||||
// GWT.log("Showing: "+result);
|
||||
// mainPanel.renderProductIntoTab(theTab, result);
|
||||
//
|
||||
// }
|
||||
// });
|
||||
// }else
|
||||
// Window.alert("No product id found");
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// });
|
||||
|
||||
eventBus.addHandler(ShowDetailsEvent.TYPE, new ShowDetailsEventHandler() {
|
||||
|
||||
@Override
|
||||
public void onShowDetails(ShowDetailsEvent showDetailsEvent) {
|
||||
GWT.log("Fired event: "+showDetailsEvent);
|
||||
FeatureRow fRow = showDetailsEvent.getFeatureRow();
|
||||
if(fRow!=null) {
|
||||
if(showDetailsEvent.getProductType().equals(ProductType.CONCESSIONE)) {
|
||||
List<String> productIds = fRow.getMapProperties().get("product_id");
|
||||
if(productIds!=null && productIds.size()>0) {
|
||||
long id = Long.parseLong(productIds.get(0));
|
||||
String tabName = "Dettagli Prodotto";
|
||||
List<String> listName = fRow.getMapProperties().get("nome");
|
||||
if(listName!=null && listName.size()>0) {
|
||||
tabName = listName.get(0);
|
||||
}
|
||||
|
||||
boolean found = mainPanel.selectTabForProductId(id);
|
||||
GWT.log("Product with id: "+id+" found? "+found);
|
||||
if(!found) {
|
||||
|
||||
final Tab theTab = mainPanel.addAsTab(tabName, true, null);
|
||||
GeoportalDataViewerServiceAsync.Util.getInstance().getConcessioneForId(id, new AsyncCallback<ConcessioneDV>() {
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
Window.alert(caught.getMessage());
|
||||
theTab.clear();
|
||||
theTab.setIcon(IconType.WARNING_SIGN);
|
||||
theTab.add(new HTML(caught.getMessage()));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(ConcessioneDV result) {
|
||||
GWT.log("Showing: "+result);
|
||||
mainPanel.renderProductIntoTab(theTab, result);
|
||||
|
||||
}
|
||||
});
|
||||
}else
|
||||
Window.alert("No product id found");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Long id = showDetailsEvent.getGeonaID();
|
||||
|
||||
if(id==null) {
|
||||
Window.alert("Item Id not found");
|
||||
return;
|
||||
}
|
||||
|
||||
String tabName = showDetailsEvent.getItemName()==null?"Dettagli Prodotto":showDetailsEvent.getItemName();
|
||||
|
||||
boolean found = mainPanel.selectTabForProductId(id);
|
||||
GWT.log("Product with id: "+id+" found? "+found);
|
||||
if(!found) {
|
||||
|
||||
if(showDetailsEvent.getGeonaItemType().equalsIgnoreCase("Concessione")) {
|
||||
|
||||
final Tab theTab = mainPanel.addAsTab(tabName, true, null);
|
||||
GeoportalDataViewerServiceAsync.Util.getInstance().getConcessioneForId(id, new AsyncCallback<ConcessioneDV>() {
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
Window.alert(caught.getMessage());
|
||||
theTab.clear();
|
||||
theTab.setIcon(IconType.WARNING_SIGN);
|
||||
theTab.add(new HTML(caught.getMessage()));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(ConcessioneDV result) {
|
||||
GWT.log("Showing: "+result);
|
||||
mainPanel.renderProductIntoTab(theTab, result);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
|
|
@ -10,7 +10,8 @@ public class GeoportalDataViewerConstants {
|
|||
public static final String MAP_DIV = "map";
|
||||
|
||||
public static final String GET_WMS_PARAMETER = "wmsrequest";
|
||||
public static final String GET_DISPLAY_LAYER_TYPE = "dlt";
|
||||
public static final String GET_GEONA_ITEM_TYPE = "git";
|
||||
public static final String GET_GEONA_ITEM_ID = "gid";
|
||||
public static final String GET_UUID_PARAMETER = "uuid";
|
||||
public static final String GET_LAYER_TITLE = "layertitle";
|
||||
public static final String GET_MAX_ZOOM_LEVEL = OpenLayersMapParameters.OL_MAP_PARAM.maxzoomlevel.name();
|
||||
|
|
|
@ -5,7 +5,7 @@ import java.util.List;
|
|||
import org.gcube.portlets.user.geoportaldataviewer.shared.GeoNaDataObject;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.GeoNaDataViewerProfile;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.BoundsMap;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.LayerItem;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.LayerObject;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.wms.GeoInformationForWMSRequest;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.products.ConcessioneDV;
|
||||
|
||||
|
@ -20,7 +20,7 @@ public interface GeoportalDataViewerService extends RemoteService {
|
|||
|
||||
GeoInformationForWMSRequest parseWmsRequest(String wmsRequest, String layerName) throws Exception;
|
||||
|
||||
List<GeoNaDataObject> getDataResult(List<LayerItem> layerItems, String mapSrsName, BoundsMap mapBBOX,
|
||||
List<GeoNaDataObject> getDataResult(List<LayerObject> layerObjects, String mapSrsName, BoundsMap mapBBOX,
|
||||
int maxWFSFeature, double zoomLevel);
|
||||
|
||||
ConcessioneDV getConcessioneForId(Long id) throws Exception;
|
||||
|
|
|
@ -5,7 +5,7 @@ import java.util.List;
|
|||
import org.gcube.portlets.user.geoportaldataviewer.shared.GeoNaDataObject;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.GeoNaDataViewerProfile;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.BoundsMap;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.LayerItem;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.LayerObject;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.wms.GeoInformationForWMSRequest;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.products.ConcessioneDV;
|
||||
|
||||
|
@ -33,7 +33,7 @@ public interface GeoportalDataViewerServiceAsync {
|
|||
|
||||
void parseWmsRequest(String wmsRequest, String layerName, AsyncCallback<GeoInformationForWMSRequest> callback);
|
||||
|
||||
void getDataResult(List<LayerItem> layerItems, String mapSrsName, BoundsMap mapBBOX, int maxWFSFeature, double zoomLevel,
|
||||
void getDataResult(List<LayerObject> layerObjects, String mapSrsName, BoundsMap mapBBOX, int maxWFSFeature, double zoomLevel,
|
||||
AsyncCallback<List<GeoNaDataObject>> callback);
|
||||
|
||||
void getConcessioneForId(Long id, AsyncCallback<ConcessioneDV> callback);
|
||||
|
|
|
@ -15,10 +15,10 @@ import org.gcube.portlets.user.geoportaldataviewer.client.events.ShowDetailsEven
|
|||
import org.gcube.portlets.user.geoportaldataviewer.client.gis.OpenLayerOSM;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.client.util.URLUtil;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.GeoNaDataObject;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.ProductType;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.BoundsMap;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.GeoQuery;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.LayerItem;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.LayerObject;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.wfs.FeatureRow;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.wms.GeoInformationForWMSRequest;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.wms.ZAxis;
|
||||
|
@ -55,9 +55,8 @@ public class LayerManager {
|
|||
|
||||
/** The ol map. */
|
||||
private OpenLayerOSM olMap;
|
||||
|
||||
/** The layer items. */
|
||||
private List<LayerItem> layerItems = new ArrayList<LayerItem>();
|
||||
|
||||
private List<LayerObject> layerObjects = new ArrayList<LayerObject>();
|
||||
|
||||
private HandlerManager eventBus = new HandlerManager("");
|
||||
|
||||
|
@ -88,9 +87,9 @@ public class LayerManager {
|
|||
GeoQuery selectDataInfo = queryEvent.getGeoQuery();
|
||||
GWT.log("("+selectDataInfo.getX1()+","+selectDataInfo.getY1()+")("+selectDataInfo.getX2()+","+selectDataInfo.getY2()+")");
|
||||
|
||||
for (LayerItem layerItem : layerItems){
|
||||
for (LayerObject layerObj : layerObjects){
|
||||
//TODO
|
||||
isLayerVisible(layerItem);
|
||||
isLayerVisible(layerObj.getLayerItem());
|
||||
|
||||
}
|
||||
|
||||
|
@ -126,29 +125,30 @@ public class LayerManager {
|
|||
|
||||
GWT.log("Bounds is: "+mapBBOX);
|
||||
|
||||
GeoportalDataViewerServiceAsync.Util.getInstance().getDataResult(layerItems, olMap.getProjectionCode(), mapBBOX, GeoportalDataViewerConstants.MAX_WFS_FEATURES, olMap.getCurrentZoomLevel(), new AsyncCallback<List<GeoNaDataObject>>() {
|
||||
GeoportalDataViewerServiceAsync.Util.getInstance().getDataResult(layerObjects, olMap.getProjectionCode(), mapBBOX, GeoportalDataViewerConstants.MAX_WFS_FEATURES, olMap.getCurrentZoomLevel(), new AsyncCallback<List<GeoNaDataObject>>() {
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(List<GeoNaDataObject> result) {
|
||||
public void onSuccess(List<GeoNaDataObject> listGeonaDataObjects) {
|
||||
|
||||
if(result==null || result.isEmpty())
|
||||
GWT.log("GeoNaDataObject's: "+listGeonaDataObjects);
|
||||
|
||||
if(listGeonaDataObjects==null || listGeonaDataObjects.isEmpty())
|
||||
return;
|
||||
|
||||
GWT.log("Data result: "+result);
|
||||
|
||||
|
||||
FlexTable flex = new FlexTable();
|
||||
flex.setCellPadding(1);
|
||||
flex.setCellSpacing(1);
|
||||
flex.getElement().addClassName("popup-table");
|
||||
boolean featureFound = false;
|
||||
FeatureRow feature = null;
|
||||
for (GeoNaDataObject geoNaDataObject : result) {
|
||||
for (GeoNaDataObject geoNaDataObject : listGeonaDataObjects) {
|
||||
List<FeatureRow> features = geoNaDataObject.getFeatures();
|
||||
|
||||
|
||||
//USING ONLY THE FIRST FEATURE IN THE LIST
|
||||
if(features!=null && features.size()>0) {
|
||||
feature = features.get(0);
|
||||
Map<String, List<String>> entries = features.get(0).getMapProperties();
|
||||
|
@ -165,93 +165,99 @@ public class LayerManager {
|
|||
}
|
||||
|
||||
featureFound = true;
|
||||
break; //Only the first one
|
||||
//break; //Only the first one
|
||||
}
|
||||
}
|
||||
FeatureRow theFeature = feature;
|
||||
Button button = null;
|
||||
if(!featureFound) {
|
||||
flex.setHTML(0, 0, new HTML("No data available").toString());
|
||||
}else {
|
||||
button = new Button("Open Details");
|
||||
button.getElement().setId("open-details");
|
||||
button.setType(ButtonType.LINK);
|
||||
}
|
||||
|
||||
VerticalPanel vpPanel = new VerticalPanel();
|
||||
vpPanel.add(flex);
|
||||
|
||||
if(button!=null) {
|
||||
vpPanel.add(button);
|
||||
button.setType(ButtonType.LINK);
|
||||
button.addClickHandler(new ClickHandler() {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
applicationBus.fireEvent(new ShowDetailsEvent(ProductType.CONCESSIONE, theFeature));
|
||||
|
||||
GWT.log("The selected Feature is: "+feature);
|
||||
FeatureRow theFeature = feature;
|
||||
Button button = null;
|
||||
if(!featureFound) {
|
||||
flex.setHTML(0, 0, new HTML("No data available").toString());
|
||||
}else {
|
||||
button = new Button("Open Details");
|
||||
button.getElement().setId("open-details");
|
||||
button.setType(ButtonType.LINK);
|
||||
}
|
||||
|
||||
VerticalPanel vpPanel = new VerticalPanel();
|
||||
vpPanel.add(flex);
|
||||
|
||||
if(button!=null) {
|
||||
vpPanel.add(button);
|
||||
button.setType(ButtonType.LINK);
|
||||
button.addClickHandler(new ClickHandler() {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
ShowDetailsEvent toEvent = parseGeonaReferences(geoNaDataObject.getSourceLayerObject().getItemType(), theFeature);
|
||||
applicationBus.fireEvent(toEvent);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
olMap.showPopup(vpPanel.toString(), queryEvent.getoLCoordinate());
|
||||
|
||||
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
Element buttonElement = DOM.getElementById("open-details");
|
||||
Event.sinkEvents(buttonElement, Event.ONCLICK);
|
||||
Event.setEventListener(buttonElement, new EventListener() {
|
||||
|
||||
@Override
|
||||
public void onBrowserEvent(Event event) {
|
||||
if(Event.ONCLICK == event.getTypeInt()) {
|
||||
ShowDetailsEvent toEvent = parseGeonaReferences(geoNaDataObject.getSourceLayerObject().getItemType(), theFeature);
|
||||
applicationBus.fireEvent(toEvent);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
olMap.showPopup(vpPanel.toString(), queryEvent.getoLCoordinate());
|
||||
|
||||
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
Element buttonElement = DOM.getElementById("open-details");
|
||||
Event.sinkEvents(buttonElement, Event.ONCLICK);
|
||||
Event.setEventListener(buttonElement, new EventListener() {
|
||||
|
||||
@Override
|
||||
public void onBrowserEvent(Event event) {
|
||||
if(Event.ONCLICK == event.getTypeInt()) {
|
||||
applicationBus.fireEvent(new ShowDetailsEvent(ProductType.CONCESSIONE, theFeature));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Adds the layer by wms.
|
||||
*
|
||||
* @param layerTitle the layer title
|
||||
* @param layerName the layer name
|
||||
* @param wmsRequest the wms request
|
||||
* @param isBase the is base
|
||||
* @param UUID the uuid
|
||||
*/
|
||||
public void addLayerByWms(String layerTitle, String layerName, String wmsRequest, boolean isBase, String UUID) {
|
||||
|
||||
boolean displayInLayerSwitcher = false;
|
||||
if(isBase)
|
||||
displayInLayerSwitcher = true;
|
||||
|
||||
addLayerByWmsRequest(layerTitle, layerName, wmsRequest, isBase, displayInLayerSwitcher, UUID, true);
|
||||
}
|
||||
|
||||
|
||||
private ShowDetailsEvent parseGeonaReferences(String itemType, FeatureRow fRow) {
|
||||
if(fRow==null)
|
||||
return null;
|
||||
|
||||
List<String> productIds = fRow.getMapProperties().get("product_id");
|
||||
if(productIds!=null && productIds.size()>0) {
|
||||
long id = Long.parseLong(productIds.get(0));
|
||||
String itemName = "Dettagli Prodotto";
|
||||
List<String> listName = fRow.getMapProperties().get("nome");
|
||||
if(listName!=null && listName.size()>0) {
|
||||
itemName = listName.get(0);
|
||||
}
|
||||
|
||||
return new ShowDetailsEvent(itemType, id, itemName, fRow);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Adds the layer by wms request.
|
||||
* Adds the layer.
|
||||
*
|
||||
* @param geonaItemType the geona item type
|
||||
* @param layerTitle the layer title
|
||||
* @param layerName the layer name
|
||||
* @param wmsRequest the wms request
|
||||
* @param wmsLink the wms link
|
||||
* @param isBase the is base
|
||||
* @param displayInLayerSwitcher the display in layer switcher
|
||||
* @param UUID the uuid
|
||||
* @param onTop the on top
|
||||
*/
|
||||
public void addLayerByWmsRequest(final String layerTitle, final String layerName, final String wmsRequest, final boolean isBase,final boolean displayInLayerSwitcher, final String UUID, final boolean onTop) {
|
||||
public void addLayer(final String geonaItemType, final String layerTitle, final String layerName, final String wmsLink, final boolean isBase,final boolean displayInLayerSwitcher, final String UUID, final boolean onTop) {
|
||||
|
||||
// final LayoutContainer westPanel = (LayoutContainer) layersPanel.getParent();
|
||||
//
|
||||
|
@ -262,7 +268,7 @@ public class LayerManager {
|
|||
|
||||
final LayerType featureType = isBase?LayerType.RASTER_BASELAYER:LayerType.FEATURE_TYPE;
|
||||
// Info.display("Adding Layer", layerName);
|
||||
GeoportalDataViewerServiceAsync.Util.getInstance().parseWmsRequest(wmsRequest, layerName, new AsyncCallback<GeoInformationForWMSRequest>() {
|
||||
GeoportalDataViewerServiceAsync.Util.getInstance().parseWmsRequest(wmsLink, layerName, new AsyncCallback<GeoInformationForWMSRequest>() {
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
|
@ -271,40 +277,24 @@ public class LayerManager {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(GeoInformationForWMSRequest result) {
|
||||
public void onSuccess(GeoInformationForWMSRequest geoInfoWMS) {
|
||||
|
||||
GWT.log("Add Layer By WMS: "+result.getWmsRequest() + ", and isNCWMS? "+result.isNcWMS());
|
||||
addLayerByWms(featureType, layerTitle, result.getLayerName(), result.getWmsRequest(), result.getBaseWmsServiceHost(), true, isBase, displayInLayerSwitcher, (ArrayList<String>) result.getStyles().getGeoStyles(), result.getWmsRequest(), false, result.getMapWMSNoStandard(), result.isNcWMS(), UUID, result.getZAxis());
|
||||
GWT.log("Parsed WMS Request returned: "+geoInfoWMS);
|
||||
//ddLayerByWms(featureType, layerTitle, result.getLayerName(), result.getWmsRequest(), result.getBaseWmsServiceHost(), true, isBase, displayInLayerSwitcher, (ArrayList<String>) result.getStyles().getGeoStyles(), result.getWmsRequest(), false, result.getMapWMSNoStandard(), result.isNcWMS(), UUID, result.getZAxis());
|
||||
|
||||
LayerItem layerItem = toLayerItem(featureType, layerTitle, geoInfoWMS.getLayerName(), geoInfoWMS.getWmsRequest(), geoInfoWMS.getBaseWmsServiceHost(), true, isBase, displayInLayerSwitcher, (ArrayList<String>) geoInfoWMS.getStyles().getGeoStyles(), geoInfoWMS.getWmsRequest(), false, geoInfoWMS.getMapWMSNoStandard(), geoInfoWMS.isNcWMS(), UUID, geoInfoWMS.getZAxis());
|
||||
LayerObject lo = new LayerObject();
|
||||
lo.setLayerItem(layerItem);
|
||||
lo.setItemType(geonaItemType);
|
||||
layerObjects.add(lo);
|
||||
olMap.addWMSLayer(layerItem.getMapServerHost(), layerItem.getName());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// public void addLayerByType(String layerType) {
|
||||
//
|
||||
// final boolean isBase = false;
|
||||
// final LayerType featureType = isBase?LayerType.RASTER_BASELAYER:LayerType.FEATURE_TYPE;
|
||||
// boolean displayInLayerSwitcher = false;
|
||||
// GeoportalDataViewerServiceAsync.Util.getInstance().getLayerForType(layerType, new AsyncCallback<GeoInformationForWMSRequest>() {
|
||||
//
|
||||
// @Override
|
||||
// public void onFailure(Throwable caught) {
|
||||
// Window.alert(caught.getMessage());
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onSuccess(GeoInformationForWMSRequest result) {
|
||||
// GWT.log("Add Layer By WMS: "+result.getMapWMSNoStandard() + ", and isNCWMS? "+result.isNcWMS());
|
||||
// addLayerByWms(featureType, result.getLayerName(), result.getLayerName(), result.getWmsRequest(), result.getBaseWmsServiceHost(), true, isBase, displayInLayerSwitcher, (ArrayList<String>) result.getStyles().getGeoStyles(), result.getWmsRequest(), false, result.getMapWMSNoStandard(), result.isNcWMS(), null, result.getZAxis());
|
||||
//
|
||||
// }
|
||||
// });
|
||||
//
|
||||
// }
|
||||
|
||||
/**
|
||||
* Adds the layer by wms.
|
||||
* To layer item.
|
||||
*
|
||||
* @param layerType the layer type
|
||||
* @param layerTitle the layer title
|
||||
|
@ -321,8 +311,9 @@ public class LayerManager {
|
|||
* @param isNcWms the is nc wms
|
||||
* @param UUID the uuid
|
||||
* @param zAxis the z axis
|
||||
* @return the layer item
|
||||
*/
|
||||
private void addLayerByWms(LayerType layerType, String layerTitle, String layerName, String layerURL, String mapServerHost, boolean isExternal, boolean isBase, boolean displayInLayerSwitcher, ArrayList<String> styles, String wmsLink, boolean onTop, HashMap<String, String> wmsNotStandardParams, boolean isNcWms, String UUID, ZAxis zAxis) {
|
||||
private LayerItem toLayerItem(LayerType layerType, String layerTitle, String layerName, String layerURL, String mapServerHost, boolean isExternal, boolean isBase, boolean displayInLayerSwitcher, ArrayList<String> styles, String wmsLink, boolean onTop, HashMap<String, String> wmsNotStandardParams, boolean isNcWms, String UUID, ZAxis zAxis) {
|
||||
|
||||
// GWT.log("Add addLayerByWms 1");
|
||||
LayerItem layerItem = new LayerItem();
|
||||
|
@ -376,15 +367,10 @@ public class LayerManager {
|
|||
}
|
||||
}
|
||||
GWT.log("Built layer: "+layerItem);
|
||||
layerItems.add(layerItem);
|
||||
olMap.addWMSLayer(layerItem.getMapServerHost(), layerName);
|
||||
|
||||
// openLayersMap.addLayerItemByWms(l, displayInLayerSwitcher);
|
||||
// layersPanel.addLayerItems(layerItems, onTop);
|
||||
// layersPanel.updateLayersOrder();
|
||||
return layerItem;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Checks if is layer visible.
|
||||
*
|
||||
|
@ -414,10 +400,4 @@ public class LayerManager {
|
|||
return eventBus;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,29 +1,38 @@
|
|||
package org.gcube.portlets.user.geoportaldataviewer.client.events;
|
||||
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.ProductType;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.wfs.FeatureRow;
|
||||
|
||||
import com.google.gwt.event.shared.GwtEvent;
|
||||
|
||||
|
||||
/**
|
||||
* The Class QueryDataEvent.
|
||||
* The Class ShowDetailsEvent.
|
||||
*
|
||||
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
|
||||
*
|
||||
* Oct 29, 2020
|
||||
* Nov 13, 2020
|
||||
*/
|
||||
public class ShowDetailsEvent extends GwtEvent<ShowDetailsEventHandler> {
|
||||
public static Type<ShowDetailsEventHandler> TYPE = new Type<ShowDetailsEventHandler>();
|
||||
private ProductType productType;
|
||||
private String geonaItemType;
|
||||
private FeatureRow featureRow;
|
||||
private Long geonaID;
|
||||
private String itemName;
|
||||
|
||||
|
||||
/**
|
||||
* Instantiates a new table row selected event.
|
||||
* @param coordinate
|
||||
* Instantiates a new show details event.
|
||||
*
|
||||
* @param geonaItemType the geona item type
|
||||
* @param geonaID the geona ID
|
||||
* @param itemName the item name
|
||||
* @param featureRow the feature row
|
||||
*/
|
||||
public ShowDetailsEvent(ProductType productType, FeatureRow row) {
|
||||
this.productType = productType;
|
||||
this.featureRow = row;
|
||||
public ShowDetailsEvent(String geonaItemType, long geonaID, String itemName, FeatureRow featureRow) {
|
||||
this.geonaItemType = geonaItemType;
|
||||
this.geonaID = geonaID;
|
||||
this.itemName = itemName;
|
||||
this.featureRow = featureRow;
|
||||
|
||||
}
|
||||
|
||||
|
@ -47,12 +56,53 @@ public class ShowDetailsEvent extends GwtEvent<ShowDetailsEventHandler> {
|
|||
handler.onShowDetails(this);
|
||||
|
||||
}
|
||||
|
||||
public ProductType getProductType() {
|
||||
return productType;
|
||||
|
||||
/**
|
||||
* Gets the geona item type.
|
||||
*
|
||||
* @return the geona item type
|
||||
*/
|
||||
public String getGeonaItemType() {
|
||||
return geonaItemType;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the feature row.
|
||||
*
|
||||
* @return the feature row
|
||||
*/
|
||||
public FeatureRow getFeatureRow() {
|
||||
return featureRow;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the geona ID.
|
||||
*
|
||||
* @return the geona ID
|
||||
*/
|
||||
public Long getGeonaID() {
|
||||
return geonaID;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the item name.
|
||||
*
|
||||
* @return the item name
|
||||
*/
|
||||
public String getItemName() {
|
||||
return itemName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the item name.
|
||||
*
|
||||
* @param itemName the new item name
|
||||
*/
|
||||
public void setItemName(String itemName) {
|
||||
this.itemName = itemName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -196,6 +196,7 @@ public class OpenLayerOSM {
|
|||
|
||||
|
||||
public void showPopup(String html, Coordinate coordinate) {
|
||||
GWT.log("Showing popup on: "+coordinate);
|
||||
if(popupOverlay==null) {
|
||||
Element elPopup = DOM.getElementById("popup");
|
||||
elPopup.getStyle().setVisibility(Visibility.VISIBLE);
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package org.gcube.portlets.user.geoportaldataviewer.server;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
@ -17,6 +18,8 @@ import org.gcube.portlets.user.geoportaldataviewer.shared.GeoNaDataObject;
|
|||
import org.gcube.portlets.user.geoportaldataviewer.shared.GeoNaDataViewerProfile;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.BoundsMap;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.LayerItem;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.LayerObject;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.wfs.FeatureRow;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.wms.GeoInformationForWMSRequest;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.wms.Styles;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.wms.ZAxis;
|
||||
|
@ -103,30 +106,35 @@ public class GeoportalDataViewerServiceImpl extends RemoteServiceServlet impleme
|
|||
throw new Exception(msg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the data result.
|
||||
*
|
||||
* @param layerItems the layer items
|
||||
* @param layerObjects the layer objects
|
||||
* @param mapSrsName the map srs name
|
||||
* @param selectBBOX the select BBOX
|
||||
* @param maxWFSFeature the max WFS feature
|
||||
* @param zoomLevel the zoom level
|
||||
* @return the data result
|
||||
*/
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.gcube.portlets.user.gisviewer.client.GisViewerService#getDataResult(java.
|
||||
* util.List, java.lang.String, int)
|
||||
*/
|
||||
@Override
|
||||
public List<GeoNaDataObject> getDataResult(List<LayerItem> layerItems, String mapSrsName, BoundsMap selectBBOX,
|
||||
public List<GeoNaDataObject> getDataResult(List<LayerObject> layerObjects, String mapSrsName, BoundsMap selectBBOX,
|
||||
int maxWFSFeature, double zoomLevel) {
|
||||
LOG.info("getDataResult called");
|
||||
List<GeoNaDataObject> result = FeatureParser.getDataResults(layerItems, mapSrsName, selectBBOX, maxWFSFeature);
|
||||
return result;
|
||||
|
||||
List<GeoNaDataObject> listDAO = new ArrayList<GeoNaDataObject>(layerObjects.size());
|
||||
|
||||
for (LayerObject layerObject : layerObjects) {
|
||||
GeoNaDataObject geoDAO = new GeoNaDataObject();
|
||||
List<FeatureRow> features = FeatureParser.getWFSFeatures(layerObject.getLayerItem(), mapSrsName, selectBBOX, maxWFSFeature);
|
||||
LOG.debug("For layer name: "+layerObject.getLayerItem().getName() +" got features: "+features);
|
||||
geoDAO.setFeatures(features);
|
||||
geoDAO.setSourceLayerObject(layerObject);
|
||||
LOG.info("Fo layer name: "+layerObject.getLayerItem().getName() +" got "+features.size()+" feature/s");
|
||||
listDAO.add(geoDAO);
|
||||
}
|
||||
LOG.info("returning "+listDAO+" geona data objects");
|
||||
return listDAO;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -227,7 +235,6 @@ public class GeoportalDataViewerServiceImpl extends RemoteServiceServlet impleme
|
|||
* Gets the layer for type.
|
||||
*
|
||||
* @param layerType the layer type
|
||||
* @param fallbackOnError the fallback on error
|
||||
* @return the layer for type
|
||||
* @throws Exception the exception
|
||||
*/
|
||||
|
@ -258,6 +265,12 @@ public class GeoportalDataViewerServiceImpl extends RemoteServiceServlet impleme
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the geo na data view profile.
|
||||
*
|
||||
* @return the geo na data view profile
|
||||
* @throws Exception the exception
|
||||
*/
|
||||
@Override
|
||||
public GeoNaDataViewerProfile getGeoNaDataViewProfile() throws Exception{
|
||||
LOG.info("Called getAvailableLayers");
|
||||
|
|
|
@ -17,7 +17,6 @@ import java.util.Map;
|
|||
import org.apache.commons.io.IOUtils;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.server.util.URLParserUtil;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.GeoNaDataObject;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.BoundsMap;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.LayerItem;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.wfs.FeatureGeometry;
|
||||
|
@ -29,48 +28,37 @@ import org.slf4j.Logger;
|
|||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* The Class FeatureParser.
|
||||
*
|
||||
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
|
||||
*
|
||||
* Oct 29, 2020
|
||||
* Nov 13, 2020
|
||||
*/
|
||||
public class FeatureParser {
|
||||
|
||||
private static Logger LOG = LoggerFactory.getLogger(FeatureParser.class);
|
||||
|
||||
|
||||
/**
|
||||
* Gets the data results.
|
||||
* Gets the WFS features.
|
||||
*
|
||||
* @param layerItems the layer items
|
||||
* @param layerItem the layer item
|
||||
* @param mapSrsName the map srs name
|
||||
* @param selectBBOX the select BBOX
|
||||
* @param maxWFSFeature the max WFS feature
|
||||
* @return the data results
|
||||
* @return the WFS features
|
||||
*/
|
||||
public static List<GeoNaDataObject> getDataResults(List<LayerItem> layerItems, String mapSrsName, BoundsMap selectBBOX, int maxWFSFeature) {
|
||||
public static List<FeatureRow> getWFSFeatures(LayerItem layerItem, String mapSrsName, BoundsMap selectBBOX, int maxWFSFeature) {
|
||||
|
||||
if(maxWFSFeature<0) {
|
||||
maxWFSFeature = GeoportalDataViewerConstants.MAX_WFS_FEATURES;
|
||||
}
|
||||
|
||||
List<GeoNaDataObject> listGeonaDO = new ArrayList<GeoNaDataObject>();
|
||||
//IF WFS IS AVAILABLE USE WFS REQUEST OTHERWHISE TRY TO USE WPS SERVICE
|
||||
for (LayerItem layerItem : layerItems){
|
||||
List<FeatureRow> rows = getWFSFeatureProperties(layerItem, mapSrsName, selectBBOX, maxWFSFeature);
|
||||
GeoNaDataObject gdo = new GeoNaDataObject();
|
||||
gdo.setLayerItem(layerItem);
|
||||
gdo.setFeatures(rows);
|
||||
listGeonaDO.add(gdo);
|
||||
}
|
||||
return listGeonaDO;
|
||||
return getWFSFeatureProperties(layerItem, mapSrsName, selectBBOX, maxWFSFeature);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Gets the WFS feature properties.
|
||||
*
|
||||
|
|
|
@ -3,9 +3,8 @@ package org.gcube.portlets.user.geoportaldataviewer.shared;
|
|||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.LayerItem;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.LayerObject;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.wfs.FeatureRow;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.products.ConcessioneDV;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -13,19 +12,16 @@ import org.gcube.portlets.user.geoportaldataviewer.shared.products.ConcessioneDV
|
|||
*
|
||||
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
|
||||
*
|
||||
* Oct 29, 2020
|
||||
* Nov 13, 2020
|
||||
*/
|
||||
public class GeoNaDataObject implements Serializable{
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 5566069859060851625L;
|
||||
/** The form data entry fields. */
|
||||
private static final long serialVersionUID = 3513120677727206958L;
|
||||
private List<FeatureRow> features;
|
||||
private ProductType productType;
|
||||
private LayerItem layerItem;
|
||||
private ConcessioneDV concessioneDV;
|
||||
private LayerObject sourceLayerObject;
|
||||
|
||||
/**
|
||||
* Instantiates a new geo na data object.
|
||||
|
@ -34,52 +30,56 @@ public class GeoNaDataObject implements Serializable{
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the features.
|
||||
*
|
||||
* @return the features
|
||||
*/
|
||||
public List<FeatureRow> getFeatures() {
|
||||
return features;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the features.
|
||||
*
|
||||
* @param features the new features
|
||||
*/
|
||||
public void setFeatures(List<FeatureRow> features) {
|
||||
this.features = features;
|
||||
}
|
||||
|
||||
public ProductType getProductType() {
|
||||
return productType;
|
||||
/**
|
||||
* Gets the source layer object.
|
||||
*
|
||||
* @return the source layer object
|
||||
*/
|
||||
public LayerObject getSourceLayerObject() {
|
||||
return sourceLayerObject;
|
||||
}
|
||||
|
||||
public void setProductType(ProductType productType) {
|
||||
this.productType = productType;
|
||||
}
|
||||
|
||||
public LayerItem getLayerItem() {
|
||||
return layerItem;
|
||||
}
|
||||
|
||||
public void setLayerItem(LayerItem layerItem) {
|
||||
this.layerItem = layerItem;
|
||||
}
|
||||
|
||||
public ConcessioneDV getConcessioneDV() {
|
||||
return concessioneDV;
|
||||
}
|
||||
|
||||
public void setConcessioneDV(ConcessioneDV concessioneDV) {
|
||||
this.concessioneDV = concessioneDV;
|
||||
/**
|
||||
* Sets the source layer object.
|
||||
*
|
||||
* @param sourceLayerObject the new source layer object
|
||||
*/
|
||||
public void setSourceLayerObject(LayerObject sourceLayerObject) {
|
||||
this.sourceLayerObject = sourceLayerObject;
|
||||
}
|
||||
|
||||
/**
|
||||
* To string.
|
||||
*
|
||||
* @return the string
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append("GeoNaDataObject [features=");
|
||||
builder.append(features);
|
||||
builder.append(", productType=");
|
||||
builder.append(productType);
|
||||
builder.append(", layerItem=");
|
||||
builder.append(layerItem);
|
||||
builder.append(", concessioneDV=");
|
||||
builder.append(concessioneDV);
|
||||
builder.append(", sourceLayerObject=");
|
||||
builder.append(sourceLayerObject);
|
||||
builder.append("]");
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
package org.gcube.portlets.user.geoportaldataviewer.shared;
|
||||
|
||||
public enum ProductType {
|
||||
|
||||
CONCESSIONE
|
||||
|
||||
}
|
|
@ -0,0 +1,82 @@
|
|||
package org.gcube.portlets.user.geoportaldataviewer.shared.gis;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* The Class LayerObject.
|
||||
*
|
||||
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
|
||||
*
|
||||
* Nov 13, 2020
|
||||
*/
|
||||
public class LayerObject implements Serializable {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -2282478701630148774L;
|
||||
/* This is the layer/product type. E.g. Concessione */
|
||||
private String itemType;
|
||||
private LayerItem layerItem;
|
||||
|
||||
/**
|
||||
* Instantiates a new layer object.
|
||||
*/
|
||||
public LayerObject() {
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the item type.
|
||||
*
|
||||
* @return the item type
|
||||
*/
|
||||
public String getItemType() {
|
||||
return itemType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the item type.
|
||||
*
|
||||
* @param itemType the new item type
|
||||
*/
|
||||
public void setItemType(String itemType) {
|
||||
this.itemType = itemType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the layer item.
|
||||
*
|
||||
* @return the layer item
|
||||
*/
|
||||
public LayerItem getLayerItem() {
|
||||
return layerItem;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the layer item.
|
||||
*
|
||||
* @param layerItem the new layer item
|
||||
*/
|
||||
public void setLayerItem(LayerItem layerItem) {
|
||||
this.layerItem = layerItem;
|
||||
}
|
||||
|
||||
/**
|
||||
* To string.
|
||||
*
|
||||
* @return the string
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append("LayerObject [itemType=");
|
||||
builder.append(itemType);
|
||||
builder.append(", layerItem=");
|
||||
builder.append(layerItem);
|
||||
builder.append("]");
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
}
|
|
@ -11,7 +11,7 @@ import com.google.gwt.user.client.rpc.IsSerializable;
|
|||
*
|
||||
* Nov 2, 2020
|
||||
*/
|
||||
public class RecordDV implements Serializable, IsSerializable {
|
||||
public abstract class RecordDV implements Serializable, IsSerializable {
|
||||
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue