From 6c23c0d1a125b441b78b09479cdbf9e881ab0488 Mon Sep 17 00:00:00 2001 From: francesco Date: Tue, 3 Nov 2020 13:09:08 +0100 Subject: [PATCH] in progress to show the page with details --- .../com.gwtplugins.gdt.eclipse.core.prefs | 2 +- pom.xml | 52 +++++---- .../client/GeoportalDataViewer.java | 52 ++++++++- .../client/GeoportalDataViewerService.java | 5 +- .../GeoportalDataViewerServiceAsync.java | 5 +- .../client/LayerManager.java | 29 ++++- .../client/events/ShowDetailsEvent.java | 58 ++++++++++ .../events/ShowDetailsEventHandler.java | 21 ++++ .../client/ui/GeonaDataViewMainPanel.java | 20 +++- .../client/ui/GeonaDataViewMainPanel.ui.xml | 2 +- .../server/ConvertToDataViewModel.java | 83 ++++++++------ .../GeoportalDataViewerServiceImpl.java | 14 +-- .../server/gis/FeatureParser.java | 4 +- .../server/util/SessionUtil.java | 106 ++++++++++++++++++ .../shared/GeoNaDataObject.java | 8 +- .../shared/ProductType.java | 7 ++ .../shared/gis/LayerItem.java | 3 + .../shared/gis/{ => wfs}/FeatureGeometry.java | 2 +- .../shared/{ => gis/wfs}/FeatureRow.java | 4 +- .../GeoInformationForWMSRequest.java | 2 +- .../shared/gis/{ => wms}/Property.java | 2 +- .../shared/gis/{ => wms}/Styles.java | 2 +- .../shared/gis/{ => wms}/ZAxis.java | 2 +- .../shared/products/ConcessioneDV.java | 13 +-- .../products/content/AssociatedContentDV.java | 9 +- .../shared/products/model/RecordDV.java | 13 +-- 26 files changed, 413 insertions(+), 107 deletions(-) create mode 100644 src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/events/ShowDetailsEvent.java create mode 100644 src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/events/ShowDetailsEventHandler.java create mode 100644 src/main/java/org/gcube/portlets/user/geoportaldataviewer/server/util/SessionUtil.java create mode 100644 src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/ProductType.java rename src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/gis/{ => wfs}/FeatureGeometry.java (93%) rename src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/{ => gis/wfs}/FeatureRow.java (91%) rename src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/gis/{ => wms}/GeoInformationForWMSRequest.java (98%) rename src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/gis/{ => wms}/Property.java (97%) rename src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/gis/{ => wms}/Styles.java (96%) rename src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/gis/{ => wms}/ZAxis.java (96%) diff --git a/.settings/com.gwtplugins.gdt.eclipse.core.prefs b/.settings/com.gwtplugins.gdt.eclipse.core.prefs index d16c112..ff5aa39 100644 --- a/.settings/com.gwtplugins.gdt.eclipse.core.prefs +++ b/.settings/com.gwtplugins.gdt.eclipse.core.prefs @@ -1,4 +1,4 @@ eclipse.preferences.version=1 -lastWarOutDir=/home/francesco-mangiacrapa/git/geoportal-data-viewer-app/target/geoportal-data-viewer-app-1.0.0-SNAPSHOT +lastWarOutDir=/home/francesco/git/geoportal-data-viewer-app/target/geoportal-data-viewer-app-1.0.0-SNAPSHOT warSrcDir=src/main/webapp warSrcDirIsOutput=false diff --git a/pom.xml b/pom.xml index dd1eaa5..0fc54bc 100644 --- a/pom.xml +++ b/pom.xml @@ -49,29 +49,29 @@ - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -115,6 +115,12 @@ [2.4.1,3.0.0-SNAPSHOT) provided + + org.gcube.dvos + usermanagement-core + [2.4.1,3.0.0-SNAPSHOT) + provided + org.gcube.application geoportal-logic diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/GeoportalDataViewer.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/GeoportalDataViewer.java index 3e7bb51..d6b1abd 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/GeoportalDataViewer.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/GeoportalDataViewer.java @@ -1,8 +1,15 @@ package org.gcube.portlets.user.geoportaldataviewer.client; +import java.util.List; + +import org.gcube.portlets.user.geoportaldataviewer.client.events.ShowDetailsEvent; +import org.gcube.portlets.user.geoportaldataviewer.client.events.ShowDetailsEventHandler; import org.gcube.portlets.user.geoportaldataviewer.client.gis.OpenLayerOSM; import org.gcube.portlets.user.geoportaldataviewer.client.ui.GeonaDataViewMainPanel; import org.gcube.portlets.user.geoportaldataviewer.client.util.URLUtil; +import org.gcube.portlets.user.geoportaldataviewer.shared.ProductType; +import org.gcube.portlets.user.geoportaldataviewer.shared.gis.wfs.FeatureRow; +import org.gcube.portlets.user.geoportaldataviewer.shared.products.ConcessioneDV; import com.google.gwt.core.client.EntryPoint; import com.google.gwt.core.client.GWT; @@ -10,7 +17,9 @@ import com.google.gwt.core.client.Scheduler; import com.google.gwt.core.client.Scheduler.ScheduledCommand; import com.google.gwt.event.logical.shared.ResizeEvent; import com.google.gwt.event.logical.shared.ResizeHandler; +import com.google.gwt.event.shared.HandlerManager; import com.google.gwt.user.client.Window; +import com.google.gwt.user.client.rpc.AsyncCallback; import com.google.gwt.user.client.ui.RootPanel; // TODO: Auto-generated Javadoc @@ -47,8 +56,10 @@ public class GeoportalDataViewer implements EntryPoint { /** The param layer title. */ private String paramLayerTitle; + private HandlerManager eventBus = new HandlerManager(""); + /** The layer manager. */ - private LayerManager layerManager = new LayerManager(); + private LayerManager layerManager = new LayerManager(eventBus); //https://data.d4science.org/gis-viewer-app/?wmsrequest=https%3A%2F%2Fgeona-proto.d4science.org%2Fgeoserver%2Fconcessioni_conf%2Fwms%3Fservice%3DWMS%26version%3D1.1.0%26request%3DGetMap%26layers%3Dconcessioni_conf%3Acentroids_concessioni%26styles%3D%26bbox%3D8.476%2C39.179%2C17.391%2C45.772%26width%3D768%26height%3D567%26srs%3DEPSG%3A4326%26format%3Dapplication%2Fopenlayers&zoom=6¢ermap=12.45%2C42.98 @@ -57,7 +68,7 @@ public class GeoportalDataViewer implements EntryPoint { */ public void onModuleLoad() { - mainPanel = new GeonaDataViewMainPanel(); + mainPanel = new GeonaDataViewMainPanel(eventBus); RootPanel.get(APP_DIV).add(mainPanel); @@ -118,6 +129,43 @@ public class GeoportalDataViewer implements EntryPoint { } } + bindEvents(); + } + + private void bindEvents() { + eventBus.addHandler(ShowDetailsEvent.TYPE, new ShowDetailsEventHandler() { + + @Override + public void onShowDetails(ShowDetailsEvent showDetailsEvent) { + FeatureRow fRow = showDetailsEvent.getFeatureRow(); + if(fRow!=null) { + if(showDetailsEvent.getProductType().equals(ProductType.CONCESSIONE)) { + List productIds = fRow.getMapProperties().get("product_id"); + if(productIds!=null && productIds.size()>0) { + long id = Long.parseLong(productIds.get(0)); + GeoportalDataViewerServiceAsync.Util.getInstance().getConcessioneForId(id, new AsyncCallback() { + + @Override + public void onFailure(Throwable caught) { + // TODO Auto-generated method stub + + } + + @Override + public void onSuccess(ConcessioneDV result) { + mainPanel.addNewTab(result); + + } + }); + }else + Window.alert("No product id found"); + + } + } + + } + }); + } } diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/GeoportalDataViewerService.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/GeoportalDataViewerService.java index 7614141..bbd5125 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/GeoportalDataViewerService.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/GeoportalDataViewerService.java @@ -4,8 +4,9 @@ import java.util.List; import org.gcube.portlets.user.geoportaldataviewer.shared.GeoNaDataObject; import org.gcube.portlets.user.geoportaldataviewer.shared.gis.BoundsMap; -import org.gcube.portlets.user.geoportaldataviewer.shared.gis.GeoInformationForWMSRequest; import org.gcube.portlets.user.geoportaldataviewer.shared.gis.LayerItem; +import org.gcube.portlets.user.geoportaldataviewer.shared.gis.wms.GeoInformationForWMSRequest; +import org.gcube.portlets.user.geoportaldataviewer.shared.products.ConcessioneDV; import com.google.gwt.user.client.rpc.RemoteService; import com.google.gwt.user.client.rpc.RemoteServiceRelativePath; @@ -21,4 +22,6 @@ public interface GeoportalDataViewerService extends RemoteService { List getDataResult(List layerItems, String mapSrsName, BoundsMap mapBBOX, int maxWFSFeature, double zoomLevel); + ConcessioneDV getConcessioneForId(Long id) throws Exception; + } diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/GeoportalDataViewerServiceAsync.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/GeoportalDataViewerServiceAsync.java index e0a1dd7..6839acb 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/GeoportalDataViewerServiceAsync.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/GeoportalDataViewerServiceAsync.java @@ -4,8 +4,9 @@ import java.util.List; import org.gcube.portlets.user.geoportaldataviewer.shared.GeoNaDataObject; import org.gcube.portlets.user.geoportaldataviewer.shared.gis.BoundsMap; -import org.gcube.portlets.user.geoportaldataviewer.shared.gis.GeoInformationForWMSRequest; import org.gcube.portlets.user.geoportaldataviewer.shared.gis.LayerItem; +import org.gcube.portlets.user.geoportaldataviewer.shared.gis.wms.GeoInformationForWMSRequest; +import org.gcube.portlets.user.geoportaldataviewer.shared.products.ConcessioneDV; import com.google.gwt.core.client.GWT; import com.google.gwt.user.client.rpc.AsyncCallback; @@ -33,4 +34,6 @@ public interface GeoportalDataViewerServiceAsync { void getDataResult(List layerItems, String mapSrsName, BoundsMap mapBBOX, int maxWFSFeature, double zoomLevel, AsyncCallback> callback); + + void getConcessioneForId(Long id, AsyncCallback callback); } diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/LayerManager.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/LayerManager.java index 46d409b..83da54a 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/LayerManager.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/LayerManager.java @@ -8,17 +8,23 @@ import java.util.Map; import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants.LayerType; import org.gcube.portlets.user.geoportaldataviewer.client.events.QueryDataEvent; import org.gcube.portlets.user.geoportaldataviewer.client.events.QueryDataEventHandler; +import org.gcube.portlets.user.geoportaldataviewer.client.events.ShowDetailsEvent; import org.gcube.portlets.user.geoportaldataviewer.client.gis.OpenLayerOSM; import org.gcube.portlets.user.geoportaldataviewer.client.util.URLUtil; -import org.gcube.portlets.user.geoportaldataviewer.shared.FeatureRow; import org.gcube.portlets.user.geoportaldataviewer.shared.GeoNaDataObject; +import org.gcube.portlets.user.geoportaldataviewer.shared.ProductType; import org.gcube.portlets.user.geoportaldataviewer.shared.gis.BoundsMap; -import org.gcube.portlets.user.geoportaldataviewer.shared.gis.GeoInformationForWMSRequest; import org.gcube.portlets.user.geoportaldataviewer.shared.gis.GeoQuery; import org.gcube.portlets.user.geoportaldataviewer.shared.gis.LayerItem; -import org.gcube.portlets.user.geoportaldataviewer.shared.gis.ZAxis; +import org.gcube.portlets.user.geoportaldataviewer.shared.gis.wfs.FeatureRow; +import org.gcube.portlets.user.geoportaldataviewer.shared.gis.wms.GeoInformationForWMSRequest; +import org.gcube.portlets.user.geoportaldataviewer.shared.gis.wms.ZAxis; +import com.github.gwtbootstrap.client.ui.Button; +import com.github.gwtbootstrap.client.ui.constants.ButtonType; import com.google.gwt.core.client.GWT; +import com.google.gwt.event.dom.client.ClickEvent; +import com.google.gwt.event.dom.client.ClickHandler; import com.google.gwt.event.shared.HandlerManager; import com.google.gwt.user.client.Window; import com.google.gwt.user.client.rpc.AsyncCallback; @@ -45,10 +51,14 @@ public class LayerManager { private HandlerManager eventBus = new HandlerManager(""); + private HandlerManager applicationBus; + /** * Instantiates a new layer manager. + * @param applicationBus */ - public LayerManager() { + public LayerManager(HandlerManager applicationBus) { + this.applicationBus = applicationBus; bindEvents(); } @@ -137,6 +147,17 @@ public class LayerManager { flex.setHTML(2, 0, new HTML(""+entries.get(key).get(0)).toString()+""); } } + Button button = new Button("Open Details"); + button.setType(ButtonType.LINK); + button.addClickHandler(new ClickHandler() { + + @Override + public void onClick(ClickEvent event) { + applicationBus.fireEvent(new ShowDetailsEvent(ProductType.CONCESSIONE, features.get(0))); + + } + }); + flex.add(button); featureFound = true; break; //Only the first one } diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/events/ShowDetailsEvent.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/events/ShowDetailsEvent.java new file mode 100644 index 0000000..124160c --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/events/ShowDetailsEvent.java @@ -0,0 +1,58 @@ +package org.gcube.portlets.user.geoportaldataviewer.client.events; + +import org.gcube.portlets.user.geoportaldataviewer.shared.ProductType; +import org.gcube.portlets.user.geoportaldataviewer.shared.gis.wfs.FeatureRow; + +import com.google.gwt.event.shared.GwtEvent; + +/** + * The Class QueryDataEvent. + * + * @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it) + * + * Oct 29, 2020 + */ +public class ShowDetailsEvent extends GwtEvent { + public static Type TYPE = new Type(); + private ProductType productType; + private FeatureRow featureRow; + + /** + * Instantiates a new table row selected event. + * @param coordinate + */ + public ShowDetailsEvent(ProductType productType, FeatureRow row) { + this.productType = productType; + this.featureRow = row; + + } + + /** + * Gets the associated type. + * + * @return the associated type + */ + @Override + public Type getAssociatedType() { + return TYPE; + } + + /** + * Dispatch. + * + * @param handler the handler + */ + @Override + protected void dispatch(ShowDetailsEventHandler handler) { + handler.onShowDetails(this); + + } + + public ProductType getProductType() { + return productType; + } + + public FeatureRow getFeatureRow() { + return featureRow; + } +} \ No newline at end of file diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/events/ShowDetailsEventHandler.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/events/ShowDetailsEventHandler.java new file mode 100644 index 0000000..4a6fd28 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/events/ShowDetailsEventHandler.java @@ -0,0 +1,21 @@ +package org.gcube.portlets.user.geoportaldataviewer.client.events; + +import com.google.gwt.event.shared.EventHandler; + +/** + * The Interface ShowDetailsEventHandler. + * + * @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it) + * + * Nov 3, 2020 + */ +public interface ShowDetailsEventHandler extends EventHandler { + + + /** + * On show details. + * + * @param showDetailsEvent the show details event + */ + void onShowDetails(ShowDetailsEvent showDetailsEvent); +} diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/GeonaDataViewMainPanel.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/GeonaDataViewMainPanel.java index 60a80bf..10884de 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/GeonaDataViewMainPanel.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/GeonaDataViewMainPanel.java @@ -1,17 +1,21 @@ package org.gcube.portlets.user.geoportaldataviewer.client.ui; import org.gcube.portlets.user.geoportaldataviewer.client.gis.OpenLayerOSM; +import org.gcube.portlets.user.geoportaldataviewer.shared.products.ConcessioneDV; import com.github.gwtbootstrap.client.ui.Button; import com.github.gwtbootstrap.client.ui.NavLink; import com.github.gwtbootstrap.client.ui.Tab; +import com.github.gwtbootstrap.client.ui.TabPanel; import com.github.gwtbootstrap.client.ui.constants.IconType; import com.google.gwt.core.client.GWT; import com.google.gwt.event.dom.client.ClickEvent; import com.google.gwt.event.dom.client.ClickHandler; +import com.google.gwt.event.shared.HandlerManager; import com.google.gwt.uibinder.client.UiBinder; import com.google.gwt.uibinder.client.UiField; import com.google.gwt.user.client.ui.Composite; +import com.google.gwt.user.client.ui.HTML; import com.google.gwt.user.client.ui.Widget; public class GeonaDataViewMainPanel extends Composite { @@ -32,6 +36,9 @@ public class GeonaDataViewMainPanel extends Composite { @UiField Button removeQuery; + + @UiField + TabPanel mainTabPanel; // @UiField // ButtonGroup buttonGroup; @@ -40,8 +47,11 @@ public class GeonaDataViewMainPanel extends Composite { private OpenLayerOSM map; - public GeonaDataViewMainPanel() { + private HandlerManager eventBus; + + public GeonaDataViewMainPanel(HandlerManager eventBus) { initWidget(uiBinder.createAndBindUi(this)); + this.eventBus = eventBus; mapPanel = new MapPanel("600px"); mapTabPanel.add(mapPanel); bindHandlers(); @@ -105,5 +115,13 @@ public class GeonaDataViewMainPanel extends Composite { }); } + + public void addNewTab(ConcessioneDV cdv) { + Tab tab = new Tab(); + String nome = cdv.getNome(); + tab.setHeading(nome); + + tab.add(new HTML(cdv.toString())); + } } diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/GeonaDataViewMainPanel.ui.xml b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/GeonaDataViewMainPanel.ui.xml index a1b0f1d..209440c 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/GeonaDataViewMainPanel.ui.xml +++ b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/GeonaDataViewMainPanel.ui.xml @@ -15,7 +15,7 @@ Data Point Selection - Data Box + Data Box Selection diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/server/ConvertToDataViewModel.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/server/ConvertToDataViewModel.java index adc8aba..86ab56a 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/server/ConvertToDataViewModel.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/server/ConvertToDataViewModel.java @@ -1,5 +1,7 @@ package org.gcube.portlets.user.geoportaldataviewer.server; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatterBuilder; import java.util.ArrayList; import java.util.List; @@ -31,6 +33,15 @@ public class ConvertToDataViewModel { /** The Constant LOG. */ private static final Logger LOG = LoggerFactory.getLogger(ConvertToDataViewModel.class); + 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"; + + public static final DateTimeFormatterBuilder dtf = new DateTimeFormatterBuilder() + .appendPattern(DATE_FORMAT + " " + TIME_FORMAT); + /** * To concessione. * @@ -38,68 +49,70 @@ public class ConvertToDataViewModel { * @return the concessione * @throws Exception the exception */ - public static ConcessioneDV toConcessione( - Concessione concessione) throws Exception { - - if(concessione==null) + public static ConcessioneDV toConcessione(Concessione concessione) throws Exception { + + if (concessione == null) return null; - + ConcessioneDV theConcessione = new ConcessioneDV(); theConcessione.setAccesso(concessione.getAccesso().name()); theConcessione.setAuthors(concessione.getAuthors()); theConcessione.setCentroidLat(concessione.getCentroidLat()); theConcessione.setCentroidLong(concessione.getCentroidLong()); theConcessione.setContributore(concessione.getContributore()); - theConcessione.setCreationTime(concessione.getCreationTime()); - theConcessione.setCreationUser(concessione.getCreationUser()); - theConcessione.setDataFineProgetto(concessione.getDataFineProgetto()); - theConcessione.setDataInizioProgetto(concessione.getDataInizioProgetto()); + theConcessione.setCreationTime(toDateString(concessione.getCreationTime())); + theConcessione.setCreationUser(concessione.getCreationUser().toString()); + theConcessione.setDataFineProgetto(toDateString(concessione.getDataFineProgetto())); + theConcessione.setDataInizioProgetto(toDateString(concessione.getDataInizioProgetto())); theConcessione.setDescrizioneContenuto(concessione.getDescrizioneContenuto()); theConcessione.setEditore(concessione.getEditore()); theConcessione.setFontiFinanziamento(concessione.getFontiFinanziamento()); theConcessione.setId(concessione.getId()); - - if(concessione.getGenericContent()!=null){ - List otherContentsDV = new ArrayList(concessione.getGenericContent().size()); + + if (concessione.getGenericContent() != null) { + List otherContentsDV = new ArrayList( + concessione.getGenericContent().size()); for (OtherContent gc : concessione.getGenericContent()) { otherContentsDV.add(toOtherContentDV(gc, theConcessione)); } theConcessione.setGenericContent(otherContentsDV); } - if(concessione.getImmaginiRappresentative()!=null){ - List uploadedImagesDV = new ArrayList(concessione.getImmaginiRappresentative().size()); + if (concessione.getImmaginiRappresentative() != null) { + List uploadedImagesDV = new ArrayList( + concessione.getImmaginiRappresentative().size()); for (UploadedImage ui : concessione.getImmaginiRappresentative()) { uploadedImagesDV.add(toUploadedImage(ui, theConcessione)); } theConcessione.setImmaginiRappresentative(uploadedImagesDV); } - + theConcessione.setIntroduzione(concessione.getIntroduzione()); - theConcessione.setLastUpdateTime(concessione.getLastUpdateTime()); + theConcessione.setLastUpdateTime(toDateString(concessione.getLastUpdateTime())); theConcessione.setLastUpdateUser(concessione.getLastUpdateUser()); theConcessione.setLicenzaID(concessione.getLicenzaID()); theConcessione.setNome(concessione.getNome()); theConcessione.setParoleChiaveICCD(concessione.getParoleChiaveICCD()); theConcessione.setParoleChiaveLibere(concessione.getParoleChiaveLibere()); - - if(concessione.getPianteFineScavo()!=null){ - List piantaScavoDV = new ArrayList(concessione.getPianteFineScavo().size()); + + if (concessione.getPianteFineScavo() != null) { + List piantaScavoDV = new ArrayList( + concessione.getPianteFineScavo().size()); for (LayerConcessione lc : concessione.getPianteFineScavo()) { piantaScavoDV.add(toLayerConcessione(lc, theConcessione)); } theConcessione.setPianteFineScavo(piantaScavoDV); } - - if(concessione.getPosizionamentoScavo()!=null){ + + if (concessione.getPosizionamentoScavo() != null) { LayerConcessioneDV thePosizScavo = toLayerConcessione(concessione.getPosizionamentoScavo(), theConcessione); theConcessione.setPosizionamentoScavo(thePosizScavo); } - + theConcessione.setRecordType(concessione.getRecordType().name()); - + theConcessione.setRelazioneScavo(toRelazioneScavo(concessione.getRelazioneScavo(), theConcessione)); - + theConcessione.setResponsabile(concessione.getResponsabile()); theConcessione.setRisorseCorrelate(concessione.getRisorseCorrelate()); theConcessione.setSoggetto(concessione.getSoggetto()); @@ -107,12 +120,16 @@ public class ConvertToDataViewModel { theConcessione.setTitolareLicenza(concessione.getTitolareLicenza()); theConcessione.setTitolari(concessione.getTitolari()); theConcessione.setVersion(concessione.getVersion()); - - LOG.debug("Returning concessione: "+theConcessione); + + LOG.debug("Returning concessione: " + theConcessione); return theConcessione; } + private static String toDateString(LocalDateTime dateTime) { + return dateTime.toString(); + } + /** * To relazione scavo. * @@ -127,7 +144,7 @@ public class ConvertToDataViewModel { RelazioneScavoDV theRelazioneDiScavo = new RelazioneScavoDV(); theRelazioneDiScavo.setAbstractSection(relazioneScavo.getAbstractSection()); - theRelazioneDiScavo.setCreationTime(relazioneScavo.getCreationTime()); + theRelazioneDiScavo.setCreationTime(toDateString(relazioneScavo.getCreationTime())); theRelazioneDiScavo.setId(relazioneScavo.getId()); theRelazioneDiScavo.setLicenseID(relazioneScavo.getLicenseID()); theRelazioneDiScavo.setPolicy(relazioneScavo.getPolicy().name()); @@ -136,7 +153,7 @@ public class ConvertToDataViewModel { theRelazioneDiScavo.setSoggetto(relazioneScavo.getSoggetto()); theRelazioneDiScavo.setTitolo(relazioneScavo.getTitolo()); - LOG.debug("Returning: "+theRelazioneDiScavo); + LOG.debug("Returning: " + theRelazioneDiScavo); return theRelazioneDiScavo; } @@ -153,7 +170,7 @@ public class ConvertToDataViewModel { return null; UploadedImageDV theUploadedImageDV = new UploadedImageDV(); - theUploadedImageDV.setCreationTime(uploadedImage.getCreationTime()); + theUploadedImageDV.setCreationTime(toDateString(uploadedImage.getCreationTime())); theUploadedImageDV.setDidascalia(uploadedImage.getDidascalia()); theUploadedImageDV.setFormat(uploadedImage.getFormat()); theUploadedImageDV.setId(uploadedImage.getId()); @@ -164,7 +181,7 @@ public class ConvertToDataViewModel { theUploadedImageDV.setSoggetto(uploadedImage.getSoggetto()); theUploadedImageDV.setTitolo(uploadedImage.getTitolo()); - LOG.debug("Returning: "+theUploadedImageDV); + LOG.debug("Returning: " + theUploadedImageDV); return theUploadedImageDV; } @@ -188,7 +205,7 @@ public class ConvertToDataViewModel { theLayerConessione.setAuthors(layerConcessione.getAuthors()); BoundsMap bounds = toBoundMap(layerConcessione.getBbox()); theLayerConessione.setBbox(bounds); - theLayerConessione.setCreationTime(layerConcessione.getCreationTime()); + theLayerConessione.setCreationTime(toDateString(layerConcessione.getCreationTime())); theLayerConessione.setId(layerConcessione.getId()); theLayerConessione.setLicenseID(layerConcessione.getLicenseID()); theLayerConessione.setMetodoRaccoltaDati(layerConcessione.getMetodoRaccoltaDati()); @@ -201,7 +218,7 @@ public class ConvertToDataViewModel { theLayerConessione.setValutazioneQualita(layerConcessione.getValutazioneQualita()); theLayerConessione.setWmsLink(layerConcessione.getWmsLink()); - LOG.debug("Returning: "+theLayerConessione); + LOG.debug("Returning: " + theLayerConessione); return theLayerConessione; } @@ -219,7 +236,7 @@ public class ConvertToDataViewModel { return null; OtherContentDV theOtherContent = new OtherContentDV(); - theOtherContent.setCreationTime(otherContent.getCreationTime()); + theOtherContent.setCreationTime(toDateString(otherContent.getCreationTime())); theOtherContent.setId(otherContent.getId()); theOtherContent.setLicenseID(otherContent.getLicenseID()); theOtherContent.setPolicy(otherContent.getPolicy().name()); diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/server/GeoportalDataViewerServiceImpl.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/server/GeoportalDataViewerServiceImpl.java index 68bc4f4..0588a74 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/server/GeoportalDataViewerServiceImpl.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/server/GeoportalDataViewerServiceImpl.java @@ -11,13 +11,12 @@ import org.gcube.application.geoportal.model.concessioni.Concessione; import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerService; import org.gcube.portlets.user.geoportaldataviewer.server.gis.FeatureParser; import org.gcube.portlets.user.geoportaldataviewer.server.gis.WMSUrlValidator; -import org.gcube.portlets.user.geoportaldataviewer.shared.FeatureRow; import org.gcube.portlets.user.geoportaldataviewer.shared.GeoNaDataObject; import org.gcube.portlets.user.geoportaldataviewer.shared.gis.BoundsMap; -import org.gcube.portlets.user.geoportaldataviewer.shared.gis.GeoInformationForWMSRequest; import org.gcube.portlets.user.geoportaldataviewer.shared.gis.LayerItem; -import org.gcube.portlets.user.geoportaldataviewer.shared.gis.Styles; -import org.gcube.portlets.user.geoportaldataviewer.shared.gis.ZAxis; +import org.gcube.portlets.user.geoportaldataviewer.shared.gis.wms.GeoInformationForWMSRequest; +import org.gcube.portlets.user.geoportaldataviewer.shared.gis.wms.Styles; +import org.gcube.portlets.user.geoportaldataviewer.shared.gis.wms.ZAxis; import org.gcube.portlets.user.geoportaldataviewer.shared.products.ConcessioneDV; import org.gcube.spatial.data.geoutility.GeoNcWMSMetadataUtility; import org.gcube.spatial.data.geoutility.bean.LayerStyles; @@ -100,7 +99,7 @@ public class GeoportalDataViewerServiceImpl extends RemoteServiceServlet impleme LOG.info("getDataResult called"); List result = FeatureParser.getDataResults(layerItems, mapSrsName, selectBBOX, maxWFSFeature); - for (GeoNaDataObject geoNaDataObject : result) { + /*for (GeoNaDataObject geoNaDataObject : result) { List features = geoNaDataObject.getFeatures(); for (FeatureRow feature : features) { List theProductIds = feature.getMapProperties().get(PRODUCT_ID); @@ -118,11 +117,12 @@ public class GeoportalDataViewerServiceImpl extends RemoteServiceServlet impleme LOG.error("Error:", e); } } - } + }*/ return result; } - private ConcessioneDV getConcessioneForId(Long id) throws Exception{ + @Override + public ConcessioneDV getConcessioneForId(Long id) throws Exception{ LOG.info(""); if(id==null) diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/server/gis/FeatureParser.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/server/gis/FeatureParser.java index f50728f..3e83444 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/server/gis/FeatureParser.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/server/gis/FeatureParser.java @@ -17,11 +17,11 @@ import java.util.Map; import org.apache.commons.io.IOUtils; import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants; import org.gcube.portlets.user.geoportaldataviewer.server.util.URLParserUtil; -import org.gcube.portlets.user.geoportaldataviewer.shared.FeatureRow; import org.gcube.portlets.user.geoportaldataviewer.shared.GeoNaDataObject; import org.gcube.portlets.user.geoportaldataviewer.shared.gis.BoundsMap; -import org.gcube.portlets.user.geoportaldataviewer.shared.gis.FeatureGeometry; import org.gcube.portlets.user.geoportaldataviewer.shared.gis.LayerItem; +import org.gcube.portlets.user.geoportaldataviewer.shared.gis.wfs.FeatureGeometry; +import org.gcube.portlets.user.geoportaldataviewer.shared.gis.wfs.FeatureRow; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/server/util/SessionUtil.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/server/util/SessionUtil.java new file mode 100644 index 0000000..0d86b74 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/server/util/SessionUtil.java @@ -0,0 +1,106 @@ +/** + * + */ +package org.gcube.portlets.user.geoportaldataviewer.server.util; + +import javax.servlet.http.HttpServletRequest; + +import org.gcube.common.portal.PortalContext; +import org.gcube.common.scope.api.ScopeProvider; +import org.gcube.vomanagement.usermanagement.GroupManager; +import org.gcube.vomanagement.usermanagement.exception.GroupRetrievalFault; +import org.gcube.vomanagement.usermanagement.exception.UserManagementSystemException; +import org.gcube.vomanagement.usermanagement.impl.LiferayGroupManager; +import org.gcube.vomanagement.usermanagement.model.GCubeGroup; +import org.gcube.vomanagement.usermanagement.model.GCubeUser; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.liferay.portal.service.UserLocalServiceUtil; + + +/** + * The Class SessionUtil. + * + * @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it) + * + * Oct 20, 2020 + */ +public class SessionUtil { + + /** The log. */ + private static Logger LOG = LoggerFactory.getLogger(SessionUtil.class); + + /** + * Checks if is into portal. + * + * @return true, if is into portal + */ + public static boolean isIntoPortal() { + try { + UserLocalServiceUtil.getService(); + return true; + }catch (Exception ex) { + LOG.debug("Development Mode ON"); + return false; + } + } + + /** + * Retrieve the current user by using the portal manager. + * + * @param request the request + * @return a GcubeUser object + */ + public static GCubeUser getCurrentUser(HttpServletRequest request){ + + if(request == null) + throw new IllegalArgumentException("HttpServletRequest is null!"); + + PortalContext pContext = PortalContext.getConfiguration(); + GCubeUser user = pContext.getCurrentUser(request); + LOG.debug("Returning user " + user); + return user; + } + + /** + * Retrieve the current scope by using the portal manager. + * + * @param request the request + * @param setInThread the set in thread + * @return a GcubeUser object + */ + public static String getCurrentContext(HttpServletRequest request, boolean setInThread){ + + if(request == null) + throw new IllegalArgumentException("HttpServletRequest is null!"); + + PortalContext pContext = PortalContext.getConfiguration(); + String context = pContext.getCurrentScope(request); + LOG.debug("Returning context " + context); + + if(context != null && setInThread) + ScopeProvider.instance.set(context); + + return context; + } + + /** + * Retrieve the group given the scope. + * + * @param scope the scope + * @return the group from scope + * @throws UserManagementSystemException the user management system exception + * @throws GroupRetrievalFault the group retrieval fault + */ + public static GCubeGroup getGroupFromScope(String scope) throws UserManagementSystemException, GroupRetrievalFault{ + + if(scope == null || scope.isEmpty()) + throw new IllegalArgumentException("Scope is missing here!!"); + + GroupManager gm = new LiferayGroupManager(); + long groupId = gm.getGroupIdFromInfrastructureScope(scope); + return gm.getGroup(groupId); + + } +} diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/GeoNaDataObject.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/GeoNaDataObject.java index f67e3af..290dc68 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/GeoNaDataObject.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/GeoNaDataObject.java @@ -2,9 +2,9 @@ package org.gcube.portlets.user.geoportaldataviewer.shared; import java.io.Serializable; import java.util.List; -import java.util.Map; import org.gcube.portlets.user.geoportaldataviewer.shared.gis.LayerItem; +import org.gcube.portlets.user.geoportaldataviewer.shared.gis.wfs.FeatureRow; import org.gcube.portlets.user.geoportaldataviewer.shared.products.ConcessioneDV; @@ -23,7 +23,7 @@ public class GeoNaDataObject implements Serializable{ private static final long serialVersionUID = 5566069859060851625L; /** The form data entry fields. */ private List features; - private String productType; //e.g. "Concessioni" + private ProductType productType; private LayerItem layerItem; private ConcessioneDV concessioneDV; @@ -42,11 +42,11 @@ public class GeoNaDataObject implements Serializable{ this.features = features; } - public String getProductType() { + public ProductType getProductType() { return productType; } - public void setProductType(String productType) { + public void setProductType(ProductType productType) { this.productType = productType; } diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/ProductType.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/ProductType.java new file mode 100644 index 0000000..f28f37b --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/ProductType.java @@ -0,0 +1,7 @@ +package org.gcube.portlets.user.geoportaldataviewer.shared; + +public enum ProductType { + + CONCESSIONE + +} diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/gis/LayerItem.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/gis/LayerItem.java index 5753694..b4df034 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/gis/LayerItem.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/gis/LayerItem.java @@ -5,6 +5,9 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; +import org.gcube.portlets.user.geoportaldataviewer.shared.gis.wms.Property; +import org.gcube.portlets.user.geoportaldataviewer.shared.gis.wms.ZAxis; + // TODO: Auto-generated Javadoc /** * The Class LayerItem. diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/gis/FeatureGeometry.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/gis/wfs/FeatureGeometry.java similarity index 93% rename from src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/gis/FeatureGeometry.java rename to src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/gis/wfs/FeatureGeometry.java index 99da794..fe1748b 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/gis/FeatureGeometry.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/gis/wfs/FeatureGeometry.java @@ -1,4 +1,4 @@ -package org.gcube.portlets.user.geoportaldataviewer.shared.gis; +package org.gcube.portlets.user.geoportaldataviewer.shared.gis.wfs; import java.io.Serializable; diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/FeatureRow.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/gis/wfs/FeatureRow.java similarity index 91% rename from src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/FeatureRow.java rename to src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/gis/wfs/FeatureRow.java index efd700b..0027806 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/FeatureRow.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/gis/wfs/FeatureRow.java @@ -1,14 +1,12 @@ /** * */ -package org.gcube.portlets.user.geoportaldataviewer.shared; +package org.gcube.portlets.user.geoportaldataviewer.shared.gis.wfs; import java.io.Serializable; import java.util.List; import java.util.Map; -import org.gcube.portlets.user.geoportaldataviewer.shared.gis.FeatureGeometry; - /** * The Class FeatureRow. * diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/gis/GeoInformationForWMSRequest.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/gis/wms/GeoInformationForWMSRequest.java similarity index 98% rename from src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/gis/GeoInformationForWMSRequest.java rename to src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/gis/wms/GeoInformationForWMSRequest.java index c54f3f7..a6c0b45 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/gis/GeoInformationForWMSRequest.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/gis/wms/GeoInformationForWMSRequest.java @@ -1,4 +1,4 @@ -package org.gcube.portlets.user.geoportaldataviewer.shared.gis; +package org.gcube.portlets.user.geoportaldataviewer.shared.gis.wms; import java.io.Serializable; import java.util.HashMap; diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/gis/Property.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/gis/wms/Property.java similarity index 97% rename from src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/gis/Property.java rename to src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/gis/wms/Property.java index d45aeac..0ddee62 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/gis/Property.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/gis/wms/Property.java @@ -1,4 +1,4 @@ -package org.gcube.portlets.user.geoportaldataviewer.shared.gis; +package org.gcube.portlets.user.geoportaldataviewer.shared.gis.wms; import java.io.Serializable; diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/gis/Styles.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/gis/wms/Styles.java similarity index 96% rename from src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/gis/Styles.java rename to src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/gis/wms/Styles.java index ab79254..81673df 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/gis/Styles.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/gis/wms/Styles.java @@ -1,7 +1,7 @@ /** * */ -package org.gcube.portlets.user.geoportaldataviewer.shared.gis; +package org.gcube.portlets.user.geoportaldataviewer.shared.gis.wms; import java.util.List; import java.util.Map; diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/gis/ZAxis.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/gis/wms/ZAxis.java similarity index 96% rename from src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/gis/ZAxis.java rename to src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/gis/wms/ZAxis.java index f5eff19..b026180 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/gis/ZAxis.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/gis/wms/ZAxis.java @@ -1,7 +1,7 @@ /** * */ -package org.gcube.portlets.user.geoportaldataviewer.shared.gis; +package org.gcube.portlets.user.geoportaldataviewer.shared.gis.wms; import java.io.Serializable; import java.util.List; diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/products/ConcessioneDV.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/products/ConcessioneDV.java index daa1ab8..b927ebe 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/products/ConcessioneDV.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/products/ConcessioneDV.java @@ -1,7 +1,6 @@ package org.gcube.portlets.user.geoportaldataviewer.shared.products; import java.io.Serializable; -import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List; @@ -53,10 +52,10 @@ public class ConcessioneDV extends RecordDV implements Serializable { private List risorseCorrelate; /** The data inizio progetto. */ - private LocalDateTime dataInizioProgetto; + private String dataInizioProgetto; /** The data fine progetto. */ - private LocalDateTime dataFineProgetto; + private String dataFineProgetto; /** The titolare licenza. */ private String titolareLicenza; @@ -283,7 +282,7 @@ public class ConcessioneDV extends RecordDV implements Serializable { * * @return the data inizio progetto */ - public LocalDateTime getDataInizioProgetto() { + public String getDataInizioProgetto() { return dataInizioProgetto; } @@ -292,7 +291,7 @@ public class ConcessioneDV extends RecordDV implements Serializable { * * @param dataInizioProgetto the new data inizio progetto */ - public void setDataInizioProgetto(LocalDateTime dataInizioProgetto) { + public void setDataInizioProgetto(String dataInizioProgetto) { this.dataInizioProgetto = dataInizioProgetto; } @@ -301,7 +300,7 @@ public class ConcessioneDV extends RecordDV implements Serializable { * * @return the data fine progetto */ - public LocalDateTime getDataFineProgetto() { + public String getDataFineProgetto() { return dataFineProgetto; } @@ -310,7 +309,7 @@ public class ConcessioneDV extends RecordDV implements Serializable { * * @param dataFineProgetto the new data fine progetto */ - public void setDataFineProgetto(LocalDateTime dataFineProgetto) { + public void setDataFineProgetto(String dataFineProgetto) { this.dataFineProgetto = dataFineProgetto; } diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/products/content/AssociatedContentDV.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/products/content/AssociatedContentDV.java index 72e994b..148ab30 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/products/content/AssociatedContentDV.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/products/content/AssociatedContentDV.java @@ -1,7 +1,6 @@ package org.gcube.portlets.user.geoportaldataviewer.shared.products.content; import java.io.Serializable; -import java.time.LocalDateTime; import org.gcube.portlets.user.geoportaldataviewer.shared.products.model.RecordDV; @@ -32,7 +31,7 @@ public abstract class AssociatedContentDV implements Serializable{ private String titolo; /** The creation time. */ - private LocalDateTime creationTime = LocalDateTime.now(); + private String creationTime; /** The record. */ private RecordDV record; @@ -54,7 +53,7 @@ public abstract class AssociatedContentDV implements Serializable{ * @param creationTime the creation time * @param record the record */ - public AssociatedContentDV(long id, String policy, String licenseID, String titolo, LocalDateTime creationTime, + public AssociatedContentDV(long id, String policy, String licenseID, String titolo, String creationTime, RecordDV record) { super(); this.id = id; @@ -142,7 +141,7 @@ public abstract class AssociatedContentDV implements Serializable{ * * @return the creation time */ - public LocalDateTime getCreationTime() { + public String getCreationTime() { return creationTime; } @@ -151,7 +150,7 @@ public abstract class AssociatedContentDV implements Serializable{ * * @param creationTime the new creation time */ - public void setCreationTime(LocalDateTime creationTime) { + public void setCreationTime(String creationTime) { this.creationTime = creationTime; } diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/products/model/RecordDV.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/products/model/RecordDV.java index c752a5e..fa42e25 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/products/model/RecordDV.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/products/model/RecordDV.java @@ -1,7 +1,6 @@ package org.gcube.portlets.user.geoportaldataviewer.shared.products.model; import java.io.Serializable; -import java.time.LocalDateTime; /** * The Class Record. @@ -42,13 +41,13 @@ public abstract class RecordDV implements Serializable { /** The last update time. */ // Accounting - private LocalDateTime lastUpdateTime = LocalDateTime.now(); + private String lastUpdateTime; /** The last update user. */ private String lastUpdateUser; /** The creation time. */ - private LocalDateTime creationTime = LocalDateTime.now(); + private String creationTime; /** The creation user. */ private String creationUser; @@ -191,7 +190,7 @@ public abstract class RecordDV implements Serializable { * * @return the last update time */ - public LocalDateTime getLastUpdateTime() { + public String getLastUpdateTime() { return lastUpdateTime; } @@ -200,7 +199,7 @@ public abstract class RecordDV implements Serializable { * * @param lastUpdateTime the new last update time */ - public void setLastUpdateTime(LocalDateTime lastUpdateTime) { + public void setLastUpdateTime(String lastUpdateTime) { this.lastUpdateTime = lastUpdateTime; } @@ -227,7 +226,7 @@ public abstract class RecordDV implements Serializable { * * @return the creation time */ - public LocalDateTime getCreationTime() { + public String getCreationTime() { return creationTime; } @@ -236,7 +235,7 @@ public abstract class RecordDV implements Serializable { * * @param creationTime the new creation time */ - public void setCreationTime(LocalDateTime creationTime) { + public void setCreationTime(String creationTime) { this.creationTime = creationTime; }