Merge pull request 'bug_25265' (!12) from bug_25265 into master

Reviewed-on: #12
This commit is contained in:
Francesco Mangiacrapa 2023-06-19 10:59:13 +02:00
commit c9e2b1598d
9 changed files with 83 additions and 66 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry including="**/*.java" kind="src" output="target/geoportal-data-entry-app-3.2.0-SNAPSHOT/WEB-INF/classes" path="src/main/java">
<classpathentry including="**/*.java" kind="src" output="target/geoportal-data-entry-app-3.2.0/WEB-INF/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
@ -31,5 +31,5 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/geoportal-data-entry-app-3.2.0-SNAPSHOT/WEB-INF/classes"/>
<classpathentry kind="output" path="target/geoportal-data-entry-app-3.2.0/WEB-INF/classes"/>
</classpath>

View File

@ -1,5 +1,5 @@
eclipse.preferences.version=1
jarsExcludedFromWebInfLib=
lastWarOutDir=/home/francescomangiacrapa/git/geoportal-data-entry-app/target/geoportal-data-entry-app-3.2.0-SNAPSHOT
lastWarOutDir=/home/francescomangiacrapa/git/geoportal-data-entry-app/target/geoportal-data-entry-app-3.2.0
warSrcDir=src/main/webapp
warSrcDirIsOutput=false

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
@ -111,8 +111,14 @@
<wb-module deploy-name="geoportal-data-entry-app-3.2.0-SNAPSHOT">
<wb-module deploy-name="geoportal-data-entry-app-3.2.0">
@ -225,7 +231,10 @@
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
@ -338,7 +347,10 @@
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
@ -451,7 +463,10 @@
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
@ -516,7 +531,10 @@
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
@ -629,7 +647,10 @@
<property name="context-root" value="geoportal-data-entry-app"/>
@ -742,7 +763,10 @@
<property name="java-output-path" value="/geoportal-data-entry-app/target/geoportal-data-entry-app-2.0.0-SNAPSHOT/WEB-INF/classes"/>
@ -855,7 +879,10 @@
</wb-module>

View File

