diff --git a/.settings/com.gwtplugins.gdt.eclipse.core.prefs b/.settings/com.gwtplugins.gdt.eclipse.core.prefs index e75d335..d16c112 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/francescomangiacrapa/git/geoportal-data-viewer-app/target/geoportal-data-viewer-app-1.0.0-SNAPSHOT +lastWarOutDir=/home/francesco-mangiacrapa/git/geoportal-data-viewer-app/target/geoportal-data-viewer-app-1.0.0-SNAPSHOT warSrcDir=src/main/webapp warSrcDirIsOutput=false 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 3f1aaef..707681e 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 @@ -174,8 +174,18 @@ public class LayerManager { VerticalPanel vpPanel = new VerticalPanel(); vpPanel.add(flex); - if(button!=null) + if(button!=null) { vpPanel.add(button); + button.setType(ButtonType.LINK); + button.addClickHandler(new ClickHandler() { + + @Override + public void onClick(ClickEvent event) { + applicationBus.fireEvent(new ShowDetailsEvent(ProductType.CONCESSIONE, theFeature)); + + } + }); + } olMap.showPopup(vpPanel.toString(), queryEvent.getoLCoordinate()); @@ -196,16 +206,7 @@ public class LayerManager { }); } }); - button.setType(ButtonType.LINK); - button.addClickHandler(new ClickHandler() { - - @Override - public void onClick(ClickEvent event) { - GWT.log("qui"); - applicationBus.fireEvent(new ShowDetailsEvent(ProductType.CONCESSIONE, theFeature)); - - } - }); + } }); } diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/gis/LightOpenLayerOSM.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/gis/LightOpenLayerOSM.java index a6ed7d5..94bd98f 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/gis/LightOpenLayerOSM.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/gis/LightOpenLayerOSM.java @@ -31,7 +31,6 @@ import ol.source.XyzOptions; import ol.style.FillOptions; import ol.style.Icon; import ol.style.IconOptions; -import ol.style.Image; import ol.style.Style; public class LightOpenLayerOSM { diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/map/MapView.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/map/MapView.java index 560fdc3..f664da3 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/map/MapView.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/map/MapView.java @@ -1,7 +1,6 @@ package org.gcube.portlets.user.geoportaldataviewer.client.ui.map; import org.gcube.portlets.user.geoportaldataviewer.client.gis.LightOpenLayerOSM; -import org.gcube.portlets.user.geoportaldataviewer.client.gis.OpenLayerOSM; import com.google.gwt.core.client.GWT; import com.google.gwt.core.client.Scheduler; diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/products/ConcessioneView.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/products/ConcessioneView.java index f1ad879..8620d14 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/products/ConcessioneView.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/products/ConcessioneView.java @@ -4,12 +4,13 @@ import java.util.List; import org.gcube.portlets.user.geoportaldataviewer.client.ui.images.ImageView; import org.gcube.portlets.user.geoportaldataviewer.client.ui.map.MapView; +import org.gcube.portlets.user.geoportaldataviewer.client.ui.util.CustomFlexTable; import org.gcube.portlets.user.geoportaldataviewer.shared.products.ConcessioneDV; import org.gcube.portlets.user.geoportaldataviewer.shared.products.model.UploadedImageDV; -import com.github.gwtbootstrap.client.ui.Column; -import com.github.gwtbootstrap.client.ui.Heading; +import com.gargoylesoftware.htmlunit.Page; import com.github.gwtbootstrap.client.ui.Label; +import com.github.gwtbootstrap.client.ui.PageHeader; import com.github.gwtbootstrap.client.ui.Paragraph; import com.github.gwtbootstrap.client.ui.Thumbnails; import com.github.gwtbootstrap.client.ui.constants.LabelType; @@ -22,105 +23,105 @@ import com.google.gwt.user.client.ui.FlowPanel; import com.google.gwt.user.client.ui.HTMLPanel; import com.google.gwt.user.client.ui.Widget; - public class ConcessioneView extends Composite { private static ConcessioneViewUiBinder uiBinder = GWT.create(ConcessioneViewUiBinder.class); interface ConcessioneViewUiBinder extends UiBinder { } - + @UiField - Heading titolo; - + PageHeader titolo; + @UiField Paragraph introduzione; @UiField - HTMLPanel recordPanel; - - @UiField - Column autori; - - @UiField - Column contributore; - + HTMLPanel concessioniPanel; + @UiField HTMLPanel imagesPanel; - + @UiField HTMLPanel pageViewDetails; - + @UiField HTMLPanel mapViewPanel; - + private ConcessioneDV concessioneDV; - + private Thumbnails thumbNails = new Thumbnails(); + private CustomFlexTable customTable = new CustomFlexTable(); + public ConcessioneView() { initWidget(uiBinder.createAndBindUi(this)); pageViewDetails.getElement().setId("page-view-details"); } - public ConcessioneView(ConcessioneDV concessioneDV) { this(); - recordPanel.setVisible(true); - recordPanel.add(new RecordView(concessioneDV)); this.concessioneDV = concessioneDV; titolo.setText(concessioneDV.getNome()); introduzione.setText(concessioneDV.getIntroduzione()); + + concessioniPanel.add(new RecordView(concessioneDV)); + - if(concessioneDV.getAuthors()!=null) { - - for (String author : concessioneDV.getAuthors()) { - addLabel(autori, author); - //autori.add(new Label(author)); - } + if (concessioneDV.getDataInizioProgetto() != null) { + customTable.addNextKeyValue("Data Inizio Progetto", concessioneDV.getDataFineProgetto()); } - addLabel(contributore, concessioneDV.getContributore()); - addImages(); + if (concessioneDV.getDataFineProgetto() != null) { + customTable.addNextKeyValue("Data Fine Progetto", concessioneDV.getDataFineProgetto()); + + } + if (concessioneDV.getAuthors() != null) { + customTable.addNextKeyValues("Autori", concessioneDV.getAuthors(), "\n"); + + } + + customTable.addNextKeyValue("Contributore", concessioneDV.getContributore()); + + concessioniPanel.add(customTable); + addImages(); addMap(); } - + private void addMap() { MapView mapView = new MapView(concessioneDV.getCentroidLong(), concessioneDV.getCentroidLat()); mapViewPanel.add(mapView); } - private void addImages() { List immagini = concessioneDV.getImmaginiRappresentative(); - if(immagini!=null && immagini.size()>0) { + if (immagini != null && immagini.size() > 0) { imagesPanel.setVisible(true); int i = 0; for (UploadedImageDV uploadedImageDV : immagini) { - if(i==0) + if (i == 0) imagesPanel.add(thumbNails); - + thumbNails.add(new ImageView(uploadedImageDV)); } } - + } - - public void addLabel(FlowPanel w, String labelValue, LabelType type){ + public void addLabel(FlowPanel w, String labelValue, LabelType type) { Label label = new Label(labelValue); label.setType(type); label.getElement().getStyle().setMarginRight(5, Unit.PX); w.add(label); } - - public void addLabel(FlowPanel w, String labelValue){ + + public void addLabel(FlowPanel w, String labelValue) { com.google.gwt.user.client.ui.Label label = new com.google.gwt.user.client.ui.Label(labelValue); label.getElement().getStyle().setMarginRight(5, Unit.PX); w.add(label); } - + public ConcessioneDV getConcessioneDV() { return concessioneDV; } diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/products/ConcessioneView.ui.xml b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/products/ConcessioneView.ui.xml index 846b49c..7379373 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/products/ConcessioneView.ui.xml +++ b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/products/ConcessioneView.ui.xml @@ -16,41 +16,31 @@ font-size: 22px; } - .display-60 { - width: 60%; + + + + - - - - + + - - - - - - Autori - - - - - - Contributore - - - + - + { } - - @UiField - Column creationTime; @UiField - Column lastUpdateTime; + HTMLPanel recordDVPanel; - @UiField - Column updatedByUser; + private CustomFlexTable customTable = new CustomFlexTable(); public RecordView() { initWidget(uiBinder.createAndBindUi(this)); @@ -33,10 +30,11 @@ public class RecordView extends Composite { public RecordView(RecordDV record) { initWidget(uiBinder.createAndBindUi(this)); - addLabel(creationTime, record.getCreationTime()); - addLabel(lastUpdateTime, record.getLastUpdateTime()); - addLabel(updatedByUser, record.getLastUpdateUser()); + customTable.addNextKeyValue("Created", record.getCreationTime()); + customTable.addNextKeyValue("Last Updated", record.getLastUpdateTime()); + customTable.addNextKeyValue("Updated by", record.getLastUpdateUser()); + recordDVPanel.add(customTable); } public void addLabel(FlowPanel w, String labelValue){ diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/products/RecordView.ui.xml b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/products/RecordView.ui.xml index 52707c0..01f5816 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/products/RecordView.ui.xml +++ b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/products/RecordView.ui.xml @@ -5,23 +5,5 @@ - - - Created - - - - - - Last Update - - - - - - Updated By - - - \ No newline at end of file diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/util/CustomFlexTable.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/util/CustomFlexTable.java new file mode 100644 index 0000000..f35ac4d --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/util/CustomFlexTable.java @@ -0,0 +1,84 @@ +package org.gcube.portlets.user.geoportaldataviewer.client.ui.util; + +import java.util.List; + +import com.google.gwt.user.client.ui.FlexTable; +import com.google.gwt.user.client.ui.Label; +import com.google.gwt.user.client.ui.Widget; + + +/** + * The Class CustomFlexTable. + * + * @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it) + * + * Nov 11, 2020 + */ +public class CustomFlexTable extends FlexTable { + + /** + * Instantiates a new custom flex table. + */ + public CustomFlexTable() { + + this.getElement().addClassName("my-custom-flex-table"); + } + + + /** + * Adds the next key values. + * + * @param key the key + * @param listValues the list values + * @param separator the separator + */ + public void addNextKeyValues(String key, List listValues, String separator) { + Label keyLabel = new Label(key); + int row = getRowCount() + 1; + setWidget(row, 0, keyLabel); + + if(listValues==null) + return; + + String valuesAsString = ""; + for (String value : listValues) { + valuesAsString+=value+separator; + } + valuesAsString = valuesAsString.substring(0, valuesAsString.lastIndexOf(separator)); + Label valuesLabel = new Label(valuesAsString); + setWidget(row, 1, valuesLabel); + } + + /** + * Adds the next key value. + * + * @param key the key + * @param value the value + */ + public void addNextKeyValue(String key, String value) { + Label keyLabel = new Label(key); + + // keyLabel.getElement().getStyle().setMarginRight(5, Unit.PX); + int row = getRowCount() + 1; + setWidget(row, 0, keyLabel); + if(value==null) + return; + + Label valueLabel = new Label(value); + setWidget(row, 1, valueLabel); + } + + /** + * Adds the next key widget. + * + * @param key the key + * @param value the value + */ + public void addNextKeyWidget(String key, Widget value) { + Label keyLabel = new Label(key); + int row = getRowCount() + 1; + setWidget(row, 0, keyLabel); + setWidget(row, 1, value); + } + +} 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 7fd041e..0910f0b 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 @@ -96,7 +96,7 @@ public class ConvertToDataViewModel { theConcessione.setRelazioneScavo(toRelazioneScavo(concessione.getRelazioneScavo())); - /* + if (concessione.getImmaginiRappresentative() != null) { List uploadedImagesDV = new ArrayList( concessione.getImmaginiRappresentative().size()); @@ -104,9 +104,9 @@ public class ConvertToDataViewModel { uploadedImagesDV.add(toUploadedImage(ui)); } theConcessione.setImmaginiRappresentative(uploadedImagesDV); - }*/ + } + - /* if (concessione.getGenericContent() != null) { List otherContentsDV = new ArrayList( concessione.getGenericContent().size()); @@ -114,9 +114,9 @@ public class ConvertToDataViewModel { otherContentsDV.add(toOtherContentDV(gc)); } theConcessione.setGenericContent(otherContentsDV); - }*/ + } - /* + if (concessione.getPianteFineScavo() != null) { List piantaScavoDV = new ArrayList( concessione.getPianteFineScavo().size()); @@ -129,7 +129,7 @@ public class ConvertToDataViewModel { if (concessione.getPosizionamentoScavo() != null) { LayerConcessioneDV thePosizScavo = toLayerConcessione(concessione.getPosizionamentoScavo()); theConcessione.setPosizionamentoScavo(thePosizScavo); - }*/ + } LOG.debug("Returning concessione: " + theConcessione); 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 7677e4b..b39cf44 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 @@ -8,7 +8,6 @@ import org.gcube.application.geoportal.managers.AbstractRecordManager; import org.gcube.application.geoportal.managers.ManagerFactory; import org.gcube.application.geoportal.model.Record; import org.gcube.application.geoportal.model.concessioni.Concessione; -import org.gcube.common.scope.api.ScopeProvider; 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; diff --git a/src/main/webapp/GeoportalDataViewer.css b/src/main/webapp/GeoportalDataViewer.css index 4a5e0ba..2958dac 100644 --- a/src/main/webapp/GeoportalDataViewer.css +++ b/src/main/webapp/GeoportalDataViewer.css @@ -69,23 +69,30 @@ font-weight: bold; } -#page-view-details div { +#page-view-details{ + margin: 10px; + text-rendering: optimizelegibility; font-family: Lato, 'Helvetica Neue', Arial, Helvetica, sans-serif; } -#page-view-details .hero-unit h1, #page-view-details .hero-unit h2, - #page-view-details .hero-unit p { - font-family: Lato, -apple-system, BlinkMacSystemFont, system-ui, - Segoe UI, Roboto, Helvetica, Arial, sans-serif; +#page-view-details > h1 { + font-size: 32px; } -#page-view-details .hero-unit { - padding: 40px; - margin-left: 5px; - margin-right: 5px; +#page-view-details > p { + font-size: 24px; + padding: 10px; + color: #999; } -#page-view-details .span1 .gwt-Label, #page-view-details .span2 .gwt-Label { +#page-view-details .my-custom-flex-table{ + margin-left: 20px; + margin-right: 20px; + font-size: 14px; +} + +#page-view-details .my-custom-flex-table tbody tr > td:first-child { color: gray; font-weight: bold; + width: 170px; } \ No newline at end of file