From fb7a80bb2f4717b29929a375cf117e0855f2754d Mon Sep 17 00:00:00 2001 From: "francesco.mangiacrapa" Date: Tue, 26 Mar 2024 17:00:37 +0100 Subject: [PATCH 01/13] Implementing the init facility to resolve a public link on an item #27120 --- .classpath | 4 +- .../com.gwtplugins.gdt.eclipse.core.prefs | 2 +- .settings/org.eclipse.wst.common.component | 230 +++++++++++- CHANGELOG.md | 4 + pom.xml | 7 +- .../ConstantsGeoPortalDataEntryApp.java | 4 + .../client/GeoPortalDataEntryApp.java | 327 ++++++++++++------ .../client/InitExecutor.java | 43 +++ .../client/events/GetListOfRecordsEvent.java | 7 +- .../client/events/OperationOnItemEvent.java | 5 + .../client/ui/GeonaMainTabPanel.java | 9 + .../ui/projects/ListOfProjectTablePanel.java | 23 +- .../server/GeoportalDataEntryServiceImpl.java | 16 +- 13 files changed, 552 insertions(+), 129 deletions(-) create mode 100644 src/main/java/org/gcube/portlets/user/geoportaldataentry/client/InitExecutor.java diff --git a/.classpath b/.classpath index 59c98da..d0dee6a 100644 --- a/.classpath +++ b/.classpath @@ -1,6 +1,6 @@ - + @@ -31,5 +31,5 @@ - + diff --git a/.settings/com.gwtplugins.gdt.eclipse.core.prefs b/.settings/com.gwtplugins.gdt.eclipse.core.prefs index a6efe72..2533716 100644 --- a/.settings/com.gwtplugins.gdt.eclipse.core.prefs +++ b/.settings/com.gwtplugins.gdt.eclipse.core.prefs @@ -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 +lastWarOutDir=/home/francescomangiacrapa/git/geoportal-data-entry-app/target/geoportal-data-entry-app-3.3.0-SNAPSHOT warSrcDir=src/main/webapp warSrcDirIsOutput=false diff --git a/.settings/org.eclipse.wst.common.component b/.settings/org.eclipse.wst.common.component index 35cb89c..d10a6f1 100644 --- a/.settings/org.eclipse.wst.common.component +++ b/.settings/org.eclipse.wst.common.component @@ -1,5 +1,5 @@ - + @@ -114,8 +114,54 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -231,7 +277,30 @@ - + + + + + + + + + + + + + + + + + + + + + + + + @@ -347,7 +416,30 @@ - + + + + + + + + + + + + + + + + + + + + + + + + @@ -463,7 +555,30 @@ - + + + + + + + + + + + + + + + + + + + + + + + + @@ -531,7 +646,33 @@ - + + uses + + + + + + + + + + + + + + + + + + + + + + + + + @@ -647,7 +788,30 @@ - + + + + + + + + + + + + + + + + + + + + + + + + @@ -763,7 +927,30 @@ - + + + + + + + + + + + + + + + + + + + + + + + + @@ -879,7 +1066,30 @@ - + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CHANGELOG.md b/CHANGELOG.md index 3bd1678..66d1c23 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ 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.3.0-SNAPSHOT] - 2024-03-26 + +- Implemented the init facility to resolve a public link on an item [#27120] + ## [v3.2.2] - 2024-01-11 - Improved display of results on multiple fields (in the table) [#26372] diff --git a/pom.xml b/pom.xml index 5dbdb43..62460d1 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ org.gcube.portlets.user geoportal-data-entry-app war - 3.2.2 + 3.3.0-SNAPSHOT GeoPortal Data Entry App 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 @@ -25,11 +25,12 @@ - 2.9.0 + 2.10.0 ${project.build.directory}/${project.build.finalName} UTF-8 UTF-8 + 1.8 1.8 @@ -224,7 +225,7 @@ slf4j-api provided - + junit 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 e175e9b..82e046d 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 @@ -25,6 +25,10 @@ public class ConstantsGeoPortalDataEntryApp { public static final String DIV_PORTLET_ID = "geoportal-data-entry"; public static final String DIV_LOADERS_ID = "geoportal-loaders"; + + public static final String GET_GEONA_ITEM_TYPE = "git"; + + public static final String GET_GEONA_ITEM_ID = "gid"; public static final String DATE_FORMAT = ConstantsMPFormBuilder.DATE_FORMAT; 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 2d5e469..968cc86 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 @@ -6,6 +6,7 @@ import java.util.Collection; import java.util.LinkedHashMap; import java.util.List; import java.util.TreeMap; +import java.util.stream.Collectors; import org.gcube.application.geoportalcommon.shared.GeoportalItemReferences; import org.gcube.application.geoportalcommon.shared.SearchingFilter; @@ -59,6 +60,7 @@ import org.gcube.portlets.user.geoportaldataentry.client.ui.card.GeoNaFormCardMo import org.gcube.portlets.user.geoportaldataentry.client.ui.edit.EditModeRecord; import org.gcube.portlets.user.geoportaldataentry.client.ui.edit.UpdateRecord; import org.gcube.portlets.user.geoportaldataentry.client.ui.form.GeonaDataEntryMainForm; +import org.gcube.portlets.user.geoportaldataentry.client.ui.projects.ListOfProjectTablePanel; import org.gcube.portlets.user.geoportaldataentry.client.ui.report.LifecycleInformationPanel; import org.gcube.portlets.user.geoportaldataentry.client.ui.report.ReportTemplateToHTML; import org.gcube.portlets.user.geoportaldataentry.client.ui.tree.NodeItem; @@ -103,6 +105,8 @@ import com.google.gwt.event.dom.client.ClickHandler; import com.google.gwt.event.logical.shared.ResizeEvent; import com.google.gwt.event.logical.shared.ResizeHandler; import com.google.gwt.event.shared.HandlerManager; +import com.google.gwt.user.client.Command; +import com.google.gwt.user.client.Timer; import com.google.gwt.user.client.Window; import com.google.gwt.user.client.rpc.AsyncCallback; import com.google.gwt.user.client.ui.Anchor; @@ -162,32 +166,19 @@ public class GeoPortalDataEntryApp implements EntryPoint { private GeoPortalClientCaches geoportalCaches; + private String paramGeonaItemType; + + private String paramGeonaItemID; + + private boolean canCreateNewItem = false; + /** * This is the entry point method. */ public void onModuleLoad() { - /* - * ArrayList gnaCardsModels = new - * ArrayList(10); GcubeProfileDV gprofile = new - * GcubeProfileDV(); gprofile.setParentName("$."); - * gprofile.setSectionTitle("Istruzione"); GeoNaFormCardModel fcm = new - * GeoNaFormCardModel(); fcm.setGcubeProfile(gprofile); gnaCardsModels.add(fcm); - * - * for (int i = 0; i < 2; i++) { GcubeProfileDV gprofile1 = new - * GcubeProfileDV(); gprofile1.setParentName("$.livello1"); - * gprofile1.setSectionTitle("Secondaria Superiore "+i); GeoNaFormCardModel fcm1 - * = new GeoNaFormCardModel(); fcm1.setGcubeProfile(gprofile1); - * gnaCardsModels.add(fcm1); } - * - * for (int i = 0; i < 3; i++) { GcubeProfileDV gprofile2 = new - * GcubeProfileDV(); gprofile2.setParentName("$.livello1.livello2"); - * gprofile2.setSectionTitle("Alberghiero di Pisa "+i); GeoNaFormCardModel fcm2 - * = new GeoNaFormCardModel(); fcm2.setGcubeProfile(gprofile2); - * gnaCardsModels.add(fcm2); } - * - * TreeItemPanel tip = new TreeItemPanel("Concessione", gnaCardsModels); - * RootPanel.get(GeoPortalDataEntryApp.DIV_PORTLET_ID).add(tip.getTree()); - */ + + final InitExecutor initExecutor = new InitExecutor(); + geoportalCaches = new GeoPortalClientCaches(); ConstantsGeoPortalDataEntryApp.ROOT_PANEL_DIV_LOADERS.getElement() @@ -198,94 +189,224 @@ public class GeoPortalDataEntryApp implements EntryPoint { geoNaMainForm = new GeonaDataEntryMainForm(appManagerBus); mainTabPanel.addFormPanel(geoNaMainForm); + paramGeonaItemType = Window.Location.getParameter(ConstantsGeoPortalDataEntryApp.GET_GEONA_ITEM_TYPE); + paramGeonaItemID = Window.Location.getParameter(ConstantsGeoPortalDataEntryApp.GET_GEONA_ITEM_ID); + ConstantsGeoPortalDataEntryApp.ROOT_PANEL_DIV_PORTLET.add(mainTabPanel); // ROOT_PANEL_DIV_PORTLET.getElement().getStyle().setOpacity(0.3); ConstantsGeoPortalDataEntryApp.ROOT_PANEL_DIV_PORTLET.getElement() .addClassName(ConstantsGeoPortalDataEntryApp.CSS_CLASS_ANIMATE_FADE_IN_OUT); - GeoportalDataEntryServiceAsync.Util.getInstance().getGeonaInitConfig(new AsyncCallback() { + Command commandGeonaInitConfig = new Command() { @Override - public void onFailure(Throwable caught) { - String errorMsg = "Sorry, an error occurred when loading configurations. Please, contact the support"; - Alert alert = new Alert(errorMsg, AlertType.ERROR); - alert.setClose(false); - try { - ConstantsGeoPortalDataEntryApp.ROOT_PANEL_DIV_LOADERS.remove(loaderApplication); - } catch (Exception e) { + public void execute() { + GWT.log("Execute commandGeonaInitConfig..."); + GeoportalDataEntryServiceAsync.Util.getInstance() + .getGeonaInitConfig(new AsyncCallback() { + @Override + public void onFailure(Throwable caught) { + String errorMsg = "Sorry, an error occurred when loading configurations. Please, contact the support"; + Alert alert = new Alert(errorMsg, AlertType.ERROR); + alert.setClose(false); + try { + ConstantsGeoPortalDataEntryApp.ROOT_PANEL_DIV_LOADERS.remove(loaderApplication); + } catch (Exception e) { + + } + ConstantsGeoPortalDataEntryApp.ROOT_PANEL_DIV_PORTLET.add(alert); + Window.alert(errorMsg); + initExecutor.execute(); + } + + @Override + public void onSuccess(GeoportalISConfig geoportalISConfig) { + geoportalISConfigs = geoportalISConfig; + + if (geoportalISConfig != null && geoportalISConfig.getScope() != null) { + + loadGeoportalConfigs(geoportalISConfig.getScope()); + } else + Window.alert("Sorry, no scope found in the session. Re-login and try again"); + + initExecutor.execute(); + + } + }); + + } + }; + + Command commandReadDataViewerConfig = new Command() { + + @Override + public void execute() { + GWT.log("Execute commandReadDataViewerConfig..."); + // Loading Geoportal Configurations from IS + GeoportalDataEntryServiceAsync.Util.getInstance() + .readDataViewerConfig(new AsyncCallback() { + + @Override + public void onFailure(Throwable caught) { + String errorMsg = "Sorry, an error occurred on istancing the application. Please, contact the support"; + Alert alert = new Alert(errorMsg, AlertType.ERROR); + alert.setClose(false); + try { + ConstantsGeoPortalDataEntryApp.ROOT_PANEL_DIV_LOADERS.remove(loaderApplication); + ConstantsGeoPortalDataEntryApp.ROOT_PANEL_DIV_PORTLET.getElement().removeClassName( + ConstantsGeoPortalDataEntryApp.CSS_CLASS_ANIMATE_FADE_IN_OUT); + } catch (Exception e) { + + } + ConstantsGeoPortalDataEntryApp.ROOT_PANEL_DIV_LOADERS.add(alert); + Window.alert(errorMsg); + + initExecutor.execute(); + + } + + @Override + public void onSuccess(GNADataEntryExtendedConfigProfile gNADataEntryConfig) { + GWT.log(GNADataEntryExtendedConfigProfile.class.getSimpleName() + " loaded: " + + gNADataEntryConfig); + + try { + ConstantsGeoPortalDataEntryApp.ROOT_PANEL_DIV_LOADERS.remove(loaderApplication); + } catch (Exception e) { + + } + + // PERMISSIONS + myRights = gNADataEntryConfig.getUserRights(); + initGUI(); + GcubeUserRole userRole = myRights.getRoleRights().getUserRole(); + mainTabPanel.setRole(userRole); + // GUI Presentation + mainTabPanel.setGUIPresentation(gNADataEntryConfig.getDataEntryGUIPresentation()); + + RoleRights roleRights = myRights.getRoleRights(); + canCreateNewItem = roleRights.getListPermessions().keySet() + .contains(OPERATION_ON_ITEM.CREATE_NEW_PROJECT); + + if (!canCreateNewItem) { + // removing Tab "Create New Project" + mainTabPanel.removeTab(0); + // activating Tab "List of Project" + mainTabPanel.setTabActive(0); + // mainTabPanel.instanceAndShowListOfProjects(); + } + + initExecutor.execute(); + } + }); + + } + }; + + Command commandInitOnItem = null; + + if (paramGeonaItemType != null && paramGeonaItemID != null) { + + commandInitOnItem = new Command() { + + @Override + public void execute() { + GWT.log("Execute commandInitOnItem..."); + GeoportalDataEntryServiceAsync.Util.getInstance().getResultDocumentFoProjectByID(paramGeonaItemType, + paramGeonaItemID, new AsyncCallback() { + + @Override + public void onFailure(Throwable caught) { + Window.alert("Error " + caught.getMessage()); + initExecutor.execute(); + + } + + @Override + public void onSuccess(final ResultDocumentDV result) { + GWT.log("commandInitOnItem success: " + result); + Integer attempts = 0; + + Scheduler.get().scheduleDeferred(new ScheduledCommand() { + + @Override + public void execute() { + appManagerBus.fireEvent(new OperationOnItemEvent( + Arrays.asList(result), OPERATION_ON_ITEM.VIEW_PROJECT_AS_DOCUMENT)); + + + Timer timer = new Timer() { + int attempts = 0; + + @Override + public void run() { + attempts++; + GWT.log("commandInitOnItem run timer..."); + List list = mainTabPanel + .getUcdProjectTypesForListingDataView(); + if (list.size() > 0) { + this.cancel(); + + List filterUCD = mainTabPanel + .getUcdProjectTypesForListingDataView().stream() + .filter(u -> u.getId() + .contentEquals(paramGeonaItemType)) + .collect(Collectors.toList()); + + if (filterUCD.size() == 1) { + GWT.log("FilterUCD"); + + UseCaseDescriptorDV ucd = filterUCD.get(0); + + ListOfProjectTablePanel listProjectPanel = mainTabPanel.getListOfProjectTablePanel(); + SearchingFilter searchingFilter = new SearchingFilter(); + searchingFilter.setGetForIDs(result.getProfileID(), result.getProjectID()); + //searchFilter.setConditions(null); + //searchFilter.setGetForIDs(result.getProfileID(), result.getProjectID()); + + GetListOfRecordsEvent event = new GetListOfRecordsEvent(true, ucd.getProfileID(), + searchingFilter, true); + + listProjectPanel.setSearchTypeAndFire(filterUCD.get(0).getName(), event); + } + + if(attempts>30) { + this.cancel(); + } + } + + } + }; + timer.schedule(500); + initExecutor.execute(); + } + }); + + if (canCreateNewItem) { + mainTabPanel.setTabActive(1); + } else + mainTabPanel.setTabActive(0); + } + }); } - ConstantsGeoPortalDataEntryApp.ROOT_PANEL_DIV_PORTLET.add(alert); - Window.alert(errorMsg); + + }; + + } + + try { + initExecutor.putCommand(commandGeonaInitConfig); + initExecutor.putCommand(commandReadDataViewerConfig); + if (commandInitOnItem != null) { + initExecutor.putCommand(commandInitOnItem); } - - @Override - public void onSuccess(GeoportalISConfig geoportalISConfig) { - geoportalISConfigs = geoportalISConfig; - - if (geoportalISConfig != null && geoportalISConfig.getScope() != null) { - - loadGeoportalConfigs(geoportalISConfig.getScope()); - } else - Window.alert("Sorry, no scope found in the session. Re-login and try again"); - - } - }); - - // Loading Geoportal Configurations from IS - GeoportalDataEntryServiceAsync.Util.getInstance() - .readDataViewerConfig(new AsyncCallback() { - - @Override - public void onFailure(Throwable caught) { - String errorMsg = "Sorry, an error occurred on istancing the application. Please, contact the support"; - Alert alert = new Alert(errorMsg, AlertType.ERROR); - alert.setClose(false); - try { - ConstantsGeoPortalDataEntryApp.ROOT_PANEL_DIV_LOADERS.remove(loaderApplication); - ConstantsGeoPortalDataEntryApp.ROOT_PANEL_DIV_PORTLET.getElement() - .removeClassName(ConstantsGeoPortalDataEntryApp.CSS_CLASS_ANIMATE_FADE_IN_OUT); - } catch (Exception e) { - - } - ConstantsGeoPortalDataEntryApp.ROOT_PANEL_DIV_LOADERS.add(alert); - Window.alert(errorMsg); - - } - - @Override - public void onSuccess(GNADataEntryExtendedConfigProfile gNADataEntryConfig) { - GWT.log(GNADataEntryExtendedConfigProfile.class.getSimpleName() + " loaded: " - + gNADataEntryConfig); - - try { - ConstantsGeoPortalDataEntryApp.ROOT_PANEL_DIV_LOADERS.remove(loaderApplication); - } catch (Exception e) { - - } - - // PERMISSIONS - myRights = gNADataEntryConfig.getUserRights(); - initGUI(); - GcubeUserRole userRole = myRights.getRoleRights().getUserRole(); - mainTabPanel.setRole(userRole); - // GUI Presentation - mainTabPanel.setGUIPresentation(gNADataEntryConfig.getDataEntryGUIPresentation()); - - RoleRights roleRights = myRights.getRoleRights(); - boolean canCreateNewItem = roleRights.getListPermessions().keySet() - .contains(OPERATION_ON_ITEM.CREATE_NEW_PROJECT); - - if (!canCreateNewItem) { - // removing Tab "Create New Project" - mainTabPanel.removeTab(0); - // activating Tab "List of Project" - mainTabPanel.setTabActive(0); - // mainTabPanel.instanceAndShowListOfProjects(); - } - } - }); + initExecutor.execute(); + } catch (InterruptedException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } } @@ -790,7 +911,7 @@ public class GeoPortalDataEntryApp implements EntryPoint { @Override public void onGetList(GetListOfRecordsEvent getListOfRecordsEvent) { - GWT.log("Fired: " + getListOfRecordsEvent); + GWT.log("Fired onGetList: " + getListOfRecordsEvent); SearchingFilter searchingFilter = getListOfRecordsEvent.getSearchingFilter(); CacheSearchingFilterParametersFromConfig seachingFilterParameters = geoportalCaches @@ -809,7 +930,7 @@ public class GeoPortalDataEntryApp implements EntryPoint { if (searchingFilter == null || getListOfRecordsEvent.isOnApplicationInit() || getListOfRecordsEvent.isReloadFilteringParameters()) { mainTabPanel.setFilteringParameters(seachingFilterParameters); - searchingFilter = mainTabPanel.getCurrentProjectsSearchingFilter(); + // Searching in the cache if the list of relationship definition is present List listRelationshipsDef = geoportalCaches @@ -835,6 +956,10 @@ public class GeoPortalDataEntryApp implements EntryPoint { } }); } + + if(searchingFilter == null ) { + searchingFilter = mainTabPanel.getCurrentProjectsSearchingFilter(); + } } searchingFilter.setProjection(seachingFilterParameters.getProjection()); diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/InitExecutor.java b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/InitExecutor.java new file mode 100644 index 0000000..13896ae --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/InitExecutor.java @@ -0,0 +1,43 @@ +package org.gcube.portlets.user.geoportaldataentry.client; + +import java.util.LinkedHashMap; + +import com.google.gwt.user.client.Command; +import com.google.gwt.user.client.Window; + +public class InitExecutor { + + private LinkedHashMap queueInitStage = new LinkedHashMap<>(); + + public InitExecutor() { + + } + + public synchronized void putCommand(Command command) throws InterruptedException { + queueInitStage.put(queueInitStage.size(), command); + } + + private synchronized Command pollCommand() throws InterruptedException { + for (Integer key : queueInitStage.keySet()) { + Command command = queueInitStage.get(key); + if(command!=null) { + queueInitStage.put(key, null); + return command; + } + } + + return null; + } + + protected void execute() { + try { + Command command = pollCommand(); + if (command != null) + command.execute(); + } catch (InterruptedException e) { + Window.alert("An error occurred while initializing the application. Please contact the support. Error is: " + + e.getMessage()); + } + } + +} diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/events/GetListOfRecordsEvent.java b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/events/GetListOfRecordsEvent.java index 3659853..383942c 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/events/GetListOfRecordsEvent.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/events/GetListOfRecordsEvent.java @@ -105,11 +105,6 @@ public class GetListOfRecordsEvent extends GwtEvent extends GwtEvent selectItems; private OPERATION_ON_ITEM action; private Element sourceElement; + private String ucdName; /** * Instantiates a new action on item event. @@ -65,6 +66,10 @@ public class OperationOnItemEvent extends GwtEvent getUcdProjectTypesForListingDataView() { + return ucdProjectTypesForListingDataView; + } } diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/projects/ListOfProjectTablePanel.java b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/projects/ListOfProjectTablePanel.java index 9747596..112f053 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/projects/ListOfProjectTablePanel.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/projects/ListOfProjectTablePanel.java @@ -324,17 +324,25 @@ public class ListOfProjectTablePanel extends Composite { if (ucdProjectTypesForListingDataView.size() == 1) { // noProjectSelectionMessage.setVisible(false); UseCaseDescriptorDV singleUCD = ucdProjectTypesForListingDataView.get(0); - alertProjectType.setText(singleUCD.getName()); - // setFilteringParameters(displayFields, sortByFields, searchForFields, - // currentSearchingFilter); - appManagerBus.fireEvent(new GetListOfRecordsEvent(true, singleUCD.getProfileID(), - getCurrentSearchingFilter(), true)); + GetListOfRecordsEvent event = new GetListOfRecordsEvent(true, singleUCD.getProfileID(), + getCurrentSearchingFilter(), true); + setSearchTypeAndFire(singleUCD.getName(), event); } } }); } + + public void setSearchTypeAndFire(String ucdName, GetListOfRecordsEvent event) { + alertProjectType.setText(ucdName); + +// if(event.getSearchingFilter().getProfileID()!=null && event.getSearchingFilter().getProjectID()) { +// +// } +// + appManagerBus.fireEvent(event); + } /** * Built searching filter. @@ -471,5 +479,10 @@ public class ListOfProjectTablePanel extends Composite { ddProjectType.add(link); } + + + public String getSelectedProjectType() { + return alertProjectType.getText(); + } } 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 a9b2eed..6e75d23 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 @@ -902,6 +902,8 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen searchedData.setTotalItems(totalProjectForProfile); LOG.info("Total Docs read from config: " + totalProjectForProfile); + + boolean isSearchForIds = filter.getProfileID()!=null && filter.getProjectID()!=null; // Saving client PROJECTION LinkedHashMap originalProjection = filter.getProjection(); @@ -928,13 +930,23 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen totalItems = listProjectIDs.size(); searchedData.setTotalItems(totalItems); LOG.info("Total Docs read from query per ID: " + totalItems); + }else if(isSearchForIds) { + //searching one item for IDs + searchedData.setTotalItems(1); } // NOW PERFORMING THE (REAL) SECOND QUERY FROM CLIENT // SETTING ORIGINAL PROJECTION FROM CLIENT filter.setProjection(originalProjection); // LIMIT IS FROM CLIENT - Iterator projects = client.queryOnMongo(theProfileID, totalItems, start, limit, filter); + + Iterator projects = null; + if(!isSearchForIds) { + projects = client.queryOnMongo(theProfileID, totalItems, start, limit, filter); + }else { + Project project = client.getProjectByID(filter.getProfileID(), filter.getProjectID()); + projects = Arrays.asList(project).iterator(); + } searchedData.setClientStartIndex(start); searchedData.setLimit(limit); @@ -1406,7 +1418,7 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen Project project = projects.getProjectByID(profileID, projectID); ProjectDVBuilder projectBuilder = ProjectDVBuilder.newBuilder().fullDocumentMap(true); ProjectDV projectDV = ConvertToDataValueObjectModel.toProjectDV(project, projectBuilder); - LOG.info("returning: " + projectDV.getId()); + LOG.info("returning ProjectByID: " + projectDV.getId()); return projectDV; } catch (Exception e) { -- 2.17.1 From b86439cba65095edac6c7cf2bc26082e09347ee7 Mon Sep 17 00:00:00 2001 From: "francesco.mangiacrapa" Date: Wed, 27 Mar 2024 10:55:42 +0100 Subject: [PATCH 02/13] added information when resolving shared link --- .../client/GeoPortalDataEntryApp.java | 74 ++++++++++++------ .../client/GeoportalDataEntryService.java | 2 +- .../GeoportalDataEntryServiceAsync.java | 2 +- .../client/resource/Images.java | 3 + .../client/resource/information_icon.png | Bin 0 -> 22484 bytes .../server/GeoportalDataEntryServiceImpl.java | 2 +- src/main/webapp/GeoPortalDataEntryApp.css | 19 ++++- 7 files changed, 76 insertions(+), 26 deletions(-) create mode 100644 src/main/java/org/gcube/portlets/user/geoportaldataentry/client/resource/information_icon.png 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 968cc86..8b7c41c 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 @@ -110,6 +110,7 @@ import com.google.gwt.user.client.Timer; import com.google.gwt.user.client.Window; import com.google.gwt.user.client.rpc.AsyncCallback; import com.google.gwt.user.client.ui.Anchor; +import com.google.gwt.user.client.ui.FlowPanel; import com.google.gwt.user.client.ui.HTML; import com.google.gwt.user.client.ui.HorizontalPanel; import com.google.gwt.user.client.ui.Image; @@ -172,6 +173,8 @@ public class GeoPortalDataEntryApp implements EntryPoint { private boolean canCreateNewItem = false; + private GNADataEntryExtendedConfigProfile gNADataEntryPresentationConfig = null; + /** * This is the entry point method. */ @@ -198,6 +201,7 @@ public class GeoPortalDataEntryApp implements EntryPoint { ConstantsGeoPortalDataEntryApp.ROOT_PANEL_DIV_PORTLET.getElement() .addClassName(ConstantsGeoPortalDataEntryApp.CSS_CLASS_ANIMATE_FADE_IN_OUT); + // Loads Geoportal init configurations Command commandGeonaInitConfig = new Command() { @Override @@ -239,6 +243,7 @@ public class GeoPortalDataEntryApp implements EntryPoint { } }; + // Loads data entry presetentation configurations Command commandReadDataViewerConfig = new Command() { @Override @@ -246,7 +251,7 @@ public class GeoPortalDataEntryApp implements EntryPoint { GWT.log("Execute commandReadDataViewerConfig..."); // Loading Geoportal Configurations from IS GeoportalDataEntryServiceAsync.Util.getInstance() - .readDataViewerConfig(new AsyncCallback() { + .readDataEntryPresentationConfig(new AsyncCallback() { @Override public void onFailure(Throwable caught) { @@ -272,6 +277,7 @@ public class GeoPortalDataEntryApp implements EntryPoint { GWT.log(GNADataEntryExtendedConfigProfile.class.getSimpleName() + " loaded: " + gNADataEntryConfig); + gNADataEntryPresentationConfig = gNADataEntryConfig; try { ConstantsGeoPortalDataEntryApp.ROOT_PANEL_DIV_LOADERS.remove(loaderApplication); } catch (Exception e) { @@ -307,6 +313,7 @@ public class GeoPortalDataEntryApp implements EntryPoint { Command commandInitOnItem = null; + // Resolves the gid={ITEM_ID}&git={PROFILE_ID} if (paramGeonaItemType != null && paramGeonaItemID != null) { commandInitOnItem = new Command() { @@ -327,19 +334,18 @@ public class GeoPortalDataEntryApp implements EntryPoint { @Override public void onSuccess(final ResultDocumentDV result) { GWT.log("commandInitOnItem success: " + result); - Integer attempts = 0; Scheduler.get().scheduleDeferred(new ScheduledCommand() { @Override public void execute() { - appManagerBus.fireEvent(new OperationOnItemEvent( - Arrays.asList(result), OPERATION_ON_ITEM.VIEW_PROJECT_AS_DOCUMENT)); - +// appManagerBus.fireEvent(new OperationOnItemEvent( +// Arrays.asList(result), OPERATION_ON_ITEM.VIEW_PROJECT_AS_DOCUMENT)); + Timer timer = new Timer() { int attempts = 0; - + @Override public void run() { attempts++; @@ -357,22 +363,47 @@ public class GeoPortalDataEntryApp implements EntryPoint { if (filterUCD.size() == 1) { GWT.log("FilterUCD"); - + UseCaseDescriptorDV ucd = filterUCD.get(0); - - ListOfProjectTablePanel listProjectPanel = mainTabPanel.getListOfProjectTablePanel(); + + ListOfProjectTablePanel listProjectPanel = mainTabPanel + .getListOfProjectTablePanel(); SearchingFilter searchingFilter = new SearchingFilter(); - searchingFilter.setGetForIDs(result.getProfileID(), result.getProjectID()); - //searchFilter.setConditions(null); - //searchFilter.setGetForIDs(result.getProfileID(), result.getProjectID()); - - GetListOfRecordsEvent event = new GetListOfRecordsEvent(true, ucd.getProfileID(), - searchingFilter, true); - - listProjectPanel.setSearchTypeAndFire(filterUCD.get(0).getName(), event); + searchingFilter.setGetForIDs(result.getProfileID(), + result.getProjectID()); + // searchFilter.setConditions(null); + // searchFilter.setGetForIDs(result.getProfileID(), + // result.getProjectID()); + + GetListOfRecordsEvent event = new GetListOfRecordsEvent( + true, ucd.getProfileID(), searchingFilter, true); + + listProjectPanel.setSearchTypeAndFire( + filterUCD.get(0).getName(), event); + + Modal errorModal = new Modal(true, true); + // errorModal.setWidth("800px"); + errorModal.setCloseVisible(true); + errorModal.setTitle("Information..."); + Image geoportalError = new Image(Images.ICONS.info()); + geoportalError.setWidth("128px"); + FlowPanel errorPanelMsg = new FlowPanel(); + errorPanelMsg.getElement().addClassName("general_info"); + errorPanelMsg.add(geoportalError); + errorPanelMsg.add(new HTML(gNADataEntryPresentationConfig + .getDataEntryGUIPresentation().getHeader() + .getTitle())); + HTML erroMessage = new HTML( + "The List of Projects only shows the

