#22518 Added the search facility
This commit is contained in:
parent
5daa568c44
commit
0e97a234ce
|
@ -31,6 +31,8 @@ import org.gcube.portlets.user.geoportaldataviewer.client.events.MapExtentToEven
|
||||||
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.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.ShowPopupOnCentroiEventHandler;
|
||||||
import org.gcube.portlets.user.geoportaldataviewer.client.events.ZoomOutOverMinimumEvent;
|
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.events.ZoomOutOverMinimumEventHandler;
|
||||||
import org.gcube.portlets.user.geoportaldataviewer.client.gis.ExtentWrapped;
|
import org.gcube.portlets.user.geoportaldataviewer.client.gis.ExtentWrapped;
|
||||||
|
@ -139,6 +141,7 @@ public class GeoportalDataViewer implements EntryPoint {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(List<ItemField> result) {
|
public void onSuccess(List<ItemField> result) {
|
||||||
|
GWT.log("Loaded item fields: "+result);
|
||||||
|
|
||||||
for (ItemField itemField : result) {
|
for (ItemField itemField : result) {
|
||||||
if(itemField.isDisplayIntoTable()) {
|
if(itemField.isDisplayIntoTable()) {
|
||||||
|
@ -160,7 +163,7 @@ public class GeoportalDataViewer implements EntryPoint {
|
||||||
initialSortFilter.setOrder(ORDER.ASC);
|
initialSortFilter.setOrder(ORDER.ASC);
|
||||||
initialSortFilter.setOrderByFields(Arrays.asList(new ItemField("Name", Arrays.asList("name"), true, true, true)));
|
initialSortFilter.setOrderByFields(Arrays.asList(new ItemField("Name", Arrays.asList("name"), true, true, true)));
|
||||||
|
|
||||||
mainPanel = new GeonaDataViewMainPanel(applicationBus, getClientHeight(),searchByFields,sortByFields,initialSortFilter);
|
mainPanel = new GeonaDataViewMainPanel(applicationBus, getClientHeight(),sortByFields,searchByFields,initialSortFilter);
|
||||||
RootPanel.get(APP_DIV).add(mainPanel);
|
RootPanel.get(APP_DIV).add(mainPanel);
|
||||||
|
|
||||||
initApplication();
|
initApplication();
|
||||||
|
@ -256,7 +259,7 @@ public class GeoportalDataViewer implements EntryPoint {
|
||||||
geonaDataViewerProfile = profile;
|
geonaDataViewerProfile = profile;
|
||||||
GWT.log("Profile: " + geonaDataViewerProfile);
|
GWT.log("Profile: " + geonaDataViewerProfile);
|
||||||
Iterator<String> it;
|
Iterator<String> it;
|
||||||
String theItemType = paramGeonaItemType;
|
String theItemType = paramGeonaItemType.toLowerCase();
|
||||||
if (theItemType == null) {
|
if (theItemType == null) {
|
||||||
it = geonaDataViewerProfile.getMapLayers().keySet().iterator();
|
it = geonaDataViewerProfile.getMapLayers().keySet().iterator();
|
||||||
it.hasNext();
|
it.hasNext();
|
||||||
|
@ -381,7 +384,7 @@ public class GeoportalDataViewer implements EntryPoint {
|
||||||
public void run() {
|
public void run() {
|
||||||
attempt++;
|
attempt++;
|
||||||
GWT.log("waiting get record: " + attempt);
|
GWT.log("waiting get record: " + attempt);
|
||||||
RecordDV record = mainPanel.getDisplyedRecord();
|
RecordDV record = mainPanel.getDisplayedRecord();
|
||||||
if (record != null) {
|
if (record != null) {
|
||||||
this.cancel();
|
this.cancel();
|
||||||
GWT.log("cancelled timer");
|
GWT.log("cancelled timer");
|
||||||
|
@ -427,7 +430,7 @@ public class GeoportalDataViewer implements EntryPoint {
|
||||||
@Override
|
@Override
|
||||||
public void onZoomOut(ZoomOutOverMinimumEvent zoomOutEvent) {
|
public void onZoomOut(ZoomOutOverMinimumEvent zoomOutEvent) {
|
||||||
|
|
||||||
if (mainPanel.getDisplyedRecord() == null && !olMapMng.isQueryPointActive()) {
|
if (mainPanel.getDisplayedRecord() == null && !olMapMng.isQueryPointActive()) {
|
||||||
olMapMng.hidePopInfo();
|
olMapMng.hidePopInfo();
|
||||||
layerManager.removeAllDetailLayers();
|
layerManager.removeAllDetailLayers();
|
||||||
|
|
||||||
|
@ -519,6 +522,17 @@ public class GeoportalDataViewer implements EntryPoint {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
applicationBus.addHandler(ShowPopupOnCentroiEvent.TYPE, new ShowPopupOnCentroiEventHandler() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onShowPopup(ShowPopupOnCentroiEvent showPopupOnCentroiEvent) {
|
||||||
|
|
||||||
|
if(showPopupOnCentroiEvent.getRecord()!=null)
|
||||||
|
performWFSQueryOnCentroid(showPopupOnCentroiEvent.getRecord());
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// /**
|
// /**
|
||||||
|
|
|
@ -0,0 +1,61 @@
|
||||||
|
package org.gcube.portlets.user.geoportaldataviewer.client.events;
|
||||||
|
|
||||||
|
import org.gcube.application.geoportalcommon.shared.products.model.RecordDV;
|
||||||
|
|
||||||
|
import com.google.gwt.event.shared.GwtEvent;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Class ShowDetailsEvent.
|
||||||
|
*
|
||||||
|
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
|
||||||
|
*
|
||||||
|
* Jul 30, 2021
|
||||||
|
*/
|
||||||
|
public class ShowPopupOnCentroiEvent extends GwtEvent<ShowPopupOnCentroiEventHandler> {
|
||||||
|
public static Type<ShowPopupOnCentroiEventHandler> TYPE = new Type<ShowPopupOnCentroiEventHandler>();
|
||||||
|
private RecordDV record;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Instantiates a new show details event.
|
||||||
|
*
|
||||||
|
* @param geonaItemType the geona item type
|
||||||
|
* @param geonaMongoID the geona mongo ID
|
||||||
|
* @param itemName the item name
|
||||||
|
* @param featureRow the feature row
|
||||||
|
*/
|
||||||
|
public ShowPopupOnCentroiEvent(RecordDV record) {
|
||||||
|
this.record = record;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the associated type.
|
||||||
|
*
|
||||||
|
* @return the associated type
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Type<ShowPopupOnCentroiEventHandler> getAssociatedType() {
|
||||||
|
return TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Dispatch.
|
||||||
|
*
|
||||||
|
* @param handler the handler
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected void dispatch(ShowPopupOnCentroiEventHandler handler) {
|
||||||
|
handler.onShowPopup(this);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public RecordDV getRecord() {
|
||||||
|
return record;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,21 @@
|
||||||
|
package org.gcube.portlets.user.geoportaldataviewer.client.events;
|
||||||
|
|
||||||
|
import com.google.gwt.event.shared.EventHandler;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Interface ShowPopupOnCentroiEventHandler.
|
||||||
|
*
|
||||||
|
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
|
||||||
|
*
|
||||||
|
* Dec 10, 2021
|
||||||
|
*/
|
||||||
|
public interface ShowPopupOnCentroiEventHandler extends EventHandler {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* On show popup.
|
||||||
|
*
|
||||||
|
* @param showPopupOnCentroiEvent the show popup on centroi event
|
||||||
|
*/
|
||||||
|
void onShowPopup(ShowPopupOnCentroiEvent showPopupOnCentroiEvent);
|
||||||
|
}
|
|
@ -23,6 +23,8 @@ import com.github.gwtbootstrap.client.ui.NavLink;
|
||||||
import com.github.gwtbootstrap.client.ui.Paragraph;
|
import com.github.gwtbootstrap.client.ui.Paragraph;
|
||||||
import com.github.gwtbootstrap.client.ui.constants.IconType;
|
import com.github.gwtbootstrap.client.ui.constants.IconType;
|
||||||
import com.google.gwt.core.client.GWT;
|
import com.google.gwt.core.client.GWT;
|
||||||
|
import com.google.gwt.core.client.Scheduler;
|
||||||
|
import com.google.gwt.core.client.Scheduler.ScheduledCommand;
|
||||||
import com.google.gwt.dom.client.Style.Unit;
|
import com.google.gwt.dom.client.Style.Unit;
|
||||||
import com.google.gwt.event.dom.client.ClickEvent;
|
import com.google.gwt.event.dom.client.ClickEvent;
|
||||||
import com.google.gwt.event.dom.client.ClickHandler;
|
import com.google.gwt.event.dom.client.ClickHandler;
|
||||||
|
@ -154,7 +156,18 @@ public class GeonaDataViewMainPanel extends Composite {
|
||||||
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);
|
||||||
|
searchFacilityButton.setIcon(IconType.SEARCH);
|
||||||
searchFacilityPanel.add(searchFacility);
|
searchFacilityPanel.add(searchFacility);
|
||||||
|
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void execute() {
|
||||||
|
searchFacilityPanel.getElement().getParentElement().getStyle().setOpacity(0.9);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
// layersDDB.setToggle(true);
|
// layersDDB.setToggle(true);
|
||||||
bindEvents();
|
bindEvents();
|
||||||
|
|
||||||
|
@ -318,7 +331,7 @@ public class GeonaDataViewMainPanel extends Composite {
|
||||||
*
|
*
|
||||||
* @return the displyed record
|
* @return the displyed record
|
||||||
*/
|
*/
|
||||||
public RecordDV getDisplyedRecord() {
|
public RecordDV getDisplayedRecord() {
|
||||||
return detailsPanel.getDisplayedRecord();
|
return detailsPanel.getDisplayedRecord();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,11 @@
|
||||||
</g:HTMLPanel>
|
</g:HTMLPanel>
|
||||||
</g:HTMLPanel>
|
</g:HTMLPanel>
|
||||||
</b:DropdownButton>
|
</b:DropdownButton>
|
||||||
|
<b:DropdownButton type="LINK" text="Search"
|
||||||
|
ui:field="searchFacilityButton">
|
||||||
|
<g:ScrollPanel ui:field="searchFacilityPanel"
|
||||||
|
addStyleNames="search-facility"></g:ScrollPanel>
|
||||||
|
</b:DropdownButton>
|
||||||
<b:DropdownButton type="LINK"
|
<b:DropdownButton type="LINK"
|
||||||
title="Select the Map" text="Map" ui:field="linkMap">
|
title="Select the Map" text="Map" ui:field="linkMap">
|
||||||
<g:HTMLPanel ui:field="panelBaseLayers">
|
<g:HTMLPanel ui:field="panelBaseLayers">
|
||||||
|
@ -52,10 +57,6 @@
|
||||||
text="World" title="Center to World"></b:Button>
|
text="World" title="Center to World"></b:Button>
|
||||||
</b:Nav>
|
</b:Nav>
|
||||||
</b:DropdownButton>
|
</b:DropdownButton>
|
||||||
<b:DropdownButton type="LINK" text="Search"
|
|
||||||
ui:field="searchFacilityButton">
|
|
||||||
<g:ScrollPanel ui:field="searchFacilityPanel" addStyleNames="search-facility"></g:ScrollPanel>
|
|
||||||
</b:DropdownButton>
|
|
||||||
<b:DropdownButton type="LINK" text="Query"
|
<b:DropdownButton type="LINK" text="Query"
|
||||||
visible="false">
|
visible="false">
|
||||||
<!-- <b:ButtonGroup toggle="checkbox" ui:field="buttonGroup"> -->
|
<!-- <b:ButtonGroup toggle="checkbox" ui:field="buttonGroup"> -->
|
||||||
|
|
|
@ -1,25 +1,32 @@
|
||||||
package org.gcube.portlets.user.geoportaldataviewer.client.ui;
|
package org.gcube.portlets.user.geoportaldataviewer.client.ui;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.gcube.application.geoportalcommon.shared.GeoNaItemRef;
|
||||||
import org.gcube.application.geoportalcommon.shared.ItemField;
|
import org.gcube.application.geoportalcommon.shared.ItemField;
|
||||||
import org.gcube.application.geoportalcommon.shared.ResultSetPaginatedData;
|
import org.gcube.application.geoportalcommon.shared.ResultSetPaginatedData;
|
||||||
import org.gcube.application.geoportalcommon.shared.SearchingFilter;
|
import org.gcube.application.geoportalcommon.shared.SearchingFilter;
|
||||||
import org.gcube.application.geoportalcommon.shared.SearchingFilter.ORDER;
|
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.RECORD_TYPE;
|
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.GetListOfRecordsEvent;
|
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.util.LoaderIcon;
|
||||||
import org.gcube.portlets.user.geoportaldataviewer.client.util.StringUtil;
|
import org.gcube.portlets.user.geoportaldataviewer.client.util.StringUtil;
|
||||||
|
|
||||||
|
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.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;
|
||||||
|
import com.github.gwtbootstrap.client.ui.constants.AlertType;
|
||||||
import com.github.gwtbootstrap.client.ui.constants.ButtonType;
|
import com.github.gwtbootstrap.client.ui.constants.ButtonType;
|
||||||
|
import com.github.gwtbootstrap.client.ui.constants.IconType;
|
||||||
import com.google.gwt.core.client.GWT;
|
import com.google.gwt.core.client.GWT;
|
||||||
import com.google.gwt.event.dom.client.ChangeEvent;
|
import com.google.gwt.event.dom.client.ChangeEvent;
|
||||||
import com.google.gwt.event.dom.client.ChangeHandler;
|
import com.google.gwt.event.dom.client.ChangeHandler;
|
||||||
|
@ -76,6 +83,8 @@ public class SearchFacilityUI extends Composite {
|
||||||
|
|
||||||
private static final String LABEL_FILTER_SEPARATOR = " - ";
|
private static final String LABEL_FILTER_SEPARATOR = " - ";
|
||||||
|
|
||||||
|
private ResultSetPaginatedData latestResult;
|
||||||
|
|
||||||
interface SearchFacilityPanelUiBinder extends UiBinder<Widget, SearchFacilityUI> {
|
interface SearchFacilityPanelUiBinder extends UiBinder<Widget, SearchFacilityUI> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,32 +115,35 @@ public class SearchFacilityUI extends Composite {
|
||||||
private void bindEvents() {
|
private void bindEvents() {
|
||||||
|
|
||||||
for (ItemField record_FIELD : sortByFields) {
|
for (ItemField record_FIELD : sortByFields) {
|
||||||
|
if(record_FIELD.isSortable()) {
|
||||||
String labelASC = toLabelFilter(record_FIELD, ORDER.ASC);
|
String labelASC = toLabelFilter(record_FIELD, ORDER.ASC);
|
||||||
String labelDESC = toLabelFilter(record_FIELD, ORDER.DESC);
|
String labelDESC = toLabelFilter(record_FIELD, ORDER.DESC);
|
||||||
listBoxSortBy.addItem(labelASC);
|
listBoxSortBy.addItem(labelASC);
|
||||||
listBoxSortBy.addItem(labelDESC);
|
listBoxSortBy.addItem(labelDESC);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
listBoxSortBy.addChangeHandler(new ChangeHandler() {
|
listBoxSortBy.addChangeHandler(new ChangeHandler() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onChange(ChangeEvent event) {
|
public void onChange(ChangeEvent event) {
|
||||||
appManagerBus.fireEvent(new GetListOfRecordsEvent(RECORD_TYPE.CONCESSIONE, getCurrentSortFilter()));
|
if(latestResult!=null && latestResult.getData().size()>0) {
|
||||||
|
doSearchEvent();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
for (ItemField record_FIELD : searchForFields) {
|
for (ItemField record_FIELD : searchForFields) {
|
||||||
|
GWT.log("search for: "+record_FIELD);
|
||||||
|
if(record_FIELD.isSearchable()) {
|
||||||
listBoxSearchFor.addItem(record_FIELD.getDisplayName());
|
listBoxSearchFor.addItem(record_FIELD.getDisplayName());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
listBoxSearchFor.addChangeHandler(new ChangeHandler() {
|
listBoxSearchFor.addChangeHandler(new ChangeHandler() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onChange(ChangeEvent event) {
|
public void onChange(ChangeEvent event) {
|
||||||
|
|
||||||
// alertSearchFor.setText(listBoxSearchFor.getSelectedValue());
|
|
||||||
|
|
||||||
if (searchField.getText().length() >= MIN_LENGHT_SERCHING_STRING) {
|
if (searchField.getText().length() >= MIN_LENGHT_SERCHING_STRING) {
|
||||||
doSearchEvent();
|
doSearchEvent();
|
||||||
}
|
}
|
||||||
|
@ -182,8 +194,10 @@ 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()));
|
//appManagerBus.fireEvent(new GetListOfRecordsEvent(RECORD_TYPE.CONCESSIONE, getCurrentSortFilter()));
|
||||||
resetSearch.setVisible(false);
|
resetSearch.setVisible(false);
|
||||||
|
panelResults.clear();
|
||||||
|
latestResult = null;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -192,20 +206,31 @@ public class SearchFacilityUI extends Composite {
|
||||||
private void searchConcessioni() {
|
private void searchConcessioni() {
|
||||||
|
|
||||||
SearchingFilter filter = getCurrentSortFilter();
|
SearchingFilter filter = getCurrentSortFilter();
|
||||||
|
panelResults.clear();
|
||||||
|
panelResults.add(new HTML("<hr>"));
|
||||||
|
panelResults.add(new LoaderIcon("Searching..."));
|
||||||
GeoportalDataViewerServiceAsync.Util.getInstance().getListConcessioni(0, 30, filter, false,
|
GeoportalDataViewerServiceAsync.Util.getInstance().getListConcessioni(0, 30, filter, false,
|
||||||
new AsyncCallback<ResultSetPaginatedData>() {
|
new AsyncCallback<ResultSetPaginatedData>() {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
// showLoading(false);
|
// showLoading(false);
|
||||||
// Window.alert(caught.getMessage());
|
// Window.alert(caught.getMessage());
|
||||||
|
panelResults.clear();
|
||||||
|
panelResults.add(new HTML("<hr>"));
|
||||||
|
Alert alert = new Alert("Error on searching. Please, refresh or change it");
|
||||||
|
alert.setType(AlertType.ERROR);
|
||||||
|
alert.setClose(false);
|
||||||
|
panelResults.add(alert);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(ResultSetPaginatedData result) {
|
public void onSuccess(ResultSetPaginatedData result) {
|
||||||
|
|
||||||
|
latestResult = result;
|
||||||
|
|
||||||
panelResults.clear();
|
panelResults.clear();
|
||||||
panelResults.add(new HTML("<hr>"));
|
panelResults.add(new HTML("<hr>"));
|
||||||
|
|
||||||
|
@ -216,20 +241,24 @@ public class SearchFacilityUI extends Composite {
|
||||||
|
|
||||||
FlexTable ft = new FlexTable();
|
FlexTable ft = new FlexTable();
|
||||||
ft.getElement().setClassName("table-results");
|
ft.getElement().setClassName("table-results");
|
||||||
int i = 0;
|
int i = 1;
|
||||||
ft.setWidget(0, i, new HTML("Name"));
|
ft.setWidget(0, i, new HTML("Name"));
|
||||||
|
|
||||||
String selValue = listBoxSearchFor.getSelectedValue().toLowerCase();
|
String selValue = listBoxSearchFor.getSelectedValue().toLowerCase();
|
||||||
|
|
||||||
boolean addIntroduction = false;
|
boolean addIntroduction = false;
|
||||||
if(selValue.startsWith("name")) {
|
if(selValue.startsWith("name") || selValue.startsWith("any")) {
|
||||||
ft.setWidget(0, ++i, new HTML("Introduction"));
|
ft.setWidget(0, ++i, new HTML("Introduction"));
|
||||||
addIntroduction = true;
|
addIntroduction = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean addStaff = false;
|
boolean addStaff = false;
|
||||||
if(selValue.startsWith("staff")) {
|
if(selValue.startsWith("direttore")) {
|
||||||
ft.setWidget(0, ++i, new HTML("Staff"));
|
ft.setWidget(0, ++i, new HTML("Authors"));
|
||||||
|
ft.setWidget(0, ++i, new HTML("Responsabile"));
|
||||||
|
ft.setWidget(0, ++i, new HTML("Editore"));
|
||||||
|
ft.setWidget(0, ++i, new HTML("Titolari"));
|
||||||
|
ft.setWidget(0, ++i, new HTML("Contributore"));
|
||||||
addStaff = true;
|
addStaff = true;
|
||||||
}
|
}
|
||||||
boolean addParole = false;
|
boolean addParole = false;
|
||||||
|
@ -242,12 +271,35 @@ public class SearchFacilityUI extends Composite {
|
||||||
i = 1;
|
i = 1;
|
||||||
for (ConcessioneDV concessione : result.getData()) {
|
for (ConcessioneDV concessione : result.getData()) {
|
||||||
int j = -1;
|
int j = -1;
|
||||||
|
|
||||||
|
NavLink locateOnMap = new NavLink("Show");
|
||||||
|
locateOnMap.setTitle("Locate on the Map and show details");
|
||||||
|
locateOnMap.setIcon(IconType.MAP_MARKER);
|
||||||
|
|
||||||
|
locateOnMap.addClickHandler(new ClickHandler() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(ClickEvent event) {
|
||||||
|
GeoNaItemRef gir = new GeoNaItemRef(concessione.getItemId(), GeoportalDataViewerConstants.RECORD_TYPE.CONCESSIONE.toString());
|
||||||
|
appManagerBus.fireEvent(new ShowDetailsEvent(gir, null, null));
|
||||||
|
appManagerBus.fireEvent(new ShowPopupOnCentroiEvent(concessione));
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
ft.setWidget(i, ++j, locateOnMap);
|
||||||
|
|
||||||
|
|
||||||
ft.setWidget(i, ++j, new HTML(concessione.getNome()));
|
ft.setWidget(i, ++j, new HTML(concessione.getNome()));
|
||||||
if(addIntroduction)
|
if(addIntroduction)
|
||||||
ft.setWidget(i, ++j, new HTML(StringUtil.ellipsize(concessione.getIntroduzione(), 100)));
|
ft.setWidget(i, ++j, new HTML(StringUtil.ellipsize(concessione.getIntroduzione(), 100)));
|
||||||
|
|
||||||
if(addStaff) {
|
if(addStaff) {
|
||||||
ft.setWidget(i, ++j, new HTML(toDisplayList(concessione.getAuthors())));
|
ft.setWidget(i, ++j, new HTML(toDisplayList(concessione.getAuthors())));
|
||||||
|
ft.setWidget(i, ++j, new HTML(toDisplayList(Arrays.asList(concessione.getResponsabile()))));
|
||||||
|
ft.setWidget(i, ++j, new HTML(toDisplayList(Arrays.asList(concessione.getEditore()))));
|
||||||
|
ft.setWidget(i, ++j, new HTML(toDisplayList(concessione.getTitolari())));
|
||||||
|
ft.setWidget(i, ++j, new HTML(toDisplayList(Arrays.asList(concessione.getContributore()))));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(addParole) {
|
if(addParole) {
|
||||||
|
@ -346,15 +398,22 @@ public class SearchFacilityUI extends Composite {
|
||||||
if (searchText != null && !searchText.isEmpty()) {
|
if (searchText != null && !searchText.isEmpty()) {
|
||||||
Map<String, Object> searchInto = new HashMap<String, Object>();
|
Map<String, Object> searchInto = new HashMap<String, Object>();
|
||||||
|
|
||||||
String searchForField = "";
|
List<String> listOfSeachingFields = new ArrayList<String>();
|
||||||
|
|
||||||
for (ItemField recordField : searchForFields) {
|
for (ItemField recordField : searchForFields) {
|
||||||
if (recordField.getDisplayName().equals(listBoxSearchFor.getSelectedValue())) {
|
if (recordField.getDisplayName().equals(listBoxSearchFor.getSelectedValue())) {
|
||||||
searchForField = recordField.getJsonFields().get(0);
|
listOfSeachingFields = recordField.getJsonFields();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
searchInto.put(searchForField, searchText);
|
|
||||||
|
if(listOfSeachingFields.size()==0) {
|
||||||
|
listOfSeachingFields.add("nome");
|
||||||
|
}
|
||||||
|
for (String fieldname : listOfSeachingFields) {
|
||||||
|
searchInto.put(fieldname, searchText);
|
||||||
|
}
|
||||||
|
|
||||||
searchingFilter.setSearchInto(searchInto);
|
searchingFilter.setSearchInto(searchInto);
|
||||||
}
|
}
|
||||||
return searchingFilter;
|
return searchingFilter;
|
||||||
|
|
|
@ -701,13 +701,16 @@ public class GeoportalDataViewerServiceImpl extends RemoteServiceServlet impleme
|
||||||
// return gc.getGNADataConfig().getListItemFields();
|
// return gc.getGNADataConfig().getListItemFields();
|
||||||
|
|
||||||
List<ItemField> listItemFields = new ArrayList<ItemField>();
|
List<ItemField> listItemFields = new ArrayList<ItemField>();
|
||||||
|
listItemFields.add(new ItemField("Any Field",
|
||||||
|
Arrays.asList("nome", "authors", "introduzione", "contributore", "titolari", "editore", "responsabile", "paroleChiaveLibere", "paroleChiaveICCD"), false, false, true));
|
||||||
listItemFields.add(new ItemField("Name", Arrays.asList("nome"), true, true, true));
|
listItemFields.add(new ItemField("Name", Arrays.asList("nome"), true, true, true));
|
||||||
listItemFields.add(new ItemField("Staff", Arrays.asList("authors"), true, true, true));
|
listItemFields.add(new ItemField("Direttore/Staff",
|
||||||
listItemFields.add(new ItemField("Parola chiave", Arrays.asList("paroleChiaveLibere","paroleChiaveICCD"), true, true, true));
|
Arrays.asList("authors", "contributore", "titolari", "editore", "responsabile"), true, false, true));
|
||||||
|
listItemFields.add(new ItemField("Parola chiave", Arrays.asList("paroleChiaveLibere", "paroleChiaveICCD"), true,
|
||||||
|
false, true));
|
||||||
return listItemFields;
|
return listItemFields;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the list concessioni.
|
* Gets the list concessioni.
|
||||||
*
|
*
|
||||||
|
|
|
@ -473,14 +473,14 @@ body {
|
||||||
|
|
||||||
.table-results {
|
.table-results {
|
||||||
table-layout: fixed;
|
table-layout: fixed;
|
||||||
width: 600px;
|
/*width: 600px;*/
|
||||||
}
|
}
|
||||||
|
|
||||||
.table-results td {
|
.table-results td {
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
/* For Firefox */
|
/* For Firefox */
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
word-break: break-all;
|
/*word-break: break-all;*/
|
||||||
/* For Chrome and IE */
|
/* For Chrome and IE */
|
||||||
word-wrap: break-word;
|
word-wrap: break-word;
|
||||||
}
|
}
|
||||||
|
@ -496,6 +496,6 @@ body {
|
||||||
}
|
}
|
||||||
|
|
||||||
.table-results td:nth-child(1) {
|
.table-results td:nth-child(1) {
|
||||||
width: 200px;
|
/*width: 200px;*/
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue