fixing issues #24632
This commit is contained in:
parent
2b6272dd60
commit
9581d3ce73
|
@ -1,12 +1,12 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" output="target/geoportal-data-viewer-app-3.2.1/WEB-INF/classes" path="src/main/java">
|
||||
<classpathentry kind="src" output="target/geoportal-data-viewer-app-3.3.0-SNAPSHOT/WEB-INF/classes" path="src/main/java">
|
||||
<attributes>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry excluding="**" kind="src" output="target/geoportal-data-viewer-app-3.2.1/WEB-INF/classes" path="src/main/resources">
|
||||
<classpathentry excluding="**" kind="src" output="target/geoportal-data-viewer-app-3.3.0-SNAPSHOT/WEB-INF/classes" path="src/main/resources">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
|
@ -35,5 +35,5 @@
|
|||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="output" path="target/geoportal-data-viewer-app-3.2.1/WEB-INF/classes"/>
|
||||
<classpathentry kind="output" path="target/geoportal-data-viewer-app-3.3.0-SNAPSHOT/WEB-INF/classes"/>
|
||||
</classpath>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
eclipse.preferences.version=1
|
||||
lastWarOutDir=/home/francescomangiacrapa/git/geoportal-data-viewer-app/target/geoportal-data-viewer-app-3.2.1
|
||||
lastWarOutDir=/home/francescomangiacrapa/git/geoportal-data-viewer-app/target/geoportal-data-viewer-app-3.3.0-SNAPSHOT
|
||||
warSrcDir=src/main/webapp
|
||||
warSrcDirIsOutput=false
|
||||
|
|
|
@ -51,7 +51,9 @@
|
|||
|
||||
|
||||
|
||||
<wb-module deploy-name="geoportal-data-viewer-app-3.2.1">
|
||||
|
||||
<wb-module deploy-name="geoportal-data-viewer-app-3.3.0-SNAPSHOT">
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -136,6 +138,7 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -189,6 +192,7 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -242,6 +246,7 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -295,6 +300,7 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -317,9 +323,7 @@
|
|||
|
||||
|
||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
|
||||
<dependent-module archiveName="geoportal-data-common-2.0.2.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/geoportal-data-common/geoportal-data-common">
|
||||
<dependency-type>uses</dependency-type>
|
||||
</dependent-module>
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -404,6 +408,7 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -457,6 +462,7 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -510,6 +516,7 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -4,6 +4,13 @@
|
|||
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] - 2023-02-20
|
||||
|
||||
#### Fixes
|
||||
|
||||
- [#24632] Returning the public layer index if the private is missing
|
||||
- [#24632] No temporal info shown if the temporal extent is missing
|
||||
|
||||
## [v3.2.1] - 2023-02-03
|
||||
|
||||
#### Fixes
|
||||
|
|
2
pom.xml
2
pom.xml
|
@ -14,7 +14,7 @@
|
|||
<groupId>org.gcube.portlets.user</groupId>
|
||||
<artifactId>geoportal-data-viewer-app</artifactId>
|
||||
<packaging>war</packaging>
|
||||
<version>3.2.1</version>
|
||||
<version>3.3.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>
|
||||
|
||||
|
|
|
@ -806,6 +806,7 @@ public class LayerManager {
|
|||
|
||||
TemporalReferenceDV tempRef = projectDV.getTemporalReference();
|
||||
if (tempRef != null) {
|
||||
if(tempRef.getStart()!=null || tempRef.getEnd()!=null)
|
||||
flowPanel.add(new HTML(ProjectUtil.toHTMLCode(tempRef)));
|
||||
}
|
||||
|
||||
|
@ -957,6 +958,7 @@ public class LayerManager {
|
|||
GWT.log("Temporal reference is: "+tempRef);
|
||||
if (tempRef != null) {
|
||||
|
||||
if(tempRef.getStart()!=null || tempRef.getEnd()!=null)
|
||||
flex.setHTML(flex.getRowCount() + 1, 0, ProjectUtil.toHTMLCode(tempRef));
|
||||
}
|
||||
|
||||
|
@ -1162,7 +1164,7 @@ public class LayerManager {
|
|||
|
||||
TemporalReferenceDV tempRef = projectDV.getTemporalReference();
|
||||
if (tempRef != null) {
|
||||
|
||||
if(tempRef.getStart()!=null || tempRef.getEnd()!=null)
|
||||
flex.setHTML(flex.getRowCount() + 1, 0, ProjectUtil.toHTMLCode(tempRef));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -189,7 +189,7 @@ public class DragDropLayer extends FlowPanel {
|
|||
|
||||
if(layerObject.getProjectDV().getTemporalReference()!=null) {
|
||||
TemporalReferenceDV tempRef = layerObject.getProjectDV().getTemporalReference();
|
||||
// ft.setWidget(ft.getRowCount() + 1, 2, new HTML(ProjectUtil.toHTMLCode(tempRef)));
|
||||
if(tempRef.getStart()!=null || tempRef.getEnd()!=null)
|
||||
vpInner.add(new HTML(ProjectUtil.toHTMLCode(tempRef)));
|
||||
}
|
||||
|
||||
|
|
|
@ -118,6 +118,30 @@ public class GeoportalDataViewerServiceImpl extends RemoteServiceServlet impleme
|
|||
gif, png, jpeg, jpg, bmp, tif, tiff, svg, avif, webp
|
||||
}
|
||||
|
||||
public static enum CENTROID_LAYER_INDEX_FLAG {
|
||||
PUBLIC("public"), PRIVATE("internal");
|
||||
|
||||
String id;
|
||||
|
||||
CENTROID_LAYER_INDEX_FLAG(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append("CENTROID_LAYER_INDEX_FLAG [id=");
|
||||
builder.append(id);
|
||||
builder.append("]");
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* The Class ImageDetector.
|
||||
*
|
||||
|
@ -452,40 +476,38 @@ public class GeoportalDataViewerServiceImpl extends RemoteServiceServlet impleme
|
|||
// TODO TO Check index flag should be in configuration or evaluated according to
|
||||
// user credentials
|
||||
|
||||
String indexFlag = "public"; // default
|
||||
CENTROID_LAYER_INDEX_FLAG setIndexFlag = null;
|
||||
|
||||
GeoportalServiceIdentityProxy gsp = getGeoportalServiceProxy();
|
||||
if (gsp.isUser()) {
|
||||
indexFlag = "internal";
|
||||
LOG.info("user logged - using indexFlag: " + indexFlag);
|
||||
setIndexFlag = CENTROID_LAYER_INDEX_FLAG.PRIVATE;
|
||||
LOG.info("user logged - using indexFlag: " + setIndexFlag);
|
||||
} else if (gsp.isIAMClient()) {
|
||||
indexFlag = "public";
|
||||
LOG.info("user not logged - using indexFlag: " + indexFlag);
|
||||
setIndexFlag = CENTROID_LAYER_INDEX_FLAG.PUBLIC;
|
||||
LOG.info("user not logged - using indexFlag: " + setIndexFlag);
|
||||
}
|
||||
|
||||
// TODO constant
|
||||
coll.setIndexes(new ArrayList());
|
||||
|
||||
LOG.debug(
|
||||
"Checking if " + u.getId() + " is GIS Indexed. Index flag needed is " + indexFlag);
|
||||
|
||||
for (Index index : ucdConfig.getIndexes()) {
|
||||
try {
|
||||
IndexLayerDV toAdd = ConvertToDataValueObjectModel.convert(index);
|
||||
if (toAdd.getFlag().equals(indexFlag)) {
|
||||
LOG.debug("Checking if " + u.getId() + " is GIS Indexed. Index flag needed is '" + setIndexFlag+"'");
|
||||
IndexLayerDV toAdd = getLayerIndex(ucdConfig, setIndexFlag);
|
||||
if(toAdd!=null) {
|
||||
coll.getIndexes().add(toAdd);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
LOG.debug("Skipping invalid index ", e);
|
||||
} catch (Throwable t) {
|
||||
LOG.error("Unable to check index ", t);
|
||||
|
||||
// Using the public centroid layer as default
|
||||
if (coll.getIndexes().isEmpty()) {
|
||||
LOG.info("No available GIS Index for collection " + coll.getUcd().getName() +" with flag "+setIndexFlag.getId());
|
||||
setIndexFlag = CENTROID_LAYER_INDEX_FLAG.PUBLIC;
|
||||
LOG.info("Prevent fallback - getting the GIS index with flag '"+setIndexFlag.getId() + "' available");
|
||||
toAdd = getLayerIndex(ucdConfig, setIndexFlag);
|
||||
if(toAdd!=null) {
|
||||
coll.getIndexes().add(toAdd);
|
||||
}
|
||||
}
|
||||
|
||||
// Return only if gis indexed
|
||||
if (coll.getIndexes().isEmpty())
|
||||
LOG.info("No available GIS Index for collection " + coll.getUcd().getName());
|
||||
else
|
||||
if(!coll.getIndexes().isEmpty())
|
||||
config.getAvailableCollections().put(coll.getUcd().getId(), coll);
|
||||
|
||||
} catch (Throwable t) {
|
||||
|
@ -505,6 +527,27 @@ public class GeoportalDataViewerServiceImpl extends RemoteServiceServlet impleme
|
|||
}.execute().getResult();
|
||||
}
|
||||
|
||||
|
||||
private IndexLayerDV getLayerIndex(Configuration ucdConfig, CENTROID_LAYER_INDEX_FLAG flag) {
|
||||
|
||||
for (Index index : ucdConfig.getIndexes()) {
|
||||
try {
|
||||
IndexLayerDV toAdd = ConvertToDataValueObjectModel.convert(index);
|
||||
LOG.trace("Discovered index: "+toAdd);
|
||||
if (toAdd.getFlag().compareToIgnoreCase(flag.getId())==0) {
|
||||
LOG.debug("Layer index found for flag: "+flag + ", returning");
|
||||
return toAdd;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
LOG.debug("Skipping invalid index ", e);
|
||||
} catch (Throwable t) {
|
||||
LOG.error("Unable to check index ", t);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the config list of fields for searching.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue