merged with branch #20357

This commit is contained in:
Francesco Mangiacrapa 2021-01-15 15:12:03 +01:00
parent 75eab15aa5
commit f0b2995d46
22 changed files with 452 additions and 96 deletions

View File

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<classpath> <classpath>
<classpathentry kind="src" output="target/geoportal-data-viewer-app-1.0.0/WEB-INF/classes" path="src/main/java"> <classpathentry kind="src" output="target/geoportal-data-viewer-app-1.1.0-SNAPSHOT/WEB-INF/classes" path="src/main/java">
<attributes> <attributes>
<attribute name="optional" value="true"/> <attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry excluding="**" kind="src" output="target/geoportal-data-viewer-app-1.0.0/WEB-INF/classes" path="src/main/resources"> <classpathentry excluding="**" kind="src" output="target/geoportal-data-viewer-app-1.1.0-SNAPSHOT/WEB-INF/classes" path="src/main/resources">
<attributes> <attributes>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
@ -36,5 +36,5 @@
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="lib" path="/home/francescomangiacrapa/.m2/repository/javax/servlet/javax.servlet-api/3.1.0/javax.servlet-api-3.1.0.jar"/> <classpathentry kind="lib" path="/home/francescomangiacrapa/.m2/repository/javax/servlet/javax.servlet-api/3.1.0/javax.servlet-api-3.1.0.jar"/>
<classpathentry kind="output" path="target/geoportal-data-viewer-app-1.0.0/WEB-INF/classes"/> <classpathentry kind="output" path="target/geoportal-data-viewer-app-1.1.0-SNAPSHOT/WEB-INF/classes"/>
</classpath> </classpath>

View File

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

View File

