Searching facility integrated with CQL filter
This commit is contained in:
parent
fb827a6913
commit
342d40fdf9
|
@ -3,6 +3,7 @@ package org.gcube.portlets.user.geoportaldataviewer.client;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.gcube.application.geoportalcommon.shared.GeoNaDataViewerProfile;
|
import org.gcube.application.geoportalcommon.shared.GeoNaDataViewerProfile;
|
||||||
|
@ -29,6 +30,8 @@ import org.gcube.portlets.user.geoportaldataviewer.client.events.DoActionOnDetai
|
||||||
import org.gcube.portlets.user.geoportaldataviewer.client.events.MapExtentToEvent;
|
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.MapExtentToEventHandler;
|
||||||
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.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.ShowDetailsEvent;
|
||||||
import org.gcube.portlets.user.geoportaldataviewer.client.events.ShowDetailsEventHandler;
|
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.ShowPopupOnCentroiEvent;
|
||||||
|
@ -59,6 +62,7 @@ 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.Coordinate;
|
||||||
|
import ol.layer.Image;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Entry point classes define <code>onModuleLoad()</code>.
|
* Entry point classes define <code>onModuleLoad()</code>.
|
||||||
|
@ -532,6 +536,41 @@ public class GeoportalDataViewer implements EntryPoint {
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
applicationBus.addHandler(SearchPerformedEvent.TYPE, new SearchPerformedEventHandler() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSearchDone(SearchPerformedEvent searchPerformedEvent) {
|
||||||
|
|
||||||
|
if(searchPerformedEvent!=null) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
LinkedHashMap<String, Image> wmsMap = olMapMng.getOLMap().getWmsLayerMap();
|
||||||
|
String firstWMSKey = wmsMap.keySet().iterator().next();
|
||||||
|
List<ConcessioneDV> result = searchPerformedEvent.getData();
|
||||||
|
|
||||||
|
if(result!=null && result.size()>0) {
|
||||||
|
String cqlFilter = "product_id IN(";
|
||||||
|
for (ConcessioneDV concessioneDV : result) {
|
||||||
|
cqlFilter+="'"+concessioneDV.getItemId()+"',";
|
||||||
|
}
|
||||||
|
cqlFilter = cqlFilter.substring(0,cqlFilter.length()-1)+")";
|
||||||
|
|
||||||
|
olMapMng.getOLMap().setCQLFilterToWMSLayer(firstWMSKey, cqlFilter);
|
||||||
|
}else {
|
||||||
|
olMapMng.getOLMap().setCQLFilterToWMSLayer(firstWMSKey, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(searchPerformedEvent.isSearchReset()) {
|
||||||
|
olMapMng.getOLMap().setCQLFilterToWMSLayer(firstWMSKey, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,71 @@
|
||||||
|
package org.gcube.portlets.user.geoportaldataviewer.client.events;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.gcube.application.geoportalcommon.shared.products.ConcessioneDV;
|
||||||
|
|
||||||
|
import com.google.gwt.event.shared.GwtEvent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Class SearchPerformedEvent.
|
||||||
|
*
|
||||||
|
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
|
||||||
|
*
|
||||||
|
* Dec 14, 2021
|
||||||
|
*/
|
||||||
|
public class SearchPerformedEvent extends GwtEvent<SearchPerformedEventHandler> {
|
||||||
|
public static Type<SearchPerformedEventHandler> TYPE = new Type<SearchPerformedEventHandler>();
|
||||||
|
private List<ConcessioneDV> data;
|
||||||
|
private boolean searchReset;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Instantiates a new search performed event.
|
||||||
|
*
|
||||||
|
* @param data the data
|
||||||
|
* @param searchReset the search reset
|
||||||
|
*/
|
||||||
|
public SearchPerformedEvent(List<ConcessioneDV> data, boolean searchReset) {
|
||||||
|
this.data = data;
|
||||||
|
this.searchReset = searchReset;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the associated type.
|
||||||
|
*
|
||||||
|
* @return the associated type
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Type<SearchPerformedEventHandler> getAssociatedType() {
|
||||||
|
return TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Dispatch.
|
||||||
|
*
|
||||||
|
* @param handler the handler
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected void dispatch(SearchPerformedEventHandler handler) {
|
||||||
|
handler.onSearchDone(this);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the data.
|
||||||
|
*
|
||||||
|
* @return the data
|
||||||
|
*/
|
||||||
|
public List<ConcessioneDV> getData() {
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if is search reset.
|
||||||
|
*
|
||||||
|
* @return true, if is search reset
|
||||||
|
*/
|
||||||
|
public boolean isSearchReset() {
|
||||||
|
return searchReset;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,20 @@
|
||||||
|
package org.gcube.portlets.user.geoportaldataviewer.client.events;
|
||||||
|
|
||||||
|
import com.google.gwt.event.shared.EventHandler;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Interface SearchPerformedEventHandler.
|
||||||
|
*
|
||||||
|
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
|
||||||
|
*
|
||||||
|
* Dec 14, 2021
|
||||||
|
*/
|
||||||
|
public interface SearchPerformedEventHandler extends EventHandler {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* On search done.
|
||||||
|
*
|
||||||
|
* @param searchPerformedEvent the search performed event
|
||||||
|
*/
|
||||||
|
void onSearchDone(SearchPerformedEvent searchPerformedEvent);
|
||||||
|
}
|
|
@ -395,9 +395,11 @@ public abstract class OpenLayerMap {
|
||||||
if (layer == null) {
|
if (layer == null) {
|
||||||
ImageWmsParams imageWMSParams = OLFactory.createOptions();
|
ImageWmsParams imageWMSParams = OLFactory.createOptions();
|
||||||
imageWMSParams.setLayers(layerItem.getName());
|
imageWMSParams.setLayers(layerItem.getName());
|
||||||
|
//imageWMSParams.set("CQL_FILTER", "product_id IN('6165b07202ad3d60e1d26f42','6166ff8002ad3d60e1d26fb7')");
|
||||||
|
|
||||||
ImageWmsOptions imageWMSOptions = OLFactory.createOptions();
|
ImageWmsOptions imageWMSOptions = OLFactory.createOptions();
|
||||||
imageWMSOptions.setUrl(layerItem.getMapServerHost());
|
imageWMSOptions.setUrl(layerItem.getMapServerHost());
|
||||||
|
|
||||||
imageWMSOptions.setParams(imageWMSParams);
|
imageWMSOptions.setParams(imageWMSParams);
|
||||||
// imageWMSOptions.setRatio(1.5f);
|
// imageWMSOptions.setRatio(1.5f);
|
||||||
|
|
||||||
|
@ -405,6 +407,7 @@ public abstract class OpenLayerMap {
|
||||||
LayerOptions layerOptions = OLFactory.createOptions();
|
LayerOptions layerOptions = OLFactory.createOptions();
|
||||||
layerOptions.setSource(imageWMSSource);
|
layerOptions.setSource(imageWMSSource);
|
||||||
|
|
||||||
|
|
||||||
// Settings MIN and MAX Resolution
|
// Settings MIN and MAX Resolution
|
||||||
if (layerItem.getMinResolution() != null) {
|
if (layerItem.getMinResolution() != null) {
|
||||||
layerOptions.setMinResolution(layerItem.getMinResolution());
|
layerOptions.setMinResolution(layerItem.getMinResolution());
|
||||||
|
@ -414,6 +417,7 @@ public abstract class OpenLayerMap {
|
||||||
}
|
}
|
||||||
|
|
||||||
Image wmsLayer = new Image(layerOptions);
|
Image wmsLayer = new Image(layerOptions);
|
||||||
|
|
||||||
int zIndex = layerOrder.getOffset(LayerOrder.LAYER_TYPE.BASE_WMS)+wmsLayerMap.size()+1;
|
int zIndex = layerOrder.getOffset(LayerOrder.LAYER_TYPE.BASE_WMS)+wmsLayerMap.size()+1;
|
||||||
wmsLayer.setZIndex(zIndex);
|
wmsLayer.setZIndex(zIndex);
|
||||||
// visibleLayerItems
|
// visibleLayerItems
|
||||||
|
@ -428,6 +432,33 @@ public abstract class OpenLayerMap {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setCQLFilterToWMSLayer(String key, String cqlFilterExpression) {
|
||||||
|
|
||||||
|
GWT.log("Getting key: "+key);
|
||||||
|
|
||||||
|
GWT.log("Setting CQL FILTER: "+cqlFilterExpression);
|
||||||
|
Image wmsLayer = wmsLayerMap.get(key);
|
||||||
|
|
||||||
|
GWT.log("WMS layer is: "+wmsLayer);
|
||||||
|
|
||||||
|
//map.removeLayer(wmsLayer);
|
||||||
|
|
||||||
|
ImageWms imageWMSSource = wmsLayer.getSource();
|
||||||
|
ImageWmsParams imageWMSParams = imageWMSSource.getParams();
|
||||||
|
|
||||||
|
if (cqlFilterExpression == null) {
|
||||||
|
imageWMSParams.delete("CQL_FILTER");
|
||||||
|
} else {
|
||||||
|
imageWMSParams.set("CQL_FILTER", cqlFilterExpression);
|
||||||
|
}
|
||||||
|
|
||||||
|
imageWMSSource.updateParams(imageWMSParams);
|
||||||
|
wmsLayer.setSource(imageWMSSource);
|
||||||
|
|
||||||
|
//map.addLayer(wmsLayer);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds the WMS detail layer.
|
* Adds the WMS detail layer.
|
||||||
|
|
|
@ -11,7 +11,6 @@ import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerCon
|
||||||
import org.gcube.portlets.user.geoportaldataviewer.client.events.ChangeMapLayerEvent;
|
import org.gcube.portlets.user.geoportaldataviewer.client.events.ChangeMapLayerEvent;
|
||||||
import org.gcube.portlets.user.geoportaldataviewer.client.events.MapExtentToEvent;
|
import org.gcube.portlets.user.geoportaldataviewer.client.events.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.GNAImages;
|
import org.gcube.portlets.user.geoportaldataviewer.client.resources.GNAImages;
|
||||||
import org.gcube.portlets.user.geoportaldataviewer.client.ui.map.ExtentMapUtil;
|
import org.gcube.portlets.user.geoportaldataviewer.client.ui.map.ExtentMapUtil;
|
||||||
import org.gcube.portlets.user.geoportaldataviewer.client.ui.map.ExtentMapUtil.Location;
|
import org.gcube.portlets.user.geoportaldataviewer.client.ui.map.ExtentMapUtil.Location;
|
||||||
|
@ -151,11 +150,12 @@ public class GeonaDataViewMainPanel extends Composite {
|
||||||
extentToEarth.getElement().appendChild(worldImg.getElement());
|
extentToEarth.getElement().appendChild(worldImg.getElement());
|
||||||
extentToEarth.setWidth("140px");
|
extentToEarth.setWidth("140px");
|
||||||
|
|
||||||
linkMap.setCustomIconStyle(GNAIcons.CustomIconType.MAP.get());
|
//linkMap.setCustomIconStyle(GNAIcons.CustomIconType.MAP.get());
|
||||||
linkPresetLocation.setCustomIconStyle(GNAIcons.CustomIconType.PRESET_LOCATION.get());
|
//linkPresetLocation.setCustomIconStyle(GNAIcons.CustomIconType.PRESET_LOCATION.get());
|
||||||
linkLayers.setCustomIconStyle(GNAIcons.CustomIconType.LAYERS.get());
|
//linkLayers.setCustomIconStyle(GNAIcons.CustomIconType.LAYERS.get());
|
||||||
|
|
||||||
searchFacility = new SearchFacilityUI(applicationBus, sortByFields, searchForFields, initialSortFilter);
|
searchFacility = new SearchFacilityUI(applicationBus, sortByFields, searchForFields, initialSortFilter);
|
||||||
|
searchFacility.setSearchButton(searchFacilityButton);
|
||||||
searchFacilityButton.setIcon(IconType.SEARCH);
|
searchFacilityButton.setIcon(IconType.SEARCH);
|
||||||
searchFacilityPanel.add(searchFacility);
|
searchFacilityPanel.add(searchFacility);
|
||||||
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
|
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
|
||||||
|
|
|
@ -14,6 +14,7 @@ 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.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.ShowDetailsEvent;
|
import org.gcube.portlets.user.geoportaldataviewer.client.events.ShowDetailsEvent;
|
||||||
import org.gcube.portlets.user.geoportaldataviewer.client.events.ShowPopupOnCentroiEvent;
|
import org.gcube.portlets.user.geoportaldataviewer.client.events.ShowPopupOnCentroiEvent;
|
||||||
import org.gcube.portlets.user.geoportaldataviewer.client.util.LoaderIcon;
|
import org.gcube.portlets.user.geoportaldataviewer.client.util.LoaderIcon;
|
||||||
|
@ -21,6 +22,7 @@ import org.gcube.portlets.user.geoportaldataviewer.client.util.StringUtil;
|
||||||
|
|
||||||
import com.github.gwtbootstrap.client.ui.Alert;
|
import com.github.gwtbootstrap.client.ui.Alert;
|
||||||
import com.github.gwtbootstrap.client.ui.Button;
|
import com.github.gwtbootstrap.client.ui.Button;
|
||||||
|
import com.github.gwtbootstrap.client.ui.DropdownButton;
|
||||||
import com.github.gwtbootstrap.client.ui.ListBox;
|
import com.github.gwtbootstrap.client.ui.ListBox;
|
||||||
import com.github.gwtbootstrap.client.ui.NavLink;
|
import com.github.gwtbootstrap.client.ui.NavLink;
|
||||||
import com.github.gwtbootstrap.client.ui.TextBox;
|
import com.github.gwtbootstrap.client.ui.TextBox;
|
||||||
|
@ -46,6 +48,14 @@ import com.google.gwt.user.client.ui.HTMLPanel;
|
||||||
import com.google.gwt.user.client.ui.HorizontalPanel;
|
import com.google.gwt.user.client.ui.HorizontalPanel;
|
||||||
import com.google.gwt.user.client.ui.Widget;
|
import com.google.gwt.user.client.ui.Widget;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Class SearchFacilityUI.
|
||||||
|
*
|
||||||
|
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
|
||||||
|
*
|
||||||
|
* Dec 14, 2021
|
||||||
|
*/
|
||||||
public class SearchFacilityUI extends Composite {
|
public class SearchFacilityUI extends Composite {
|
||||||
|
|
||||||
private static SearchFacilityPanelUiBinder uiBinder = GWT.create(SearchFacilityPanelUiBinder.class);
|
private static SearchFacilityPanelUiBinder uiBinder = GWT.create(SearchFacilityPanelUiBinder.class);
|
||||||
|
@ -85,9 +95,26 @@ public class SearchFacilityUI extends Composite {
|
||||||
|
|
||||||
private ResultSetPaginatedData latestResult;
|
private ResultSetPaginatedData latestResult;
|
||||||
|
|
||||||
|
private DropdownButton searchFacilityButton;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Interface SearchFacilityPanelUiBinder.
|
||||||
|
*
|
||||||
|
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
|
||||||
|
*
|
||||||
|
* Dec 14, 2021
|
||||||
|
*/
|
||||||
interface SearchFacilityPanelUiBinder extends UiBinder<Widget, SearchFacilityUI> {
|
interface SearchFacilityPanelUiBinder extends UiBinder<Widget, SearchFacilityUI> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Instantiates a new search facility UI.
|
||||||
|
*
|
||||||
|
* @param appManagerBus the app manager bus
|
||||||
|
* @param sortByFields the sort by fields
|
||||||
|
* @param searchForFields the search for fields
|
||||||
|
* @param initialSortFilter the initial sort filter
|
||||||
|
*/
|
||||||
public SearchFacilityUI(HandlerManager appManagerBus, List<ItemField> sortByFields, List<ItemField> searchForFields,
|
public SearchFacilityUI(HandlerManager appManagerBus, List<ItemField> sortByFields, List<ItemField> searchForFields,
|
||||||
SearchingFilter initialSortFilter) {
|
SearchingFilter initialSortFilter) {
|
||||||
initWidget(uiBinder.createAndBindUi(this));
|
initWidget(uiBinder.createAndBindUi(this));
|
||||||
|
@ -98,12 +125,19 @@ public class SearchFacilityUI extends Composite {
|
||||||
|
|
||||||
resetSearch.setType(ButtonType.LINK);
|
resetSearch.setType(ButtonType.LINK);
|
||||||
|
|
||||||
listBoxSortBy.setWidth("130px");
|
listBoxSortBy.setWidth("180px");
|
||||||
listBoxSearchFor.setWidth("130px");
|
listBoxSearchFor.setWidth("140px");
|
||||||
|
|
||||||
bindEvents();
|
bindEvents();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* To label filter.
|
||||||
|
*
|
||||||
|
* @param itemField the item field
|
||||||
|
* @param direction the direction
|
||||||
|
* @return the string
|
||||||
|
*/
|
||||||
private String toLabelFilter(ItemField itemField, ORDER direction) {
|
private String toLabelFilter(ItemField itemField, ORDER direction) {
|
||||||
String labelFilter = itemField.getDisplayName() + LABEL_FILTER_SEPARATOR + direction.name();
|
String labelFilter = itemField.getDisplayName() + LABEL_FILTER_SEPARATOR + direction.name();
|
||||||
return labelFilter;
|
return labelFilter;
|
||||||
|
@ -163,20 +197,6 @@ public class SearchFacilityUI extends Composite {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// navShowOnMap.addClickHandler(new ClickHandler() {
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void onClick(ClickEvent event) {
|
|
||||||
// List<ConcessioneDV> listConcessioni = null;
|
|
||||||
// if (grpw != null && grpw.getSelectItems() != null) {
|
|
||||||
// listConcessioni = grpw.getSelectItems();
|
|
||||||
// }
|
|
||||||
// appManagerBus
|
|
||||||
// .fireEvent(new ActionOnItemEvent<ConcessioneDV>(listConcessioni, ACTION_ON_ITEM.VIEW_ON_MAP));
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
|
|
||||||
searchField.addKeyPressHandler(new KeyPressHandler() {
|
searchField.addKeyPressHandler(new KeyPressHandler() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -194,15 +214,28 @@ public class SearchFacilityUI extends Composite {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(ClickEvent event) {
|
public void onClick(ClickEvent event) {
|
||||||
searchField.setText("");
|
searchField.setText("");
|
||||||
//appManagerBus.fireEvent(new GetListOfRecordsEvent(RECORD_TYPE.CONCESSIONE, getCurrentSortFilter()));
|
|
||||||
resetSearch.setVisible(false);
|
resetSearch.setVisible(false);
|
||||||
panelResults.clear();
|
panelResults.clear();
|
||||||
latestResult = null;
|
latestResult = null;
|
||||||
|
appManagerBus.fireEvent(new SearchPerformedEvent(null,true));
|
||||||
|
setSearchEnabled(false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void setSearchEnabled(boolean bool) {
|
||||||
|
if(bool) {
|
||||||
|
searchFacilityButton.getElement().addClassName("highlight-button");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
searchFacilityButton.getElement().removeClassName("highlight-button");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Search concessioni.
|
||||||
|
*/
|
||||||
private void searchConcessioni() {
|
private void searchConcessioni() {
|
||||||
|
|
||||||
SearchingFilter filter = getCurrentSortFilter();
|
SearchingFilter filter = getCurrentSortFilter();
|
||||||
|
@ -229,6 +262,8 @@ public class SearchFacilityUI extends Composite {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(ResultSetPaginatedData result) {
|
public void onSuccess(ResultSetPaginatedData result) {
|
||||||
|
|
||||||
|
appManagerBus.fireEvent(new SearchPerformedEvent(result.getData(),false));
|
||||||
|
setSearchEnabled(true);
|
||||||
latestResult = result;
|
latestResult = result;
|
||||||
|
|
||||||
panelResults.clear();
|
panelResults.clear();
|
||||||
|
@ -341,7 +376,7 @@ public class SearchFacilityUI extends Composite {
|
||||||
/**
|
/**
|
||||||
* To display authors.
|
* To display authors.
|
||||||
*
|
*
|
||||||
* @param authors the authors
|
* @param listValues the list values
|
||||||
* @return the string
|
* @return the string
|
||||||
*/
|
*/
|
||||||
private String toDisplayList(List<String> listValues) {
|
private String toDisplayList(List<String> listValues) {
|
||||||
|
@ -355,6 +390,9 @@ public class SearchFacilityUI extends Composite {
|
||||||
return toDisplay;
|
return toDisplay;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Do search event.
|
||||||
|
*/
|
||||||
private void doSearchEvent() {
|
private void doSearchEvent() {
|
||||||
String searchText = searchField.getText();
|
String searchText = searchField.getText();
|
||||||
if (searchText.length() < MIN_LENGHT_SERCHING_STRING) {
|
if (searchText.length() < MIN_LENGHT_SERCHING_STRING) {
|
||||||
|
@ -369,6 +407,12 @@ public class SearchFacilityUI extends Composite {
|
||||||
searchConcessioni();
|
searchConcessioni();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* To sort filter.
|
||||||
|
*
|
||||||
|
* @param labelFilter the label filter
|
||||||
|
* @return the searching filter
|
||||||
|
*/
|
||||||
public SearchingFilter toSortFilter(String labelFilter) {
|
public SearchingFilter toSortFilter(String labelFilter) {
|
||||||
GWT.log("toSortFilter for label " + labelFilter);
|
GWT.log("toSortFilter for label " + labelFilter);
|
||||||
String[] array = labelFilter.split(LABEL_FILTER_SEPARATOR);
|
String[] array = labelFilter.split(LABEL_FILTER_SEPARATOR);
|
||||||
|
@ -392,6 +436,11 @@ public class SearchFacilityUI extends Composite {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Built searching filter.
|
||||||
|
*
|
||||||
|
* @return the searching filter
|
||||||
|
*/
|
||||||
private SearchingFilter builtSearchingFilter() {
|
private SearchingFilter builtSearchingFilter() {
|
||||||
SearchingFilter searchingFilter = toSortFilter(listBoxSortBy.getSelectedValue());
|
SearchingFilter searchingFilter = toSortFilter(listBoxSortBy.getSelectedValue());
|
||||||
String searchText = searchField.getText();
|
String searchText = searchField.getText();
|
||||||
|
@ -419,10 +468,20 @@ public class SearchFacilityUI extends Composite {
|
||||||
return searchingFilter;
|
return searchingFilter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the current sort filter.
|
||||||
|
*
|
||||||
|
* @return the current sort filter
|
||||||
|
*/
|
||||||
public SearchingFilter getCurrentSortFilter() {
|
public SearchingFilter getCurrentSortFilter() {
|
||||||
currentSortFilter = builtSearchingFilter();
|
currentSortFilter = builtSearchingFilter();
|
||||||
GWT.log("currentSortFilter: " + currentSortFilter);
|
GWT.log("currentSortFilter: " + currentSortFilter);
|
||||||
return currentSortFilter;
|
return currentSortFilter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setSearchButton(DropdownButton searchFacilityButton) {
|
||||||
|
this.searchFacilityButton = searchFacilityButton;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,7 +67,7 @@ public class MapView extends Composite {
|
||||||
@UiField
|
@UiField
|
||||||
HorizontalPanel coordinatePanel;
|
HorizontalPanel coordinatePanel;
|
||||||
|
|
||||||
private LightOpenLayerMap lightOLSM;
|
private LightOpenLayerMap lightOLM;
|
||||||
|
|
||||||
private HTML attributionDiv = null;
|
private HTML attributionDiv = null;
|
||||||
|
|
||||||
|
@ -92,14 +92,14 @@ public class MapView extends Composite {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute() {
|
public void execute() {
|
||||||
lightOLSM = new LightOpenLayerMap(theMapId);
|
lightOLM = new LightOpenLayerMap(theMapId);
|
||||||
setBaseLayers();
|
setBaseLayers();
|
||||||
|
|
||||||
// EPSG_3857 LOCATION TO ITALY
|
// EPSG_3857 LOCATION TO ITALY
|
||||||
Location italyLocation = ExtentMapUtil.getLocation(PLACE.ITALY);
|
Location italyLocation = ExtentMapUtil.getLocation(PLACE.ITALY);
|
||||||
Coordinate transformedCenterCoordinate = italyLocation.getCoordinate(MAP_PROJECTION.EPSG_3857);
|
Coordinate transformedCenterCoordinate = italyLocation.getCoordinate(MAP_PROJECTION.EPSG_3857);
|
||||||
lightOLSM.setCenter(transformedCenterCoordinate);
|
lightOLM.setCenter(transformedCenterCoordinate);
|
||||||
lightOLSM.setZoom(GeoportalDataViewerConstants.LIGHT_MAP_ITALY_FIT_ZOOM_ON);
|
lightOLM.setZoom(GeoportalDataViewerConstants.LIGHT_MAP_ITALY_FIT_ZOOM_ON);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -127,7 +127,7 @@ public class MapView extends Composite {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onValueChange(ValueChangeEvent<Boolean> event) {
|
public void onValueChange(ValueChangeEvent<Boolean> event) {
|
||||||
lightOLSM.changeBaseMap(baseMapLayer);
|
lightOLM.changeBaseMap(baseMapLayer);
|
||||||
setMapAttribution(baseMapLayer);
|
setMapAttribution(baseMapLayer);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -193,9 +193,9 @@ public class MapView extends Composite {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute() {
|
public void execute() {
|
||||||
if (lightOLSM != null) {
|
if (lightOLM != null) {
|
||||||
lightOLSM.addPoint(coordinate, showCoordinateText, true);
|
lightOLM.addPoint(coordinate, showCoordinateText, true);
|
||||||
lightOLSM.getMap().getView().setCenter(coordinate);
|
lightOLM.getMap().getView().setCenter(coordinate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -232,11 +232,11 @@ public class MapView extends Composite {
|
||||||
null);
|
null);
|
||||||
}
|
}
|
||||||
|
|
||||||
lightOLSM.addWMSLayer(mapServerHost, layerName, theBBOX);
|
lightOLM.addWMSLayer(mapServerHost, layerName, theBBOX);
|
||||||
|
|
||||||
if (ew != null) {
|
if (ew != null) {
|
||||||
|
|
||||||
lightOLSM.getMap().getView().fit(ew);
|
lightOLM.getMap().getView().fit(ew);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -245,8 +245,8 @@ public class MapView extends Composite {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public LightOpenLayerMap getLightOLSM() {
|
public LightOpenLayerMap getLightOLM() {
|
||||||
return lightOLSM;
|
return lightOLM;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -110,7 +110,7 @@ public class LayerConcessioneView extends Composite {
|
||||||
}
|
}
|
||||||
|
|
||||||
// DOWNLOAD the OSM + layer by canvas
|
// DOWNLOAD the OSM + layer by canvas
|
||||||
downloadMap(mapView.getLightOLSM().getMap(), mapView.getPanelMapElementId(), htmlLinkId,
|
downloadMap(mapView.getLightOLM().getMap(), mapView.getPanelMapElementId(), htmlLinkId,
|
||||||
filename, mimeType);
|
filename, mimeType);
|
||||||
// mapExport(mapView.getLightOLSM().getMap(), mapView.getPanelMapElementId());
|
// mapExport(mapView.getLightOLSM().getMap(), mapView.getPanelMapElementId());
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,7 +92,7 @@ public class GeoportalDataViewerServiceImpl extends RemoteServiceServlet impleme
|
||||||
* @return the geo information for WMS request
|
* @return the geo information for WMS request
|
||||||
* @throws Exception the exception
|
* @throws Exception the exception
|
||||||
*/
|
*/
|
||||||
public static GeoInformationForWMSRequest loadGeoInfoForWmsRequest(String wmsLink, String layerName)
|
public GeoInformationForWMSRequest loadGeoInfoForWmsRequest(String wmsLink, String layerName)
|
||||||
throws Exception {
|
throws Exception {
|
||||||
try {
|
try {
|
||||||
WMSUrlValidator validator = new WMSUrlValidator(wmsLink, layerName);
|
WMSUrlValidator validator = new WMSUrlValidator(wmsLink, layerName);
|
||||||
|
|
|
@ -495,7 +495,12 @@ body {
|
||||||
border-bottom: 1px solid #ccc;
|
border-bottom: 1px solid #ccc;
|
||||||
}
|
}
|
||||||
|
|
||||||
.table-results td:nth-child(1) {
|
.table-results td:nth-child(1) {
|
||||||
/*width: 200px;*/
|
}
|
||||||
|
|
||||||
|
.highlight-button {
|
||||||
|
border: 2px solid #08c;
|
||||||
|
border-radius: 4px;
|
||||||
|
box-shadow: 2px 2px #08c;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue