bug fixes: convert to long, lat and keywords

This commit is contained in:
francesco 2020-10-27 11:33:45 +01:00
parent 228023129d
commit 9375b517a0
3 changed files with 50 additions and 31 deletions

View File

@ -7,6 +7,7 @@
<wb-module deploy-name="geoportal-data-entry-app-1.0.0-SNAPSHOT">
@ -16,6 +17,7 @@
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
@ -25,6 +27,7 @@
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
@ -34,6 +37,7 @@
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
@ -43,6 +47,7 @@
<wb-resource deploy-path="/WEB-INF/classes" source-path="/target/generated-sources/gwt"/>
@ -52,10 +57,9 @@
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
<dependent-module archiveName="metadata-profile-form-builder-widget-1.0.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/metadata-profile-form-builder-widget/metadata-profile-form-builder-widget">
<dependency-type>uses</dependency-type>
</dependent-module>
@ -71,6 +75,7 @@
<property name="context-root" value="geoportal-data-entry-app"/>
@ -80,6 +85,7 @@
</wb-module>
@ -89,4 +95,5 @@
</project-modules>

View File

@ -38,21 +38,15 @@ public class ConvertToServiceModel {
public static final String TIME_FORMAT = ConstantsGeoPortalDataEntryApp.TIME_FORMAT;
// public static final String DATE_FORMAT = "yyyy-MM-dd";
//
// public static final String HOURS_MINUTES_SEPARATOR = ":";
//
// public static final String TIME_FORMAT = "HH"+HOURS_MINUTES_SEPARATOR+"mm";
/**
* To concessione.
*
* @param gdb the gdb
* @param user the user
* @return the concessione
* @throws Exception
*/
public static Concessione toConcessione(GenericDatasetBean gdb, GCubeUser user) {
public static Concessione toConcessione(GenericDatasetBean gdb, GCubeUser user) throws Exception {
Map<String, List<String>> mapFields = gdb.getFormDataEntryFields();
@ -125,13 +119,15 @@ public class ConvertToServiceModel {
}
List<String> paroleChiaveLibereLst = mapFields.get("Parola chiave a scelta libera");
//LOG.debug("Parola chiave a scelta libera: "+paroleChiaveLibereLst);
if(paroleChiaveLibereLst!=null){
concessione.setParoleChiaveLibere(paroleChiaveLibereLst);
}
List<String> setParoleChiaveICCDLst = mapFields.get("Parola chiave relativa alla cronologia");
if(setParoleChiaveICCDLst!=null){
concessione.setParoleChiaveICCD(paroleChiaveLibereLst);
List<String> paroleChiaveICCDLst = mapFields.get("Parola chiave relativa alla cronologia");
//LOG.debug("Parola chiave relativa alla cronologia: "+paroleChiaveICCDLst);
if(paroleChiaveICCDLst!=null){
concessione.setParoleChiaveICCD(paroleChiaveICCDLst);
}
List<String> risorsaCorrelataLst = mapFields.get("Risorsa correlata");
@ -164,6 +160,26 @@ public class ConvertToServiceModel {
concessione.setTitolari(titolareDatiLst);
}
List<String> latList = mapFields.get("Latitudine Centroide");
if(latList!=null){
try {
Double centroidLat = Double.parseDouble(latList.get(0));
concessione.setCentroidLat(centroidLat);
}catch (Exception e) {
throw new Exception("Unable to parse "+latList.get(0)+" as valid latitude");
}
}
List<String> longList = mapFields.get("Longitudine Centroide");
if(longList!=null){
try {
Double centroidLong = Double.parseDouble(longList.get(0));
concessione.setCentroidLong(centroidLong);
}catch (Exception e) {
throw new Exception("Unable to parse "+longList.get(0)+" as valid longitude");
}
}
return concessione;
}

View File

@ -91,7 +91,7 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
LOG.debug("\n\n");
LOG.debug(ConcessioniFormCardTitle.RELAZIONE_DI_SCAVO+" building with client obj: "+rds);
RelazioneScavo relazioneDiScavo = ConvertToServiceModel.toRelazioneScavo(rds);
LOG.debug("Built "+ConcessioniFormCardTitle.INFORMAZIONI_DI_PROGETTO+" as server obj: "+relazioneDiScavo);
LOG.debug("Built "+ConcessioniFormCardTitle.RELAZIONE_DI_SCAVO+" as server obj: "+relazioneDiScavo);
//Should be only one
for (FileUploaded fileUploaded : rds.getFilesUploaded()) {
FileInputStream fis = new FileInputStream(fileUploaded.getTempSystemPath());
@ -168,10 +168,6 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
//If true -> data are published into the SDI
Boolean publish=true;
/*Chiedo al manager di salvare il progetto, causando :
*scrittura sul WS
*pubblicazione sull'SDI (boolean publish)
*scrittura sul DB di applicazione sia dei meta che dei vari link */
Concessione registered=manager.commit(publish);
LOG.info("Registered: "+registered);