added serializable

This commit is contained in:
Francesco Mangiacrapa 2020-11-10 17:53:35 +01:00
parent 6c495119b9
commit 7d2a685508
8 changed files with 77 additions and 50 deletions

View File

@ -22,8 +22,6 @@ import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.HTMLPanel;
import com.google.gwt.user.client.ui.Widget;
import ol.Coordinate;
public class ConcessioneView extends Composite {
@ -74,9 +72,12 @@ public class ConcessioneView extends Composite {
titolo.setText(concessioneDV.getNome());
introduzione.setText(concessioneDV.getIntroduzione());
for (String author : concessioneDV.getAuthors()) {
addLabel(autori, author);
//autori.add(new Label(author));
if(concessioneDV.getAuthors()!=null) {
for (String author : concessioneDV.getAuthors()) {
addLabel(autori, author);
//autori.add(new Label(author));
}
}
addLabel(contributore, concessioneDV.getContributore());

View File

@ -62,7 +62,7 @@ public class ConvertToDataViewModel {
ConcessioneDV theConcessione = new ConcessioneDV();
theConcessione.setPolicy(toPolicy(concessione.getPolicy()));
theConcessione.setAuthors(concessione.getAuthors());
//theConcessione.setAuthors(concessione.getAuthors());
theConcessione.setCentroidLat(concessione.getCentroidLat());
theConcessione.setCentroidLong(concessione.getCentroidLong());
theConcessione.setContributore(concessione.getContributore());
@ -72,28 +72,10 @@ public class ConvertToDataViewModel {
theConcessione.setDataInizioProgetto(toDateString(concessione.getDataInizioProgetto()));
theConcessione.setDescrizioneContenuto(concessione.getDescrizioneContenuto());
theConcessione.setEditore(concessione.getEditore());
theConcessione.setFontiFinanziamento(concessione.getFontiFinanziamento());
theConcessione.setFontiFinanziamento(toListString(concessione.getFontiFinanziamento()));
theConcessione.setId(concessione.getId());
theConcessione.setNome(concessione.getNome());
if (concessione.getGenericContent() != null) {
List<OtherContentDV> otherContentsDV = new ArrayList<OtherContentDV>(
concessione.getGenericContent().size());
for (OtherContent gc : concessione.getGenericContent()) {
otherContentsDV.add(toOtherContentDV(gc));
}
theConcessione.setGenericContent(otherContentsDV);
}
if (concessione.getImmaginiRappresentative() != null) {
List<UploadedImageDV> uploadedImagesDV = new ArrayList<UploadedImageDV>(
concessione.getImmaginiRappresentative().size());
for (UploadedImage ui : concessione.getImmaginiRappresentative()) {
uploadedImagesDV.add(toUploadedImage(ui));
}
theConcessione.setImmaginiRappresentative(uploadedImagesDV);
}
theConcessione.setIntroduzione(concessione.getIntroduzione());
theConcessione.setLastUpdateTime(toDateString(concessione.getLastUpdateTime()));
theConcessione.setLastUpdateUser(toUser(concessione.getLastUpdateUser()));
@ -101,7 +83,40 @@ public class ConvertToDataViewModel {
theConcessione.setNome(concessione.getNome());
theConcessione.setParoleChiaveICCD(concessione.getParoleChiaveICCD());
theConcessione.setParoleChiaveLibere(concessione.getParoleChiaveLibere());
theConcessione.setResponsabile(concessione.getResponsabile());
theConcessione.setRisorseCorrelate(concessione.getRisorseCorrelate());
theConcessione.setSoggetto(concessione.getSoggetto());
theConcessione.setTitolareCopyright(concessione.getTitolareCopyright());
theConcessione.setTitolareLicenza(concessione.getTitolareLicenza());
theConcessione.setTitolari(concessione.getTitolari());
theConcessione.setVersion(concessione.getVersion());
theConcessione.setRecordType(concessione.getRecordType().name());
theConcessione.setRelazioneScavo(toRelazioneScavo(concessione.getRelazioneScavo()));
/*
if (concessione.getImmaginiRappresentative() != null) {
List<UploadedImageDV> uploadedImagesDV = new ArrayList<UploadedImageDV>(
concessione.getImmaginiRappresentative().size());
for (UploadedImage ui : concessione.getImmaginiRappresentative()) {
uploadedImagesDV.add(toUploadedImage(ui));
}
theConcessione.setImmaginiRappresentative(uploadedImagesDV);
}*/
/*
if (concessione.getGenericContent() != null) {
List<OtherContentDV> otherContentsDV = new ArrayList<OtherContentDV>(
concessione.getGenericContent().size());
for (OtherContent gc : concessione.getGenericContent()) {
otherContentsDV.add(toOtherContentDV(gc));
}
theConcessione.setGenericContent(otherContentsDV);
}*/
/*
if (concessione.getPianteFineScavo() != null) {
List<LayerConcessioneDV> piantaScavoDV = new ArrayList<LayerConcessioneDV>(
concessione.getPianteFineScavo().size());
@ -114,19 +129,8 @@ public class ConvertToDataViewModel {
if (concessione.getPosizionamentoScavo() != null) {
LayerConcessioneDV thePosizScavo = toLayerConcessione(concessione.getPosizionamentoScavo());
theConcessione.setPosizionamentoScavo(thePosizScavo);
}
}*/
theConcessione.setRecordType(concessione.getRecordType().name());
theConcessione.setRelazioneScavo(toRelazioneScavo(concessione.getRelazioneScavo()));
theConcessione.setResponsabile(concessione.getResponsabile());
theConcessione.setRisorseCorrelate(concessione.getRisorseCorrelate());
theConcessione.setSoggetto(concessione.getSoggetto());
theConcessione.setTitolareCopyright(concessione.getTitolareCopyright());
theConcessione.setTitolareLicenza(concessione.getTitolareLicenza());
theConcessione.setTitolari(concessione.getTitolari());
theConcessione.setVersion(concessione.getVersion());
LOG.debug("Returning concessione: " + theConcessione);
return theConcessione;
@ -137,6 +141,19 @@ public class ConvertToDataViewModel {
}
//TO AVOID SERIALIZATION ISSUE AGAINST GWT
public static List<String> toListString(List<String> orginList){
if(orginList==null)
return null;
List<String> destList = new ArrayList<String>(orginList.size());
for (String orgValue : orginList) {
destList.add(orgValue);
}
return destList;
}
public static String toUser(String username) {
if(username==null)

View File

@ -107,12 +107,12 @@ public class GeoportalDataViewerServiceImpl extends RemoteServiceServlet impleme
public ConcessioneDV getConcessioneForId(Long id) throws Exception{
LOG.info("getConcessioneForId "+id+ "called");
if(!SessionUtil.isIntoPortal()) {
LOG.warn("OUT OF PORTAL setting HARD-CODED SCOPE");
String scope = "/gcube/devNext/NextNext";
LOG.warn("SCOPE is: "+scope);
ScopeProvider.instance.set(scope);
}
// if(!SessionUtil.isIntoPortal()) {
// LOG.warn("OUT OF PORTAL setting HARD-CODED SCOPE");
// String scope = "/gcube/devNext/NextNext";
// LOG.warn("SCOPE is: "+scope);
// ScopeProvider.instance.set(scope);
// }
ConcessioneDV concessionDV = null;

View File

@ -91,10 +91,10 @@ public class ConcessioneDV extends RecordDV implements Serializable, IsSerializa
private LayerConcessioneDV posizionamentoScavo;
/** The piante fine scavo. */
private List<LayerConcessioneDV> pianteFineScavo = new ArrayList<>();
private List<LayerConcessioneDV> pianteFineScavo = new ArrayList<LayerConcessioneDV>();
/** The generic content. */
private List<OtherContentDV> genericContent = new ArrayList<>();
private List<OtherContentDV> genericContent = new ArrayList<OtherContentDV>();
/**
* Instantiates a new concessione.

View File

@ -4,6 +4,8 @@ import java.io.Serializable;
import org.gcube.portlets.user.geoportaldataviewer.shared.products.model.RecordDV;
import com.google.gwt.user.client.rpc.IsSerializable;
/**
* The Class AssociatedContent.
*
@ -11,7 +13,7 @@ import org.gcube.portlets.user.geoportaldataviewer.shared.products.model.RecordD
*
* Nov 2, 2020
*/
public class AssociatedContentDV implements Serializable{
public class AssociatedContentDV implements IsSerializable, Serializable{
/**

View File

@ -1,10 +1,13 @@
package org.gcube.portlets.user.geoportaldataviewer.shared.products.model;
import java.io.Serializable;
import java.util.List;
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.BoundsMap;
public class LayerConcessioneDV extends SDILayerDescriptorDV {
import com.google.gwt.user.client.rpc.IsSerializable;
public class LayerConcessioneDV extends SDILayerDescriptorDV implements IsSerializable, Serializable{
/**
*

View File

@ -4,6 +4,8 @@ import java.io.Serializable;
import org.gcube.portlets.user.geoportaldataviewer.shared.products.content.AssociatedContentDV;
import com.google.gwt.user.client.rpc.IsSerializable;
/**
* The Class SDILayerDescriptorDV.
@ -12,7 +14,7 @@ import org.gcube.portlets.user.geoportaldataviewer.shared.products.content.Assoc
*
* Nov 4, 2020
*/
public class SDILayerDescriptorDV extends AssociatedContentDV implements Serializable {
public class SDILayerDescriptorDV extends AssociatedContentDV implements IsSerializable, Serializable {
/**
*

View File

@ -6,6 +6,8 @@ import java.util.List;
import org.gcube.portlets.user.geoportaldataviewer.shared.products.content.AssociatedContentDV;
import org.gcube.portlets.user.geoportaldataviewer.shared.products.content.WorkspaceContentDV;
import com.google.gwt.user.client.rpc.IsSerializable;
/**
* The Class UploadedImage.
*
@ -13,7 +15,7 @@ import org.gcube.portlets.user.geoportaldataviewer.shared.products.content.Works
*
* Nov 2, 2020
*/
public class UploadedImageDV extends AssociatedContentDV implements Serializable {
public class UploadedImageDV extends AssociatedContentDV implements IsSerializable, Serializable {
/** The Constant serialVersionUID. */
private static final long serialVersionUID = 809167060189883015L;