#24300 Done. Improved the GUI of the search functionality when multiple
collections are available.
This commit is contained in:
parent
78cc536f54
commit
b797a9fd8d
|
@ -1,12 +1,12 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<classpath>
|
<classpath>
|
||||||
<classpathentry kind="src" output="target/geoportal-data-viewer-app-3.0.0/WEB-INF/classes" path="src/main/java">
|
<classpathentry kind="src" output="target/geoportal-data-viewer-app-3.0.1-SNAPSHOT/WEB-INF/classes" path="src/main/java">
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="optional" value="true"/>
|
<attribute name="optional" value="true"/>
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
<classpathentry excluding="**" kind="src" output="target/geoportal-data-viewer-app-3.0.0/WEB-INF/classes" path="src/main/resources">
|
<classpathentry excluding="**" kind="src" output="target/geoportal-data-viewer-app-3.0.1-SNAPSHOT/WEB-INF/classes" path="src/main/resources">
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
|
@ -35,5 +35,5 @@
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
<classpathentry kind="output" path="target/geoportal-data-viewer-app-3.0.0/WEB-INF/classes"/>
|
<classpathentry kind="output" path="target/geoportal-data-viewer-app-3.0.1-SNAPSHOT/WEB-INF/classes"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
eclipse.preferences.version=1
|
eclipse.preferences.version=1
|
||||||
lastWarOutDir=/home/francescomangiacrapa/git/geoportal-data-viewer-app/target/geoportal-data-viewer-app-3.0.0
|
lastWarOutDir=/home/francescomangiacrapa/git/geoportal-data-viewer-app/target/geoportal-data-viewer-app-3.0.1-SNAPSHOT
|
||||||
warSrcDir=src/main/webapp
|
warSrcDir=src/main/webapp
|
||||||
warSrcDirIsOutput=false
|
warSrcDirIsOutput=false
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
|
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -35,8 +35,10 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<wb-module deploy-name="geoportal-data-viewer-app-3.0.0">
|
|
||||||
|
<wb-module deploy-name="geoportal-data-viewer-app-3.0.1-SNAPSHOT">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -73,7 +75,8 @@
|
||||||
|
|
||||||
|
|
||||||
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
|
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -110,7 +113,8 @@
|
||||||
|
|
||||||
|
|
||||||
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
|
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -147,7 +151,8 @@
|
||||||
|
|
||||||
|
|
||||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/target/generated-sources/gwt"/>
|
<wb-resource deploy-path="/WEB-INF/classes" source-path="/target/generated-sources/gwt"/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -184,7 +189,8 @@
|
||||||
|
|
||||||
|
|
||||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
|
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -221,7 +227,8 @@
|
||||||
|
|
||||||
|
|
||||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
|
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -258,7 +265,8 @@
|
||||||
|
|
||||||
|
|
||||||
<property name="java-output-path" value="/geoportal-data-viewer-app/target/geoportal-data-viewer-app-0.0.1-SNAPSHOT/WEB-INF/classes"/>
|
<property name="java-output-path" value="/geoportal-data-viewer-app/target/geoportal-data-viewer-app-0.0.1-SNAPSHOT/WEB-INF/classes"/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -295,7 +303,8 @@
|
||||||
|
|
||||||
|
|
||||||
<property name="context-root" value="geoportal-data-viewer-app"/>
|
<property name="context-root" value="geoportal-data-viewer-app"/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -332,7 +341,8 @@
|
||||||
|
|
||||||
|
|
||||||
</wb-module>
|
</wb-module>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,10 @@
|
||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [v3.0.1-SNAPSHOT] - 2022-12-13
|
||||||
|
|
||||||
|
- [#24300] Improved the GUI of the search functionality when multiple collections are available.
|
||||||
|
|
||||||
## [v3.0.0] - 2022-11-28
|
## [v3.0.0] - 2022-11-28
|
||||||
|
|
||||||
- [#23940] Passed to CMS-UCD
|
- [#23940] Passed to CMS-UCD
|
||||||
|
|
2
pom.xml
2
pom.xml
|
@ -14,7 +14,7 @@
|
||||||
<groupId>org.gcube.portlets.user</groupId>
|
<groupId>org.gcube.portlets.user</groupId>
|
||||||
<artifactId>geoportal-data-viewer-app</artifactId>
|
<artifactId>geoportal-data-viewer-app</artifactId>
|
||||||
<packaging>war</packaging>
|
<packaging>war</packaging>
|
||||||
<version>3.0.0</version>
|
<version>3.0.1-SNAPSHOT</version>
|
||||||
<name>GeoPortal Data Viewer App</name>
|
<name>GeoPortal Data Viewer App</name>
|
||||||
<description>The GeoPortal Data Viewer App is an application to access, discovery and navigate the Geoportal projects/documents by a Web-Map Interface</description>
|
<description>The GeoPortal Data Viewer App is an application to access, discovery and navigate the Geoportal projects/documents by a Web-Map Interface</description>
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,7 @@ import org.gcube.portlets.user.geoportaldataviewer.shared.gis.BaseMapLayer;
|
||||||
import com.github.gwtbootstrap.client.ui.Button;
|
import com.github.gwtbootstrap.client.ui.Button;
|
||||||
import com.github.gwtbootstrap.client.ui.CheckBox;
|
import com.github.gwtbootstrap.client.ui.CheckBox;
|
||||||
import com.github.gwtbootstrap.client.ui.DropdownButton;
|
import com.github.gwtbootstrap.client.ui.DropdownButton;
|
||||||
|
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.NavList;
|
import com.github.gwtbootstrap.client.ui.NavList;
|
||||||
import com.github.gwtbootstrap.client.ui.Paragraph;
|
import com.github.gwtbootstrap.client.ui.Paragraph;
|
||||||
|
@ -38,6 +39,8 @@ import com.google.gwt.core.client.GWT;
|
||||||
import com.google.gwt.core.client.Scheduler;
|
import com.google.gwt.core.client.Scheduler;
|
||||||
import com.google.gwt.core.client.Scheduler.ScheduledCommand;
|
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.ChangeEvent;
|
||||||
|
import com.google.gwt.event.dom.client.ChangeHandler;
|
||||||
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;
|
||||||
import com.google.gwt.event.logical.shared.ValueChangeEvent;
|
import com.google.gwt.event.logical.shared.ValueChangeEvent;
|
||||||
|
@ -56,6 +59,8 @@ import com.google.gwt.user.client.ui.ScrollPanel;
|
||||||
import com.google.gwt.user.client.ui.SimplePanel;
|
import com.google.gwt.user.client.ui.SimplePanel;
|
||||||
import com.google.gwt.user.client.ui.Widget;
|
import com.google.gwt.user.client.ui.Widget;
|
||||||
|
|
||||||
|
import ol.has.Has;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Class GeonaDataViewMainPanel.
|
* The Class GeonaDataViewMainPanel.
|
||||||
*
|
*
|
||||||
|
@ -65,6 +70,8 @@ import com.google.gwt.user.client.ui.Widget;
|
||||||
*/
|
*/
|
||||||
public class GeonaDataViewMainPanel extends Composite {
|
public class GeonaDataViewMainPanel extends Composite {
|
||||||
|
|
||||||
|
private static final String PLACEHOLDER_SELECT_SEARCH_IN = "Select Collection...";
|
||||||
|
|
||||||
private static GeonaDataViewMainPanelUiBinder uiBinder = GWT.create(GeonaDataViewMainPanelUiBinder.class);
|
private static GeonaDataViewMainPanelUiBinder uiBinder = GWT.create(GeonaDataViewMainPanelUiBinder.class);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -114,7 +121,7 @@ public class GeonaDataViewMainPanel extends Composite {
|
||||||
DropdownButton searchFacilityButton;
|
DropdownButton searchFacilityButton;
|
||||||
|
|
||||||
@UiField
|
@UiField
|
||||||
NavList navListSearch;
|
ListBox navListSearch;
|
||||||
|
|
||||||
@UiField
|
@UiField
|
||||||
ScrollPanel overlayLayersPanel;
|
ScrollPanel overlayLayersPanel;
|
||||||
|
@ -142,6 +149,10 @@ public class GeonaDataViewMainPanel extends Composite {
|
||||||
|
|
||||||
private HashMap<String, List<CheckBox>> mapCollectionCheckBoxes;
|
private HashMap<String, List<CheckBox>> mapCollectionCheckBoxes;
|
||||||
|
|
||||||
|
private SearchFacilityUI currentSearchFacility;
|
||||||
|
|
||||||
|
private HashMap<String, ItemFieldsResponse> mapItemFieldsForUCD = new HashMap<String, ItemFieldsResponse>();
|
||||||
|
|
||||||
public GeonaDataViewMainPanel(HandlerManager applicationBus, int mapHeight,
|
public GeonaDataViewMainPanel(HandlerManager applicationBus, int mapHeight,
|
||||||
List<ItemFieldsResponse> itemFieldsReponse) {
|
List<ItemFieldsResponse> itemFieldsReponse) {
|
||||||
initWidget(uiBinder.createAndBindUi(this));
|
initWidget(uiBinder.createAndBindUi(this));
|
||||||
|
@ -171,53 +182,67 @@ public class GeonaDataViewMainPanel extends Composite {
|
||||||
|
|
||||||
openCollectionDropDown.setIcon(IconType.COMPASS);
|
openCollectionDropDown.setIcon(IconType.COMPASS);
|
||||||
|
|
||||||
|
mapItemFieldsForUCD.clear();
|
||||||
|
|
||||||
SearchingFilter initialSortFilter = new SearchingFilter();
|
SearchingFilter initialSortFilter = new SearchingFilter();
|
||||||
initialSortFilter.setOrder(ORDER.ASC);
|
initialSortFilter.setOrder(ORDER.ASC);
|
||||||
|
|
||||||
for (final ItemFieldsResponse ifResponse : itemFieldsReponse) {
|
navListSearch.addItem(PLACEHOLDER_SELECT_SEARCH_IN, PLACEHOLDER_SELECT_SEARCH_IN);
|
||||||
|
|
||||||
|
navListSearch.getElement().getFirstChildElement().setAttribute("disabled", "disabled");
|
||||||
|
|
||||||
List<ItemFieldDV> result = ifResponse.getListItemFields();
|
for (final ItemFieldsResponse itemFieldResp : itemFieldsReponse) {
|
||||||
List<ItemFieldDV> displayFields = new ArrayList<ItemFieldDV>();
|
|
||||||
List<ItemFieldDV> searchByFields = new ArrayList<ItemFieldDV>();
|
|
||||||
List<ItemFieldDV> sortByFields = new ArrayList<ItemFieldDV>();
|
|
||||||
for (ItemFieldDV itemField : result) {
|
|
||||||
if (itemField.isDisplayAsResult()) {
|
|
||||||
displayFields.add(itemField);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (itemField.isSearchable()) {
|
UseCaseDescriptorDV ucd = itemFieldResp.getUseCaseDescriptorDV();
|
||||||
searchByFields.add(itemField);
|
mapItemFieldsForUCD.put(ucd.getId(), itemFieldResp);
|
||||||
}
|
GWT.log("Added navLink for: " + ucd.getName());
|
||||||
|
navListSearch.addItem(ucd.getName(), ucd.getProfileID());
|
||||||
|
}
|
||||||
|
|
||||||
if (itemField.isSortable()) {
|
navListSearch.addChangeHandler(new ChangeHandler() {
|
||||||
sortByFields.add(itemField);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
final UseCaseDescriptorDV ucd = ifResponse.getUseCaseDescriptorDV();
|
private SearchFacilityUI currentSearchFacility;
|
||||||
NavLink navLink = new NavLink(ifResponse.getUseCaseDescriptorDV().getName());
|
|
||||||
// navLink.setText(ucd.getName());
|
|
||||||
navLink.addClickHandler(new ClickHandler() {
|
|
||||||
|
|
||||||
private SearchFacilityUI currentSearchFacility;
|
@Override
|
||||||
|
public void onChange(ChangeEvent event) {
|
||||||
|
|
||||||
@Override
|
if (this.currentSearchFacility != null)
|
||||||
public void onClick(ClickEvent event) {
|
this.currentSearchFacility.resetCurrentSearch();
|
||||||
if (this.currentSearchFacility != null)
|
|
||||||
this.currentSearchFacility.resetCurrentSearch();
|
|
||||||
|
|
||||||
|
String ucdProfileID = navListSearch.getValue(navListSearch.getSelectedIndex());
|
||||||
|
GWT.log("UCD ProfileID selected: " + ucdProfileID);
|
||||||
|
|
||||||
|
if (ucdProfileID.compareTo(PLACEHOLDER_SELECT_SEARCH_IN) != 0) {
|
||||||
|
|
||||||
searchFacilityPanel.clear();
|
searchFacilityPanel.clear();
|
||||||
this.currentSearchFacility = new SearchFacilityUI(ucd.getProfileID(), applicationBus, displayFields,
|
ItemFieldsResponse itemFieldResp = mapItemFieldsForUCD.get(ucdProfileID);
|
||||||
|
|
||||||
|
List<ItemFieldDV> result = itemFieldResp.getListItemFields();
|
||||||
|
List<ItemFieldDV> displayFields = new ArrayList<ItemFieldDV>();
|
||||||
|
List<ItemFieldDV> searchByFields = new ArrayList<ItemFieldDV>();
|
||||||
|
List<ItemFieldDV> sortByFields = new ArrayList<ItemFieldDV>();
|
||||||
|
for (ItemFieldDV itemField : result) {
|
||||||
|
if (itemField.isDisplayAsResult()) {
|
||||||
|
displayFields.add(itemField);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (itemField.isSearchable()) {
|
||||||
|
searchByFields.add(itemField);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (itemField.isSortable()) {
|
||||||
|
sortByFields.add(itemField);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.currentSearchFacility = new SearchFacilityUI(ucdProfileID, applicationBus, displayFields,
|
||||||
sortByFields, searchByFields, initialSortFilter);
|
sortByFields, searchByFields, initialSortFilter);
|
||||||
searchFacilityPanel.add(currentSearchFacility);
|
searchFacilityPanel.add(currentSearchFacility);
|
||||||
currentSearchFacility.setSearchButton(searchFacilityButton);
|
currentSearchFacility.setSearchButton(searchFacilityButton);
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
|
||||||
GWT.log("Added navLink for: " + ucd.getName());
|
}
|
||||||
navListSearch.add(navLink);
|
});
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
searchFacilityButton.setIcon(IconType.SEARCH);
|
searchFacilityButton.setIcon(IconType.SEARCH);
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,14 @@
|
||||||
padding-right: 15px;
|
padding-right: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.margin-left-top-5 {
|
||||||
|
margin-left: 5px;
|
||||||
|
margin-top: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.margin-left-5 {
|
||||||
|
margin-left: 5px;
|
||||||
|
}
|
||||||
</ui:style>
|
</ui:style>
|
||||||
<g:HTMLPanel ui:field="mainHTMLPanel">
|
<g:HTMLPanel ui:field="mainHTMLPanel">
|
||||||
<g:HTMLPanel ui:field="mainContainerPanel">
|
<g:HTMLPanel ui:field="mainContainerPanel">
|
||||||
|
@ -43,7 +51,8 @@
|
||||||
</b:DropdownButton>
|
</b:DropdownButton>
|
||||||
<b:DropdownButton type="LINK"
|
<b:DropdownButton type="LINK"
|
||||||
text="Open Collection" ui:field="openCollectionDropDown">
|
text="Open Collection" ui:field="openCollectionDropDown">
|
||||||
<g:HTMLPanel ui:field="openCollectionPanel" addStyleNames="{style.open-collection-style}">
|
<g:HTMLPanel ui:field="openCollectionPanel"
|
||||||
|
addStyleNames="{style.open-collection-style}">
|
||||||
</g:HTMLPanel>
|
</g:HTMLPanel>
|
||||||
</b:DropdownButton>
|
</b:DropdownButton>
|
||||||
<b:DropdownButton type="LINK"
|
<b:DropdownButton type="LINK"
|
||||||
|
@ -53,7 +62,14 @@
|
||||||
</b:DropdownButton>
|
</b:DropdownButton>
|
||||||
<b:DropdownButton type="LINK" text="Search"
|
<b:DropdownButton type="LINK" text="Search"
|
||||||
ui:field="searchFacilityButton">
|
ui:field="searchFacilityButton">
|
||||||
<b:NavList ui:field="navListSearch"></b:NavList>
|
<g:FlowPanel addStyleNames="search-field">
|
||||||
|
<g:HorizontalPanel>
|
||||||
|
<b:Label type="INFO">Search in </b:Label>
|
||||||
|
<b:ListBox title="Search in the Collection..."
|
||||||
|
ui:field="navListSearch">
|
||||||
|
</b:ListBox>
|
||||||
|
</g:HorizontalPanel>
|
||||||
|
</g:FlowPanel>
|
||||||
<g:ScrollPanel ui:field="searchFacilityPanel"
|
<g:ScrollPanel ui:field="searchFacilityPanel"
|
||||||
addStyleNames="search-facility"></g:ScrollPanel>
|
addStyleNames="search-facility"></g:ScrollPanel>
|
||||||
</b:DropdownButton>
|
</b:DropdownButton>
|
||||||
|
|
|
@ -488,6 +488,22 @@ body {
|
||||||
width: 250px !important;
|
width: 250px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.search-field {
|
||||||
|
margin: 5px;
|
||||||
|
background-color: #f9f9f9;
|
||||||
|
padding: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.search-field div {
|
||||||
|
margin-left: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.search-field select {
|
||||||
|
margin-left: 8px;
|
||||||
|
width: 505px !important;
|
||||||
|
margin-bottom: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
.table-results {
|
.table-results {
|
||||||
table-layout: fixed;
|
table-layout: fixed;
|
||||||
/*width: 600px;*/
|
/*width: 600px;*/
|
||||||
|
|
Loading…
Reference in New Issue