\"" + + result.getFirstEntryOfMap().getValue() + + "\"

project resolved by shared link

To view all projects select Reload Projects button"); + errorPanelMsg.add(erroMessage); + errorModal.add(errorPanelMsg); + errorModal.show(); + } - - if(attempts>30) { + + if (attempts > 20) { this.cancel(); } } @@ -930,7 +961,6 @@ public class GeoPortalDataEntryApp implements EntryPoint { if (searchingFilter == null || getListOfRecordsEvent.isOnApplicationInit() || getListOfRecordsEvent.isReloadFilteringParameters()) { mainTabPanel.setFilteringParameters(seachingFilterParameters); - // Searching in the cache if the list of relationship definition is present List listRelationshipsDef = geoportalCaches @@ -956,8 +986,8 @@ public class GeoPortalDataEntryApp implements EntryPoint { } }); } - - if(searchingFilter == null ) { + + if (searchingFilter == null) { searchingFilter = mainTabPanel.getCurrentProjectsSearchingFilter(); } } diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoportalDataEntryService.java b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoportalDataEntryService.java index af4ed14..306be24 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoportalDataEntryService.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoportalDataEntryService.java @@ -104,7 +104,7 @@ public interface GeoportalDataEntryService extends RemoteService { * @return the GNA data entry ext config profile * @throws Exception the exception */ - GNADataEntryExtendedConfigProfile readDataViewerConfig() throws Exception; + GNADataEntryExtendedConfigProfile readDataEntryPresentationConfig() throws Exception; /** * Gets the list use case descriptors. diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoportalDataEntryServiceAsync.java b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoportalDataEntryServiceAsync.java index 512434d..a07a04a 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoportalDataEntryServiceAsync.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoportalDataEntryServiceAsync.java @@ -70,7 +70,7 @@ public interface GeoportalDataEntryServiceAsync { void updateRecord(String profileID, String projectID, String jsonUpdate, AsyncCallback callback); - void readDataViewerConfig(AsyncCallback asyncCallback); + void readDataEntryPresentationConfig(AsyncCallback asyncCallback); void getListUseCaseDescriptors(List handlersIds, AsyncCallback> callback); diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/resource/Images.java b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/resource/Images.java index d341e5a..650a74a 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/resource/Images.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/resource/Images.java @@ -16,4 +16,7 @@ public interface Images extends ClientBundle { @Source("one-finger-icon.png") ImageResource oneFingerIcon(); + + @Source("information_icon.png") + ImageResource info(); } diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/resource/information_icon.png b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/resource/information_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..e3f639ed988879905a57afc700e1abc222b4b6e8 GIT binary patch literal 22484 zcmcF~1y@^L({_*mCAd=@ibHXCrxc32dvPo76bgl6#ibBvaR>#9LvVL@2=4Cw=6=54 z@U6&M$yqtsXZFZ7*UWrZ`=o%0{uUho0APMll+}PA&;EO%p}^n8wfBF*56HGsDpCMI zRXpg)90>nRZK^aII4}bMgwp{4V%O{@by4^U6pN1v zvVhnB9^lrZBmh9?@Pn+Bme1mGt8enVInUMmm0MccTLXWE$~}2Y2k;x-sFZh2AEL~V zsO^SiHH~E1`(%FD_U_JSR=rDl_-!3e?;x6U&i_`EC-pe-i#(EFB0G9MlSYVa2tYA} z8j%0Jg7}MoU*$pRAYbb3$x|ZkLZhs#ypFbxwe~h0en!f5X&EX`_fYSdu}fbs=8HCzCR5z=qO zP6GTw#dUQ2!YDVnpKcEl&o%McRFvB^?Ok;tH+O5#tH>W8y--%L^0P908AE=V9U&)R zJ#b~37(eFUTW|W4-^7r>ZcaJvrD42^EehkOq1RlP*G(z2mE!kgk(D^O*kj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=@0JLfMK_rkL(Wr^j=1u65j}V_Sw~lt<8F6Ws$BBuBug1z*p)NhA%}rr|&gFnc znZmq8lBFQ!WR3U}5;KLu7>!p4k=@v!3A#5{0@~)>AHq3h7=PbNk4STlo|v({pukTo zBL5-@1AdDwiW_mZZvf+Kg8D|tX7efRxdbYZT5#K1rTNQ$!P4}5?P_7?&+%4GL6ORFML&{%!(tea6;e9PIAxQ^LRq9{dCA} zMLTv7+TAD23-PTGhghP%g=Vw=yl@^^)rWaqjG&SMtwT$I4mcRqs=dLoU9c2XzsF+( zyH)YXk1>z~=NK_=X+S}RM!k~qJU^gC@9;kFDU?lhlSINsM3JU28Nd^u@H_C4KTbbM znUKf6ek>$!hYH5Y$&v;b<+V%{>YGS18igkf#<5I@CSb7O zaJc?idTi|MPvM!7(X{k??2vn1xMdI4B*^7T`pc$Y)|9N$8jC(3!1CaD2z{lRO~w)TqPvmdfHU?^7TzHo_sJ z!LpqUmlfdZ0(Sc>;I?Smj48DF+T|_Re-Zlfee4xB&nih%Q`7j^(_|E^g!}~Kds8w7 zA#l;A%r@Pk=n71kjPBsI=TqoDZBEEGX{{X|tYP{|8efd4WvWt#86YKq5wqDh6-fKD zqlE!25ZFC}m&YpB+k52u_wu{nKb~6tI+#y)y2H0p6~j-dmGM1K)_5ac&7%sR<@;c5wd1||N4 zX9KULAD Date: Fri, 5 Apr 2024 15:54:09 +0200 Subject: [PATCH 03/13] - Integrated new Uri-Resolver-Manager [#27160] - Added Get Shareable Link facility [#27120] --- .settings/org.eclipse.wst.common.component | 39 ++++++-- CHANGELOG.md | 4 +- .../ConstantsGeoPortalDataEntryApp.java | 6 +- .../client/GeoPortalClientCaches.java | 2 - .../client/GeoPortalDataEntryApp.java | 94 ++++++++++++++++-- .../client/GeoportalDataEntryService.java | 8 +- .../GeoportalDataEntryServiceAsync.java | 4 +- .../client/resource/Images.java | 3 + .../client/resource/warning_error.png | Bin 0 -> 2777 bytes .../client/ui/GeonaMainTabPanel.java | 18 ++++ .../client/ui/GeonaMainTabPanel.ui.xml | 2 + .../ui/report/LifecycleInformationPanel.java | 2 +- .../server/GeoportalDataEntryServiceImpl.java | 39 +++++--- .../shared/ProjectNotFoundException.java | 21 ++++ 14 files changed, 203 insertions(+), 39 deletions(-) create mode 100644 src/main/java/org/gcube/portlets/user/geoportaldataentry/client/resource/warning_error.png create mode 100644 src/main/java/org/gcube/portlets/user/geoportaldataentry/shared/ProjectNotFoundException.java diff --git a/.settings/org.eclipse.wst.common.component b/.settings/org.eclipse.wst.common.component index d10a6f1..19e8b2e 100644 --- a/.settings/org.eclipse.wst.common.component +++ b/.settings/org.eclipse.wst.common.component @@ -1,5 +1,7 @@ - + + + @@ -138,7 +140,9 @@ - + + + @@ -277,7 +281,9 @@ - + + + @@ -416,7 +422,9 @@ - + + + @@ -555,7 +563,9 @@ - + + + @@ -649,7 +659,12 @@ uses - + + uses + + + + @@ -788,7 +803,9 @@ - + + + @@ -927,7 +944,9 @@ - + + + @@ -1066,7 +1085,9 @@ - + + + diff --git a/CHANGELOG.md b/CHANGELOG.md index 66d1c23..c7d2413 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,9 +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.3.0-SNAPSHOT] - 2024-03-26 +## [v3.3.0-SNAPSHOT] - 2024-04-05 - Implemented the init facility to resolve a public link on an item [#27120] +- Integrated new Uri-Resolver-Manager [#27160] +- Added Get Shareable Link facility [#27120] ## [v3.2.2] - 2024-01-11 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 82e046d..d5438c7 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,9 +26,11 @@ public class ConstantsGeoPortalDataEntryApp { public static final String DIV_LOADERS_ID = "geoportal-loaders"; - public static final String GET_GEONA_ITEM_TYPE = "git"; + public static final String GET_PARAMETER_ITEM_TYPE = "git"; - public static final String GET_GEONA_ITEM_ID = "gid"; + public static final String GET_PARAMETER_ITEM_ID = "gid"; + + public static final String GET_PARAMETER_ACTION = "act"; public static final String DATE_FORMAT = ConstantsMPFormBuilder.DATE_FORMAT; diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoPortalClientCaches.java b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoPortalClientCaches.java index d706354..ee2aa37 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoPortalClientCaches.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoPortalClientCaches.java @@ -28,8 +28,6 @@ public class GeoPortalClientCaches { private TreeMap> mapGcubeProfilePerItemType; - //private Map> mapHandlersConfigurationsForProfileId; - private Map mapUseCaseDescriptor; private Map mapSearchingFilterParametersForProfileId; 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 8b7c41c..5ae9c5c 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 @@ -74,6 +74,7 @@ import org.gcube.portlets.user.geoportaldataentry.shared.CommitReport; import org.gcube.portlets.user.geoportaldataentry.shared.GNADataEntryExtendedConfigProfile; import org.gcube.portlets.user.geoportaldataentry.shared.GeoNaFormDataObject; import org.gcube.portlets.user.geoportaldataentry.shared.GeoportalISConfig; +import org.gcube.portlets.user.geoportaldataentry.shared.ProjectNotFoundException; import org.gcube.portlets.user.geoportaldataentry.shared.Tree_Node; import org.gcube.portlets.user.geoportaldataentry.shared.UserRights; import org.gcube.portlets.widgets.gdvw.client.GeoportalDataViewerWidget; @@ -192,8 +193,8 @@ public class GeoPortalDataEntryApp implements EntryPoint { geoNaMainForm = new GeonaDataEntryMainForm(appManagerBus); mainTabPanel.addFormPanel(geoNaMainForm); - paramGeonaItemType = Window.Location.getParameter(ConstantsGeoPortalDataEntryApp.GET_GEONA_ITEM_TYPE); - paramGeonaItemID = Window.Location.getParameter(ConstantsGeoPortalDataEntryApp.GET_GEONA_ITEM_ID); + paramGeonaItemType = Window.Location.getParameter(ConstantsGeoPortalDataEntryApp.GET_PARAMETER_ITEM_TYPE); + paramGeonaItemID = Window.Location.getParameter(ConstantsGeoPortalDataEntryApp.GET_PARAMETER_ITEM_ID); ConstantsGeoPortalDataEntryApp.ROOT_PANEL_DIV_PORTLET.add(mainTabPanel); @@ -255,7 +256,7 @@ public class GeoPortalDataEntryApp implements EntryPoint { @Override public void onFailure(Throwable caught) { - String errorMsg = "Sorry, an error occurred on istancing the application. Please, contact the support"; + String errorMsg = "Sorry, an error occurred on istancing the application. Please, contact the support. Error is: "+caught.getMessage(); Alert alert = new Alert(errorMsg, AlertType.ERROR); alert.setClose(false); try { @@ -326,7 +327,26 @@ public class GeoPortalDataEntryApp implements EntryPoint { @Override public void onFailure(Throwable caught) { - Window.alert("Error " + caught.getMessage()); + + if(caught instanceof ProjectNotFoundException) { + Modal errorModal = new Modal(true, true); + errorModal.setCloseVisible(true); + errorModal.setTitle("Oops..."); + Image geoportalError = new Image(Images.ICONS.warningError()); + FlowPanel errorPanelMsg = new FlowPanel(); + errorPanelMsg.getElement().addClassName("general_warning"); + errorPanelMsg.add(geoportalError); + errorPanelMsg.add(new HTML("D4S GeoPortal")); + HTML erroMessage = new HTML( + "Oops something went wrong, either the project does not exist or you are not authorized to access it"); + errorPanelMsg.add(erroMessage); + errorModal.add(errorPanelMsg); + errorModal.show(); + } + else { + Window.alert("Error " + caught.getMessage()); + } + initExecutor.execute(); } @@ -396,7 +416,7 @@ public class GeoPortalDataEntryApp implements EntryPoint { HTML erroMessage = new HTML( "The List of Projects only shows the

