Optimized the UI for screen size 1200x1200

This commit is contained in:
Francesco Mangiacrapa 2023-08-31 15:17:21 +02:00
parent 6338792427
commit 8967184d3c
11 changed files with 115 additions and 88 deletions

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
@ -89,7 +90,8 @@
<wb-module deploy-name="geoportal-data-viewer-app-3.6.0-SNAPSHOT">
@ -179,7 +181,8 @@
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
@ -269,7 +272,8 @@
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
@ -359,7 +363,8 @@
<wb-resource deploy-path="/WEB-INF/classes" source-path="/target/generated-sources/gwt"/>
@ -449,7 +454,11 @@
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<dependent-module archiveName="geoportal-data-common-2.2.1-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/geoportal-data-common/geoportal-data-common">
<dependency-type>uses</dependency-type>
</dependent-module>
@ -539,7 +548,8 @@
<property name="java-output-path" value="/geoportal-data-viewer-app/target/geoportal-data-viewer-app-0.0.1-SNAPSHOT/WEB-INF/classes"/>
@ -629,7 +639,8 @@
<property name="context-root" value="geoportal-data-viewer-app"/>
@ -719,7 +730,8 @@
</wb-module>

View File

@ -515,7 +515,7 @@ public class LayerManager {
GWT.log("Parsed WMS Request returned: " + geoInfoWMS);
LayerItem layerItem = toLayerItem(featureType, layerTitle, geoInfoWMS.getLayerName(),
geoInfoWMS.getWmsRequest(), geoInfoWMS.getBaseWmsServiceHost(), true, isBase,
geoInfoWMS.getWmsRequest(), geoInfoWMS.getServiceEndPoint(), true, isBase,
displayInLayerSwitcher, (ArrayList<String>) geoInfoWMS.getStyles().getGeoStyles(),
geoInfoWMS.getWmsRequest(), false, geoInfoWMS.getMapWMSNoStandard(),
geoInfoWMS.isNcWMS(), UUID, geoInfoWMS.getZAxis(), minResolution, maxResolution);

View File

@ -439,7 +439,7 @@ public abstract class OpenLayerMap {
imageWMSParams.setLayers(layerItem.getName());
ImageWmsOptions imageWMSOptions = OLFactory.createOptions();
imageWMSOptions.setUrl(layerItem.getMapServerHost());
imageWMSOptions.setUrl(layerItem.getMapServerEndpoint());
imageWMSOptions.setParams(imageWMSParams);
// imageWMSOptions.setRatio(1.5f);
@ -544,7 +544,7 @@ public abstract class OpenLayerMap {
imageWMSParams.setLayers(layerItem.getName());
ImageWmsOptions imageWMSOptions = OLFactory.createOptions();
imageWMSOptions.setUrl(layerItem.getMapServerHost());
imageWMSOptions.setUrl(layerItem.getMapServerEndpoint());
imageWMSOptions.setParams(imageWMSParams);
// imageWMSOptions.setRatio(1.5f);
@ -595,7 +595,7 @@ public abstract class OpenLayerMap {
imageWMSParams.setLayers(layerItem.getName());
ImageWmsOptions imageWMSOptions = OLFactory.createOptions();
imageWMSOptions.setUrl(layerItem.getMapServerHost());
imageWMSOptions.setUrl(layerItem.getMapServerEndpoint());
imageWMSOptions.setParams(imageWMSParams);
// imageWMSOptions.setRatio(1.5f);

View File

@ -219,7 +219,7 @@ public class OverlayCustomLayerPanel extends Composite {
flow.add(new HTMLPanel("Legend for: " + theLayerName));
final HorizontalPanel hpLegend = new HorizontalPanel();
String url = geoInformation.getBaseWmsServiceHost() + "?service=WMS&" + "version="
String url = geoInformation.getServiceEndPoint() + "?service=WMS&" + "version="
+ URLUtil.getValueOfParameter("version", wmsLink) + "&" + "request=GetLegendGraphic&" + "layer="
+ theLayerName;

View File

@ -271,7 +271,7 @@ public class LayerCollectionPanel extends Composite {
flow.add(new HTMLPanel("Legend for: " + theLayerName));
final HorizontalPanel hpLegend = new HorizontalPanel();
String url = geoInformation.getBaseWmsServiceHost() + "?service=WMS&" + "version="
String url = geoInformation.getServiceEndPoint() + "?service=WMS&" + "version="
+ URLUtil.getValueOfParameter("version", wmsLink) + "&" + "request=GetLegendGraphic&" + "layer="
+ theLayerName;

View File

@ -65,6 +65,7 @@ import org.gcube.application.geoportalcommon.shared.geoportal.ucd.HandlerDeclara
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.UseCaseDescriptorDV;
import org.gcube.application.geoportalcommon.shared.geoportal.view.ProjectView;
import org.gcube.application.geoportalcommon.shared.gis.BoundsMap;
import org.gcube.application.geoportalcommon.util.StringUtil;
import org.gcube.application.geoportalcommon.util.URLParserUtil;
import org.gcube.application.geoportaldatamapper.GcubeProfilesPerUCDIdCache;
import org.gcube.application.geoportaldatamapper.Geoportal_JSON_Mapper;
@ -262,7 +263,7 @@ public class GeoportalDataViewerServiceImpl extends RemoteServiceServlet impleme
public GeoInformationForWMSRequest loadGeoInfoForWmsRequest(String wmsLink, String layerName) throws Exception {
try {
WMSUrlValidator validator = new WMSUrlValidator(wmsLink, layerName);
String wmsServiceHost = validator.getWmsServiceHost();
String wmsServiceServiceEndpoint = validator.getWmsServiceEndPoint();
String validWMSRequest = validator.parseWMSRequest(true, true);
layerName = validator.getLayerName();
String versionWms = validator.getValueOfParsedWMSParameter(WmsParameters.VERSION);
@ -289,7 +290,7 @@ public class GeoportalDataViewerServiceImpl extends RemoteServiceServlet impleme
? new ZAxis(layerZAxis.getUnits(), layerZAxis.isPositive(), layerZAxis.getValues())
: null;
return new GeoInformationForWMSRequest(wmsServiceHost, validWMSRequest, layerName, versionWms, crs,
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;
@ -705,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 {}", wmsLink);
LOG.info("wms link is {}", StringUtil.ellipsize(wmsLink, 150));
int lastCharOfthePath = wmsLink.indexOf("?");
String wmsPath = wmsLink.substring(0, lastCharOfthePath);
for (GeoServerPlatformInfoDV geoserver : indexLayer.getPlatformInfos()) {
@ -715,7 +716,7 @@ public class GeoportalDataViewerServiceImpl extends RemoteServiceServlet impleme
LOG.debug("purged wmsPath from the 'workspace' is {}", wmsPath);
wmsLink = wmsPath + wmsLink.substring(lastCharOfthePath, wmsLink.length());
ogcLinks.put("wms", wmsLink);
LOG.info("wms link without {} is {}", geoserver.getWorkspace(), wmsLink);
LOG.info("wms link without {} is {}", geoserver.getWorkspace(), StringUtil.ellipsize(wmsLink, 150));
}
}
return index;
@ -863,7 +864,7 @@ public class GeoportalDataViewerServiceImpl extends RemoteServiceServlet impleme
*/
@Override
protected void onBeforeRequestDeserialized(String serializedRequest) {
LOG.info("onBeforeRequestDeserialized called");
LOG.debug("onBeforeRequestDeserialized called");
String scope = "";
try {

View File

@ -61,8 +61,8 @@ public class GisMakers {
public static String buildWFSFeatureQuery(LayerItem layerItem, String mapSrsName, BoundsMap mapBBOX,
int maxFeatures, String outputFormat) {
String link = layerItem.getMapServerHost();
LOG.debug("Map server host URL: " + link);
String link = layerItem.getMapServerEndpoint();
LOG.debug("Map server endpoint: " + link);
LOG.debug("CQL filter is: " + layerItem.getCqlFilter());
LOG.debug("MAX FEATURES: " + maxFeatures);
LOG.debug("BBOX: " + mapBBOX);

View File

@ -24,7 +24,7 @@ public class WMSUrlValidator {
private static final String OWS = "ows";
private HashMap<String, String> parametersValue = new HashMap<String, String>();
private String wmsRequestURI;
private String wmsServiceHost;
private String wmsServiceEndPoint;
private String layerName;
private String wmsNoStandardParameters = "";
@ -48,34 +48,29 @@ public class WMSUrlValidator {
throw new Exception("WMS request is null or empty");
this.wmsRequestURI = wmsRequest.trim();
boolean isOwsService = GeoWmsServiceUtility.isOWSSerice(this.wmsRequestURI);
WebMapServerHost webMapServerHost;
// IS WMS?
if (GeoWmsServiceUtility.isWMSService(wmsRequestURI)) {
LOG.trace("found " + GeoWmsServiceUtility.SERVICE_WMS + " in wms request: " + wmsRequestURI);
webMapServerHost = getWebMapServerHost(wmsRequestURI);
} else
throw new Exception("WMS service not found for layer: " + inputLayerName);
// VALIDATION WMS
String baseWmsService = webMapServerHost.getHost();
// IS OWS OR WMS?
this.wmsServiceHost = appendWmsServiceToBaseUrl(wmsRequest.substring(0, wmsRequest.indexOf("?")), isOwsService);
this.layerName = inputLayerName;
int endpointLastCharIndex = wmsRequest.lastIndexOf("?");
// No '?' char found
if (endpointLastCharIndex == -1) {
LOG.info("Char '?' not found, setting last index the end of the URI");
endpointLastCharIndex = wmsRequest.length();
}
String readWMSServiceEndpoint = wmsRequest.substring(0, endpointLastCharIndex);
this.wmsServiceEndPoint = readWMSServiceEndpoint;
try {
// VALIDATE WMS SERVICE FOR WEB MAP SERVER
if (!HttpRequestUtil.urlExists(this.wmsServiceHost, true)) {
LOG.info("baseWmsServiceUrl: " + wmsServiceHost
+ " is not a geoserver, setting as input base wms server: " + baseWmsService);
this.wmsServiceHost = baseWmsService;
if (!HttpRequestUtil.urlExists(this.wmsServiceEndPoint, true)) {
LOG.warn("baseWmsServiceUrl: " + wmsServiceEndPoint + " is not valid URL!!");
this.wmsServiceEndPoint = readWMSServiceEndpoint;
}
} catch (Exception e) {
LOG.error("error on validating geoserver wms service: " + e);
LOG.info("setting baseWmsService as input base wms server: " + baseWmsService);
this.wmsServiceHost = baseWmsService;
LOG.error("Error on validating the endpoint: " + this.wmsServiceEndPoint, e);
boolean isOwsService = GeoWmsServiceUtility.isOWSSerice(this.wmsRequestURI);
LOG.info("Retrying by appending suffix WMS or WFS...");
this.wmsServiceEndPoint = appendWmsServiceToBaseUrl(readWMSServiceEndpoint, isOwsService);
}
// VALIDATION FOR THREDDS - FIND LAYER NAME INTO WMS PATH
@ -86,7 +81,8 @@ public class WMSUrlValidator {
throw new Exception("Layer name is null or empty");
}
LOG.info("WMSURLValidator found endpoint: " + wmsServiceEndPoint);
parametersValue.put(WmsParameters.LAYERS.getParameter(), this.layerName);
}
@ -230,13 +226,13 @@ public class WMSUrlValidator {
}
/**
* Gets the wms service host.
* Gets the wms service end point.
*
* @return the wms service host
* @return the wms service end point
*/
public String getWmsServiceHost() {
public String getWmsServiceEndPoint() {
return wmsServiceHost;
return wmsServiceEndPoint;
}
/**

View File

@ -36,7 +36,7 @@ public class LayerItem implements Serializable, Cloneable {
private String url;
/** The base map server URL. */
private String mapServerHost;
private String mapServerEndpoint;
/** The style. */
private String style;
@ -774,21 +774,21 @@ public class LayerItem implements Serializable, Cloneable {
}
/**
* Gets the map server host.
* Gets the map server endpoint.
*
* @return the map server host
* @return the map server endpoint
*/
public String getMapServerHost() {
return mapServerHost;
public String getMapServerEndpoint() {
return mapServerEndpoint;
}
/**
* Sets the map server host.
*
* @param mapServerHost the new map server host
* @param mapServerEndpoint the new map server host
*/
public void setMapServerHost(String mapServerHost) {
this.mapServerHost = mapServerHost;
public void setMapServerHost(String mapServerEndpoint) {
this.mapServerEndpoint = mapServerEndpoint;
}
/**
@ -881,6 +881,11 @@ public class LayerItem implements Serializable, Cloneable {
return maxResolution;
}
/**
* To string.
*
* @return the string
*/
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
@ -890,8 +895,8 @@ public class LayerItem implements Serializable, Cloneable {
builder.append(title);
builder.append(", url=");
builder.append(url);
builder.append(", mapServerHost=");
builder.append(mapServerHost);
builder.append(", mapServerEndpoint=");
builder.append(mapServerEndpoint);
builder.append(", style=");
builder.append(style);
builder.append(", isTrasparent=");

View File

@ -8,15 +8,14 @@ import java.util.HashMap;
*
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
*
* Oct 27, 2020
* Oct 27, 2020
*/
public class GeoInformationForWMSRequest implements Serializable {
/** The Constant serialVersionUID. */
private static final long serialVersionUID = -6846636281073641003L;
/** The base wms service host. */
private String baseWmsServiceHost;
private String serviceEndPoint;
/** The wms request. */
private String wmsRequest;
@ -53,20 +52,19 @@ public class GeoInformationForWMSRequest implements Serializable {
/**
* Instantiates a new geo information for wms request.
*
* @param baseWmsServiceHost the base wms service host
* @param wmsRequest the wms request
* @param layerName the layer name
* @param versionWms the version wms
* @param crs the crs
* @param mapWmsNoStandard the map wms not standard
* @param styles the layer styles
* @param isNcWMS the is nc WMS
* @param zAxis the z axis
* @param serviceEndPoint the base wms service host
* @param wmsRequest the wms request
* @param layerName the layer name
* @param versionWms the version wms
* @param crs the crs
* @param mapWmsNoStandard the map wms not standard
* @param styles the layer styles
* @param isNcWMS the is nc WMS
* @param zAxis the z axis
*/
public GeoInformationForWMSRequest(String baseWmsServiceHost, String wmsRequest, String layerName,
String versionWms, String crs, HashMap<String, String> mapWmsNoStandard, Styles styles, boolean isNcWMS,
ZAxis zAxis) {
this.baseWmsServiceHost = baseWmsServiceHost;
public GeoInformationForWMSRequest(String serviceEndPoint, String wmsRequest, String layerName, String versionWms,
String crs, HashMap<String, String> mapWmsNoStandard, Styles styles, boolean isNcWMS, ZAxis zAxis) {
this.serviceEndPoint = serviceEndPoint;
this.wmsRequest = wmsRequest;
this.layerName = layerName;
this.versionWMS = versionWms;
@ -98,13 +96,21 @@ public class GeoInformationForWMSRequest implements Serializable {
}
/**
* Gets the base wms service host.
* Gets the service end point.
*
* @return the baseWmsServiceHost
* @return the service end point
*/
public String getBaseWmsServiceHost() {
public String getServiceEndPoint() {
return serviceEndPoint;
}
return baseWmsServiceHost;
/**
* Sets the service end point.
*
* @param serviceEndPoint the new service end point
*/
public void setServiceEndPoint(String serviceEndPoint) {
this.serviceEndPoint = serviceEndPoint;
}
/**
@ -180,11 +186,11 @@ public class GeoInformationForWMSRequest implements Serializable {
/**
* Sets the base wms service host.
*
* @param baseWmsServiceHost the baseWmsServiceHost to set
* @param baseWmsServiceHost the new base wms service host
*/
public void setBaseWmsServiceHost(String baseWmsServiceHost) {
this.baseWmsServiceHost = baseWmsServiceHost;
this.serviceEndPoint = baseWmsServiceHost;
}
/**
@ -271,8 +277,8 @@ public class GeoInformationForWMSRequest implements Serializable {
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("GeoInformationForWMSRequest [baseWmsServiceHost=");
builder.append(baseWmsServiceHost);
builder.append("GeoInformationForWMSRequest [serviceEndPoint=");
builder.append(serviceEndPoint);
builder.append(", wmsRequest=");
builder.append(wmsRequest);
builder.append(", layerName=");

View File

@ -877,10 +877,14 @@ RESPONSIVE
.dand-layer {
width: 336px;
}
.search-facility {
width: 100%;
}
.thePopDataTable {
}
.search-facility {
max-width: 680px;
}
.search-field {
width: 97%;
}
.ol-popup {
min-width: 220px;
@ -889,6 +893,9 @@ RESPONSIVE
.thePopDataTable tr:last-of-type {
display: none;
}
.layer-panel {
width: 355px;
}
}
@media all and (max-width: 1024px) {
#timeline-data {
@ -900,8 +907,8 @@ RESPONSIVE
width: 400px;
}
.search-facility {
width: 250px;
max-width: 300px;
/*width: 250px;
max-width: 300px;*/
}
.inner-toolbar {
/*width: 100px;*/