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 0000000..e3f639e Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/resource/information_icon.png differ 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 6e75d23..6743d63 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 @@ -1088,7 +1088,7 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen * @throws Exception the exception */ @Override - public GNADataEntryExtendedConfigProfile readDataViewerConfig() throws Exception { + public GNADataEntryExtendedConfigProfile readDataEntryPresentationConfig() throws Exception { LOG.info("readDataViewerConfig called"); GCubeUser user = null; diff --git a/src/main/webapp/GeoPortalDataEntryApp.css b/src/main/webapp/GeoPortalDataEntryApp.css index fa035cd..7494363 100644 --- a/src/main/webapp/GeoPortalDataEntryApp.css +++ b/src/main/webapp/GeoPortalDataEntryApp.css @@ -315,4 +315,21 @@ h1 { font-size: 12px !important; } -/** END OVERRDING legend-style into 'metadata-profile-form-builder-widget' */ \ No newline at end of file +/** END OVERRDING legend-style into 'metadata-profile-form-builder-widget' */ + + +.general_info { + text-align: center; + font-size: 20px; +} + +.general_info div { + padding: 20px; +} + +.general_info_facility { + font-style: italic; + font-weight: bold; + color: #3e6eac; + font-family: Helvetica, Arial; +}