\"" + result.getFirstEntryOfMap().getValue() - + "\"

project resolved by shared link

To view all projects select Reload Projects button"); + + "\"

project resolved by shareable link

To view all projects select Reload Projects button"); errorPanelMsg.add(erroMessage); errorModal.add(errorPanelMsg); errorModal.show(); @@ -1620,7 +1640,7 @@ public class GeoPortalDataEntryApp implements EntryPoint { modal.add(hpGetLink); GeoportalDataEntryServiceAsync.Util.getInstance().getLinksFor(resultDocumentDV.getId(), - resultDocumentDV.getProfileID(), new AsyncCallback() { + resultDocumentDV.getProfileID(), GeoportalItemReferences.SHARE_LINK_TO.DATA_VIEWER, new AsyncCallback() { @Override public void onFailure(Throwable caught) { try { @@ -1631,7 +1651,7 @@ public class GeoPortalDataEntryApp implements EntryPoint { } Alert alert = new Alert(caught.getMessage(), AlertType.ERROR); alert.setClose(false); - hpGetLink.add(alert); + modal.add(alert); // newBrowserWindow.close(); } @@ -1668,6 +1688,66 @@ public class GeoPortalDataEntryApp implements EntryPoint { break; } + + case GET_SHAREABLE_LINK: { + + final Modal modal = new Modal(true, true); + modal.setTitle("Share the Project by link..."); + modal.setCloseVisible(true); + final HorizontalPanel hpGetLink = new HorizontalPanel(); + final LoaderIcon lc = new LoaderIcon("Just moment getting link..."); + hpGetLink.add(lc); + modal.add(hpGetLink); + + GeoportalDataEntryServiceAsync.Util.getInstance().getLinksFor(resultDocumentDV.getId(), + resultDocumentDV.getProfileID(), GeoportalItemReferences.SHARE_LINK_TO.DATA_ENTRY, new AsyncCallback() { + @Override + public void onFailure(Throwable caught) { + try { + hpGetLink.setVisible(false); + modal.remove(hpGetLink); + } catch (Exception e) { + // TODO: handle exception + } + Alert alert = new Alert(caught.getMessage(), AlertType.ERROR); + alert.setClose(false); + modal.add(alert); + // newBrowserWindow.close(); + } + + @Override + public void onSuccess(GeoportalItemReferences result) { + try { + hpGetLink.setVisible(false); + modal.remove(hpGetLink); + } catch (Exception e) { + // TODO: handle exception + } + String theURL = result.getRestrictedLink().getShortURL() != null + ? result.getRestrictedLink().getShortURL() + : result.getRestrictedLink().getCompleteURL(); + // newBrowserWindow.setUrl(theURL); + + Anchor anchor = new Anchor(theURL); + anchor.setHref(theURL); + anchor.setTarget("_blank"); + anchor.setTitle( + "Shareable link of the project with id: " + resultDocumentDV.getId()); + com.github.gwtbootstrap.client.ui.Label label = new com.github.gwtbootstrap.client.ui.Label( + "Shareable link"); + label.setType(LabelType.SUCCESS); + + modal.add(label); + modal.add(new HTML("
")); + modal.add(anchor); + + } + }); + + modal.show(); + + break; + } case VIEW_REPORT: { diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoportalDataEntryService.java b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoportalDataEntryService.java index 306be24..fd7afe5 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoportalDataEntryService.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoportalDataEntryService.java @@ -3,6 +3,7 @@ package org.gcube.portlets.user.geoportaldataentry.client; import java.util.List; import org.gcube.application.geoportalcommon.shared.GeoportalItemReferences; +import org.gcube.application.geoportalcommon.shared.GeoportalItemReferences.SHARE_LINK_TO; import org.gcube.application.geoportalcommon.shared.ResultSetPaginatedData; import org.gcube.application.geoportalcommon.shared.SearchingFilter; import org.gcube.application.geoportalcommon.shared.geoportal.ResultDocumentDV; @@ -56,12 +57,13 @@ public interface GeoportalDataEntryService extends RemoteService { /** * Gets the links for. * - * @param itemId the item id + * @param itemId the item id is the mongoId * @param profileID the profile ID + * @param shareLinkTo the share link to * @return the links for * @throws Exception the exception */ - GeoportalItemReferences getLinksFor(String itemId, String profileID) throws Exception; + GeoportalItemReferences getLinksFor(String itemId, String profileID, SHARE_LINK_TO shareLinkTo) throws Exception; /** * Gets the list projects. @@ -237,4 +239,6 @@ public interface GeoportalDataEntryService extends RemoteService { ProjectView getProjectView(String profileID, String projectID) throws Exception; + + } diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoportalDataEntryServiceAsync.java b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoportalDataEntryServiceAsync.java index a07a04a..35412ee 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoportalDataEntryServiceAsync.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoportalDataEntryServiceAsync.java @@ -3,6 +3,7 @@ package org.gcube.portlets.user.geoportaldataentry.client; import java.util.List; import org.gcube.application.geoportalcommon.shared.GeoportalItemReferences; +import org.gcube.application.geoportalcommon.shared.GeoportalItemReferences.SHARE_LINK_TO; import org.gcube.application.geoportalcommon.shared.ResultSetPaginatedData; import org.gcube.application.geoportalcommon.shared.SearchingFilter; import org.gcube.application.geoportalcommon.shared.geoportal.ResultDocumentDV; @@ -59,7 +60,8 @@ public interface GeoportalDataEntryServiceAsync { void getGeonaInitConfig(AsyncCallback callback); - void getLinksFor(String itemId, String profileID, AsyncCallback callback); + void getLinksFor(String itemId, String profileID, SHARE_LINK_TO shareLinkTo, + AsyncCallback callback); void getListProjects(String theProfileID, Integer start, Integer limit, SearchingFilter filter, boolean reloadFromService, AsyncCallback callback); diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/resource/Images.java b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/resource/Images.java index 650a74a..8b2ae69 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/resource/Images.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/resource/Images.java @@ -19,4 +19,7 @@ public interface Images extends ClientBundle { @Source("information_icon.png") ImageResource info(); + + @Source("warning_error.png") + ImageResource warningError(); } diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/resource/warning_error.png b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/resource/warning_error.png new file mode 100644 index 0000000000000000000000000000000000000000..801a01be3f0bcc88f9d503e3b3706b0e0a85f44e GIT binary patch literal 2777 zcmV;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u~=1zAqs5m>L|u%0|3~mE2?T!+W&p8~#NU$x4d0xnO|YK^Sw7{Eco`l6c5cY*t=^hByO1?ZD0FB=~&QFc(V zgsrpzbX?hLqNziq8kMVxs(64g{J63;axou8HJm6#sWpHOIbO!ETRS7~Fa=zfq{Z9X zm5txW34icsQ7h+@ywgi?B`RxZ9bxPNEW`+^^7`STZz${m^a<2)>{ZK3GmGjS{B7V! z_r(!~{JynwA`qw>;juGaf@C53Xk_E%Uejn;i!X5mRsCxqIG6nooK#mLg_F-Po0Cd>r zq;;7PM3fC<8l`2pS%l;!pPzkOJ=*+fqR$TLQOo#u41 z!lE~XmL$YTpp)BCH3jpSX8;{xUx@K4t^m_`u=r*7V&2T{*MFLt3a6a9tiCoUG@5tfy;j zH@6X_Z|?dRVdTUYWfu5ElJc7>Z_YEe0ly{OL!n;G02`B(Q*f~dn4npM59;$hk!QVE zz>AS*YzCgDS%VKMES%flNnkF?^ElzJ{1;*d_#*JjB1fe9!ssXPtILTb=Ygw}l&Q7{ z_zKM(d{6`VH1J%WabvIEdwE7H<@!eg^!C<_k6N^=c*8uQm`=LgX0g66Ou4bMkhU z%<`_kpu9?V7R>+)AG7v){ZgUbudo-Ly$ct5{kg8c=TX1(6Q~5AKLKy(g?=Owi9{li fNF)-8L?ZtOlUW;}PvV$_00000NkvXXu0mjf@FNUS literal 0 HcmV?d00001 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 6a85def..7873d82 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 @@ -106,6 +106,9 @@ public class GeonaMainTabPanel extends Composite { @UiField NavLink navShowOnMap; + + @UiField + NavLink navShareLink; @UiField NavLink navShowReport; @@ -249,6 +252,21 @@ public class GeonaMainTabPanel extends Composite { } }); + + navShareLink.addClickHandler(new ClickHandler() { + + @Override + public void onClick(ClickEvent event) { + List listDocuments = null; + if (grpw != null && grpw.getSelectItems() != null) { + listDocuments = grpw.getSelectItems(); + } + + appManagerBus + .fireEvent(new OperationOnItemEvent(listDocuments, OPERATION_ON_ITEM.GET_SHAREABLE_LINK)); + + } + }); navViewAsDocument.addClickHandler(new ClickHandler() { diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/GeonaMainTabPanel.ui.xml b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/GeonaMainTabPanel.ui.xml index 479d943..93cec0f 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/GeonaMainTabPanel.ui.xml +++ b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/GeonaMainTabPanel.ui.xml @@ -107,6 +107,8 @@ Show on Map + Get Shareable link Publication Report diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/report/LifecycleInformationPanel.java b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/report/LifecycleInformationPanel.java index 6a85ea7..49528d4 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/report/LifecycleInformationPanel.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/report/LifecycleInformationPanel.java @@ -78,7 +78,7 @@ public class LifecycleInformationPanel extends FlowPanel { final LoaderIcon lc = new LoaderIcon("Get link..."); hpGetLink.add(lc); add(hpGetLink); - GeoportalDataEntryServiceAsync.Util.getInstance().getLinksFor(projectID, profileID, + GeoportalDataEntryServiceAsync.Util.getInstance().getLinksFor(projectID, profileID, GeoportalItemReferences.SHARE_LINK_TO.DATA_VIEWER, new AsyncCallback() { @Override 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 6743d63..e020dfe 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 @@ -71,6 +71,7 @@ import org.gcube.portlets.user.geoportaldataentry.shared.CommitReport; import org.gcube.portlets.user.geoportaldataentry.shared.GNADataEntryExtendedConfigProfile; import org.gcube.portlets.user.geoportaldataentry.shared.GeoNaFormDataObject; import org.gcube.portlets.user.geoportaldataentry.shared.GeoportalISConfig; +import org.gcube.portlets.user.geoportaldataentry.shared.ProjectNotFoundException; import org.gcube.portlets.user.geoportaldataentry.shared.Tree_Node; import org.gcube.portlets.user.geoportaldataentry.shared.UserRights; import org.gcube.portlets.widgets.mpformbuilder.shared.GenericDatasetBean; @@ -361,7 +362,7 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen } // Registering fileset in the section according to mapFilesToRegistrer - if (mapFilesToRegistrer != null && mapFilesToRegistrer.size()>0) { + if (mapFilesToRegistrer != null && mapFilesToRegistrer.size() > 0) { LOG.info("Cluster of fileset per fieldDefinition is: " + mapFilesToRegistrer); String theJSONDocument = currentProject.getTheDocument().toJson(); MongoServiceUtil mongoService = new MongoServiceUtil(); @@ -844,19 +845,22 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen /** * Gets the links for. * - * @param itemId the item id is the mongoId - * @param profileID the profile ID + * @param itemId the item id is the mongoId + * @param profileID the profile ID + * @param shareLinkTo the share link to * @return the links for * @throws Exception the exception */ @Override - public GeoportalItemReferences getLinksFor(String itemId, String profileID) throws Exception { + public GeoportalItemReferences getLinksFor(String itemId, String profileID, + GeoportalItemReferences.SHARE_LINK_TO shareLinkTo) throws Exception { LOG.info("getLinksFor called"); String scope = SessionUtil.getCurrentContext(this.getThreadLocalRequest(), true); - //GNADataViewerConfigProfile grViewerProfile = SessionUtil.getGeportalViewerResourceProfile(getThreadLocalRequest()); + // GNADataViewerConfigProfile grViewerProfile = + // SessionUtil.getGeportalViewerResourceProfile(getThreadLocalRequest()); GeoportalCommon gc = new GeoportalCommon(); - GeoportalItemReferences item = new GeoportalItemReferences(itemId, profileID); + GeoportalItemReferences item = new GeoportalItemReferences(itemId, profileID, shareLinkTo); item = gc.getPublicLinksFor(scope, item, true); LOG.info("Returning: " + item); return item; @@ -902,8 +906,8 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen searchedData.setTotalItems(totalProjectForProfile); LOG.info("Total Docs read from config: " + totalProjectForProfile); - - boolean isSearchForIds = filter.getProfileID()!=null && filter.getProjectID()!=null; + + boolean isSearchForIds = filter.getProfileID() != null && filter.getProjectID() != null; // Saving client PROJECTION LinkedHashMap originalProjection = filter.getProjection(); @@ -930,8 +934,8 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen totalItems = listProjectIDs.size(); searchedData.setTotalItems(totalItems); LOG.info("Total Docs read from query per ID: " + totalItems); - }else if(isSearchForIds) { - //searching one item for IDs + } else if (isSearchForIds) { + // searching one item for IDs searchedData.setTotalItems(1); } @@ -939,11 +943,11 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen // SETTING ORIGINAL PROJECTION FROM CLIENT filter.setProjection(originalProjection); // LIMIT IS FROM CLIENT - + Iterator projects = null; - if(!isSearchForIds) { + if (!isSearchForIds) { projects = client.queryOnMongo(theProfileID, totalItems, start, limit, filter); - }else { + } else { Project project = client.getProjectByID(filter.getProfileID(), filter.getProjectID()); projects = Arrays.asList(project).iterator(); } @@ -1446,14 +1450,21 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen SessionUtil.getCurrentContext(getThreadLocalRequest(), true); ProjectsCaller projects = GeoportalClientCaller.projects(); Project project = projects.getProjectByID(profileID, projectID); + if (project == null) { + throw new ProjectNotFoundException( + "Project with coordinates id: " + projectID + " and type: " + profileID + " not found"); + } ResultDocumentDV documentDV = ConvertToDataValueObjectModel.toResultDocumentDV(project); LOG.info("returning: " + documentDV.getId()); return documentDV; + } catch (ProjectNotFoundException e) { + LOG.error(ProjectNotFoundException.class.getSimpleName(), e); + throw e; } catch (Exception e) { String error = "Error occurred on reading the project with id: " + projectID; LOG.error(error, e); - throw new Exception( + throw new ProjectNotFoundException( error + ". Error: " + e.getMessage() + ". Refresh and try again or contact the support"); } diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/shared/ProjectNotFoundException.java b/src/main/java/org/gcube/portlets/user/geoportaldataentry/shared/ProjectNotFoundException.java new file mode 100644 index 0000000..f4c11aa --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/geoportaldataentry/shared/ProjectNotFoundException.java @@ -0,0 +1,21 @@ +package org.gcube.portlets.user.geoportaldataentry.shared; + +public class ProjectNotFoundException extends Exception { + + /** + * + */ + private static final long serialVersionUID = 4918313646452701634L; + + public ProjectNotFoundException() { + } + + public ProjectNotFoundException(String error){ + super(error); + } + + public ProjectNotFoundException(Throwable error){ + super(error); + } + +} -- 2.17.1 From 140856db0330328d7672ed7e66fad84b68ead940 Mon Sep 17 00:00:00 2001 From: "francesco.mangiacrapa" Date: Mon, 8 Apr 2024 17:18:29 +0200 Subject: [PATCH 04/13] - Added optional message when performing lifecycle step [#27192] --- .settings/org.eclipse.wst.common.component | 30 +++++--- CHANGELOG.md | 1 + .../client/GeoPortalDataEntryApp.java | 38 +++------- .../client/GeoportalDataEntryService.java | 16 +++-- .../GeoportalDataEntryServiceAsync.java | 2 +- .../client/ui/action/DeleteViewPanel.java | 60 ++++++++++++++++ .../client/ui/action/DeleteViewPanel.ui.xml | 33 +++++++++ .../client/ui/action/StepViewPanel.java | 72 +++++++++++++++++++ .../client/ui/action/StepViewPanel.ui.xml | 46 ++++++++++++ .../client/ui/utils/ModalConfirm.java | 7 +- .../server/GeoportalDataEntryServiceImpl.java | 8 ++- 11 files changed, 265 insertions(+), 48 deletions(-) create mode 100644 src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/action/DeleteViewPanel.java create mode 100644 src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/action/DeleteViewPanel.ui.xml create mode 100644 src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/action/StepViewPanel.java create mode 100644 src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/action/StepViewPanel.ui.xml diff --git a/.settings/org.eclipse.wst.common.component b/.settings/org.eclipse.wst.common.component index 19e8b2e..e3f5ed7 100644 --- a/.settings/org.eclipse.wst.common.component +++ b/.settings/org.eclipse.wst.common.component @@ -1,5 +1,6 @@ - + + @@ -140,7 +141,8 @@ - + + @@ -281,7 +283,8 @@ - + + @@ -422,7 +425,8 @@ - + + @@ -563,7 +567,8 @@ - + + @@ -662,7 +667,11 @@ uses - + + uses + + + @@ -803,7 +812,8 @@ - + + @@ -944,7 +954,8 @@ - + + @@ -1085,7 +1096,8 @@ - + + diff --git a/CHANGELOG.md b/CHANGELOG.md index c7d2413..e239a92 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm - Implemented the init facility to resolve a public link on an item [#27120] - Integrated new Uri-Resolver-Manager [#27160] - Added Get Shareable Link facility [#27120] +- Added optional message when performing lifecycle step [#27192] ## [v3.2.2] - 2024-01-11 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 5ae9c5c..3d2eb98 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 @@ -56,13 +56,14 @@ import org.gcube.portlets.user.geoportaldataentry.client.resource.Images; import org.gcube.portlets.user.geoportaldataentry.client.ui.GeonaMainTabPanel; import org.gcube.portlets.user.geoportaldataentry.client.ui.GeonaRecordsPaginatedView; import org.gcube.portlets.user.geoportaldataentry.client.ui.ModalWindow; +import org.gcube.portlets.user.geoportaldataentry.client.ui.action.DeleteViewPanel; +import org.gcube.portlets.user.geoportaldataentry.client.ui.action.StepViewPanel; import org.gcube.portlets.user.geoportaldataentry.client.ui.card.GeoNaFormCardModel; import org.gcube.portlets.user.geoportaldataentry.client.ui.edit.EditModeRecord; import org.gcube.portlets.user.geoportaldataentry.client.ui.edit.UpdateRecord; import org.gcube.portlets.user.geoportaldataentry.client.ui.form.GeonaDataEntryMainForm; import org.gcube.portlets.user.geoportaldataentry.client.ui.projects.ListOfProjectTablePanel; import org.gcube.portlets.user.geoportaldataentry.client.ui.report.LifecycleInformationPanel; -import org.gcube.portlets.user.geoportaldataentry.client.ui.report.ReportTemplateToHTML; import org.gcube.portlets.user.geoportaldataentry.client.ui.tree.NodeItem; import org.gcube.portlets.user.geoportaldataentry.client.ui.tree.TreeItemPanel; import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.DialogInform; @@ -1338,21 +1339,11 @@ public class GeoPortalDataEntryApp implements EntryPoint { final ResultDocumentDV resultDocumentDV = (ResultDocumentDV) item; - String htmlMsg = "Going to perform the step/s " + wActionOnItem.getAction().getCallSteps() - + " on the project with:"; - htmlMsg += "
    "; - htmlMsg += "
  • id: " + resultDocumentDV.getId() + "
  • "; - htmlMsg += "
  • profile: " + resultDocumentDV.getProfileID() + "
  • "; - htmlMsg += "
  • " + resultDocumentDV.getFirstEntryOfMap().getKey() + ": " - + resultDocumentDV.getFirstEntryOfMap().getValue() + "
  • "; - htmlMsg += "