@ -4,7 +4,11 @@
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).
## [v3.2.0] - 2022-05-12
## [v3.2.1-SNAPSHOT] - 2023-06-16
- Fixed issue in the Search facility [#25265]
## [v3.2.0] - 2023-05-12
- Implemented the Update facility [#24166]
- Integrated with the geoportal-data-mapper library [#24244]

View File

@ -7,14 +7,14 @@
<parent>
<artifactId>maven-parent</artifactId>
<groupId>org.gcube.tools</groupId>
<version>1.1.0</version>
<version>1.2.0</version>
<relativePath />
</parent>
<groupId>org.gcube.portlets.user</groupId>
<artifactId>geoportal-data-entry-app</artifactId>
<packaging>war</packaging>
<version>3.2.0</version>
<version>3.2.1-SNAPSHOT</version>
<name>GeoPortal Data Entry App</name>
<description>The GeoPortal Data Entry App is an application to build the web forms for data entries needed to create projects/documents (based on UCD) in the D4Science Geoportal service</description>
<scm>

View File

@ -837,14 +837,10 @@ public class GeoPortalDataEntryApp implements EntryPoint {
}
}
// TODO MUST MANAGE getListOfRecordsEvent.isReloadFilteringParameters()
searchingFilter.setProjection(seachingFilterParameters.getProjection());
List<ItemFieldDV> displayFields = seachingFilterParameters.getDisplayFields();
grpw = new GeonaRecordsPaginatedView(appManagerBus, profileID, displayFields, searchingFilter);
mainTabPanel.showListOfProjectsView(grpw);
// The Project Type is changed

View File

@ -15,7 +15,7 @@ public class GetListOfRecordsEvent extends GwtEvent<GetListOfRecordsEventHandler
/** The type. */
public static Type<GetListOfRecordsEventHandler> TYPE = new Type<GetListOfRecordsEventHandler>();
private SearchingFilter sortFilter;
private SearchingFilter searchingFilter;
private String profileID;
private String projectName;
private Boolean reloadFilteringParameters = false;
@ -26,13 +26,13 @@ public class GetListOfRecordsEvent extends GwtEvent<GetListOfRecordsEventHandler
*
* @param onApplicationInit the on application init
* @param profileID the profile ID
* @param sortFilter the sort filter
* @param searchingFilter the searching filter
* @param reloadFilteringParameters the reload filtering parameters
*/
public GetListOfRecordsEvent(boolean onApplicationInit, String profileID, SearchingFilter sortFilter,
public GetListOfRecordsEvent(boolean onApplicationInit, String profileID, SearchingFilter searchingFilter,
Boolean reloadFilteringParameters) {
this.onApplicationInit = onApplicationInit;
this.sortFilter = sortFilter;
this.searchingFilter = searchingFilter;
this.profileID = profileID;
this.reloadFilteringParameters = reloadFilteringParameters;
}
@ -75,7 +75,7 @@ public class GetListOfRecordsEvent extends GwtEvent<GetListOfRecordsEventHandler
* @return the searching filter
*/
public SearchingFilter getSearchingFilter() {
return sortFilter;
return searchingFilter;
}
/**
@ -113,8 +113,8 @@ public class GetListOfRecordsEvent extends GwtEvent<GetListOfRecordsEventHandler
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("GetListOfRecordsEvent [sortFilter=");
builder.append(sortFilter);
builder.append("GetListOfRecordsEvent [searchingFilter=");
builder.append(searchingFilter);
builder.append(", profileID=");
builder.append(profileID);
builder.append(", projectName=");

View File

@ -50,7 +50,6 @@ public class GeonaRecordsPaginatedView {
private MyCustomDataProvider<DocumentDV> dataProvider = new MyCustomDataProvider<DocumentDV>();
protected Widget orginalLoadingIndicator = null;
private LoaderIcon loadingPanel = new LoaderIcon("Loading data...");
// private int serverStartIndex;
private HandlerManager eventBus;
private SearchingFilter currentSearchingFilter;
private String profileID;
@ -74,7 +73,6 @@ public class GeonaRecordsPaginatedView {
orginalLoadingIndicator = itemsTable.getCellTable().getLoadingIndicator();
initPagination(ITEMS_PER_PAGE);
// loadNewPage(ITEM_START_INDEX, ITEMS_PER_PAGE, false);
loadItemsForType(profileID);
}
@ -117,31 +115,27 @@ public class GeonaRecordsPaginatedView {
/**
* Load new page.
*
* @param profileID the profile ID
* @param startIdx the start idx
* @param limit the limit
* @param resetStore the reset store
* @param currentSortFilter the current sort filter
* @param invalidCache the invalid cache
* @param profileID the profile ID
* @param startIdx the start idx
* @param limit the limit
* @param resetStore the reset store
* @param currentSearchFilter the current search filter
* @param invalidCache the invalid cache
*/
private void loadNewPage(String profileID, final int startIdx, final int limit, final boolean resetStore,
final SearchingFilter currentSortFilter, final boolean invalidCache) {
// initFirstRangeChanged = resetStore;
final SearchingFilter currentSearchFilter, final boolean invalidCache) {
GWT.log("loadNewPage with parameters [startIdx: " + startIdx + ", limit: " + limit + ", resetStore:"
+ resetStore + "]");
// showLoading(true);
int newStartIndex = startIdx;
if (resetStore) {
GWT.log("Cleaning all data...");
newStartIndex = 0;
// serverStartIndex = 0;
GWT.log("Store reset performed start index is: " + newStartIndex);
getTableDataProvider().updateRowCount(ITEMS_PER_PAGE, false);
}
loadProjects(profileID, newStartIndex, limit, currentSortFilter, invalidCache);
loadProjects(profileID, newStartIndex, limit, currentSearchFilter, invalidCache);
}
/**
@ -221,17 +215,17 @@ public class GeonaRecordsPaginatedView {
* @param theProfileID the the profile ID
* @param newStartIndex the new start index
* @param limit the limit
* @param sortFilter the sort filter
* @param searchFilter the search filter
* @param invalidCache the invalid cache
*/
private <T> void loadProjects(String theProfileID, int newStartIndex, int limit, SearchingFilter sortFilter,
private <T> void loadProjects(String theProfileID, int newStartIndex, int limit, SearchingFilter searchFilter,
boolean invalidCache) {
showLoading(true);
GWT.log("calling loadItemsForStatus with parameters [theProfileID: " + theProfileID + ", startIndex: "
+ newStartIndex + ", limit: " + limit + ", sortFilter: " + sortFilter + "]");
GeoPortalDataEntryApp.geoportalDataEntryService.getListProjects(theProfileID, newStartIndex, limit, sortFilter,
invalidCache, new AsyncCallback<ResultSetPaginatedData>() {
+ newStartIndex + ", limit: " + limit + ", searchFilter: " + searchFilter + "]");
GeoPortalDataEntryApp.geoportalDataEntryService.getListProjects(theProfileID, newStartIndex, limit,
searchFilter, invalidCache, new AsyncCallback<ResultSetPaginatedData>() {
@Override
public void onFailure(Throwable caught) {
@ -265,11 +259,16 @@ public class GeonaRecordsPaginatedView {
itemsTable.getSelectionModel().setSelected(item, select);
}
}
/**
* Removes the column.
*
* @param columnName the column name
*/
public void removeColumn(DEFAULT_DISPLAYING_COLUMN_NAME columnName) {
try {
itemsTable.removeColumn(columnName);
}catch (Exception e) {
} catch (Exception e) {
// TODO: handle exception
}
}
@ -283,9 +282,6 @@ public class GeonaRecordsPaginatedView {
return itemsTable.getSelectedItems();
}
// int latestRangeStart = -1;
// int latestRangeLenght = -1;
/**
* A custom {@link AsyncDataProvider}.
*
@ -310,15 +306,6 @@ public class GeonaRecordsPaginatedView {
int start = range.getStart();
int length = range.getLength();
// if(latestRangeStart!=start || latestRangeLenght!=length) {
// GWT.log("ranges really changed");
// latestRangeStart = start;
// latestRangeLenght = length;
// }else {
// GWT.log("ranges DO NOT changed");
// return;
// }
if (initClassFirstRangeChanged) {
GWT.log("initClassFirstRangeChanged is true.. returning");
initClassFirstRangeChanged = false;
@ -326,8 +313,6 @@ public class GeonaRecordsPaginatedView {
}
GWT.log("Range changed: " + start + " " + length + " visible count: " + display.getVisibleItemCount());
loadNewPage(profileID, start, length, false, currentSearchingFilter, false);
// eventBus.fireEvent(new TableRangeViewChangedEvent<T>(start, length));
}
}

View File

@ -1,5 +1,6 @@
package org.gcube.portlets.user.geoportaldataentry.client.ui.projects;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
@ -346,21 +347,25 @@ public class ListOfProjectTablePanel extends Composite {
if (searchText != null && !searchText.isEmpty()) {
Map<String, Object> searchInto = new HashMap<String, Object>();
String searchForField = "";
List<String> listOfSeachingFields = new ArrayList<String>();
for (ItemFieldDV recordField : cacheSearchingFilterParameters.getSearchByFields()) {
if (recordField.getDisplayName().equals(alertSearchFor.getText())) {
searchForField = recordField.getJsonFields().get(0);
listOfSeachingFields = recordField.getJsonFields();
continue;
}
}
searchInto.put(searchForField, searchText);
for (String fieldname : listOfSeachingFields) {
searchInto.put(fieldname, searchText);
}
WhereClause where = new WhereClause();
where.setSearchInto(searchInto);
where.setOperator(LOGICAL_OP.OR);
searchingFilter.setConditions(Arrays.asList(where));
}
return searchingFilter;
}