added BaseConcessioneDV

This commit is contained in:
Francesco Mangiacrapa 2021-09-09 10:15:55 +02:00
parent 90e631ffa4
commit 6499248d34
5 changed files with 359 additions and 178 deletions

View File

@ -5,7 +5,7 @@ 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] - 2021-01-29 ## [v1.1.0-SNAPSHOT] - 2021-09-09
#### Enhancements #### Enhancements

View File

@ -15,6 +15,7 @@ import org.gcube.application.geoportal.common.model.legacy.RelazioneScavo;
import org.gcube.application.geoportal.common.model.legacy.UploadedImage; import org.gcube.application.geoportal.common.model.legacy.UploadedImage;
import org.gcube.application.geoportal.common.model.legacy.WorkspaceContent; import org.gcube.application.geoportal.common.model.legacy.WorkspaceContent;
import org.gcube.application.geoportalcommon.shared.gis.BoundsMap; import org.gcube.application.geoportalcommon.shared.gis.BoundsMap;
import org.gcube.application.geoportalcommon.shared.products.BaseConcessioneDV;
import org.gcube.application.geoportalcommon.shared.products.ConcessioneDV; import org.gcube.application.geoportalcommon.shared.products.ConcessioneDV;
import org.gcube.application.geoportalcommon.shared.products.content.OtherContentDV; import org.gcube.application.geoportalcommon.shared.products.content.OtherContentDV;
import org.gcube.application.geoportalcommon.shared.products.content.WorkspaceContentDV; import org.gcube.application.geoportalcommon.shared.products.content.WorkspaceContentDV;
@ -47,7 +48,6 @@ public class ConvertToDataViewModel {
public static final String TIME_FORMAT = "HH" + HOURS_MINUTES_SEPARATOR + "mm"; public static final String TIME_FORMAT = "HH" + HOURS_MINUTES_SEPARATOR + "mm";
/** /**
* To concessione. * To concessione.
* *
@ -56,7 +56,7 @@ public class ConvertToDataViewModel {
* @throws Exception the exception * @throws Exception the exception
*/ */
public static ConcessioneDV toConcessione(Concessione concessione) throws Exception { public static ConcessioneDV toConcessione(Concessione concessione) throws Exception {
LOG.debug("called toConcessione for: "+concessione); LOG.debug("called toConcessione for: " + concessione);
if (concessione == null) if (concessione == null)
return null; return null;
@ -65,7 +65,7 @@ public class ConvertToDataViewModel {
ConcessioneDV theConcessione = new ConcessioneDV(); ConcessioneDV theConcessione = new ConcessioneDV();
theConcessione.setPolicy(toPolicy(concessione.getPolicy())); theConcessione.setPolicy(toPolicy(concessione.getPolicy()));
//theConcessione.setAuthors(concessione.getAuthors()); // theConcessione.setAuthors(concessione.getAuthors());
theConcessione.setCentroidLat(concessione.getCentroidLat()); theConcessione.setCentroidLat(concessione.getCentroidLat());
theConcessione.setCentroidLong(concessione.getCentroidLong()); theConcessione.setCentroidLong(concessione.getCentroidLong());
theConcessione.setContributore(concessione.getContributore()); theConcessione.setContributore(concessione.getContributore());
@ -99,7 +99,6 @@ public class ConvertToDataViewModel {
theConcessione.setAbstractRelazioneScavo(toAbstractRelazioneScavo(concessione.getRelazioneScavo())); theConcessione.setAbstractRelazioneScavo(toAbstractRelazioneScavo(concessione.getRelazioneScavo()));
theConcessione.setRelazioneScavo(toRelazioneScavo(concessione.getRelazioneScavo())); theConcessione.setRelazioneScavo(toRelazioneScavo(concessione.getRelazioneScavo()));
if (concessione.getImmaginiRappresentative() != null) { if (concessione.getImmaginiRappresentative() != null) {
List<UploadedImageDV> uploadedImagesDV = new ArrayList<UploadedImageDV>( List<UploadedImageDV> uploadedImagesDV = new ArrayList<UploadedImageDV>(
concessione.getImmaginiRappresentative().size()); concessione.getImmaginiRappresentative().size());
@ -109,7 +108,6 @@ public class ConvertToDataViewModel {
theConcessione.setImmaginiRappresentative(uploadedImagesDV); theConcessione.setImmaginiRappresentative(uploadedImagesDV);
} }
if (concessione.getGenericContent() != null) { if (concessione.getGenericContent() != null) {
List<OtherContentDV> otherContentsDV = new ArrayList<OtherContentDV>( List<OtherContentDV> otherContentsDV = new ArrayList<OtherContentDV>(
concessione.getGenericContent().size()); concessione.getGenericContent().size());
@ -119,41 +117,39 @@ public class ConvertToDataViewModel {
theConcessione.setGenericContent(otherContentsDV); theConcessione.setGenericContent(otherContentsDV);
} }
if (concessione.getPianteFineScavo() != null) { if (concessione.getPianteFineScavo() != null) {
List<LayerConcessioneDV> piantaScavoDV = new ArrayList<LayerConcessioneDV>( List<LayerConcessioneDV> piantaScavoDV = new ArrayList<LayerConcessioneDV>(
concessione.getPianteFineScavo().size()); concessione.getPianteFineScavo().size());
for (LayerConcessione lc : concessione.getPianteFineScavo()) { for (LayerConcessione lc : concessione.getPianteFineScavo()) {
piantaScavoDV.add(toLayerConcessione(lc)); piantaScavoDV.add(toLayerConcessione(lc, (BaseConcessioneDV) theConcessione));
} }
theConcessione.setPianteFineScavo(piantaScavoDV); theConcessione.setPianteFineScavo(piantaScavoDV);
} }
if (concessione.getPosizionamentoScavo() != null) { if (concessione.getPosizionamentoScavo() != null) {
LayerConcessioneDV thePosizScavo = toLayerConcessione(concessione.getPosizionamentoScavo()); LayerConcessioneDV thePosizScavo = toLayerConcessione(concessione.getPosizionamentoScavo(),
(BaseConcessioneDV) theConcessione);
theConcessione.setPosizionamentoScavo(thePosizScavo); theConcessione.setPosizionamentoScavo(thePosizScavo);
} }
LOG.debug("Returning concessione: " + theConcessione); LOG.debug("Returning concessione: " + theConcessione);
return theConcessione; return theConcessione;
}catch (Exception e) { } catch (Exception e) {
LOG.error("Error on converting concessione: "+concessione, e); LOG.error("Error on converting concessione: " + concessione, e);
return null; return null;
} }
} }
/** /**
* To base concessione. * To metadata concessione.
* *
* @param concessione the concessione * @param concessione the concessione
* @return the concessione DV with core fields * @return the concessione DV
* @throws Exception the exception * @throws Exception the exception
*/ */
public static ConcessioneDV toBaseConcessione(Concessione concessione) throws Exception { public static ConcessioneDV toMetadataConcessione(Concessione concessione) throws Exception {
LOG.debug("called toConcessione for: "+concessione); LOG.debug("called toConcessione for: " + concessione);
if (concessione == null) if (concessione == null)
return null; return null;
@ -162,7 +158,6 @@ public class ConvertToDataViewModel {
ConcessioneDV theConcessione = new ConcessioneDV(); ConcessioneDV theConcessione = new ConcessioneDV();
theConcessione.setPolicy(toPolicy(concessione.getPolicy())); theConcessione.setPolicy(toPolicy(concessione.getPolicy()));
//theConcessione.setAuthors(concessione.getAuthors());
theConcessione.setCentroidLat(concessione.getCentroidLat()); theConcessione.setCentroidLat(concessione.getCentroidLat());
theConcessione.setCentroidLong(concessione.getCentroidLong()); theConcessione.setCentroidLong(concessione.getCentroidLong());
theConcessione.setContributore(concessione.getContributore()); theConcessione.setContributore(concessione.getContributore());
@ -190,17 +185,54 @@ public class ConvertToDataViewModel {
theConcessione.setTitolariLicenza(concessione.getTitolareLicenza()); theConcessione.setTitolariLicenza(concessione.getTitolareLicenza());
theConcessione.setTitolari(concessione.getTitolari()); theConcessione.setTitolari(concessione.getTitolari());
LOG.debug("Returning base concessione: " + theConcessione); LOG.debug("Returning base concessione: " + theConcessione);
return theConcessione; return theConcessione;
}catch (Exception e) { } catch (Exception e) {
LOG.error("Error on converting concessione: "+concessione, e); LOG.error("Error on converting concessione: " + concessione, e);
return null; return null;
} }
} }
//TO AVOID SERIALIZATION ISSUE AGAINST GWT /**
* To base concessione.
*
* @param concessione the concessione
* @return the concessione DV
* @throws Exception the exception
*/
public static BaseConcessioneDV toBaseConcessione(Concessione concessione) throws Exception {
LOG.debug("called toConcessione for: " + concessione);
if (concessione == null)
return null;
try {
BaseConcessioneDV theConcessione = new BaseConcessioneDV();
theConcessione.setPolicy(toPolicy(concessione.getPolicy()));
theConcessione.setCreationTime(DateUtils.asDate(concessione.getCreationTime()));
theConcessione.setCreationUser(toUser(concessione.getCreationUser()));
theConcessione.setItemId(concessione.getMongo_id());
theConcessione.setNome(concessione.getNome());
theConcessione.setAuthors(concessione.getAuthors());
theConcessione.setCreationTime(DateUtils.asDate(concessione.getCreationTime()));
theConcessione.setIntroduzione(concessione.getIntroduzione());
theConcessione.setLastUpdateTime(DateUtils.asDate(concessione.getLastUpdateTime()));
theConcessione.setLastUpdateUser(toUser(concessione.getLastUpdateUser()));
theConcessione.setLicenzaID(concessione.getLicenzaID());
LOG.debug("Returning base concessione: " + theConcessione);
return theConcessione;
} catch (Exception e) {
LOG.error("Error on converting concessione: " + concessione, e);
return null;
}
}
// TO AVOID SERIALIZATION ISSUE AGAINST GWT
// public static List<String> toListString(List<String> orginList){ // public static List<String> toListString(List<String> orginList){
// if(orginList==null) // if(orginList==null)
// return null; // return null;
@ -221,7 +253,7 @@ public class ConvertToDataViewModel {
*/ */
public static String toUser(String username) { public static String toUser(String username) {
if(username==null) if (username == null)
return null; return null;
return username; return username;
@ -236,7 +268,7 @@ public class ConvertToDataViewModel {
*/ */
public static String toPolicy(AccessPolicy policy) { public static String toPolicy(AccessPolicy policy) {
if(policy==null) if (policy == null)
return null; return null;
return policy.name(); return policy.name();
@ -251,27 +283,27 @@ public class ConvertToDataViewModel {
*/ */
public static String toDateFormatString(LocalDateTime dateTime) { public static String toDateFormatString(LocalDateTime dateTime) {
if(dateTime==null) if (dateTime == null)
return null; return null;
String time = dateTime.toString(); String time = dateTime.toString();
DateTimeFormatter formatter = null; DateTimeFormatter formatter = null;
try { try {
if(!time.endsWith(NO_TIME)) { if (!time.endsWith(NO_TIME)) {
formatter = DateTimeFormatter.ofPattern(DATE_FORMAT + " " + TIME_FORMAT); formatter = DateTimeFormatter.ofPattern(DATE_FORMAT + " " + TIME_FORMAT);
}else { } else {
time = time.replace(NO_TIME, ""); time = time.replace(NO_TIME, "");
formatter = DateTimeFormatter.ofPattern(DATE_FORMAT); formatter = DateTimeFormatter.ofPattern(DATE_FORMAT);
} }
}catch (Exception e) { } catch (Exception e) {
LOG.warn("Parsing error: ",e); LOG.warn("Parsing error: ", e);
} }
try { try {
if(formatter!=null) if (formatter != null)
return dateTime.format(formatter); return dateTime.format(formatter);
}catch (Exception e) { } catch (Exception e) {
LOG.warn("Date format error: ",e); LOG.warn("Date format error: ", e);
} }
return dateTime.toString(); return dateTime.toString();
@ -296,7 +328,7 @@ public class ConvertToDataViewModel {
theRelazioneDiScavo.setId(relazioneScavo.getId()); theRelazioneDiScavo.setId(relazioneScavo.getId());
theRelazioneDiScavo.setLicenseID(relazioneScavo.getLicenseID()); theRelazioneDiScavo.setLicenseID(relazioneScavo.getLicenseID());
theRelazioneDiScavo.setPolicy(toPolicy(relazioneScavo.getPolicy())); theRelazioneDiScavo.setPolicy(toPolicy(relazioneScavo.getPolicy()));
//theRelazioneDiScavo.setRecord(recordDV); // theRelazioneDiScavo.setRecord(recordDV);
theRelazioneDiScavo.setResponsabili(relazioneScavo.getResponsabili()); theRelazioneDiScavo.setResponsabili(relazioneScavo.getResponsabili());
theRelazioneDiScavo.setSoggetto(relazioneScavo.getSoggetto()); theRelazioneDiScavo.setSoggetto(relazioneScavo.getSoggetto());
theRelazioneDiScavo.setTitolo(relazioneScavo.getTitolo()); theRelazioneDiScavo.setTitolo(relazioneScavo.getTitolo());
@ -321,18 +353,18 @@ public class ConvertToDataViewModel {
theRelazioneDiScavo.setId(relazioneScavo.getId()); theRelazioneDiScavo.setId(relazioneScavo.getId());
theRelazioneDiScavo.setLicenseID(relazioneScavo.getLicenseID()); theRelazioneDiScavo.setLicenseID(relazioneScavo.getLicenseID());
theRelazioneDiScavo.setPolicy(toPolicy(relazioneScavo.getPolicy())); theRelazioneDiScavo.setPolicy(toPolicy(relazioneScavo.getPolicy()));
//theRelazioneDiScavo.setRecord(recordDV); // theRelazioneDiScavo.setRecord(recordDV);
theRelazioneDiScavo.setResponsabili(relazioneScavo.getResponsabili()); theRelazioneDiScavo.setResponsabili(relazioneScavo.getResponsabili());
theRelazioneDiScavo.setSoggetto(relazioneScavo.getSoggetto()); theRelazioneDiScavo.setSoggetto(relazioneScavo.getSoggetto());
theRelazioneDiScavo.setTitolo(relazioneScavo.getTitolo()); theRelazioneDiScavo.setTitolo(relazioneScavo.getTitolo());
List<PersistedContent> actContent = relazioneScavo.getActualContent(); List<PersistedContent> actContent = relazioneScavo.getActualContent();
if(actContent!=null && actContent.size()>0) { if (actContent != null && actContent.size() > 0) {
List<WorkspaceContentDV> listWsContent = new ArrayList<WorkspaceContentDV>(); List<WorkspaceContentDV> listWsContent = new ArrayList<WorkspaceContentDV>();
for (PersistedContent content : actContent) { for (PersistedContent content : actContent) {
if(content!=null && content instanceof WorkspaceContent) { if (content != null && content instanceof WorkspaceContent) {
listWsContent.add(toWorkspaceContent((WorkspaceContent)content)); listWsContent.add(toWorkspaceContent((WorkspaceContent) content));
} }
} }
theRelazioneDiScavo.setListWsContent(listWsContent); theRelazioneDiScavo.setListWsContent(listWsContent);
@ -360,18 +392,18 @@ public class ConvertToDataViewModel {
theUploadedImageDV.setId(uploadedImage.getId()); theUploadedImageDV.setId(uploadedImage.getId());
theUploadedImageDV.setLicenseID(uploadedImage.getLicenseID()); theUploadedImageDV.setLicenseID(uploadedImage.getLicenseID());
theUploadedImageDV.setPolicy(toPolicy(uploadedImage.getPolicy())); theUploadedImageDV.setPolicy(toPolicy(uploadedImage.getPolicy()));
//theUploadedImageDV.setRecord(recordDV); // theUploadedImageDV.setRecord(recordDV);
theUploadedImageDV.setResponsabili(uploadedImage.getResponsabili()); theUploadedImageDV.setResponsabili(uploadedImage.getResponsabili());
theUploadedImageDV.setSoggetto(uploadedImage.getSoggetto()); theUploadedImageDV.setSoggetto(uploadedImage.getSoggetto());
theUploadedImageDV.setTitolo(uploadedImage.getTitolo()); theUploadedImageDV.setTitolo(uploadedImage.getTitolo());
List<PersistedContent> actContent = uploadedImage.getActualContent(); List<PersistedContent> actContent = uploadedImage.getActualContent();
if(actContent!=null && actContent.size()>0) { if (actContent != null && actContent.size() > 0) {
List<WorkspaceContentDV> listWsContent = new ArrayList<WorkspaceContentDV>(); List<WorkspaceContentDV> listWsContent = new ArrayList<WorkspaceContentDV>();
for (PersistedContent content : actContent) { for (PersistedContent content : actContent) {
if(content!=null && content instanceof WorkspaceContent) { if (content != null && content instanceof WorkspaceContent) {
listWsContent.add(toWorkspaceContent((WorkspaceContent)content)); listWsContent.add(toWorkspaceContent((WorkspaceContent) content));
} }
} }
theUploadedImageDV.setListWsContent(listWsContent); theUploadedImageDV.setListWsContent(listWsContent);
@ -381,14 +413,13 @@ public class ConvertToDataViewModel {
return theUploadedImageDV; return theUploadedImageDV;
} }
/** /**
* To workspace content. * To workspace content.
* *
* @param wContent the w content * @param wContent the w content
* @return the workspace content DV * @return the workspace content DV
*/ */
public static WorkspaceContentDV toWorkspaceContent(WorkspaceContent wContent){ public static WorkspaceContentDV toWorkspaceContent(WorkspaceContent wContent) {
if (wContent == null) if (wContent == null)
return null; return null;
@ -404,15 +435,17 @@ public class ConvertToDataViewModel {
/** /**
* To layer concessione. * To layer concessione.
* *
* @param layerConcessione the layer concessione * @param layerConcessione the layer concessione
* @param refersToBaseConcessione the refers to base concessione
* @return the layer concessione data view * @return the layer concessione data view
*/ */
public static LayerConcessioneDV toLayerConcessione(LayerConcessione layerConcessione) { public static LayerConcessioneDV toLayerConcessione(LayerConcessione layerConcessione,
BaseConcessioneDV refersToBaseConcessione) {
if (layerConcessione == null) if (layerConcessione == null)
return null; return null;
LOG.debug("Converting: "+layerConcessione); LOG.debug("Converting: " + layerConcessione);
LayerConcessioneDV theLayerConessione = new LayerConcessioneDV(); LayerConcessioneDV theLayerConessione = new LayerConcessioneDV();
theLayerConessione.setAbstractSection(layerConcessione.getAbstractSection()); theLayerConessione.setAbstractSection(layerConcessione.getAbstractSection());
@ -420,28 +453,27 @@ public class ConvertToDataViewModel {
String layerName = null; String layerName = null;
BoundsMap bounds = null; BoundsMap bounds = null;
//reading layer name from wmsLink // reading layer name from wmsLink
//string bbox // string bbox
if(wmsLink!=null) { if (wmsLink != null) {
layerName = URLParserUtil.extractValueOfParameterFromURL("layers", wmsLink); layerName = URLParserUtil.extractValueOfParameterFromURL("layers", wmsLink);
String bbox = URLParserUtil.extractValueOfParameterFromURL("bbox", wmsLink); String bbox = URLParserUtil.extractValueOfParameterFromURL("bbox", wmsLink);
String wmsVersion = URLParserUtil.extractValueOfParameterFromURL("version", wmsLink); String wmsVersion = URLParserUtil.extractValueOfParameterFromURL("version", wmsLink);
bounds = toBoundMap(wmsVersion, bbox, ","); bounds = toBoundMap(wmsVersion, bbox, ",");
LOG.debug("Built bounds from wmsLInk: "+bounds); LOG.debug("Built bounds from wmsLInk: " + bounds);
} }
if(layerName!=null) if (layerName != null)
theLayerConessione.setLayerName(layerName); theLayerConessione.setLayerName(layerName);
else else
theLayerConessione.setLayerName(layerConcessione.getLayerName()); theLayerConessione.setLayerName(layerConcessione.getLayerName());
theLayerConessione.setWmsLink(wmsLink); theLayerConessione.setWmsLink(wmsLink);
theLayerConessione.setLayerID(layerConcessione.getLayerID()); theLayerConessione.setLayerID(layerConcessione.getLayerID());
theLayerConessione.setLayerUUID(layerConcessione.getLayerUUID()); theLayerConessione.setLayerUUID(layerConcessione.getLayerUUID());
theLayerConessione.setAuthors(layerConcessione.getAuthors()); theLayerConessione.setAuthors(layerConcessione.getAuthors());
if(bounds==null) if (bounds == null)
bounds = toBoundMap(layerConcessione.getBbox()); bounds = toBoundMap(layerConcessione.getBbox());
theLayerConessione.setBbox(bounds); theLayerConessione.setBbox(bounds);
@ -450,13 +482,13 @@ public class ConvertToDataViewModel {
theLayerConessione.setLicenseID(layerConcessione.getLicenseID()); theLayerConessione.setLicenseID(layerConcessione.getLicenseID());
theLayerConessione.setMetodoRaccoltaDati(layerConcessione.getMetodoRaccoltaDati()); theLayerConessione.setMetodoRaccoltaDati(layerConcessione.getMetodoRaccoltaDati());
theLayerConessione.setPolicy(toPolicy(layerConcessione.getPolicy())); theLayerConessione.setPolicy(toPolicy(layerConcessione.getPolicy()));
//theLayerConessione.setRecord(recordDV); // theLayerConessione.setRecord(recordDV);
theLayerConessione.setScalaAcquisizione(layerConcessione.getScalaAcquisizione()); theLayerConessione.setScalaAcquisizione(layerConcessione.getScalaAcquisizione());
theLayerConessione.setSubTopic(layerConcessione.getSubTopic()); theLayerConessione.setSubTopic(layerConcessione.getSubTopic());
theLayerConessione.setTitolo(layerConcessione.getTitolo()); theLayerConessione.setTitolo(layerConcessione.getTitolo());
theLayerConessione.setTopicCategory(layerConcessione.getTopicCategory()); theLayerConessione.setTopicCategory(layerConcessione.getTopicCategory());
theLayerConessione.setValutazioneQualita(layerConcessione.getValutazioneQualita()); theLayerConessione.setValutazioneQualita(layerConcessione.getValutazioneQualita());
theLayerConessione.setRefersTo(refersToBaseConcessione);
LOG.debug("Returning: " + theLayerConessione); LOG.debug("Returning: " + theLayerConessione);
return theLayerConessione; return theLayerConessione;
@ -479,7 +511,7 @@ public class ConvertToDataViewModel {
theOtherContent.setId(otherContent.getId()); theOtherContent.setId(otherContent.getId());
theOtherContent.setLicenseID(otherContent.getLicenseID()); theOtherContent.setLicenseID(otherContent.getLicenseID());
theOtherContent.setPolicy(toPolicy(otherContent.getPolicy())); theOtherContent.setPolicy(toPolicy(otherContent.getPolicy()));
//theOtherContent.setRecord(recordDV); // theOtherContent.setRecord(recordDV);
theOtherContent.setTitolo(otherContent.getTitolo()); theOtherContent.setTitolo(otherContent.getTitolo());
return theOtherContent; return theOtherContent;
@ -499,13 +531,12 @@ public class ConvertToDataViewModel {
return new BoundsMap(bbox.getMinLong(), bbox.getMinLat(), bbox.getMaxLong(), bbox.getMaxLat(), null); return new BoundsMap(bbox.getMinLong(), bbox.getMinLat(), bbox.getMaxLong(), bbox.getMaxLat(), null);
} }
/** /**
* To bound map. * To bound map.
* *
* @param wmsVersion the wms version * @param wmsVersion the wms version
* @param bbox the bbox * @param bbox the bbox
* @param separator the separator * @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) {
@ -513,25 +544,27 @@ public class ConvertToDataViewModel {
if (bbox == null) if (bbox == null)
return null; return null;
if(wmsVersion==null) if (wmsVersion == null)
return null; return null;
if(separator==null) if (separator == null)
separator = ","; separator = ",";
try { try {
String[] bboxArr = bbox.split(separator); String[] bboxArr = bbox.split(separator);
if(wmsVersion.startsWith("1.3")) { if (wmsVersion.startsWith("1.3")) {
//is 1.3.x // is 1.3.x
return new BoundsMap(toDouble(bboxArr[1]), toDouble(bboxArr[0]), toDouble(bboxArr[3]), toDouble(bboxArr[2]), wmsVersion); return new BoundsMap(toDouble(bboxArr[1]), toDouble(bboxArr[0]), toDouble(bboxArr[3]),
}else { toDouble(bboxArr[2]), wmsVersion);
//should be 1.1.X } else {
return new BoundsMap(toDouble(bboxArr[0]), toDouble(bboxArr[1]), toDouble(bboxArr[2]), toDouble(bboxArr[3]), wmsVersion); // should be 1.1.X
return new BoundsMap(toDouble(bboxArr[0]), toDouble(bboxArr[1]), toDouble(bboxArr[2]),
toDouble(bboxArr[3]), wmsVersion);
} }
}catch (Exception e) { } catch (Exception e) {
LOG.warn("Error on creating Bounds for wmsVersion "+wmsVersion+" and bbox "+bbox+" : ",e); LOG.warn("Error on creating Bounds for wmsVersion " + wmsVersion + " and bbox " + bbox + " : ", e);
return null; return null;
} }
} }
@ -545,11 +578,10 @@ public class ConvertToDataViewModel {
public static Double toDouble(String value) { public static Double toDouble(String value) {
try { try {
return Double.parseDouble(value); return Double.parseDouble(value);
}catch (Exception e) { } catch (Exception e) {
LOG.warn("Error on parsing "+value+" as double: ",e); LOG.warn("Error on parsing " + value + " as double: ", e);
return null; return null;
} }
} }
} }

View File

@ -0,0 +1,83 @@
package org.gcube.application.geoportalcommon.shared.products;
import java.io.Serializable;
import java.util.List;
import org.gcube.application.geoportalcommon.shared.products.model.RecordDV;
/**
* The Class BaseConcessioneDV.
*
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
*
* Sep 9, 2021
*/
public class BaseConcessioneDV extends RecordDV implements Serializable {
/**
*
*/
private static final long serialVersionUID = 8368901256890493525L;
/** The introduzione. */
private String introduzione;
/** The authors. */
private List<String> authors;
/**
* Instantiates a new base concessione DV.
*/
public BaseConcessioneDV() {
}
/**
* Instantiates a new base concessione DV.
*
* @param introduzione the introduzione
* @param authors the authors
*/
public BaseConcessioneDV(String introduzione, List<String> authors) {
this.introduzione = introduzione;
this.authors = authors;
}
/**
* Gets the introduzione.
*
* @return the introduzione
*/
public String getIntroduzione() {
return introduzione;
}
/**
* Gets the authors.
*
* @return the authors
*/
public List<String> getAuthors() {
return authors;
}
/**
* Sets the introduzione.
*
* @param introduzione the new introduzione
*/
public void setIntroduzione(String introduzione) {
this.introduzione = introduzione;
}
/**
* Sets the authors.
*
* @param authors the new authors
*/
public void setAuthors(List<String> authors) {
this.authors = authors;
}
}

View File

@ -8,7 +8,6 @@ import java.util.List;
import org.gcube.application.geoportalcommon.shared.products.content.OtherContentDV; import org.gcube.application.geoportalcommon.shared.products.content.OtherContentDV;
import org.gcube.application.geoportalcommon.shared.products.model.AbstractRelazioneScavoDV; import org.gcube.application.geoportalcommon.shared.products.model.AbstractRelazioneScavoDV;
import org.gcube.application.geoportalcommon.shared.products.model.LayerConcessioneDV; import org.gcube.application.geoportalcommon.shared.products.model.LayerConcessioneDV;
import org.gcube.application.geoportalcommon.shared.products.model.RecordDV;
import org.gcube.application.geoportalcommon.shared.products.model.RelazioneScavoDV; import org.gcube.application.geoportalcommon.shared.products.model.RelazioneScavoDV;
import org.gcube.application.geoportalcommon.shared.products.model.UploadedImageDV; import org.gcube.application.geoportalcommon.shared.products.model.UploadedImageDV;
@ -19,22 +18,16 @@ import org.gcube.application.geoportalcommon.shared.products.model.UploadedImage
* *
* Nov 4, 2020 * Nov 4, 2020
*/ */
public class ConcessioneDV extends RecordDV implements Serializable { public class ConcessioneDV extends BaseConcessioneDV implements Serializable {
/** /**
* *
*/ */
private static final long serialVersionUID = 1387327199157005059L; private static final long serialVersionUID = 1387327199157005059L;
/** The introduzione. */
private String introduzione;
/** The descrizione contenuto. */ /** The descrizione contenuto. */
private String descrizioneContenuto; private String descrizioneContenuto;
/** The authors. */
private List<String> authors;
/** The contributore. */ /** The contributore. */
private String contributore; private String contributore;
@ -105,24 +98,6 @@ public class ConcessioneDV extends RecordDV implements Serializable {
} }
/**
* Gets the introduzione.
*
* @return the introduzione
*/
public String getIntroduzione() {
return introduzione;
}
/**
* Sets the introduzione.
*
* @param introduzione the new introduzione
*/
public void setIntroduzione(String introduzione) {
this.introduzione = introduzione;
}
/** /**
* Gets the descrizione contenuto. * Gets the descrizione contenuto.
* *
@ -141,24 +116,6 @@ public class ConcessioneDV extends RecordDV implements Serializable {
this.descrizioneContenuto = descrizioneContenuto; this.descrizioneContenuto = descrizioneContenuto;
} }
/**
* Gets the authors.
*
* @return the authors
*/
public List<String> getAuthors() {
return authors;
}
/**
* Sets the authors.
*
* @param authors the new authors
*/
public void setAuthors(List<String> authors) {
this.authors = authors;
}
/** /**
* Gets the contributore. * Gets the contributore.
* *
@ -519,7 +476,6 @@ public class ConcessioneDV extends RecordDV implements Serializable {
this.genericContent = genericContent; this.genericContent = genericContent;
} }
/** /**
* Gets the abstract relazione scavo. * Gets the abstract relazione scavo.
* *
@ -541,12 +497,8 @@ public class ConcessioneDV extends RecordDV implements Serializable {
@Override @Override
public String toString() { public String toString() {
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
builder.append("ConcessioneDV [introduzione="); builder.append("ConcessioneDV [descrizioneContenuto=");
builder.append(introduzione);
builder.append(", descrizioneContenuto=");
builder.append(descrizioneContenuto); builder.append(descrizioneContenuto);
builder.append(", authors=");
builder.append(authors);
builder.append(", contributore="); builder.append(", contributore=");
builder.append(contributore); builder.append(contributore);
builder.append(", titolari="); builder.append(", titolari=");

View File

@ -4,8 +4,16 @@ import java.io.Serializable;
import java.util.List; import java.util.List;
import org.gcube.application.geoportalcommon.shared.gis.BoundsMap; import org.gcube.application.geoportalcommon.shared.gis.BoundsMap;
import org.gcube.application.geoportalcommon.shared.products.BaseConcessioneDV;
public class LayerConcessioneDV extends SDILayerDescriptorDV implements Serializable{ /**
* The Class LayerConcessioneDV.
*
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
*
* Sep 9, 2021
*/
public class LayerConcessioneDV extends SDILayerDescriptorDV implements Serializable {
/** /**
* *
@ -35,78 +43,186 @@ public class LayerConcessioneDV extends SDILayerDescriptorDV implements Serializ
private List<String> authors; private List<String> authors;
private BaseConcessioneDV refersTo;
/**
* Instantiates a new layer concessione DV.
*/
public LayerConcessioneDV() { public LayerConcessioneDV() {
} }
/**
* Gets the abstract section.
*
* @return the abstract section
*/
public String getAbstractSection() { public String getAbstractSection() {
return abstractSection; return abstractSection;
} }
/**
* Sets the abstract section.
*
* @param abstractSection the new abstract section
*/
public void setAbstractSection(String abstractSection) { public void setAbstractSection(String abstractSection) {
this.abstractSection = abstractSection; this.abstractSection = abstractSection;
} }
/**
* Gets the topic category.
*
* @return the topic category
*/
public String getTopicCategory() { public String getTopicCategory() {
return topicCategory; return topicCategory;
} }
/**
* Sets the topic category.
*
* @param topicCategory the new topic category
*/
public void setTopicCategory(String topicCategory) { public void setTopicCategory(String topicCategory) {
this.topicCategory = topicCategory; this.topicCategory = topicCategory;
} }
/**
* Gets the sub topic.
*
* @return the sub topic
*/
public String getSubTopic() { public String getSubTopic() {
return subTopic; return subTopic;
} }
/**
* Sets the sub topic.
*
* @param subTopic the new sub topic
*/
public void setSubTopic(String subTopic) { public void setSubTopic(String subTopic) {
this.subTopic = subTopic; this.subTopic = subTopic;
} }
/**
* Gets the bbox.
*
* @return the bbox
*/
public BoundsMap getBbox() { public BoundsMap getBbox() {
return bbox; return bbox;
} }
/**
* Sets the bbox.
*
* @param bbox the new bbox
*/
public void setBbox(BoundsMap bbox) { public void setBbox(BoundsMap bbox) {
this.bbox = bbox; this.bbox = bbox;
} }
/**
* Gets the valutazione qualita.
*
* @return the valutazione qualita
*/
public String getValutazioneQualita() { public String getValutazioneQualita() {
return valutazioneQualita; return valutazioneQualita;
} }
/**
* Sets the valutazione qualita.
*
* @param valutazioneQualita the new valutazione qualita
*/
public void setValutazioneQualita(String valutazioneQualita) { public void setValutazioneQualita(String valutazioneQualita) {
this.valutazioneQualita = valutazioneQualita; this.valutazioneQualita = valutazioneQualita;
} }
/**
* Gets the metodo raccolta dati.
*
* @return the metodo raccolta dati
*/
public String getMetodoRaccoltaDati() { public String getMetodoRaccoltaDati() {
return metodoRaccoltaDati; return metodoRaccoltaDati;
} }
/**
* Sets the metodo raccolta dati.
*
* @param metodoRaccoltaDati the new metodo raccolta dati
*/
public void setMetodoRaccoltaDati(String metodoRaccoltaDati) { public void setMetodoRaccoltaDati(String metodoRaccoltaDati) {
this.metodoRaccoltaDati = metodoRaccoltaDati; this.metodoRaccoltaDati = metodoRaccoltaDati;
} }
/**
* Gets the scala acquisizione.
*
* @return the scala acquisizione
*/
public String getScalaAcquisizione() { public String getScalaAcquisizione() {
return scalaAcquisizione; return scalaAcquisizione;
} }
/**
* Sets the scala acquisizione.
*
* @param scalaAcquisizione the new scala acquisizione
*/
public void setScalaAcquisizione(String scalaAcquisizione) { public void setScalaAcquisizione(String scalaAcquisizione) {
this.scalaAcquisizione = scalaAcquisizione; this.scalaAcquisizione = scalaAcquisizione;
} }
/**
* Gets the authors.
*
* @return the authors
*/
public List<String> getAuthors() { public List<String> getAuthors() {
return authors; return authors;
} }
/**
* Sets the authors.
*
* @param authors the new authors
*/
public void setAuthors(List<String> authors) { public void setAuthors(List<String> authors) {
this.authors = authors; this.authors = authors;
} }
/**
* Gets the refers to.
*
* @return the refers to
*/
public BaseConcessioneDV getRefersTo() {
return refersTo;
}
/**
* Sets the refers to.
*
* @param refersTo the new refers to
*/
public void setRefersTo(BaseConcessioneDV refersTo) {
this.refersTo = refersTo;
}
/**
* To string.
*
* @return the string
*/
@Override @Override
public String toString() { public String toString() {
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
builder.append("LayerConcessione [abstractSection="); builder.append("LayerConcessioneDV [abstractSection=");
builder.append(abstractSection); builder.append(abstractSection);
builder.append(", topicCategory="); builder.append(", topicCategory=");
builder.append(topicCategory); builder.append(topicCategory);
@ -122,10 +238,8 @@ public class LayerConcessioneDV extends SDILayerDescriptorDV implements Serializ
builder.append(scalaAcquisizione); builder.append(scalaAcquisizione);
builder.append(", authors="); builder.append(", authors=");
builder.append(authors); builder.append(authors);
builder.append(", wmsLink="); builder.append(", refersTo=");
builder.append(super.getWmsLink()); builder.append(refersTo);
builder.append(", layerName=");
builder.append(super.getLayerName());
builder.append("]"); builder.append("]");
return builder.toString(); return builder.toString();
} }