"; - htmlMsg += "
"; - htmlMsg += "Would you like to proceed?"; - final ModalConfirm dialog = new ModalConfirm(null, - "Step/s " + wActionOnItem.getAction().getTitle() + ", Confirm?", htmlMsg); - dialog.addToCenterPanel( - new ReportTemplateToHTML("Project", resultDocumentDV.getDocumentAsJSON(), false)); + "Step/s " + wActionOnItem.getAction().getTitle() + ", Confirm?", null); + + final StepViewPanel stvp = new StepViewPanel(resultDocumentDV, wActionOnItem.getAction()); + dialog.addToCenterPanel(stvp); dialog.getYesButton().addClickHandler(new ClickHandler() { @@ -1374,7 +1365,7 @@ public class GeoPortalDataEntryApp implements EntryPoint { modal.add(modalContainerPanel); GeoportalDataEntryServiceAsync.Util.getInstance().performActionSteps( - resultDocumentDV.getProfileID(), resultDocumentDV.getId(), + resultDocumentDV.getProfileID(), resultDocumentDV.getId(),stvp.getOptionalMessage(), wActionOnItem.getAction(), new AsyncCallback() { @Override @@ -1945,19 +1936,10 @@ public class GeoPortalDataEntryApp implements EntryPoint { case DELETE_PROJECT: { - String htmlMsg = "Going to delete the project with:"; - htmlMsg += "
    "; - htmlMsg += "
  • id: " + resultDocumentDV.getId() + "
  • "; - htmlMsg += "
  • profile: " + resultDocumentDV.getProfileID() + "
  • "; - htmlMsg += "
  • " + resultDocumentDV.getFirstEntryOfMap().getKey() + ": " - + resultDocumentDV.getFirstEntryOfMap().getValue() + "
  • "; - htmlMsg += "
