feature_25598 #17

Merged
francesco.mangiacrapa merged 3 commits from feature_25598 into master 2023-09-11 15:06:52 +02:00
11 changed files with 136 additions and 20 deletions

View File

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

View File

@ -1,4 +1,4 @@
eclipse.preferences.version=1
lastWarOutDir=/home/francescomangiacrapa/git/geoportal-data-viewer-app/target/geoportal-data-viewer-app-3.6.0-SNAPSHOT
lastWarOutDir=/home/francescomangiacrapa/git/geoportal-data-viewer-app/target/geoportal-data-viewer-app-3.6.0
warSrcDir=src/main/webapp
warSrcDirIsOutput=false

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
@ -90,8 +90,20 @@
<wb-module deploy-name="geoportal-data-viewer-app-3.6.0-SNAPSHOT">
<wb-module deploy-name="geoportal-data-viewer-app-3.6.0">
@ -183,7 +195,13 @@
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
@ -275,7 +293,13 @@
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
@ -367,7 +391,13 @@
<wb-resource deploy-path="/WEB-INF/classes" source-path="/target/generated-sources/gwt"/>
@ -459,7 +489,16 @@
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<dependent-module archiveName="geoportal-data-common-2.3.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/geoportal-data-common/geoportal-data-common">
<dependency-type>uses</dependency-type>
</dependent-module>
@ -551,7 +590,13 @@
<property name="java-output-path" value="/geoportal-data-viewer-app/target/geoportal-data-viewer-app-0.0.1-SNAPSHOT/WEB-INF/classes"/>
@ -643,7 +688,13 @@
<property name="context-root" value="geoportal-data-viewer-app"/>
@ -735,7 +786,13 @@
</wb-module>

View File

