diff --git a/.settings/org.eclipse.wst.common.component b/.settings/org.eclipse.wst.common.component index cb5059f..3d4530c 100644 --- a/.settings/org.eclipse.wst.common.component +++ b/.settings/org.eclipse.wst.common.component @@ -1,5 +1,6 @@ - + + @@ -8,7 +9,8 @@ - + + @@ -17,7 +19,8 @@ - + + @@ -26,7 +29,8 @@ - + + @@ -35,7 +39,8 @@ - + + @@ -44,7 +49,8 @@ - + + @@ -53,10 +59,8 @@ - - uses - - + + @@ -65,14 +69,16 @@ - + + - + + @@ -81,7 +87,8 @@ - + + diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/server/ConvertToServiceModel.java b/src/main/java/org/gcube/portlets/user/geoportaldataentry/server/ConvertToServiceModel.java index fd4e676..5b36f68 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataentry/server/ConvertToServiceModel.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataentry/server/ConvertToServiceModel.java @@ -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> mapFields = gdb.getFormDataEntryFields(); @@ -125,13 +119,15 @@ public class ConvertToServiceModel { } List paroleChiaveLibereLst = mapFields.get("Parola chiave a scelta libera"); + //LOG.debug("Parola chiave a scelta libera: "+paroleChiaveLibereLst); if(paroleChiaveLibereLst!=null){ concessione.setParoleChiaveLibere(paroleChiaveLibereLst); } - List setParoleChiaveICCDLst = mapFields.get("Parola chiave relativa alla cronologia"); - if(setParoleChiaveICCDLst!=null){ - concessione.setParoleChiaveICCD(paroleChiaveLibereLst); + List paroleChiaveICCDLst = mapFields.get("Parola chiave relativa alla cronologia"); + //LOG.debug("Parola chiave relativa alla cronologia: "+paroleChiaveICCDLst); + if(paroleChiaveICCDLst!=null){ + concessione.setParoleChiaveICCD(paroleChiaveICCDLst); } List risorsaCorrelataLst = mapFields.get("Risorsa correlata"); @@ -164,6 +160,26 @@ public class ConvertToServiceModel { concessione.setTitolari(titolareDatiLst); } + List 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 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; } diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/server/GeoportalDataEntryServiceImpl.java b/src/main/java/org/gcube/portlets/user/geoportaldataentry/server/GeoportalDataEntryServiceImpl.java index 27073d1..525660e 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataentry/server/GeoportalDataEntryServiceImpl.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataentry/server/GeoportalDataEntryServiceImpl.java @@ -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);