"; - htmlMsg += "
"; - htmlMsg += "This operation cannot be undone. Would you like to proceed?"; + DeleteViewPanel dvp = new DeleteViewPanel(resultDocumentDV); - final ModalConfirm dialog = new ModalConfirm(null, "Delete Confirm?", htmlMsg); - dialog.addToCenterPanel( - new ReportTemplateToHTML("Project", resultDocumentDV.getDocumentAsJSON(), false)); + final ModalConfirm dialog = new ModalConfirm(null, "Delete Confirm?", null); + dialog.addToCenterPanel(dvp); dialog.show(); dialog.getYesButton().addClickHandler(new ClickHandler() { diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoportalDataEntryService.java b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoportalDataEntryService.java index fd7afe5..0d3e054 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoportalDataEntryService.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoportalDataEntryService.java @@ -142,11 +142,11 @@ public interface GeoportalDataEntryService extends RemoteService { * * @param profileID the profile ID * @param projectID the project ID - * @param action the action + * @param optionalMessage the optional message + * @param action the action * @return the project DV - * @throws Exception the exception */ - ProjectDV performActionSteps(String profileID, String projectID, ActionDefinitionDV action) throws Exception; + ProjectDV performActionSteps(String profileID, String projectID, String optionalMessage, ActionDefinitionDV action) throws Exception; /** * Gets the relationships definition. @@ -237,8 +237,14 @@ public interface GeoportalDataEntryService extends RemoteService { CommitReport updateGeportalDataForm(String profileID, String projectID, GeoNaFormDataObject section, String sectionPath, List listFilePaths) throws Exception; + /** + * Gets the project view. + * + * @param profileID the profile ID + * @param projectID the project ID + * @return the project view + * @throws Exception the exception + */ ProjectView getProjectView(String profileID, String projectID) throws Exception; - - } diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoportalDataEntryServiceAsync.java b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoportalDataEntryServiceAsync.java index 35412ee..e861ee0 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoportalDataEntryServiceAsync.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoportalDataEntryServiceAsync.java @@ -79,7 +79,7 @@ public interface GeoportalDataEntryServiceAsync { void getLifecycleInfoForProjectId(String profileID, String projectID, AsyncCallback callback); - void performActionSteps(String profileID, String projectID, ActionDefinitionDV action, + void performActionSteps(String profileID, String projectID, String optionalMessage, ActionDefinitionDV action, AsyncCallback callback); void getRelationshipsDefinition(String profileID, AsyncCallback> callback); diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/action/DeleteViewPanel.java b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/action/DeleteViewPanel.java new file mode 100644 index 0000000..a454684 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/action/DeleteViewPanel.java @@ -0,0 +1,60 @@ +package org.gcube.portlets.user.geoportaldataentry.client.ui.action; + +import org.gcube.application.geoportalcommon.shared.geoportal.ResultDocumentDV; +import org.gcube.portlets.user.geoportaldataentry.client.ui.report.ReportTemplateToHTML; + +import com.github.gwtbootstrap.client.ui.AccordionGroup; +import com.google.gwt.core.client.GWT; +import com.google.gwt.uibinder.client.UiBinder; +import com.google.gwt.uibinder.client.UiField; +import com.google.gwt.user.client.ui.Composite; +import com.google.gwt.user.client.ui.FlowPanel; +import com.google.gwt.user.client.ui.HTML; +import com.google.gwt.user.client.ui.Widget; + +public class DeleteViewPanel extends Composite { + + private static DeleteViewPanelUiBinder uiBinder = GWT.create(DeleteViewPanelUiBinder.class); + + interface DeleteViewPanelUiBinder extends UiBinder { + } + + @UiField + FlowPanel principalPanel; + + @UiField + AccordionGroup accordionProjectDetails; + + @UiField + FlowPanel confirmProceedPanel; + + private ResultDocumentDV resultDocumentDV; + + public DeleteViewPanel(ResultDocumentDV resultDocumentDV) { + initWidget(uiBinder.createAndBindUi(this)); + this.resultDocumentDV = resultDocumentDV; + builtUI(); + } + + private void builtUI() { + String htmlMsg = "