@ -4,10 +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.6.0]
## [v3.6.0-SNAPSHOT]
- GUI optimization [#25461]
- Using the latest libraries version: gwt-ol.v8.4.1 (with openlayers.v6.6.1) and gwt.v2.10
- Showing basic statistics (i.e. "X project published") via 'countByPhase' method [#25598]
## [v3.5.0]

View File

@ -14,7 +14,7 @@
<groupId>org.gcube.portlets.user</groupId>
<artifactId>geoportal-data-viewer-app</artifactId>
<packaging>war</packaging>
<version>3.6.0</version>
<version>3.6.0-SNAPSHOT</version>
<name>GeoPortal Data Viewer App</name>
<description>The GeoPortal Data Viewer App is an application to access, discovery and navigate the Geoportal projects/documents by a Web-Map Interface</description>

View File

@ -227,4 +227,6 @@ public interface GeoportalDataViewerService extends RemoteService {
*/
String getHTTPResponseForURL(String url);
Integer getCountFor(String profileID, String phase, String status);
}

View File

@ -91,4 +91,6 @@ public interface GeoportalDataViewerServiceAsync {
void getHTTPResponseForURL(String url, AsyncCallback<String> callback);
void getCountFor(String profileID, String phase, String status, AsyncCallback<Integer> callback);
}

View File

@ -66,6 +66,9 @@ public class LayerCollectionPanel extends Composite {
@UiField
HTMLPanel styleListPanel;
@UiField
HTMLPanel statisticPanel;
@UiField
Button buttonLegend;
@ -109,6 +112,7 @@ public class LayerCollectionPanel extends Composite {
buttonLegend.setType(ButtonType.LINK);
legendPanel.setVisible(false);
statisticPanel.setVisible(false);
GWT.log("Found available collection " + coll);
String label = coll.getUcd().getName();
@ -139,6 +143,31 @@ public class LayerCollectionPanel extends Composite {
});
basePanel.add(checkbox);
GeoportalDataViewerServiceAsync.Util.getInstance().getCountFor(collectionID, "Published", "OK", new AsyncCallback<Integer>() {
@Override
public void onFailure(Throwable caught) {
// TODO Auto-generated method stub
}
@Override
public void onSuccess(Integer result) {
if(result!=null) {
String resultLabel = result+" project";
if(result>1) {
resultLabel+="s";
}
resultLabel+= " published";
statisticPanel.setVisible(true);
statisticPanel.add(new HTML(resultLabel));
}
}
});
ViewerConfiguration theConfig = GeoportalDataViewer.getStatus().getViewerConfig();
final GCubeCollection toOpen = theConfig.getAvailableCollections().get(collectionID);

View File

@ -10,6 +10,8 @@
<g:HTMLPanel>
<g:HTMLPanel ui:field="basePanel">
</g:HTMLPanel>
<g:HTMLPanel ui:field="statisticPanel" addStyleNames="statistic-style-panel">
</g:HTMLPanel>
<g:HTMLPanel ui:field="stylePanel" visible="false" addStyleNames="layer-style-panel">
Layer Style
<g:HorizontalPanel>

View File

@ -290,8 +290,8 @@ public class GeoportalDataViewerServiceImpl extends RemoteServiceServlet impleme
? new ZAxis(layerZAxis.getUnits(), layerZAxis.isPositive(), layerZAxis.getValues())
: null;
return new GeoInformationForWMSRequest(wmsServiceServiceEndpoint, validWMSRequest, layerName, versionWms, crs,
mapWmsNotStandard, styles, styles.isNcWms(), zAxis);
return new GeoInformationForWMSRequest(wmsServiceServiceEndpoint, validWMSRequest, layerName, versionWms,
crs, mapWmsNotStandard, styles, styles.isNcWms(), zAxis);
} catch (Exception e) {
String msg = "An error occurred during wms request validation for layer: " + layerName;
LOG.error(msg, e);
@ -706,7 +706,7 @@ public class GeoportalDataViewerServiceImpl extends RemoteServiceServlet impleme
GCubeSDILayer indexLayer = index.getLayer();
HashMap<String, String> ogcLinks = indexLayer.getOgcLinks();
String wmsLink = ogcLinks.get("wms");
LOG.info("wms link is {}", StringUtil.ellipsize(wmsLink, 150));
LOG.info("wms link is {}", StringUtil.ellipsize(wmsLink, 150));
int lastCharOfthePath = wmsLink.indexOf("?");
String wmsPath = wmsLink.substring(0, lastCharOfthePath);
for (GeoServerPlatformInfoDV geoserver : indexLayer.getPlatformInfos()) {
@ -1863,4 +1863,19 @@ public class GeoportalDataViewerServiceImpl extends RemoteServiceServlet impleme
return HTTPRequestUtil.getResponse(url);
}
@Override
public Integer getCountFor(String profileID, String phase, String status) {
LOG.debug("getCountFor profileID: " + profileID + ", phase: " + phase + ", status: " + status + "called");
Integer integer = null;
try {
new GeoportalServiceIdentityProxy(this.getThreadLocalRequest());
integer = GeoportalClientCaller.projects().getCountByPhaseFor(profileID, phase, status);
LOG.info("getCountFor profileID: " + profileID + ", phase: " + phase + ", status: " + status
+ " returning: " + integer);
} catch (Exception e) {
LOG.error("Error occurred in getCountFor for profileID: " + profileID, e);
}
return integer;
}
}

View File

@ -368,9 +368,9 @@ body {
background-color: white;
opacity: 90%;
padding: 10px;
width: 410px;
max-width: 430px;
z-index: 500;
overflow-y: scroll;
overflow-y: auto;
position: absolute;
left: 52px;
}
@ -776,6 +776,14 @@ Table Of Contents (TOC)
color: gray;
}
.statistic-style-panel {
margin-left: 25px;
font-size: 13px;
color: gray;
font-weight: bold;
margin-top: -3px;
}
.layer-style-panel-table-legend table td {
padding-left: 5px;
}