From 68b5548718032bb08e6a14874885ed96d0e3d250 Mon Sep 17 00:00:00 2001 From: "francesco.mangiacrapa" Date: Wed, 31 Aug 2022 17:16:39 +0200 Subject: [PATCH] #23784 List, Reload, Searching and Ordering facilities migrated --- CHANGELOG.md | 3 ++- .../client/ConstantsGeoPortalDataEntryApp.java | 2 ++ .../client/GeoPortalDataEntryApp.java | 4 ++-- .../client/ui/GeonaMainTabPanel.java | 11 ++++++----- .../client/ui/GeonaRecordsPaginatedView.java | 3 ++- .../server/GeoportalDataEntryServiceImpl.java | 9 +++++++++ 6 files changed, 23 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4dab90b..1d996e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,9 +11,10 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm - [#22684] Migrated to geoportal-data-entry-app configuration for UCD - [#23587] GUI model viewer passed to tree data structure -- Moved to maven-portal-bom v3.7.0[-SNAPSHOT] - [#22883] Integrated with (the new) geoportal-client (>= 1.1.0-SNAPSHOT) - [#22685] Migrated to geoportal-data-list configuration for UCD +- [#23784] Migrated list and reload, searching and ordering functionalities +- Moved to maven-portal-bom v3.7.0[-SNAPSHOT] ## [v2.2.1] - 2022-06-29 diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ConstantsGeoPortalDataEntryApp.java b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ConstantsGeoPortalDataEntryApp.java index c945bdc..80938ba 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ConstantsGeoPortalDataEntryApp.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ConstantsGeoPortalDataEntryApp.java @@ -26,6 +26,8 @@ public class ConstantsGeoPortalDataEntryApp { public static final String HOURS_MINUTES_SEPARATOR = ConstantsMPFormBuilder.HOURS_MINUTES_SEPARATOR; public static final int MAX_COLUMN_DISPLAYED_IN_THE_TABLE = 5; + + public static final int PAGINATION_SIZE = 20; /** * The Enum RECORD_TYPE. diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoPortalDataEntryApp.java b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoPortalDataEntryApp.java index 84febcf..c7d5fdf 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoPortalDataEntryApp.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoPortalDataEntryApp.java @@ -117,7 +117,7 @@ public class GeoPortalDataEntryApp implements EntryPoint { private UserRights myRights = null; - private LoaderIcon loaderApplication = new LoaderIcon("Loading Application... please wait"); + private LoaderIcon loaderApplication = new LoaderIcon("Loading Application facilities... please wait"); private LoaderIcon loaderConfigurations = new LoaderIcon("Loading Configurations... please wait"); @@ -824,7 +824,7 @@ public class GeoPortalDataEntryApp implements EntryPoint { CacheSearchingFilterParametersFromConfig seachingFilterParameters = geoportalCaches .getFilterParametersForProfileId(getListOfRecordsEvent.getProfileID()); - if (searchingFilter == null || getListOfRecordsEvent.isOnApplicationInit()) { + if (searchingFilter == null || getListOfRecordsEvent.isOnApplicationInit() || getListOfRecordsEvent.isReloadFilteringParameters()) { mainTabPanel.setFilteringParameters(seachingFilterParameters); searchingFilter = mainTabPanel.getCurrentSearchingFilter(); } diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/GeonaMainTabPanel.java b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/GeonaMainTabPanel.java index 6bed384..28b9473 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/GeonaMainTabPanel.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/GeonaMainTabPanel.java @@ -311,11 +311,12 @@ public class GeonaMainTabPanel extends Composite { @Override public void onClick(ClickEvent event) { - Window.alert("buttonReloadConcessioni MUST BE REVISITED"); - /* - * appManagerBus.fireEvent(new GetListOfRecordsEvent(RECORD_TYPE.CONCESSIONE, - * getCurrentSortFilter())); - */ + + UseCaseDescriptorDV singleUCD = getSelectProjectType(); + if (singleUCD != null) { + appManagerBus.fireEvent(new GetListOfRecordsEvent(false, singleUCD.getName(), + singleUCD.getProfileID(), getCurrentSearchingFilter(), true)); + } } }); diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/GeonaRecordsPaginatedView.java b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/GeonaRecordsPaginatedView.java index f3d6916..bd36870 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/GeonaRecordsPaginatedView.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/GeonaRecordsPaginatedView.java @@ -8,6 +8,7 @@ import org.gcube.application.geoportalcommon.shared.SearchingFilter; import org.gcube.application.geoportalcommon.shared.geoportal.DocumentDV; import org.gcube.application.geoportalcommon.shared.geoportal.config.ItemFieldDV; import org.gcube.application.geoportalcommon.shared.geoportal.project.ProjectDV; +import org.gcube.portlets.user.geoportaldataentry.client.ConstantsGeoPortalDataEntryApp; import org.gcube.portlets.user.geoportaldataentry.client.GeoPortalDataEntryApp; import org.gcube.portlets.user.geoportaldataentry.client.ui.table.ItemsTable; import org.gcube.portlets.user.geoportaldataentry.client.ui.table.SortedCellTable; @@ -40,7 +41,7 @@ import com.google.gwt.view.client.SingleSelectionModel; public class GeonaRecordsPaginatedView { private static final int ITEM_START_INDEX = 0; - private static final int ITEMS_PER_PAGE = 10; + private static final int ITEMS_PER_PAGE = ConstantsGeoPortalDataEntryApp.PAGINATION_SIZE; private VerticalPanel vPanel = new VerticalPanel(); private FlowPanel pagerPanel = new FlowPanel(); private Boolean initClassFirstRangeChanged = false; diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/server/GeoportalDataEntryServiceImpl.java b/src/main/java/org/gcube/portlets/user/geoportaldataentry/server/GeoportalDataEntryServiceImpl.java index 1509d87..a7a274c 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataentry/server/GeoportalDataEntryServiceImpl.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataentry/server/GeoportalDataEntryServiceImpl.java @@ -400,6 +400,15 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen List toReturnList = ConvertToDataValueObjectModel.toListResultDocument(projects); searchedData.setData(toReturnList); + + + // TODO BUGGY WORKAROUND. BLOCKED BY #22487 IT MUST BE REMOVE AFTER THE QUERY COUNT + // AND LIST.SIZE BY QUERY WILL BE AVAILABLE IN THE SERVICE + if (filter.getConditions() != null) { + searchedData.setTotalItems(toReturnList.size()); + int totalItems = toReturnList.size(); + searchedData.setTotalItems(totalItems); + } if (totalProjectForProfile == limit || totalProjectForProfile == 0) { LOG.debug("Page completed returning " + totalProjectForProfile + " projects");