Going to permanently delete the:

"; + // TODO Auto-generated method stub + principalPanel.add(new HTML(htmlMsg)); + ReportTemplateToHTML rt = new ReportTemplateToHTML("Project", resultDocumentDV.getDocumentAsJSON(), false); + rt.showAsJSON(false); + principalPanel.add(rt); + + String projectDetails = "
    "; + projectDetails += "
  • id: " + resultDocumentDV.getId() + "
  • "; + projectDetails += "
  • profile: " + resultDocumentDV.getProfileID() + "
  • "; + projectDetails += "
  • " + resultDocumentDV.getFirstEntryOfMap().getKey() + ": " + + resultDocumentDV.getFirstEntryOfMap().getValue() + "
  • "; + projectDetails += "
"; + + accordionProjectDetails.add(new HTML(projectDetails)); + + String confirmMessage = "This operation cannot be undone. Would you like to proceed?"; + confirmProceedPanel.add(new HTML(confirmMessage)); + } + +} diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/action/DeleteViewPanel.ui.xml b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/action/DeleteViewPanel.ui.xml new file mode 100644 index 0000000..e32baaf --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/action/DeleteViewPanel.ui.xml @@ -0,0 +1,33 @@ + + + + + .important { + font-weight: bold; + } + + .accordion-no-border { + border: 0px !important; + } + .text-are-size { + width: 80%; + height: 50px; + } + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/action/StepViewPanel.java b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/action/StepViewPanel.java new file mode 100644 index 0000000..1ec02c9 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/action/StepViewPanel.java @@ -0,0 +1,72 @@ +package org.gcube.portlets.user.geoportaldataentry.client.ui.action; + +import org.gcube.application.geoportalcommon.shared.geoportal.ResultDocumentDV; +import org.gcube.application.geoportalcommon.shared.geoportal.config.ActionDefinitionDV; +import org.gcube.portlets.user.geoportaldataentry.client.ui.report.ReportTemplateToHTML; + +import com.github.gwtbootstrap.client.ui.AccordionGroup; +import com.github.gwtbootstrap.client.ui.TextArea; +import com.google.gwt.core.client.GWT; +import com.google.gwt.uibinder.client.UiBinder; +import com.google.gwt.uibinder.client.UiField; +import com.google.gwt.user.client.ui.Composite; +import com.google.gwt.user.client.ui.FlowPanel; +import com.google.gwt.user.client.ui.HTML; +import com.google.gwt.user.client.ui.Widget; + +public class StepViewPanel extends Composite { + + private static StepViewPanelUiBinder uiBinder = GWT.create(StepViewPanelUiBinder.class); + + interface StepViewPanelUiBinder extends UiBinder { + } + + @UiField + FlowPanel principalPanel; + + @UiField + AccordionGroup accordionProjectDetails; + + @UiField + FlowPanel confirmProceedPanel; + + @UiField + TextArea txtOptionalMessage; + + private ResultDocumentDV resultDocumentDV; + + private ActionDefinitionDV actionDefinitionDV; + + public StepViewPanel(ResultDocumentDV resultDocumentDV, ActionDefinitionDV actionDefinitionDV) { + initWidget(uiBinder.createAndBindUi(this)); + this.resultDocumentDV = resultDocumentDV; + this.actionDefinitionDV = actionDefinitionDV; + builtUI(); + } + + private void builtUI() { + String htmlMsg = "

Going to perform the step/s " + actionDefinitionDV.getCallSteps() + " on the:

"; + // TODO Auto-generated method stub + principalPanel.add(new HTML(htmlMsg)); + ReportTemplateToHTML rt = new ReportTemplateToHTML("Project", resultDocumentDV.getDocumentAsJSON(), false); + rt.showAsJSON(false); + principalPanel.add(rt); + + String projectDetails = "
    "; + projectDetails += "
  • id: " + resultDocumentDV.getId() + "
  • "; + projectDetails += "
  • profile: " + resultDocumentDV.getProfileID() + "
  • "; + projectDetails += "
  • " + resultDocumentDV.getFirstEntryOfMap().getKey() + ": " + + resultDocumentDV.getFirstEntryOfMap().getValue() + "
  • "; + projectDetails += "