@ -4,6 +4,12 @@
All notable changes to this project will be documented in this file. 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). This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [v1.1.0-SNAPSHOT] - 2020-12-21
#### Enhancements
[#20357] Improvements feedback-driven
## [v1.0.0] - 2020-12-09 ## [v1.0.0] - 2020-12-09
[#20004] First release [#20004] First release

View File

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

View File

@ -258,7 +258,6 @@ import ol.style.TextOptions;
NumberFormat fmt = NumberFormat.getFormat("#.####"); NumberFormat fmt = NumberFormat.getFormat("#.####");
textOptions.setText("Long: "+fmt.format(transfCoord.getX()) + ", Lat: "+fmt.format(transfCoord.getY())); textOptions.setText("Long: "+fmt.format(transfCoord.getX()) + ", Lat: "+fmt.format(transfCoord.getY()));
Text text = new Text(textOptions); Text text = new Text(textOptions);
// FillOptions fillOptions = new FillOptions(); // FillOptions fillOptions = new FillOptions();
// Color color = new Color(217, 217, 223, 0.0); // Color color = new Color(217, 217, 223, 0.0);

View File

@ -24,17 +24,17 @@ public class ModalWindow {
* Instantiates a new modal window. * Instantiates a new modal window.
* *
* @param title the title * @param title the title
* @param toAdd the to add * @param width the width
* @param toReturn the to return * @param maxHeight the max height
*/ */
public ModalWindow(String title) { public ModalWindow(String title, int width, int maxHeight) {
modal = new Modal(false); modal = new Modal(false);
modal.hide(false); modal.hide(false);
modal.setTitle(title); modal.setTitle(title);
modal.setCloseVisible(true); modal.setCloseVisible(true);
modal.setWidth(900); modal.setWidth(width);
modal.setMaxHeigth(600+"px"); modal.setMaxHeigth(maxHeight+"px");
ModalFooter modalFooter = new ModalFooter(); ModalFooter modalFooter = new ModalFooter();
final Button buttClose = new Button("Close"); final Button buttClose = new Button("Close");

View File

@ -56,7 +56,9 @@ public class ImageView extends Composite {
public ImageView(UploadedImageDV imageDV, final boolean showView, final boolean showOpen) { public ImageView(UploadedImageDV imageDV, final boolean showView, final boolean showOpen) {
initWidget(uiBinder.createAndBindUi(this)); initWidget(uiBinder.createAndBindUi(this));
heading.setText(imageDV.getTitolo()); if(imageDV.getTitolo()!=null && !imageDV.getTitolo().isEmpty()) {
heading.setText(imageDV.getTitolo());
}
paragraph1.setText(imageDV.getDidascalia()); paragraph1.setText(imageDV.getDidascalia());
paragraph1.getElement().getStyle().setTextAlign(TextAlign.LEFT); paragraph1.getElement().getStyle().setTextAlign(TextAlign.LEFT);
@ -103,7 +105,7 @@ public class ImageView extends Composite {
if(latest!=null) { if(latest!=null) {
ModalWindow mw = new ModalWindow(StringUtil.ellipsize(imageDV.getTitolo(), 20)); ModalWindow mw = new ModalWindow(StringUtil.ellipsize(imageDV.getDidascalia(), 50), 900, 600);
mw.add(new ImageView(imageDV, false, true)); mw.add(new ImageView(imageDV, false, true));
mw.setCaller(ImageView.this); mw.setCaller(ImageView.this);
//mw.setWidth(900); //mw.setWidth(900);

View File

@ -10,6 +10,10 @@
.float-right { .float-right {
float: right; float: right;
} }
.margin-top-10 {
margin-top: 10px;
}
</ui:style> </ui:style>
<g:HTMLPanel> <g:HTMLPanel>
<!-- <b:Thumbnail size="4" addStyleNames="{style.max-width-400}" ui:field="thumbnailCont"> --> <!-- <b:Thumbnail size="4" addStyleNames="{style.max-width-400}" ui:field="thumbnailCont"> -->
@ -17,8 +21,8 @@
<b:Button ui:field="openImage" <b:Button ui:field="openImage"
addStyleNames="{style.float-right}" visible="false">Open</b:Button> addStyleNames="{style.float-right}" visible="false">Open</b:Button>
<b:Image ui:field="imageURL" visible="false" /> <b:Image ui:field="imageURL" visible="false" />
<b:Caption> <b:Caption addStyleNames="{style.margin-top-10}">
<b:Heading size="4" ui:field="heading"></b:Heading> <b:Heading size="4" ui:field="heading" visible="false"></b:Heading>
<b:Paragraph ui:field="paragraph1"> <b:Paragraph ui:field="paragraph1">
</b:Paragraph> </b:Paragraph>
<b:Paragraph ui:field="paragraph2" visible="false"> <b:Paragraph ui:field="paragraph2" visible="false">

View File

@ -55,10 +55,12 @@ import ol.OLFactory;
* @param centerTo the center to * @param centerTo the center to
* @param zoom the zoom * @param zoom the zoom
*/ */
public MapView(Coordinate centerTo, int zoom) { public MapView(Coordinate centerTo, int zoom, String internalMapWidth, String internalMapHeight) {
initWidget(uiBinder.createAndBindUi(this)); initWidget(uiBinder.createAndBindUi(this));
String theMapId = "map"+Random.nextInt(); String theMapId = "map"+Random.nextInt();
theMap.getElement().setId(theMapId); theMap.getElement().setId(theMapId);
theMap.setWidth(internalMapWidth);
theMap.setHeight(internalMapHeight);
Scheduler.get().scheduleDeferred(new ScheduledCommand() { Scheduler.get().scheduleDeferred(new ScheduledCommand() {

View File

@ -3,12 +3,16 @@
xmlns:g="urn:import:com.google.gwt.user.client.ui"> xmlns:g="urn:import:com.google.gwt.user.client.ui">
<ui:style> <ui:style>
.internalMap { .internalMap {
width: 300px; height: 280px;
height: 300px; display: inline-block;
float: right; margin: 0 auto;
/*float: right;*/
} }
.map-style { .map-style {
width: 100%; width: 100%;
text-align:center;
margin-top: 10px;
margin-bottom: 20px;
} }
</ui:style> </ui:style>
<g:HTMLPanel addStyleNames="{style.map-style}"> <g:HTMLPanel addStyleNames="{style.map-style}">

View File

@ -12,8 +12,8 @@ import org.gcube.portlets.user.geoportaldataviewer.client.ui.images.ThumbnailIma
import org.gcube.portlets.user.geoportaldataviewer.client.ui.map.MapView; import org.gcube.portlets.user.geoportaldataviewer.client.ui.map.MapView;
import org.gcube.portlets.user.geoportaldataviewer.client.ui.util.CustomFlexTable; import org.gcube.portlets.user.geoportaldataviewer.client.ui.util.CustomFlexTable;
import org.gcube.portlets.user.geoportaldataviewer.shared.products.ConcessioneDV; import org.gcube.portlets.user.geoportaldataviewer.shared.products.ConcessioneDV;
import org.gcube.portlets.user.geoportaldataviewer.shared.products.model.AbstractRelazioneScavoDV;
import org.gcube.portlets.user.geoportaldataviewer.shared.products.model.LayerConcessioneDV; import org.gcube.portlets.user.geoportaldataviewer.shared.products.model.LayerConcessioneDV;
import org.gcube.portlets.user.geoportaldataviewer.shared.products.model.RelazioneScavoDV;
import org.gcube.portlets.user.geoportaldataviewer.shared.products.model.UploadedImageDV; import org.gcube.portlets.user.geoportaldataviewer.shared.products.model.UploadedImageDV;
import com.github.gwtbootstrap.client.ui.Button; import com.github.gwtbootstrap.client.ui.Button;
@ -27,6 +27,7 @@ import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler; import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.uibinder.client.UiBinder; import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField; import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.rpc.AsyncCallback; import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.Composite; import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HTMLPanel; import com.google.gwt.user.client.ui.HTMLPanel;
@ -202,7 +203,9 @@ public class ConcessioneView extends Composite {
ConcessioneView cv = new ConcessioneView(geonaItemRef, concessioneDV, false, openImageButtonVisible); ConcessioneView cv = new ConcessioneView(geonaItemRef, concessioneDV, false, openImageButtonVisible);
cv.setViewDetailsButtonVisible(false); cv.setViewDetailsButtonVisible(false);
ModalWindow mw = new ModalWindow(concessioneDV.getNome()); int width = Window.getClientWidth()*75/100;
int height = Window.getClientHeight()*70/100;
ModalWindow mw = new ModalWindow(concessioneDV.getNome(), width, height);
mw.add(cv); mw.add(cv);
mw.setCaller(ConcessioneView.this); mw.setCaller(ConcessioneView.this);
//mw.setWidth(900); //mw.setWidth(900);
@ -280,19 +283,19 @@ public class ConcessioneView extends Composite {
private void addRelazioneDiScavo() { private void addRelazioneDiScavo() {
RelazioneScavoDV relazioneScavo = concessioneDV.getRelazioneScavo(); AbstractRelazioneScavoDV abstractRS = concessioneDV.getAbstractRelazioneScavo();
if(relazioneScavo==null) if(abstractRS==null)
return; return;
if(relazioneScavo.getPolicy()==null || relazioneScavo.getPolicy().equalsIgnoreCase("OPEN")) { if(abstractRS.getPolicy()==null || abstractRS.getPolicy().equalsIgnoreCase("OPEN")) {
relazioneScavoPanel.setVisible(true); relazioneScavoPanel.setVisible(true);
relazioneScavoPanel.add(new RelazioneScavoView(relazioneScavo)); relazioneScavoPanel.add(new RelazioneScavoView(abstractRS, concessioneDV.getRelazioneScavo(), false));
}else { }else {
//I need to be authenticated to show the fields according to POLICY //I need to be authenticated to show the fields according to POLICY
if(myLogin!=null) { if(myLogin!=null) {
relazioneScavoPanel.setVisible(true); relazioneScavoPanel.setVisible(true);
relazioneScavoPanel.add(new RelazioneScavoView(relazioneScavo)); relazioneScavoPanel.add(new RelazioneScavoView(abstractRS, concessioneDV.getRelazioneScavo(), true));
} }
} }
} }
@ -300,7 +303,7 @@ public class ConcessioneView extends Composite {
private void addCentroidMap() { private void addCentroidMap() {
Coordinate centerCoordinate = OLFactory.createCoordinate(GeoportalDataViewerConstants.ITALY_CENTER_LONG, GeoportalDataViewerConstants.ITALY_CENTER_LAT); Coordinate centerCoordinate = OLFactory.createCoordinate(GeoportalDataViewerConstants.ITALY_CENTER_LONG, GeoportalDataViewerConstants.ITALY_CENTER_LAT);
Coordinate transformedCenterCoordinate = MapUtils.transformCoordiante(centerCoordinate, GeoportalDataViewerConstants.EPSG_4326, GeoportalDataViewerConstants.EPSG_3857); Coordinate transformedCenterCoordinate = MapUtils.transformCoordiante(centerCoordinate, GeoportalDataViewerConstants.EPSG_4326, GeoportalDataViewerConstants.EPSG_3857);
MapView mapView = new MapView(transformedCenterCoordinate, GeoportalDataViewerConstants.LIGHT_MAP_ITALY_FIT_ZOOM_ON); MapView mapView = new MapView(transformedCenterCoordinate, GeoportalDataViewerConstants.LIGHT_MAP_ITALY_FIT_ZOOM_ON, "70%", "300px");
if(concessioneDV!=null && concessioneDV.getCentroidLat()!=null && concessioneDV.getCentroidLong()!=null) { if(concessioneDV!=null && concessioneDV.getCentroidLat()!=null && concessioneDV.getCentroidLong()!=null) {
Coordinate coord = new Coordinate(concessioneDV.getCentroidLong(), concessioneDV.getCentroidLat()); Coordinate coord = new Coordinate(concessioneDV.getCentroidLong(), concessioneDV.getCentroidLat());

View File

@ -28,28 +28,28 @@
.width-100 { .width-100 {
width: 100%; width: 100%;
} }
</ui:style> </ui:style>
<g:HTMLPanel ui:field="pageViewDetails"> <g:HTMLPanel ui:field="pageViewDetails">
<!-- <g:HTMLPanel ui:field="sharePanel" --> <!-- <g:HTMLPanel ui:field="sharePanel" -->
<!-- addStyleNames="{style.align-to-right}"> --> <!-- addStyleNames="{style.align-to-right}"> -->
<!-- </g:HTMLPanel> --> <!-- </g:HTMLPanel> -->
<b:PageHeader ui:field="titolo" addStyleNames="{style.the-title}"></b:PageHeader> <b:PageHeader ui:field="titolo"
addStyleNames="{style.the-title}"></b:PageHeader>
<g:HorizontalPanel <g:HorizontalPanel
addStyleNames="{style.margin-bottom-10}"> addStyleNames="{style.margin-bottom-10}">
<b:Button ui:field="shareButton">Share</b:Button> <b:Button ui:field="shareButton">Share</b:Button>
<b:Button ui:field="viewButton">View</b:Button> <b:Button ui:field="viewButton">View</b:Button>
</g:HorizontalPanel> </g:HorizontalPanel>
<b:Paragraph ui:field="introduzione"></b:Paragraph> <b:Paragraph ui:field="introduzione"></b:Paragraph>
<g:HorizontalPanel addStyleNames="{style.width-100}"> <g:VerticalPanel addStyleNames="{style.width-100}">
<g:HTMLPanel ui:field="concessioniPanel">
</g:HTMLPanel>
<g:HTMLPanel ui:field="mapViewPanel"> <g:HTMLPanel ui:field="mapViewPanel">
</g:HTMLPanel> </g:HTMLPanel>
</g:HorizontalPanel> <g:HTMLPanel ui:field="concessioniPanel">
</g:HTMLPanel>
</g:VerticalPanel>
<g:HTMLPanel ui:field="relazioneScavoPanel" <g:HTMLPanel ui:field="relazioneScavoPanel"
addStyleNames="{style.margin-left-10}" visible="false"> addStyleNames="{style.margin-left-10}" visible="false">
<b:PageHeader addStyleNames="{style.font-size-h1-22}">Relazione Scavo</b:PageHeader> <b:PageHeader addStyleNames="{style.font-size-h1-22}">Relazione di Scavo</b:PageHeader>
</g:HTMLPanel> </g:HTMLPanel>
<g:HTMLPanel ui:field="imagesPanel" <g:HTMLPanel ui:field="imagesPanel"
addStyleNames="{style.margin-left-10}" visible="false"> addStyleNames="{style.margin-left-10}" visible="false">

View File

@ -46,7 +46,7 @@ public class LayerConcessioneView extends Composite {
if(layerDV.getLayerName()!=null && layerDV.getWmsLink()!=null) { if(layerDV.getLayerName()!=null && layerDV.getWmsLink()!=null) {
Coordinate centerCoordinate = OLFactory.createCoordinate(GeoportalDataViewerConstants.ITALY_CENTER_LONG, GeoportalDataViewerConstants.ITALY_CENTER_LAT); Coordinate centerCoordinate = OLFactory.createCoordinate(GeoportalDataViewerConstants.ITALY_CENTER_LONG, GeoportalDataViewerConstants.ITALY_CENTER_LAT);
Coordinate transformedCenterCoordinate = MapUtils.transformCoordiante(centerCoordinate, GeoportalDataViewerConstants.EPSG_4326, GeoportalDataViewerConstants.EPSG_3857); Coordinate transformedCenterCoordinate = MapUtils.transformCoordiante(centerCoordinate, GeoportalDataViewerConstants.EPSG_4326, GeoportalDataViewerConstants.EPSG_3857);
MapView mapView = new MapView(transformedCenterCoordinate, GeoportalDataViewerConstants.LIGHT_MAP_ITALY_FIT_ZOOM_ON); MapView mapView = new MapView(transformedCenterCoordinate, GeoportalDataViewerConstants.LIGHT_MAP_ITALY_FIT_ZOOM_ON, "70%", "300px");
mapViewPanel.add(mapView); mapViewPanel.add(mapView);
String mapServerHost = layerDV.getWmsLink().contains("?")? layerDV.getWmsLink().substring(0,layerDV.getWmsLink().indexOf("?")):layerDV.getWmsLink(); String mapServerHost = layerDV.getWmsLink().contains("?")? layerDV.getWmsLink().substring(0,layerDV.getWmsLink().indexOf("?")):layerDV.getWmsLink();

View File

@ -7,13 +7,11 @@
.important { .important {
font-weight: bold; font-weight: bold;
} }
</ui:style> </ui:style>
<g:HTMLPanel addStyleNames="style-layer"> <g:HTMLPanel addStyleNames="style-layer">
<g:HorizontalPanel> <g:VerticalPanel>
<g:HTMLPanel ui:field="mapViewPanel"></g:HTMLPanel>
<g:HTMLPanel ui:field="layerConcessionePanel"></g:HTMLPanel> <g:HTMLPanel ui:field="layerConcessionePanel"></g:HTMLPanel>
<g:HTMLPanel ui:field="mapViewPanel"> </g:VerticalPanel>
</g:HTMLPanel>
</g:HorizontalPanel>
</g:HTMLPanel> </g:HTMLPanel>
</ui:UiBinder> </ui:UiBinder>

View File

@ -1,19 +1,31 @@
package org.gcube.portlets.user.geoportaldataviewer.client.ui.products.concessioni; package org.gcube.portlets.user.geoportaldataviewer.client.ui.products.concessioni;
import java.util.List;
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants; import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants;
import org.gcube.portlets.user.geoportaldataviewer.client.ui.util.CustomFlexTable; import org.gcube.portlets.user.geoportaldataviewer.client.ui.util.CustomFlexTable;
import org.gcube.portlets.user.geoportaldataviewer.shared.products.content.WorkspaceContentDV;
import org.gcube.portlets.user.geoportaldataviewer.shared.products.model.AbstractRelazioneScavoDV;
import org.gcube.portlets.user.geoportaldataviewer.shared.products.model.RelazioneScavoDV; import org.gcube.portlets.user.geoportaldataviewer.shared.products.model.RelazioneScavoDV;
import com.github.gwtbootstrap.client.ui.Button;
import com.github.gwtbootstrap.client.ui.Paragraph; import com.github.gwtbootstrap.client.ui.Paragraph;
import com.google.gwt.core.client.GWT; import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.uibinder.client.UiBinder; import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField; import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Composite; import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HTMLPanel; import com.google.gwt.user.client.ui.HTMLPanel;
import com.google.gwt.user.client.ui.Widget; import com.google.gwt.user.client.ui.Widget;
public class RelazioneScavoView extends Composite { public class RelazioneScavoView extends Composite {
private static final String SHOW_ITALIAN_DESCR = "Italian description";
private static final String SHOW_ENGLISH_DESCR = "English description";
private static RelazioneScavoViewUiBinder uiBinder = GWT.create(RelazioneScavoViewUiBinder.class); private static RelazioneScavoViewUiBinder uiBinder = GWT.create(RelazioneScavoViewUiBinder.class);
interface RelazioneScavoViewUiBinder extends UiBinder<Widget, RelazioneScavoView> { interface RelazioneScavoViewUiBinder extends UiBinder<Widget, RelazioneScavoView> {
@ -23,21 +35,72 @@ public class RelazioneScavoView extends Composite {
HTMLPanel relazioneScavoPanel; HTMLPanel relazioneScavoPanel;
@UiField @UiField
Paragraph abstractParagraph; Paragraph abstractParagraphIta;
@UiField
Paragraph abstractParagraphEng;
@UiField
Button linkAbstractEng;
private CustomFlexTable customTable = new CustomFlexTable(); private CustomFlexTable customTable = new CustomFlexTable();
public RelazioneScavoView(RelazioneScavoDV relazioneScavoDV) { public RelazioneScavoView(AbstractRelazioneScavoDV abstractDV, RelazioneScavoDV relazioneScavoDV, boolean autheticatedUser) {
initWidget(uiBinder.createAndBindUi(this)); initWidget(uiBinder.createAndBindUi(this));
if(relazioneScavoDV.getAbstractSection()!=null) if(abstractDV.getAbstractSectionIta()!=null) {
abstractParagraph.setText(relazioneScavoDV.getAbstractSection()); abstractParagraphIta.setText(abstractDV.getAbstractSectionIta());
if(abstractDV.getAbstractSectionEng()!=null) {
linkAbstractEng.setVisible(true);
abstractParagraphEng.setText(abstractDV.getAbstractSectionEng());
linkAbstractEng.setText(SHOW_ENGLISH_DESCR);
}
}
//customTable.addNextKeyValue("Created", relazioneScavoDV.getCreationTime()); //customTable.addNextKeyValue("Created", relazioneScavoDV.getCreationTime());
//customTable.addNextKeyValue("ID Licenza", relazioneScavoDV.getLicenseID()); //customTable.addNextKeyValue("ID Licenza", relazioneScavoDV.getLicenseID());
customTable.addNextKeyValues("Responsabili", relazioneScavoDV.getResponsabili(), GeoportalDataViewerConstants.NEW_LINE_BR); customTable.addNextKeyValues("Responsabili", relazioneScavoDV.getResponsabili(), GeoportalDataViewerConstants.NEW_LINE_BR);
linkAbstractEng.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
if(abstractParagraphIta.isVisible()) {
abstractParagraphIta.setVisible(false);
abstractParagraphEng.setVisible(true);
linkAbstractEng.setText(SHOW_ENGLISH_DESCR);
}else {
abstractParagraphIta.setVisible(true);
abstractParagraphEng.setVisible(false);
linkAbstractEng.setText(SHOW_ITALIAN_DESCR);
}
}
});
//Showing the Download PFD relazione accoding to policy
if(relazioneScavoDV.getPolicy()==null || relazioneScavoDV.getPolicy().equalsIgnoreCase("OPEN")) {
relazioneScavoPanel.setVisible(true);
showLintToDownloadLastContent(relazioneScavoDV.getListWsContent());
//DOWNLOAD RS
}else {
//I need to be authenticated to show the fields according to POLICY
if(autheticatedUser) {
showLintToDownloadLastContent(relazioneScavoDV.getListWsContent());
}
}
relazioneScavoPanel.add(customTable); relazioneScavoPanel.add(customTable);
} }
private void showLintToDownloadLastContent(List<WorkspaceContentDV> listContent) {
if(listContent!=null) {
int size = listContent.size();
WorkspaceContentDV lastDoc = listContent.get(size-1);
customTable.addNextKeyWidget("PDF Relazione", new HTML("<a href=\""+lastDoc.getLink()+"\">download</a>"));
}
}
} }

View File

@ -4,15 +4,18 @@
xmlns:b="urn:import:com.github.gwtbootstrap.client.ui"> xmlns:b="urn:import:com.github.gwtbootstrap.client.ui">
<ui:style> <ui:style>
.description>p {
.description > p { font-size: 20px;
font-size: 20px; padding: 10px;
padding: 10px; color: #999;
color: #999;
} }
</ui:style> </ui:style>
<g:HTMLPanel ui:field="relazioneScavoPanel" addStyleNames="{style.description}"> <g:HTMLPanel ui:field="relazioneScavoPanel"
<b:Paragraph ui:field="abstractParagraph"></b:Paragraph> addStyleNames="{style.description}">
<b:Button ui:field="linkAbstractEng" visible="false"
type="LINK"></b:Button>
<b:Paragraph ui:field="abstractParagraphIta"></b:Paragraph>
<b:Paragraph ui:field="abstractParagraphEng"
visible="false"></b:Paragraph>
</g:HTMLPanel> </g:HTMLPanel>
</ui:UiBinder> </ui:UiBinder>

View File

@ -19,6 +19,7 @@ import org.gcube.portlets.user.geoportaldataviewer.shared.gis.BoundsMap;
import org.gcube.portlets.user.geoportaldataviewer.shared.products.ConcessioneDV; import org.gcube.portlets.user.geoportaldataviewer.shared.products.ConcessioneDV;
import org.gcube.portlets.user.geoportaldataviewer.shared.products.content.OtherContentDV; import org.gcube.portlets.user.geoportaldataviewer.shared.products.content.OtherContentDV;
import org.gcube.portlets.user.geoportaldataviewer.shared.products.content.WorkspaceContentDV; import org.gcube.portlets.user.geoportaldataviewer.shared.products.content.WorkspaceContentDV;
import org.gcube.portlets.user.geoportaldataviewer.shared.products.model.AbstractRelazioneScavoDV;
import org.gcube.portlets.user.geoportaldataviewer.shared.products.model.LayerConcessioneDV; import org.gcube.portlets.user.geoportaldataviewer.shared.products.model.LayerConcessioneDV;
import org.gcube.portlets.user.geoportaldataviewer.shared.products.model.RelazioneScavoDV; import org.gcube.portlets.user.geoportaldataviewer.shared.products.model.RelazioneScavoDV;
import org.gcube.portlets.user.geoportaldataviewer.shared.products.model.UploadedImageDV; import org.gcube.portlets.user.geoportaldataviewer.shared.products.model.UploadedImageDV;
@ -95,6 +96,7 @@ public class ConvertToDataViewModel {
theConcessione.setRecordType(concessione.getRecordType().name()); theConcessione.setRecordType(concessione.getRecordType().name());
theConcessione.setAbstractRelazioneScavo(toAbstractRelazioneScavo(concessione.getRelazioneScavo()));
theConcessione.setRelazioneScavo(toRelazioneScavo(concessione.getRelazioneScavo())); theConcessione.setRelazioneScavo(toRelazioneScavo(concessione.getRelazioneScavo()));
@ -155,6 +157,12 @@ public class ConvertToDataViewModel {
// return destList; // return destList;
// } // }
/**
* To user.
*
* @param username the username
* @return the string
*/
public static String toUser(String username) { public static String toUser(String username) {
if(username==null) if(username==null)
@ -164,6 +172,12 @@ public class ConvertToDataViewModel {
} }
/**
* To policy.
*
* @param policy the policy
* @return the string
*/
public static String toPolicy(AccessPolicy policy) { public static String toPolicy(AccessPolicy policy) {
if(policy==null) if(policy==null)
@ -173,6 +187,12 @@ public class ConvertToDataViewModel {
} }
/**
* To date format string.
*
* @param dateTime the date time
* @return the string
*/
public static String toDateFormatString(LocalDateTime dateTime) { public static String toDateFormatString(LocalDateTime dateTime) {
if(dateTime==null) if(dateTime==null)
@ -202,19 +222,20 @@ public class ConvertToDataViewModel {
} }
/** /**
* To relazione scavo. * To abstract relazione scavo.
* *
* @param relazioneScavo the relazione scavo * @param relazioneScavo the relazione scavo
* @param recordDV the record data view * @return the abstract relazione scavo DV
* @return the relazione scavo data view
*/ */
public static RelazioneScavoDV toRelazioneScavo(RelazioneScavo relazioneScavo) { public static AbstractRelazioneScavoDV toAbstractRelazioneScavo(RelazioneScavo relazioneScavo) {
if (relazioneScavo == null) if (relazioneScavo == null)
return null; return null;
RelazioneScavoDV theRelazioneDiScavo = new RelazioneScavoDV(); AbstractRelazioneScavoDV theRelazioneDiScavo = new AbstractRelazioneScavoDV();
theRelazioneDiScavo.setAbstractSection(relazioneScavo.getAbstractSection()); theRelazioneDiScavo.setAbstractSectionIta(relazioneScavo.getAbstractIta());
theRelazioneDiScavo.setAbstractSectionEng(relazioneScavo.getAbstractEng());
theRelazioneDiScavo.setCreationTime(toDateFormatString(relazioneScavo.getCreationTime())); theRelazioneDiScavo.setCreationTime(toDateFormatString(relazioneScavo.getCreationTime()));
theRelazioneDiScavo.setId(relazioneScavo.getId()); theRelazioneDiScavo.setId(relazioneScavo.getId());
theRelazioneDiScavo.setLicenseID(relazioneScavo.getLicenseID()); theRelazioneDiScavo.setLicenseID(relazioneScavo.getLicenseID());
@ -228,11 +249,47 @@ public class ConvertToDataViewModel {
return theRelazioneDiScavo; return theRelazioneDiScavo;
} }
/**
* To relazione scavo.
*
* @param relazioneScavo the relazione scavo
* @return the relazione scavo data view
*/
public static RelazioneScavoDV toRelazioneScavo(RelazioneScavo relazioneScavo) {
if (relazioneScavo == null)
return null;
RelazioneScavoDV theRelazioneDiScavo = new RelazioneScavoDV();
theRelazioneDiScavo.setCreationTime(toDateFormatString(relazioneScavo.getCreationTime()));
theRelazioneDiScavo.setId(relazioneScavo.getId());
theRelazioneDiScavo.setLicenseID(relazioneScavo.getLicenseID());
theRelazioneDiScavo.setPolicy(toPolicy(relazioneScavo.getPolicy()));
//theRelazioneDiScavo.setRecord(recordDV);
theRelazioneDiScavo.setResponsabili(relazioneScavo.getResponsabili());
theRelazioneDiScavo.setSoggetto(relazioneScavo.getSoggetto());
theRelazioneDiScavo.setTitolo(relazioneScavo.getTitolo());
List<PersistedContent> actContent = relazioneScavo.getActualContent();
if(actContent!=null && actContent.size()>0) {
List<WorkspaceContentDV> listWsContent = new ArrayList<WorkspaceContentDV>();
for (PersistedContent content : actContent) {
if(content!=null && content instanceof WorkspaceContent) {
listWsContent.add(toWorkspaceContent((WorkspaceContent)content));
}
}
theRelazioneDiScavo.setListWsContent(listWsContent);
}
LOG.debug("Returning: " + theRelazioneDiScavo);
return theRelazioneDiScavo;
}
/** /**
* To uploaded image. * To uploaded image.
* *
* @param uploadedImage the uploaded image * @param uploadedImage the uploaded image
* @param recordDV the record data-view
* @return the uploaded image data-view * @return the uploaded image data-view
*/ */
public static UploadedImageDV toUploadedImage(UploadedImage uploadedImage) { public static UploadedImageDV toUploadedImage(UploadedImage uploadedImage) {
@ -292,7 +349,6 @@ public class ConvertToDataViewModel {
* To layer concessione. * To layer concessione.
* *
* @param layerConcessione the layer concessione * @param layerConcessione the layer concessione
* @param recordDV the record DV
* @return the layer concessione data view * @return the layer concessione data view
*/ */
public static LayerConcessioneDV toLayerConcessione(LayerConcessione layerConcessione) { public static LayerConcessioneDV toLayerConcessione(LayerConcessione layerConcessione) {
@ -355,7 +411,6 @@ public class ConvertToDataViewModel {
* To other content DV. * To other content DV.
* *
* @param otherContent the other content * @param otherContent the other content
* @param recordDV the record DV
* @return the other content DV * @return the other content DV
*/ */
public static OtherContentDV toOtherContentDV(OtherContent otherContent) { public static OtherContentDV toOtherContentDV(OtherContent otherContent) {
@ -392,7 +447,9 @@ public class ConvertToDataViewModel {
/** /**
* To bound map. * To bound map.
* *
* @param wmsVersion the wms version
* @param bbox the bbox * @param bbox the bbox
* @param separator the separator
* @return the bounds map * @return the bounds map
*/ */
public static BoundsMap toBoundMap(String wmsVersion, String bbox, String separator) { public static BoundsMap toBoundMap(String wmsVersion, String bbox, String separator) {
@ -423,6 +480,12 @@ public class ConvertToDataViewModel {
} }
} }
/**
* To double.
*
* @param value the value
* @return the double
*/
public static Double toDouble(String value) { public static Double toDouble(String value) {
try { try {
return Double.parseDouble(value); return Double.parseDouble(value);

View File

@ -210,19 +210,6 @@ public class GeoportalDataViewerServiceImpl extends RemoteServiceServlet impleme
String erroMsg = UploadedImage.class.getSimpleName() +" not available for "+Concessione.class.getSimpleName() +" with id "+id; String erroMsg = UploadedImage.class.getSimpleName() +" not available for "+Concessione.class.getSimpleName() +" with id "+id;
LOG.error(erroMsg,e); LOG.error(erroMsg,e);
throw new Exception(erroMsg); throw new Exception(erroMsg);
//TODO REMOTE THIS
// listUI = new ArrayList<UploadedImageDV>(1);
// UploadedImageDV img = new UploadedImageDV();
// List<WorkspaceContentDV> listWsContent = new ArrayList<WorkspaceContentDV>();
// WorkspaceContentDV wcDV = new WorkspaceContentDV();
// wcDV.setLink("https://upload.wikimedia.org/wikipedia/commons/thumb/b/b4/Tempio_di_Giove_2.jpg/1280px-Tempio_di_Giove_2.jpg");
// listWsContent.add(wcDV);
// img.setListWsContent(listWsContent);
// listUI.add(img);
// LOG.warn("DUMMY UploadedImageDVs: "+listUI);
// return listUI;
} }
} }

View File

@ -5,6 +5,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.gcube.portlets.user.geoportaldataviewer.shared.products.content.OtherContentDV; import org.gcube.portlets.user.geoportaldataviewer.shared.products.content.OtherContentDV;
import org.gcube.portlets.user.geoportaldataviewer.shared.products.model.AbstractRelazioneScavoDV;
import org.gcube.portlets.user.geoportaldataviewer.shared.products.model.LayerConcessioneDV; import org.gcube.portlets.user.geoportaldataviewer.shared.products.model.LayerConcessioneDV;
import org.gcube.portlets.user.geoportaldataviewer.shared.products.model.RecordDV; import org.gcube.portlets.user.geoportaldataviewer.shared.products.model.RecordDV;
import org.gcube.portlets.user.geoportaldataviewer.shared.products.model.RelazioneScavoDV; import org.gcube.portlets.user.geoportaldataviewer.shared.products.model.RelazioneScavoDV;
@ -80,6 +81,9 @@ public class ConcessioneDV extends RecordDV implements Serializable, IsSerializa
/** The centroid long. */ /** The centroid long. */
private Double centroidLong; private Double centroidLong;
/** The relazione scavo. */
private AbstractRelazioneScavoDV abstractRelazioneScavo;
/** The relazione scavo. */ /** The relazione scavo. */
private RelazioneScavoDV relazioneScavo; private RelazioneScavoDV relazioneScavo;
@ -516,6 +520,25 @@ public class ConcessioneDV extends RecordDV implements Serializable, IsSerializa
this.genericContent = genericContent; this.genericContent = genericContent;
} }
/**
* Gets the abstract relazione scavo.
*
* @return the abstract relazione scavo
*/
public AbstractRelazioneScavoDV getAbstractRelazioneScavo() {
return abstractRelazioneScavo;
}
/**
* Sets the abstract relazione scavo.
*
* @param abstractRelazioneScavo the new abstract relazione scavo
*/
public void setAbstractRelazioneScavo(AbstractRelazioneScavoDV abstractRelazioneScavo) {
this.abstractRelazioneScavo = abstractRelazioneScavo;
}
@Override @Override
public String toString() { public String toString() {
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
@ -555,6 +578,8 @@ public class ConcessioneDV extends RecordDV implements Serializable, IsSerializa
builder.append(centroidLat); builder.append(centroidLat);
builder.append(", centroidLong="); builder.append(", centroidLong=");
builder.append(centroidLong); builder.append(centroidLong);
builder.append(", abstractRelazioneScavo=");
builder.append(abstractRelazioneScavo);
builder.append(", relazioneScavo="); builder.append(", relazioneScavo=");
builder.append(relazioneScavo); builder.append(relazioneScavo);
builder.append(", immaginiRappresentative="); builder.append(", immaginiRappresentative=");
@ -569,6 +594,4 @@ public class ConcessioneDV extends RecordDV implements Serializable, IsSerializa
return builder.toString(); return builder.toString();
} }
} }

View File

@ -13,7 +13,7 @@ import com.google.gwt.user.client.rpc.IsSerializable;
* *
* Nov 2, 2020 * Nov 2, 2020
*/ */
public class AssociatedContentDV implements IsSerializable, Serializable{ public abstract class AssociatedContentDV implements IsSerializable, Serializable{
/** /**
@ -39,6 +39,7 @@ public class AssociatedContentDV implements IsSerializable, Serializable{
/** The record. */ /** The record. */
private RecordDV record; private RecordDV record;
/** /**
* Instantiates a new associated content. * Instantiates a new associated content.
*/ */

View File

@ -0,0 +1,152 @@
package org.gcube.portlets.user.geoportaldataviewer.shared.products.model;
import java.io.Serializable;
import java.util.List;
import org.gcube.portlets.user.geoportaldataviewer.shared.products.content.AssociatedContentDV;
/**
* The Class AbstractRelazioneScavoDV.
*
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
*
* Dec 21, 2020
*/
public class AbstractRelazioneScavoDV extends AssociatedContentDV implements Serializable {
/**
*
*/
private static final long serialVersionUID = 8768745863185590509L;
/** The abstract section. */
private String abstractSectionIta;
private String abstractSectionEng;
/** The responsabili. */
private List<String> responsabili;
/** The soggetto. */
private List<String> soggetto;
/**
* Instantiates a new abstract relazione scavo.
*/
public AbstractRelazioneScavoDV() {
}
/**
* Instantiates a new abstract relazione scavo.
*
* @param abstractSectionIta the abstract section ita
* @param abstractSectionEng the abstract section eng
* @param responsabili the responsabili
* @param soggetto the soggetto
*/
public AbstractRelazioneScavoDV(String abstractSectionIta, String abstractSectionEng, List<String> responsabili, List<String> soggetto) {
super();
this.abstractSectionIta = abstractSectionIta;
this.abstractSectionEng = abstractSectionEng;
this.responsabili = responsabili;
this.soggetto = soggetto;
}
/**
* Gets the abstract section ita.
*
* @return the abstract section ita
*/
public String getAbstractSectionIta() {
return abstractSectionIta;
}
/**
* Sets the abstract section ita.
*
* @param abstractSectionIta the new abstract section ita
*/
public void setAbstractSectionIta(String abstractSectionIta) {
this.abstractSectionIta = abstractSectionIta;
}
/**
* Gets the abstract section eng.
*
* @return the abstract section eng
*/
public String getAbstractSectionEng() {
return abstractSectionEng;
}
/**
* Sets the abstract section eng.
*
* @param abstractSectionEng the new abstract section eng
*/
public void setAbstractSectionEng(String abstractSectionEng) {
this.abstractSectionEng = abstractSectionEng;
}
/**
* Gets the responsabili.
*
* @return the responsabili
*/
public List<String> getResponsabili() {
return responsabili;
}
/**
* Sets the responsabili.
*
* @param responsabili the new responsabili
*/
public void setResponsabili(List<String> responsabili) {
this.responsabili = responsabili;
}
/**
* Gets the soggetto.
*
* @return the soggetto
*/
public List<String> getSoggetto() {
return soggetto;
}
/**
* Sets the soggetto.
*
* @param soggetto the new soggetto
*/
public void setSoggetto(List<String> soggetto) {
this.soggetto = soggetto;
}
/**
* To string.
*
* @return the string
*/
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("RelazioneScavoDV [abstractSectionIta=");
builder.append(abstractSectionIta);
builder.append(", abstractSectionEng=");
builder.append(abstractSectionEng);
builder.append(", responsabili=");
builder.append(responsabili);
builder.append(", soggetto=");
builder.append(soggetto);
builder.append("]");
return builder.toString();
}
}

View File

@ -4,13 +4,15 @@ import java.io.Serializable;
import java.util.List; import java.util.List;
import org.gcube.portlets.user.geoportaldataviewer.shared.products.content.AssociatedContentDV; import org.gcube.portlets.user.geoportaldataviewer.shared.products.content.AssociatedContentDV;
import org.gcube.portlets.user.geoportaldataviewer.shared.products.content.WorkspaceContentDV;
/** /**
* The Class RelazioneScavo. * The Class RelazioneScavoDV.
* *
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it) * @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
* *
* Nov 2, 2020 * Dec 21, 2020
*/ */
public class RelazioneScavoDV extends AssociatedContentDV implements Serializable { public class RelazioneScavoDV extends AssociatedContentDV implements Serializable {
@ -19,61 +21,105 @@ public class RelazioneScavoDV extends AssociatedContentDV implements Serializabl
*/ */
private static final long serialVersionUID = 2456950567302197554L; private static final long serialVersionUID = 2456950567302197554L;
/** The abstract section. */
private String abstractSection;
/** The responsabili. */ /** The responsabili. */
private List<String> responsabili; private List<String> responsabili;
/** The soggetto. */ /** The soggetto. */
private List<String> soggetto; private List<String> soggetto;
private List<WorkspaceContentDV> listWsContent;
/**
* Instantiates a new relazione scavo DV.
*/
public RelazioneScavoDV() { public RelazioneScavoDV() {
} }
public RelazioneScavoDV(String abstractSection, List<String> responsabili, List<String> soggetto) { /**
* Instantiates a new relazione scavo DV.
*
* @param responsabili the responsabili
* @param soggetto the soggetto
*/
public RelazioneScavoDV(List<String> responsabili, List<String> soggetto) {
super(); super();
this.abstractSection = abstractSection;
this.responsabili = responsabili; this.responsabili = responsabili;
this.soggetto = soggetto; this.soggetto = soggetto;
} }
public String getAbstractSection() { /**
return abstractSection; * Gets the responsabili.
} *
* @return the responsabili
public void setAbstractSection(String abstractSection) { */
this.abstractSection = abstractSection;
}
public List<String> getResponsabili() { public List<String> getResponsabili() {
return responsabili; return responsabili;
} }
/**
* Sets the responsabili.
*
* @param responsabili the new responsabili
*/
public void setResponsabili(List<String> responsabili) { public void setResponsabili(List<String> responsabili) {
this.responsabili = responsabili; this.responsabili = responsabili;
} }
/**
* Gets the soggetto.
*
* @return the soggetto
*/
public List<String> getSoggetto() { public List<String> getSoggetto() {
return soggetto; return soggetto;
} }
/**
* Sets the soggetto.
*
* @param soggetto the new soggetto
*/
public void setSoggetto(List<String> soggetto) { public void setSoggetto(List<String> soggetto) {
this.soggetto = soggetto; this.soggetto = soggetto;
} }
/**
* Gets the list ws content.
*
* @return the list ws content
*/
public List<WorkspaceContentDV> getListWsContent() {
return listWsContent;
}
/**
* Sets the list ws content.
*
* @param listWsContent the new list ws content
*/
public void setListWsContent(List<WorkspaceContentDV> listWsContent) {
this.listWsContent = listWsContent;
}
/**
* To string.
*
* @return the string
*/
@Override @Override
public String toString() { public String toString() {
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
builder.append("RelazioneScavo [abstractSection="); builder.append("RelazioneScavoDV [responsabili=");
builder.append(abstractSection);
builder.append(", responsabili=");
builder.append(responsabili); builder.append(responsabili);
builder.append(", soggetto="); builder.append(", soggetto=");
builder.append(soggetto); builder.append(soggetto);
builder.append(", listWsContent=");
builder.append(listWsContent);
builder.append("]"); builder.append("]");
return builder.toString(); return builder.toString();
} }
} }