diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e87fe0..fc9dbe7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm - [#23784] Migrated list and reload, searching and ordering functionalities - [#23785] Migrated the GNA functionalities - [#23834] Create Relation facility +- [#23913] Integrated with GUI presentation configurations read from IS - Moved to maven-portal-bom v3.7.0[-SNAPSHOT] ## [v2.2.1] - 2022-06-29 diff --git a/pom.xml b/pom.xml index e951481..bbe2bec 100644 --- a/pom.xml +++ b/pom.xml @@ -183,6 +183,10 @@ javax.servlet servlet-api + + org.projectlombok + lombok + 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 acc0c2c..426190a 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 @@ -63,9 +63,9 @@ import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.LoaderIcon; import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.ModalConfirm; import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.NewBrowserWindow; import org.gcube.portlets.user.geoportaldataentry.shared.CommitReport; -import org.gcube.portlets.user.geoportaldataentry.shared.GNADataEntryExtConfigProfile; +import org.gcube.portlets.user.geoportaldataentry.shared.GNADataEntryExtendedConfigProfile; import org.gcube.portlets.user.geoportaldataentry.shared.GeoNaFormDataObject; -import org.gcube.portlets.user.geoportaldataentry.shared.GeonaISConfig; +import org.gcube.portlets.user.geoportaldataentry.shared.GeoportalISConfig; import org.gcube.portlets.user.geoportaldataentry.shared.Tree_Node; import org.gcube.portlets.user.geoportaldataentry.shared.UserRights; import org.gcube.portlets.widgets.mpformbuilder.client.MetadataProfileFormBuilderServiceAsync; @@ -123,7 +123,7 @@ public class GeoPortalDataEntryApp implements EntryPoint { private LoaderIcon loaderConfigurations = new LoaderIcon("Step 2 of 2. Loading Configurations, please wait"); - private GeonaISConfig geonaISConfig; + private GeoportalISConfig geoportalISConfigs; private int numberOfCards = 0; @@ -185,7 +185,7 @@ public class GeoPortalDataEntryApp implements EntryPoint { ConstantsGeoPortalDataEntryApp.ROOT_PANEL_DIV_PORTLET.getElement() .addClassName(ConstantsGeoPortalDataEntryApp.CSS_CLASS_ANIMATE_FADE_IN_OUT); - GeoportalDataEntryServiceAsync.Util.getInstance().getGeonaInitConfig(new AsyncCallback() { + GeoportalDataEntryServiceAsync.Util.getInstance().getGeonaInitConfig(new AsyncCallback() { @Override public void onFailure(Throwable caught) { @@ -202,20 +202,21 @@ public class GeoPortalDataEntryApp implements EntryPoint { } @Override - public void onSuccess(GeonaISConfig result) { - geonaISConfig = result; + public void onSuccess(GeoportalISConfig geoportalISConfig) { + geoportalISConfigs = geoportalISConfig; - if (result != null && result.getScope() != null) { + if (geoportalISConfig != null && geoportalISConfig.getScope() != null) { - loadGeoportalConfigs(result.getScope()); + 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() { + .readDataViewerConfig(new AsyncCallback() { @Override public void onFailure(Throwable caught) { @@ -235,8 +236,8 @@ public class GeoPortalDataEntryApp implements EntryPoint { } @Override - public void onSuccess(GNADataEntryExtConfigProfile gNADataEntryConfig) { - GWT.log(GNADataEntryExtConfigProfile.class.getSimpleName() + " loaded: " + gNADataEntryConfig); + public void onSuccess(GNADataEntryExtendedConfigProfile gNADataEntryConfig) { + GWT.log(GNADataEntryExtendedConfigProfile.class.getSimpleName() + " loaded: " + gNADataEntryConfig); try { ConstantsGeoPortalDataEntryApp.ROOT_PANEL_DIV_LOADERS.remove(loaderApplication); @@ -249,6 +250,8 @@ public class GeoPortalDataEntryApp implements EntryPoint { initGUI(); GcubeUserRole userRole = myRights.getRoleRights().getUserRole(); mainTabPanel.setRole(userRole); + //GUI Presentation + mainTabPanel.setGUIPresentation(gNADataEntryConfig.getDataEntryGUIPresentation()); RoleRights roleRights = myRights.getRoleRights(); boolean canCreateNewItem = roleRights.getListPermessions().keySet() @@ -416,7 +419,7 @@ public class GeoPortalDataEntryApp implements EntryPoint { GWT.log("calling getProfilesInTheScope for secondaryType: " + gcubeProfile.getGcubeSecondaryType() + ", name: " + gcubeProfile.getGcubeName()); MetadataProfileFormBuilderServiceAsync.Util.getInstance().getProfilesInTheScopeForName( - geonaISConfig.getScope(), gcubeProfile.getGcubeSecondaryType(), gcubeProfile.getGcubeName(), + geoportalISConfigs.getScope(), gcubeProfile.getGcubeSecondaryType(), gcubeProfile.getGcubeName(), new AsyncCallback>() { @Override 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 1bfb074..56655fb 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 @@ -15,9 +15,9 @@ import org.gcube.application.geoportalcommon.shared.products.ConcessioneDV; import org.gcube.application.geoportalcommon.shared.products.content.WorkspaceContentDV; import org.gcube.application.geoportalcommon.shared.products.paths.FileSetPathsDV; import org.gcube.portlets.user.geoportaldataentry.shared.CommitReport; -import org.gcube.portlets.user.geoportaldataentry.shared.GNADataEntryExtConfigProfile; +import org.gcube.portlets.user.geoportaldataentry.shared.GNADataEntryExtendedConfigProfile; import org.gcube.portlets.user.geoportaldataentry.shared.GeoNaFormDataObject; -import org.gcube.portlets.user.geoportaldataentry.shared.GeonaISConfig; +import org.gcube.portlets.user.geoportaldataentry.shared.GeoportalISConfig; import org.gcube.portlets.user.geoportaldataentry.shared.Tree_Node; import org.gcube.portlets.widgets.mpformbuilder.shared.GenericDatasetBean; @@ -49,7 +49,7 @@ public interface GeoportalDataEntryService extends RemoteService { * * @return the geona init config */ - GeonaISConfig getGeonaInitConfig(); + GeoportalISConfig getGeonaInitConfig(); /** * Gets the links for. @@ -125,7 +125,7 @@ public interface GeoportalDataEntryService extends RemoteService { * @return the GNA data entry ext config profile * @throws Exception the exception */ - GNADataEntryExtConfigProfile readDataViewerConfig() throws Exception; + GNADataEntryExtendedConfigProfile readDataViewerConfig() 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 fc718e0..de333be 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 @@ -15,9 +15,9 @@ import org.gcube.application.geoportalcommon.shared.products.ConcessioneDV; import org.gcube.application.geoportalcommon.shared.products.content.WorkspaceContentDV; import org.gcube.application.geoportalcommon.shared.products.paths.FileSetPathsDV; import org.gcube.portlets.user.geoportaldataentry.shared.CommitReport; -import org.gcube.portlets.user.geoportaldataentry.shared.GNADataEntryExtConfigProfile; +import org.gcube.portlets.user.geoportaldataentry.shared.GNADataEntryExtendedConfigProfile; import org.gcube.portlets.user.geoportaldataentry.shared.GeoNaFormDataObject; -import org.gcube.portlets.user.geoportaldataentry.shared.GeonaISConfig; +import org.gcube.portlets.user.geoportaldataentry.shared.GeoportalISConfig; import org.gcube.portlets.user.geoportaldataentry.shared.Tree_Node; import org.gcube.portlets.widgets.mpformbuilder.shared.GenericDatasetBean; @@ -54,7 +54,7 @@ public interface GeoportalDataEntryServiceAsync { void saveGeonaDataForms(String profileID, Tree_Node tree_Node, AsyncCallback callback); - void getGeonaInitConfig(AsyncCallback callback); + void getGeonaInitConfig(AsyncCallback callback); void getLinksFor(String itemId, String profileID, AsyncCallback callback); @@ -73,7 +73,7 @@ public interface GeoportalDataEntryServiceAsync { List keepCurrentContent, GenericDatasetBean gDBean, AsyncCallback callback); - void readDataViewerConfig(AsyncCallback asyncCallback); + void readDataViewerConfig(AsyncCallback asyncCallback); void getListUseCaseDescriptors(List handlersIds, AsyncCallback> callback); 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 8b414cc..586e0cb 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 @@ -13,6 +13,9 @@ import org.gcube.application.geoportalcommon.shared.geoportal.config.GcubeProfil 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.UseCaseDescriptorDV; +import org.gcube.application.geoportalcommon.shared.guipresentation.BodyWelcome; +import org.gcube.application.geoportalcommon.shared.guipresentation.DataEntryGUIPresentationConfig; +import org.gcube.application.geoportalcommon.shared.guipresentation.Header; import org.gcube.portlets.user.geoportaldataentry.client.GeoPortalClientCaches.CacheSearchingFilterParametersFromConfig; import org.gcube.portlets.user.geoportaldataentry.client.events.CreateNewProjectEvent; import org.gcube.portlets.user.geoportaldataentry.client.events.GetListOfRecordsEvent; @@ -28,9 +31,11 @@ import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.LoaderIcon; import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.UCD_Util; import com.github.gwtbootstrap.client.ui.Dropdown; +import com.github.gwtbootstrap.client.ui.Heading; import com.github.gwtbootstrap.client.ui.Hero; import com.github.gwtbootstrap.client.ui.NavLink; import com.github.gwtbootstrap.client.ui.PageHeader; +import com.github.gwtbootstrap.client.ui.Paragraph; import com.github.gwtbootstrap.client.ui.Tab; import com.github.gwtbootstrap.client.ui.TabPanel; import com.google.gwt.core.client.GWT; @@ -123,6 +128,15 @@ public class GeonaMainTabPanel extends Composite { @UiField DockLayoutPanel theDockLayoutPanel; + @UiField + PageHeader pageHeader; + + @UiField + Heading welcomeTitle; + + @UiField + Paragraph welcomeDescription; + private HandlerManager appManagerBus; private GeonaRecordsPaginatedView grpw = null; @@ -143,6 +157,8 @@ public class GeonaMainTabPanel extends Composite { private ListOfProjectWorkflowActionsPanel listOfProjectWorkflowActionsPanel; + private DataEntryGUIPresentationConfig dataGUIPresentation; + /** * Instantiates a new geona main tab panel. * @@ -481,6 +497,32 @@ public class GeonaMainTabPanel extends Composite { } } + public void setGUIPresentation(DataEntryGUIPresentationConfig dataEntryGUIPresentation) { + this.dataGUIPresentation = dataEntryGUIPresentation; + GWT.log("Setting: "+dataEntryGUIPresentation); + + Header header = dataGUIPresentation.getHeader(); + if (header != null) { + if (header.getTitle() != null) { + pageHeader.setText(header.getTitle()); + } + if (header.getSubtitle() != null) { + pageHeader.setSubtext(header.getSubtitle()); + } + } + + BodyWelcome bodyWelcome = dataGUIPresentation.getBodyWelcome(); + if (bodyWelcome != null) { + if (bodyWelcome.getTitle() != null) { + welcomeTitle.setText(bodyWelcome.getTitle()); + } + if (bodyWelcome.getDescription() != null) { + welcomeDescription.setText(bodyWelcome.getDescription()); + } + } + + } + /** * Inits the action list panel. * @@ -578,11 +620,10 @@ public class GeonaMainTabPanel extends Composite { viewRelationshipPanel = new ViewRelationshipPanel(appManagerBus, selectedDocument); detailsPanel.add(viewRelationshipPanel); } - - + public void enableRelatioshipFacilities(boolean bool) { navCreateRelation.setVisible(bool); - if(!bool) { + if (!bool) { grpw.removeColumn(DEFAULT_DISPLAYING_COLUMN_NAME.RELATIONSHIPS); } } 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 d8f016e..cc6bf6d 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 @@ -50,7 +50,7 @@ GeoPortal + styleName="{style.custom-page-header}" ui:field="pageHeader">GeoPortal @@ -73,8 +73,9 @@ - Welcome - to GNA Data Entry + Welcome + to GeoPortal Data Entry + select "Create New Project" listUserRightsForRole = config.getPermissionsForRole(); - gnaDEExtConfig.setListItemFields(config.getListItemFields()); gnaDEExtConfig.setPermissionsForRole(listUserRightsForRole); + gnaDEExtConfig.setDataEntryGUIPresentation(config.getDataEntryGUIPresentation()); // DEV MODE if (!SessionUtil.isIntoPortal()) { diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/shared/GNADataEntryExtConfigProfile.java b/src/main/java/org/gcube/portlets/user/geoportaldataentry/shared/GNADataEntryExtendedConfigProfile.java similarity index 61% rename from src/main/java/org/gcube/portlets/user/geoportaldataentry/shared/GNADataEntryExtConfigProfile.java rename to src/main/java/org/gcube/portlets/user/geoportaldataentry/shared/GNADataEntryExtendedConfigProfile.java index 944d3b7..3715495 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataentry/shared/GNADataEntryExtConfigProfile.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataentry/shared/GNADataEntryExtendedConfigProfile.java @@ -4,14 +4,15 @@ import java.io.Serializable; import org.gcube.application.geoportalcommon.shared.GNADataEntryConfigProfile; + /** - * The Class GNADataEntryExtConfigProfile. + * The Class GNADataEntryExtendedConfigProfile. * * @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it * - * Dec 21, 2021 + * Sep 26, 2022 */ -public class GNADataEntryExtConfigProfile extends GNADataEntryConfigProfile implements Serializable { +public class GNADataEntryExtendedConfigProfile extends GNADataEntryConfigProfile implements Serializable { /** * @@ -22,22 +23,37 @@ public class GNADataEntryExtConfigProfile extends GNADataEntryConfigProfile impl /** * Instantiates a new GNA data entry config profile. */ - public GNADataEntryExtConfigProfile() { + public GNADataEntryExtendedConfigProfile() { } + /** + * Gets the user rights. + * + * @return the user rights + */ public UserRights getUserRights() { return userRights; } + /** + * Sets the user rights. + * + * @param userRights the new user rights + */ public void setUserRights(UserRights userRights) { this.userRights = userRights; } + /** + * To string. + * + * @return the string + */ @Override public String toString() { StringBuilder builder = new StringBuilder(); - builder.append("GNADataEntryExtConfigProfile [userRights="); + builder.append("GNADataEntryExtendedConfigProfile [userRights="); builder.append(userRights); builder.append("]"); return builder.toString(); diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/shared/GeonaISConfig.java b/src/main/java/org/gcube/portlets/user/geoportaldataentry/shared/GeoportalISConfig.java similarity index 82% rename from src/main/java/org/gcube/portlets/user/geoportaldataentry/shared/GeonaISConfig.java rename to src/main/java/org/gcube/portlets/user/geoportaldataentry/shared/GeoportalISConfig.java index 1ec007e..fb4de88 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataentry/shared/GeonaISConfig.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataentry/shared/GeoportalISConfig.java @@ -3,14 +3,13 @@ package org.gcube.portlets.user.geoportaldataentry.shared; import java.io.Serializable; /** - * The Class GeonaISConfig. + * The Class GeoportalISConfig. * * @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it * - * Dec 22, 2021 + * Sep 26, 2022 */ -public class GeonaISConfig implements Serializable { - +public class GeoportalISConfig implements Serializable { /** * @@ -22,7 +21,7 @@ public class GeonaISConfig implements Serializable { /** * Instantiates a new geona IS config. */ - public GeonaISConfig() { + public GeoportalISConfig() { } /** @@ -31,7 +30,7 @@ public class GeonaISConfig implements Serializable { * @param gRSecondaryType the g R secondary type * @param scope the scope */ - public GeonaISConfig(String gRSecondaryType, String scope) { + public GeoportalISConfig(String gRSecondaryType, String scope) { super(); this.genericResSecondaryType = gRSecondaryType; this.scope = scope; @@ -73,10 +72,15 @@ public class GeonaISConfig implements Serializable { this.scope = scope; } + /** + * To string. + * + * @return the string + */ @Override public String toString() { StringBuilder builder = new StringBuilder(); - builder.append("GeonaISConfig [genericResSecondaryType="); + builder.append("GeoportalISConfig [genericResSecondaryType="); builder.append(genericResSecondaryType); builder.append(", scope="); builder.append(scope);