"; + + accordionProjectDetails.add(new HTML(projectDetails)); + + String confirmMessage = "Would you like to proceed?"; + confirmProceedPanel.add(new HTML(confirmMessage)); + } + + public String getOptionalMessage() { + return txtOptionalMessage.getText(); + } + +} diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/action/StepViewPanel.ui.xml b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/action/StepViewPanel.ui.xml new file mode 100644 index 0000000..5fbae1b --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/action/StepViewPanel.ui.xml @@ -0,0 +1,46 @@ + + + + + .important { + font-weight: bold; + } + + .accordion-no-border { + border: 0px !important; + } + .text-are-size { + width: 80%; + height: 70px; + } + + + + + + + + + + + + + + + Message + + + + You can add an optional message... + + + + + + + \ No newline at end of file diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/utils/ModalConfirm.java b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/utils/ModalConfirm.java index a69be58..108d01e 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/utils/ModalConfirm.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/utils/ModalConfirm.java @@ -29,6 +29,7 @@ import com.google.gwt.user.client.ui.Widget; */ public class ModalConfirm extends Modal implements ClickHandler { + private static final int modal_width = 800; private DockPanel dock = new DockPanel(); private Button yesButton; private VerticalPanel vpContainer; @@ -44,7 +45,7 @@ public class ModalConfirm extends Modal implements ClickHandler { * @param text the text */ public ModalConfirm(Image img, String caption, String text) { - setWidth(800); + setWidth(modal_width); setAnimation(true); // getElement().setClassName("gwt-DialogBoxNew"); dock.setSpacing(4); @@ -65,7 +66,9 @@ public class ModalConfirm extends Modal implements ClickHandler { vpContainer = new VerticalPanel(); vpContainer.getElement().getStyle().setMargin(20.0, Unit.PX); - vpContainer.add(new HTML(text)); + vpContainer.setWidth((modal_width - 70) + "px"); + if (text != null) + vpContainer.add(new HTML(text)); hpButtons = new HorizontalPanel(); hpButtons.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); // hpButtons.getElement().getStyle().setMarginTop(20.0, Unit.PX); 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 e020dfe..d15b04a 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 @@ -136,6 +136,7 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen * Save geona data forms. * * @param profileID the profile ID + * @param optionalMessage the optional message * @param tree_Node the tree node * @param stepsOnPostCreation the steps on post creation * @return the commit report @@ -195,7 +196,7 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen LOG.info("stepsOnPostCreation are {}", stepsOnPostCreation); for (String stepID : stepsOnPostCreation) { LOG.info("calling step OnPostCreation are {}", stepID); - theProject = client.performStep(theProject.getProfileID(), theProject.getId(), stepID, null); + theProject = client.performStep(theProject.getProfileID(), theProject.getId(), stepID, null, null); } } catch (Exception e) { @@ -1265,12 +1266,13 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen * * @param profileID the profile ID * @param projectID the project ID + * @param optionalMessage the optional message * @param action the action * @return the project DV * @throws Exception the exception */ @Override - public ProjectDV performActionSteps(String profileID, String projectID, ActionDefinitionDV action) + public ProjectDV performActionSteps(String profileID, String projectID, String optionalMessage, ActionDefinitionDV action) throws Exception { LOG.info("performActionSteps called for profileID {}, projectID {}, action: " + action, profileID, projectID); @@ -1285,7 +1287,7 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen Project project = null; for (String stepID : action.getCallSteps()) { LOG.info("calling stepID {} on projectID {}", stepID, projectID); - project = client.performStep(profileID, projectID, stepID, null); + project = client.performStep(profileID, projectID, stepID, optionalMessage, null); } ProjectDVBuilder projectBuilder = ProjectDVBuilder.newBuilder().fullDocumentMap(true); -- 2.17.1 From 63816fe6480de775ef03b8ecffbebdd5885b2f7b Mon Sep 17 00:00:00 2001 From: "francesco.mangiacrapa" Date: Thu, 11 Apr 2024 11:04:54 +0200 Subject: [PATCH 05/13] integrated new bean StepPerformedResultDV --- .settings/org.eclipse.wst.common.component | 48 +++++++++---- .../client/GeoPortalDataEntryApp.java | 72 +++++++++++++------ .../client/GeoportalDataEntryService.java | 3 +- .../GeoportalDataEntryServiceAsync.java | 3 +- .../client/ui/action/StepViewPanel.ui.xml | 2 +- .../server/GeoportalDataEntryServiceImpl.java | 16 +++-- 6 files changed, 104 insertions(+), 40 deletions(-) diff --git a/.settings/org.eclipse.wst.common.component b/.settings/org.eclipse.wst.common.component index e3f5ed7..077df57 100644 --- a/.settings/org.eclipse.wst.common.component +++ b/.settings/org.eclipse.wst.common.component @@ -1,5 +1,8 @@ - + + + + @@ -141,7 +144,10 @@ - + + + + @@ -283,7 +289,10 @@ - + + + + @@ -425,7 +434,10 @@ - + + + + @@ -567,7 +579,10 @@ - + + + + @@ -667,10 +682,10 @@ uses - - uses - - + + + + @@ -812,7 +827,10 @@ - + + + + @@ -954,7 +972,10 @@ - + + + + @@ -1096,7 +1117,10 @@ - + + + + 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 3d2eb98..11c4639 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 @@ -21,8 +21,9 @@ import org.gcube.application.geoportalcommon.shared.geoportal.config.GcubeProfil import org.gcube.application.geoportalcommon.shared.geoportal.config.ItemFieldDV; import org.gcube.application.geoportalcommon.shared.geoportal.materialization.innerobject.FilesetDV; import org.gcube.application.geoportalcommon.shared.geoportal.materialization.innerobject.PayloadDV; +import org.gcube.application.geoportalcommon.shared.geoportal.project.BasicLifecycleInformationDV.Status; import org.gcube.application.geoportalcommon.shared.geoportal.project.LifecycleInformationDV; -import org.gcube.application.geoportalcommon.shared.geoportal.project.ProjectDV; +import org.gcube.application.geoportalcommon.shared.geoportal.step.StepPerformedResultDV; import org.gcube.application.geoportalcommon.shared.geoportal.ucd.GEOPORTAL_DATA_HANDLER; import org.gcube.application.geoportalcommon.shared.geoportal.ucd.HandlerDeclarationDV; import org.gcube.application.geoportalcommon.shared.geoportal.ucd.RelationshipDefinitionDV; @@ -257,7 +258,8 @@ public class GeoPortalDataEntryApp implements EntryPoint { @Override public void onFailure(Throwable caught) { - String errorMsg = "Sorry, an error occurred on istancing the application. Please, contact the support. Error is: "+caught.getMessage(); + String errorMsg = "Sorry, an error occurred on istancing the application. Please, contact the support. Error is: " + + caught.getMessage(); Alert alert = new Alert(errorMsg, AlertType.ERROR); alert.setClose(false); try { @@ -328,8 +330,8 @@ public class GeoPortalDataEntryApp implements EntryPoint { @Override public void onFailure(Throwable caught) { - - if(caught instanceof ProjectNotFoundException) { + + if (caught instanceof ProjectNotFoundException) { Modal errorModal = new Modal(true, true); errorModal.setCloseVisible(true); errorModal.setTitle("Oops..."); @@ -343,11 +345,10 @@ public class GeoPortalDataEntryApp implements EntryPoint { errorPanelMsg.add(erroMessage); errorModal.add(errorPanelMsg); errorModal.show(); - } - else { + } else { Window.alert("Error " + caught.getMessage()); } - + initExecutor.execute(); } @@ -1365,8 +1366,9 @@ public class GeoPortalDataEntryApp implements EntryPoint { modal.add(modalContainerPanel); GeoportalDataEntryServiceAsync.Util.getInstance().performActionSteps( - resultDocumentDV.getProfileID(), resultDocumentDV.getId(),stvp.getOptionalMessage(), - wActionOnItem.getAction(), new AsyncCallback() { + resultDocumentDV.getProfileID(), resultDocumentDV.getId(), + stvp.getOptionalMessage(), wActionOnItem.getAction(), + new AsyncCallback() { @Override public void onFailure(Throwable caught) { @@ -1382,7 +1384,7 @@ public class GeoPortalDataEntryApp implements EntryPoint { } @Override - public void onSuccess(final ProjectDV result) { + public void onSuccess(final StepPerformedResultDV result) { modal.setTitle("Step/s performed"); modal.setCloseVisible(true); try { @@ -1396,22 +1398,50 @@ public class GeoPortalDataEntryApp implements EntryPoint { String stepsToString = ""; for (String step : wActionOnItem.getAction().getCallSteps()) { - stepsToString += step + ", "; + stepsToString += step + " "; + } + + Status status = Status.NOT_SPECIFIED; + AlertType alertType = AlertType.INFO; + String statusMsg = "status " + status.getLabel(); + try { + status = result.getLifecycleInfoDV().getLastOperationStatus(); + switch (status) { + case OK: + alertType = AlertType.SUCCESS; + statusMsg = "performed with " + status.getLabel().toUpperCase()+"!"; + break; + case WARNING: + alertType = AlertType.WARNING; + statusMsg = "performed with " + status.getLabel().toUpperCase()+"!"; + break; + case ERROR: + alertType = AlertType.ERROR; + statusMsg = "performed with " + status.getLabel().toUpperCase()+"!"; + break; + default: + alertType = AlertType.INFO; + statusMsg = "performed. Current status " + status.getLabel(); + break; + } + } catch (Exception e) { + // silent } Alert alert = new Alert( - stepString + " " + stepsToString + "performed correclty!"); - alert.setType(AlertType.INFO); + stepString + " " + stepsToString + " " + statusMsg); + alert.setType(alertType); alert.setClose(false); modal.add(alert); GeoportalDataEntryServiceAsync.Util.getInstance() .getResultDocumentFoProjectByID(result.getProfileID(), - result.getId(), new AsyncCallback() { + result.getProjectId(), + new AsyncCallback() { @Override public void onFailure(Throwable caught) { - // TODO Auto-generated method stub + Window.alert("Error: " + caught.getMessage()); } @@ -1631,7 +1661,8 @@ public class GeoPortalDataEntryApp implements EntryPoint { modal.add(hpGetLink); GeoportalDataEntryServiceAsync.Util.getInstance().getLinksFor(resultDocumentDV.getId(), - resultDocumentDV.getProfileID(), GeoportalItemReferences.SHARE_LINK_TO.DATA_VIEWER, new AsyncCallback() { + resultDocumentDV.getProfileID(), GeoportalItemReferences.SHARE_LINK_TO.DATA_VIEWER, + new AsyncCallback() { @Override public void onFailure(Throwable caught) { try { @@ -1679,7 +1710,7 @@ public class GeoPortalDataEntryApp implements EntryPoint { break; } - + case GET_SHAREABLE_LINK: { final Modal modal = new Modal(true, true); @@ -1691,7 +1722,8 @@ public class GeoPortalDataEntryApp implements EntryPoint { modal.add(hpGetLink); GeoportalDataEntryServiceAsync.Util.getInstance().getLinksFor(resultDocumentDV.getId(), - resultDocumentDV.getProfileID(), GeoportalItemReferences.SHARE_LINK_TO.DATA_ENTRY, new AsyncCallback() { + resultDocumentDV.getProfileID(), GeoportalItemReferences.SHARE_LINK_TO.DATA_ENTRY, + new AsyncCallback() { @Override public void onFailure(Throwable caught) { try { @@ -1722,8 +1754,8 @@ public class GeoPortalDataEntryApp implements EntryPoint { Anchor anchor = new Anchor(theURL); anchor.setHref(theURL); anchor.setTarget("_blank"); - anchor.setTitle( - "Shareable link of the project with id: " + resultDocumentDV.getId()); + anchor.setTitle("Shareable link of the project with id: " + + resultDocumentDV.getId()); com.github.gwtbootstrap.client.ui.Label label = new com.github.gwtbootstrap.client.ui.Label( "Shareable link"); label.setType(LabelType.SUCCESS); diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoportalDataEntryService.java b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoportalDataEntryService.java index 0d3e054..c52839b 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoportalDataEntryService.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoportalDataEntryService.java @@ -12,6 +12,7 @@ import org.gcube.application.geoportalcommon.shared.geoportal.config.FilePathDV; import org.gcube.application.geoportalcommon.shared.geoportal.project.LifecycleInformationDV; import org.gcube.application.geoportalcommon.shared.geoportal.project.ProjectDV; import org.gcube.application.geoportalcommon.shared.geoportal.project.TemporalReferenceDV; +import org.gcube.application.geoportalcommon.shared.geoportal.step.StepPerformedResultDV; import org.gcube.application.geoportalcommon.shared.geoportal.ucd.RelationshipDefinitionDV; import org.gcube.application.geoportalcommon.shared.geoportal.ucd.UseCaseDescriptorDV; import org.gcube.application.geoportalcommon.shared.geoportal.view.ProjectView; @@ -146,7 +147,7 @@ public interface GeoportalDataEntryService extends RemoteService { * @param action the action * @return the project DV */ - ProjectDV performActionSteps(String profileID, String projectID, String optionalMessage, ActionDefinitionDV action) throws Exception; + StepPerformedResultDV performActionSteps(String profileID, String projectID, String optionalMessage, ActionDefinitionDV action) throws Exception; /** * Gets the relationships definition. diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoportalDataEntryServiceAsync.java b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoportalDataEntryServiceAsync.java index e861ee0..20b337c 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoportalDataEntryServiceAsync.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoportalDataEntryServiceAsync.java @@ -12,6 +12,7 @@ import org.gcube.application.geoportalcommon.shared.geoportal.config.FilePathDV; import org.gcube.application.geoportalcommon.shared.geoportal.project.LifecycleInformationDV; import org.gcube.application.geoportalcommon.shared.geoportal.project.ProjectDV; import org.gcube.application.geoportalcommon.shared.geoportal.project.TemporalReferenceDV; +import org.gcube.application.geoportalcommon.shared.geoportal.step.StepPerformedResultDV; import org.gcube.application.geoportalcommon.shared.geoportal.ucd.RelationshipDefinitionDV; import org.gcube.application.geoportalcommon.shared.geoportal.ucd.UseCaseDescriptorDV; import org.gcube.application.geoportalcommon.shared.geoportal.view.ProjectView; @@ -80,7 +81,7 @@ public interface GeoportalDataEntryServiceAsync { AsyncCallback callback); void performActionSteps(String profileID, String projectID, String optionalMessage, ActionDefinitionDV action, - AsyncCallback callback); + AsyncCallback callback); void getRelationshipsDefinition(String profileID, AsyncCallback> callback); diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/action/StepViewPanel.ui.xml b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/action/StepViewPanel.ui.xml index 5fbae1b..01bd0d1 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/action/StepViewPanel.ui.xml +++ b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/action/StepViewPanel.ui.xml @@ -36,7 +36,7 @@ - You can add an optional message... + You can optionally add a message... 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 d15b04a..4349754 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 @@ -55,6 +55,7 @@ import org.gcube.application.geoportalcommon.shared.geoportal.config.GcubeProfil import org.gcube.application.geoportalcommon.shared.geoportal.project.LifecycleInformationDV; import org.gcube.application.geoportalcommon.shared.geoportal.project.ProjectDV; import org.gcube.application.geoportalcommon.shared.geoportal.project.TemporalReferenceDV; +import org.gcube.application.geoportalcommon.shared.geoportal.step.StepPerformedResultDV; import org.gcube.application.geoportalcommon.shared.geoportal.ucd.GEOPORTAL_DATA_HANDLER; import org.gcube.application.geoportalcommon.shared.geoportal.ucd.RelationshipDefinitionDV; import org.gcube.application.geoportalcommon.shared.geoportal.ucd.UseCaseDescriptorDV; @@ -1272,7 +1273,7 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen * @throws Exception the exception */ @Override - public ProjectDV performActionSteps(String profileID, String projectID, String optionalMessage, ActionDefinitionDV action) + public StepPerformedResultDV performActionSteps(String profileID, String projectID, String optionalMessage, ActionDefinitionDV action) throws Exception { LOG.info("performActionSteps called for profileID {}, projectID {}, action: " + action, profileID, projectID); @@ -1289,11 +1290,16 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen LOG.info("calling stepID {} on projectID {}", stepID, projectID); project = client.performStep(profileID, projectID, stepID, optionalMessage, null); } + + LifecycleInformationDV lifecycleInfo = getLifecycleInfoForProjectId(profileID, projectID); + lifecycleInfo.getLastOperationStatus(); - ProjectDVBuilder projectBuilder = ProjectDVBuilder.newBuilder().fullDocumentMap(true); - ProjectDV theProject = ConvertToDataValueObjectModel.toProjectDV(project, projectBuilder); - LOG.info("performActionSteps returning theProject with ID {}", projectID); - return theProject; + StepPerformedResultDV sprv = new StepPerformedResultDV(profileID, projectID, lifecycleInfo); + +// ProjectDVBuilder projectBuilder = ProjectDVBuilder.newBuilder().fullDocumentMap(true); +// ProjectDV theProject = ConvertToDataValueObjectModel.toProjectDV(project, projectBuilder); + LOG.info("performActionSteps returning theProject with ID {}", sprv); + return sprv; } catch (Exception e) { String error = "Error occurred on performing the workflow step/s on the project id " + projectID; LOG.error(error, e); -- 2.17.1 From ed5b39d106f58859c2449e79217c14662c6d3c90 Mon Sep 17 00:00:00 2001 From: "francesco.mangiacrapa" Date: Thu, 11 Apr 2024 12:22:58 +0200 Subject: [PATCH 06/13] updated CSS --- .../client/ui/action/StepViewPanel.ui.xml | 4 ++-- .../client/ui/report/ReportTemplateToHTML.java | 1 + .../client/ui/report/ReportTemplateToHTML.ui.xml | 8 ++++++-- src/main/webapp/GeoPortalDataEntryApp.css | 1 + 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/action/StepViewPanel.ui.xml b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/action/StepViewPanel.ui.xml index 01bd0d1..eda62c9 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/action/StepViewPanel.ui.xml +++ b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/action/StepViewPanel.ui.xml @@ -12,8 +12,8 @@ border: 0px !important; } .text-are-size { - width: 80%; - height: 70px; + width: 80% !important; + height: 70px !important; } diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/report/ReportTemplateToHTML.java b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/report/ReportTemplateToHTML.java index 700ceb3..73f1e30 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/report/ReportTemplateToHTML.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/report/ReportTemplateToHTML.java @@ -76,6 +76,7 @@ public class ReportTemplateToHTML extends Composite { boolean openJSONReport) { initWidget(uiBinder.createAndBindUi(this)); vpContainer.setVisible(false); + vpContainer.setWidth("95%"); showReportAsJSON.setDefaultOpen(openJSONReport); showReportAsTable.setDefaultOpen(openTableReport); diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/report/ReportTemplateToHTML.ui.xml b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/report/ReportTemplateToHTML.ui.xml index 606c17d..75e4321 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/report/ReportTemplateToHTML.ui.xml +++ b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/report/ReportTemplateToHTML.ui.xml @@ -10,13 +10,17 @@ .margin-top-10 { margin-top: 10px; } + .table-style { + margin-top: 10px; + width: 95%; + } + addStyleNames="{style.table-style}"> Report: + addStyleNames="{style.table-style}"> diff --git a/src/main/webapp/GeoPortalDataEntryApp.css b/src/main/webapp/GeoPortalDataEntryApp.css index 7494363..76a5bcb 100644 --- a/src/main/webapp/GeoPortalDataEntryApp.css +++ b/src/main/webapp/GeoPortalDataEntryApp.css @@ -49,6 +49,7 @@ h1 { margin-left: 10px; margin-bottom: 10px; margin-right: 5px; + width: 100%; } .my-html-table td { -- 2.17.1 From 4a1b26128cc74156af6928661cda17572ea34d46 Mon Sep 17 00:00:00 2001 From: "francesco.mangiacrapa" Date: Mon, 15 Apr 2024 12:35:16 +0200 Subject: [PATCH 07/13] commented test --- .settings/org.eclipse.wst.common.component | 41 ++++++++++++++----- .../ui/form/GeonaDataEntryMainForm.java | 2 +- 2 files changed, 32 insertions(+), 11 deletions(-) diff --git a/.settings/org.eclipse.wst.common.component b/.settings/org.eclipse.wst.common.component index 077df57..7489de0 100644 --- a/.settings/org.eclipse.wst.common.component +++ b/.settings/org.eclipse.wst.common.component @@ -1,5 +1,7 @@ - + + + @@ -144,7 +146,9 @@ - + + + @@ -289,7 +293,9 @@ - + + + @@ -434,7 +440,9 @@ - + + + @@ -579,7 +587,9 @@ - + + + @@ -679,10 +689,15 @@ uses - + uses - + + uses + + + + @@ -827,7 +842,9 @@ - + + + @@ -972,7 +989,9 @@ - + + + @@ -1117,7 +1136,9 @@ - + + + diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/form/GeonaDataEntryMainForm.java b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/form/GeonaDataEntryMainForm.java index 1ea47da..1311659 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/form/GeonaDataEntryMainForm.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/form/GeonaDataEntryMainForm.java @@ -248,7 +248,7 @@ public class GeonaDataEntryMainForm extends Composite { appManagerBus.fireEvent(new SaveGeonaDataFormsEvent(treeItemPanel.getProfileID(), treeNode)); TreeVisitUtil.preOrderVisit(treeNode); - showAlertOnSaveAction("Andiamo a salvare", AlertType.INFO, true); + //showAlertOnSaveAction("Andiamo a salvare", AlertType.INFO, true); } else { showAlertOnSaveAction("Detected errors, please fix it/them", AlertType.ERROR, true); -- 2.17.1 From 89ddb6bc5fde4cde9bb033d9932113225648a1d5 Mon Sep 17 00:00:00 2001 From: "francesco.mangiacrapa" Date: Tue, 16 Apr 2024 11:22:38 +0200 Subject: [PATCH 08/13] updated title --- .settings/org.eclipse.wst.common.component | 9 --------- .../client/ui/GeonaMainTabPanel.ui.xml | 2 +- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/.settings/org.eclipse.wst.common.component b/.settings/org.eclipse.wst.common.component index 7489de0..604e800 100644 --- a/.settings/org.eclipse.wst.common.component +++ b/.settings/org.eclipse.wst.common.component @@ -686,15 +686,6 @@ - - uses - - - uses - - - uses - diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/GeonaMainTabPanel.ui.xml b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/GeonaMainTabPanel.ui.xml index 93cec0f..3010f13 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/GeonaMainTabPanel.ui.xml +++ b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/GeonaMainTabPanel.ui.xml @@ -107,7 +107,7 @@ Show on Map - Get Shareable link Date: Fri, 10 May 2024 12:25:20 +0200 Subject: [PATCH 09/13] Enforced deleteProject method --- .settings/org.eclipse.wst.common.component | 120 ++++++++++++++++-- CHANGELOG.md | 1 + .../server/GeoportalDataEntryServiceImpl.java | 12 ++ 3 files changed, 124 insertions(+), 9 deletions(-) diff --git a/.settings/org.eclipse.wst.common.component b/.settings/org.eclipse.wst.common.component index 604e800..5420fc3 100644 --- a/.settings/org.eclipse.wst.common.component +++ b/.settings/org.eclipse.wst.common.component @@ -1,5 +1,16 @@ - + + + + + + + + + + + + @@ -146,7 +157,18 @@ - + + + + + + + + + + + + @@ -293,7 +315,18 @@ - + + + + + + + + + + + + @@ -440,7 +473,18 @@ - + + + + + + + + + + + + @@ -587,7 +631,18 @@ - + + + + + + + + + + + + @@ -686,7 +741,21 @@ - + + uses + + + + + + + + + + + + + @@ -833,7 +902,18 @@ - + + + + + + + + + + + + @@ -980,7 +1060,18 @@ - + + + + + + + + + + + + @@ -1127,7 +1218,18 @@ - + + + + + + + + + + + + diff --git a/CHANGELOG.md b/CHANGELOG.md index e239a92..53fd7bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm - Integrated new Uri-Resolver-Manager [#27160] - Added Get Shareable Link facility [#27120] - Added optional message when performing lifecycle step [#27192] +- Enforced deleteProject method ## [v3.2.2] - 2024-01-11 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 4349754..141e5d7 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 @@ -1010,6 +1010,18 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen SessionUtil.getCurrentContext(getThreadLocalRequest(), true); client.deleteProject(profileID, projectID, true); + + try { + Project deletedP = client.getProjectByID(profileID, projectID); + if(deletedP!=null) { + String error = "The project with id: "+projectID+" still exists"; + LOG.error(error +". Sending exception.."); + throw new Exception(error); + } + }catch (Exception e) { + throw e; + } + // Updating count of Documents in session per profileID Integer totalProjectForProfile = client.getTotalDocument(profileID); SessionUtil.setTotalDocumentForProfileID(getThreadLocalRequest(), profileID, totalProjectForProfile); -- 2.17.1 From c3a923eb694149c2700c933448b2d297ab3b7f35 Mon Sep 17 00:00:00 2001 From: "francesco.mangiacrapa" Date: Fri, 10 May 2024 12:29:33 +0200 Subject: [PATCH 10/13] updated exception message --- .../server/GeoportalDataEntryServiceImpl.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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 141e5d7..7889e1e 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 @@ -1029,8 +1029,7 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen } catch (Exception e) { LOG.error("Error on deleting the project with id: " + projectID, e); - throw new Exception( - "Error occurred on deleting the project with id: " + projectID + ". Error: " + e.getMessage()); + throw new Exception(e.getMessage()); } } -- 2.17.1 From 54545e70488d015de5d82487e85754fba3a3eb8e Mon Sep 17 00:00:00 2001 From: "francesco.mangiacrapa" Date: Fri, 10 May 2024 12:50:51 +0200 Subject: [PATCH 11/13] Enforced deleteProject UX --- CHANGELOG.md | 2 +- .../client/GeoPortalDataEntryApp.java | 35 +++++++++++++++++-- .../server/GeoportalDataEntryServiceImpl.java | 4 +-- 3 files changed, 35 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 53fd7bd..7020671 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm - Integrated new Uri-Resolver-Manager [#27160] - Added Get Shareable Link facility [#27120] - Added optional message when performing lifecycle step [#27192] -- Enforced deleteProject method +- Enforced deleteProject method/UX ## [v3.2.2] - 2024-01-11 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 11c4639..dd94c31 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 @@ -1409,15 +1409,18 @@ public class GeoPortalDataEntryApp implements EntryPoint { switch (status) { case OK: alertType = AlertType.SUCCESS; - statusMsg = "performed with " + status.getLabel().toUpperCase()+"!"; + statusMsg = "performed with " + status.getLabel().toUpperCase() + + "!"; break; case WARNING: alertType = AlertType.WARNING; - statusMsg = "performed with " + status.getLabel().toUpperCase()+"!"; + statusMsg = "performed with " + status.getLabel().toUpperCase() + + "!"; break; case ERROR: alertType = AlertType.ERROR; - statusMsg = "performed with " + status.getLabel().toUpperCase()+"!"; + statusMsg = "performed with " + status.getLabel().toUpperCase() + + "!"; break; default: alertType = AlertType.INFO; @@ -2003,6 +2006,32 @@ public class GeoPortalDataEntryApp implements EntryPoint { alert.setClose(false); hp.add(alert); + VerticalPanel vp = new VerticalPanel(); + vp.getElement().getStyle().setMarginTop(20, Unit.PX); + vp.add(new Label("Check outcome in the Publication Report")); + Button buttonShowPublicationReport = new Button( + "Show Publication Report"); + buttonShowPublicationReport.setType(ButtonType.INFO); + buttonShowPublicationReport.addClickHandler(new ClickHandler() { + + @Override + public void onClick(ClickEvent event) { + modal.hide(); + appManagerBus + .fireEvent(new OperationOnItemEvent( + Arrays.asList(resultDocumentDV), + OPERATION_ON_ITEM.VIEW_REPORT)); + + } + }); + buttonShowPublicationReport.getElement().getStyle().setMarginTop(10, + Unit.PX); + buttonShowPublicationReport.getElement().getStyle() + .setMarginBottom(20, Unit.PX); + vp.add(buttonShowPublicationReport); + + modal.add(vp); + } @Override 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 7889e1e..43c1cbb 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 @@ -1014,7 +1014,7 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen try { Project deletedP = client.getProjectByID(profileID, projectID); if(deletedP!=null) { - String error = "The project with id: "+projectID+" still exists"; + String error = "The project with id "+projectID+" still exists"; LOG.error(error +". Sending exception.."); throw new Exception(error); } @@ -1029,7 +1029,7 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen } catch (Exception e) { LOG.error("Error on deleting the project with id: " + projectID, e); - throw new Exception(e.getMessage()); + throw new Exception("Error occurred on the server side when deleting the project"); } } -- 2.17.1 From bb323df98ad747a4fbcc86b222c7c07eb4ee7e9e Mon Sep 17 00:00:00 2001 From: "francesco.mangiacrapa" Date: Wed, 22 May 2024 15:34:23 +0200 Subject: [PATCH 12/13] updated logs --- .settings/org.eclipse.wst.common.component | 50 +++++++++++++++---- .../client/GeoPortalDataEntryApp.java | 2 +- .../server/GeoportalDataEntryServiceImpl.java | 8 +-- 3 files changed, 45 insertions(+), 15 deletions(-) diff --git a/.settings/org.eclipse.wst.common.component b/.settings/org.eclipse.wst.common.component index 5420fc3..4cb3434 100644 --- a/.settings/org.eclipse.wst.common.component +++ b/.settings/org.eclipse.wst.common.component @@ -1,5 +1,8 @@ - + + + + @@ -157,7 +160,10 @@ - + + + + @@ -315,7 +321,10 @@ - + + + + @@ -473,7 +482,10 @@ - + + + + @@ -631,7 +643,10 @@ - + + + + @@ -741,10 +756,16 @@ - + uses - + + uses + + + + + @@ -902,7 +923,10 @@ - + + + + @@ -1060,7 +1084,10 @@ - + + + + @@ -1218,7 +1245,10 @@ - + + + + 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 dd94c31..289b160 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 @@ -258,7 +258,7 @@ public class GeoPortalDataEntryApp implements EntryPoint { @Override public void onFailure(Throwable caught) { - String errorMsg = "Sorry, an error occurred on istancing the application. Please, contact the support. Error is: " + String errorMsg = "Sorry, an error occurred on instancing the application. Please, contact the support. Error is: " + caught.getMessage(); Alert alert = new Alert(errorMsg, AlertType.ERROR); alert.setClose(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 43c1cbb..6db6e51 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 @@ -824,7 +824,7 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen */ @Override public GeoportalISConfig getGeonaInitConfig() { - LOG.info("getConfig called"); + LOG.info("getGeonaInitConfig called"); String scope = SessionUtil.getCurrentContext(this.getThreadLocalRequest(), false); String theSecondaryType; @@ -1106,7 +1106,7 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen */ @Override public GNADataEntryExtendedConfigProfile readDataEntryPresentationConfig() throws Exception { - LOG.info("readDataViewerConfig called"); + LOG.info("readDataEntryPresentationConfig called"); GCubeUser user = null; GNADataEntryExtendedConfigProfile gnaDEExtConfig = new GNADataEntryExtendedConfigProfile(); @@ -1138,7 +1138,7 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen long groupId = pContext.getCurrentGroupId(this.getThreadLocalRequest()); if (user == null || scope == null) { - LOG.warn("called getMyRightsInTheContext with invalid parameter user: " + user + ", in the scope: " + LOG.warn("called readDataEntryPresentationConfig with invalid parameter user: " + user + ", in the scope: " + scope, ", returning null"); return null; } @@ -1183,7 +1183,7 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen gnaDEExtConfig.setUserRights(userRights); return gnaDEExtConfig; } catch (UserRetrievalFault | GroupRetrievalFault | GNAConfigException e) { - LOG.error("An error occurred during getMyRightsInTheContext: " + user, e); + LOG.error("An error occurred during readDataEntryPresentationConfig: " + user, e); Map permissions = new HashMap(); RoleRights roleRights = new RoleRights(permissions, GcubeUserRole.DATA_MEMBER); -- 2.17.1 From 40ad3ee2cf69de92766e453995b354d23ec6805c Mon Sep 17 00:00:00 2001 From: "francesco.mangiacrapa" Date: Thu, 20 Jun 2024 17:50:44 +0200 Subject: [PATCH 13/13] updated typo --- .settings/org.eclipse.wst.common.component | 63 ++++++++++++++++--- .../client/GeoPortalDataEntryApp.java | 2 +- 2 files changed, 55 insertions(+), 10 deletions(-) diff --git a/.settings/org.eclipse.wst.common.component b/.settings/org.eclipse.wst.common.component index 4cb3434..a47cb55 100644 --- a/.settings/org.eclipse.wst.common.component +++ b/.settings/org.eclipse.wst.common.component @@ -1,5 +1,10 @@ - + + + + + + @@ -160,7 +165,12 @@ - + + + + + + @@ -321,7 +331,12 @@ - + + + + + + @@ -482,7 +497,12 @@ - + + + + + + @@ -643,7 +663,12 @@ - + + + + + + @@ -762,7 +787,12 @@ uses - + + + + + + @@ -923,7 +953,12 @@ - + + + + + + @@ -1084,7 +1119,12 @@ - + + + + + + @@ -1245,7 +1285,12 @@ - + + + + + + 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 289b160..452088b 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 @@ -1354,7 +1354,7 @@ public class GeoPortalDataEntryApp implements EntryPoint { final Modal modal = new Modal(true, true); modal.setCloseVisible(false); - modal.setTitle("Perfoming Steps..."); + modal.setTitle("Performing Steps..."); modal.hide(false); modal.setWidth(800); modal.setMaxHeigth("650px"); -- 2.17.1