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

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
@ -8,7 +9,8 @@
<wb-module deploy-name="geoportal-data-entry-app-1.0.0-SNAPSHOT">
@ -17,7 +19,8 @@
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
@ -26,7 +29,8 @@
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
@ -35,7 +39,8 @@
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
@ -44,7 +49,8 @@
<wb-resource deploy-path="/WEB-INF/classes" source-path="/target/generated-sources/gwt"/>
@ -53,10 +59,8 @@
<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>
@ -65,14 +69,16 @@
<property name="java-output-path" value="/geoportal-data-entry-app/target/geoportal-data-entry-app-1.0.0-SNAPSHOT/WEB-INF/classes"/>
<property name="context-root" value="geoportal-data-entry-app"/>
@ -81,7 +87,8 @@
</wb-module>

View File

@ -37,13 +37,6 @@ public class ConvertToServiceModel {
public static final String DATE_FORMAT = ConstantsGeoPortalDataEntryApp.DATE_FORMAT;
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.
@ -51,8 +44,9 @@ public class ConvertToServiceModel {
* @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());
@ -164,14 +164,10 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
}
try {
//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);