task_21890: enhancements
#2
Merged
francesco.mangiacrapa
merged 38 commits from task_21890
into master
3 years ago
@ -1,4 +1,4 @@
|
||||
eclipse.preferences.version=1
|
||||
lastWarOutDir=/home/francescomangiacrapa/git/geoportal-data-viewer-app/target/geoportal-data-viewer-app-1.2.0-SNAPSHOT
|
||||
lastWarOutDir=/home/francescomangiacrapa/git/geoportal-data-viewer-app/target/geoportal-data-viewer-app-2.0.0-SNAPSHOT
|
||||
warSrcDir=src/main/webapp
|
||||
warSrcDirIsOutput=false
|
||||
|
@ -0,0 +1,2 @@
|
||||
eclipse.preferences.version=1
|
||||
gwtSyncCodeServer=true
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,52 @@
|
||||
package org.gcube.portlets.user.geoportaldataviewer.client.events;
|
||||
|
||||
import org.gcube.portlets.user.geoportaldataviewer.client.ui.map.ExtentMapUtil.Location;
|
||||
|
||||
import com.google.gwt.event.shared.GwtEvent;
|
||||
|
||||
/**
|
||||
* The Class MapExtentToEvent.
|
||||
*
|
||||
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
|
||||
*
|
||||
* Sep 1, 2021
|
||||
*/
|
||||
public class MapExtentToEvent extends GwtEvent<MapExtentToEventHandler> {
|
||||
public static Type<MapExtentToEventHandler> TYPE = new Type<MapExtentToEventHandler>();
|
||||
private Location location;
|
||||
|
||||
/**
|
||||
* Instantiates a new map extent to event.
|
||||
*
|
||||
* @param layerItem the layer item
|
||||
*/
|
||||
public MapExtentToEvent(Location location) {
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the associated type.
|
||||
*
|
||||
* @return the associated type
|
||||
*/
|
||||
@Override
|
||||
public Type<MapExtentToEventHandler> getAssociatedType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Dispatch.
|
||||
*
|
||||
* @param handler the handler
|
||||
*/
|
||||
@Override
|
||||
protected void dispatch(MapExtentToEventHandler handler) {
|
||||
handler.onExtentEvent(this);
|
||||
|
||||
}
|
||||
|
||||
public Location getLocation() {
|
||||
return location;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package org.gcube.portlets.user.geoportaldataviewer.client.events;
|
||||
|
||||
import com.google.gwt.event.shared.EventHandler;
|
||||
|
||||
/**
|
||||
* The Interface MapExtentToEventHandler.
|
||||
*
|
||||
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
|
||||
*
|
||||
* Sep 1, 2021
|
||||
*/
|
||||
public interface MapExtentToEventHandler extends EventHandler {
|
||||
|
||||
/**
|
||||
* On extent event.
|
||||
*
|
||||
* @param mapExtentToEvent the map extent to event
|
||||
*/
|
||||
void onExtentEvent(MapExtentToEvent mapExtentToEvent);
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
Binary file not shown.
After Width: | Height: | Size: 3.2 KiB |
@ -0,0 +1,176 @@
|
||||
package org.gcube.portlets.user.geoportaldataviewer.client.ui.map;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants.MAP_PROJECTION;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.client.gis.MapUtils;
|
||||
|
||||
import ol.Coordinate;
|
||||
import ol.OLFactory;
|
||||
|
||||
/**
|
||||
* The Class ExtentMapUtil.
|
||||
*
|
||||
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
|
||||
*
|
||||
* Sep 1, 2021
|
||||
*/
|
||||
public class ExtentMapUtil {
|
||||
|
||||
/**
|
||||
* The Enum PLACE.
|
||||
*
|
||||
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
|
||||
*
|
||||
* Sep 1, 2021
|
||||
*/
|
||||
public static enum PLACE {
|
||||
ITALY, WORLD
|
||||
}
|
||||
|
||||
final static Map<PLACE, Location> mapExtent = new HashMap<PLACE, Location>();
|
||||
|
||||
static {
|
||||
|
||||
// EPSG_4326 ITALY LOCATION
|
||||
Location ita = new Location(PLACE.ITALY.name(), GeoportalDataViewerConstants.ITALY_CENTER_LONG,
|
||||
GeoportalDataViewerConstants.ITALY_CENTER_LAT, MAP_PROJECTION.EPSG_4326,
|
||||
GeoportalDataViewerConstants.MAP_ITALY_FIT_ZOOM_ON);
|
||||
|
||||
// EPSG_4326 WORLD LOCATION
|
||||
Location earth = new Location(PLACE.WORLD.name(), 0,
|
||||
0, MAP_PROJECTION.EPSG_4326,
|
||||
2);
|
||||
|
||||
mapExtent.put(PLACE.ITALY, ita);
|
||||
mapExtent.put(PLACE.WORLD, earth);
|
||||
|
||||
}
|
||||
|
||||
public static Location getLocation(PLACE place) {
|
||||
return mapExtent.get(place);
|
||||
}
|
||||
|
||||
/**
|
||||
* The Class Location.
|
||||
*
|
||||
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
|
||||
*
|
||||
* Sep 1, 2021
|
||||
*/
|
||||
public static class Location {
|
||||
public String name;
|
||||
public double coordinateX;
|
||||
public double coordinateY;
|
||||
public MAP_PROJECTION projection;
|
||||
public int zoomLevel;
|
||||
|
||||
/**
|
||||
* Instantiates a new location.
|
||||
*
|
||||
* @param name the name
|
||||
* @param coordinateX the coordinate X
|
||||
* @param coordinateY the coordinate Y
|
||||
* @param projection the projection
|
||||
* @param zoomLevel the zoom level
|
||||
*/
|
||||
public Location(String name, double coordinateX, double coordinateY, MAP_PROJECTION projection, int zoomLevel) {
|
||||
super();
|
||||
this.name = name;
|
||||
this.coordinateX = coordinateX;
|
||||
this.coordinateY = coordinateY;
|
||||
this.projection = projection;
|
||||
this.zoomLevel = zoomLevel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the name.
|
||||
*
|
||||
* @return the name
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the coordinate X.
|
||||
*
|
||||
* @return the coordinate X
|
||||
*/
|
||||
public double getCoordinateX() {
|
||||
return coordinateX;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the coordinate Y.
|
||||
*
|
||||
* @return the coordinate Y
|
||||
*/
|
||||
public double getCoordinateY() {
|
||||
return coordinateY;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the projection.
|
||||
*
|
||||
* @return the projection
|
||||
*/
|
||||
public MAP_PROJECTION getProjection() {
|
||||
return projection;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the zoom level.
|
||||
*
|
||||
* @return the zoom level
|
||||
*/
|
||||
public int getZoomLevel() {
|
||||
return zoomLevel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the coordinate.
|
||||
*
|
||||
* @param targetProjection the target projection
|
||||
* @return the coordinate
|
||||
*/
|
||||
public Coordinate getCoordinate(MAP_PROJECTION targetProjection) {
|
||||
|
||||
Coordinate coordinate = OLFactory.createCoordinate(coordinateX, coordinateY);
|
||||
if (projection.equals(targetProjection)) {
|
||||
return coordinate;
|
||||
} else {
|
||||
Coordinate transformedCenterCoordinate = MapUtils.transformCoordiante(coordinate, projection.getName(),
|
||||
targetProjection.getName());
|
||||
return transformedCenterCoordinate;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* To string.
|
||||
*
|
||||
* @return the string
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append("Location [name=");
|
||||
builder.append(name);
|
||||
builder.append(", coordinateX=");
|
||||
builder.append(coordinateX);
|
||||
builder.append(", coordinateY=");
|
||||
builder.append(coordinateY);
|
||||
builder.append(", projection=");
|
||||
builder.append(projection);
|
||||
builder.append(", zoomLevel=");
|
||||
builder.append(zoomLevel);
|
||||
builder.append("]");
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
package org.gcube.portlets.user.geoportaldataviewer.server;
|
||||
|
||||
/**
|
||||
* The Class ApplicationProfileException.
|
||||
*
|
||||
* @author Francesco Mangiacrapa francesco.mangiacrapa{@literal @}isti.cnr.it
|
||||
* Sep 6, 2016
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class ApplicationProfileNotFoundException extends Exception {
|
||||
|
||||
/**
|
||||
* Instantiates a new application profile exception.
|
||||
*
|
||||
* @param message the message
|
||||
*/
|
||||
public ApplicationProfileNotFoundException(String message) {
|
||||
super(message);
|
||||
}
|
||||
}
|
@ -1,499 +0,0 @@
|
||||
package org.gcube.portlets.user.geoportaldataviewer.server;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.gcube.application.geoportal.common.model.legacy.AccessPolicy;
|
||||
import org.gcube.application.geoportal.common.model.legacy.BBOX;
|
||||
import org.gcube.application.geoportal.common.model.legacy.Concessione;
|
||||
import org.gcube.application.geoportal.common.model.legacy.LayerConcessione;
|
||||
import org.gcube.application.geoportal.common.model.legacy.OtherContent;
|
||||
import org.gcube.application.geoportal.common.model.legacy.PersistedContent;
|
||||
import org.gcube.application.geoportal.common.model.legacy.RelazioneScavo;
|
||||
import org.gcube.application.geoportal.common.model.legacy.UploadedImage;
|
||||
import org.gcube.application.geoportal.common.model.legacy.WorkspaceContent;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.server.util.URLParserUtil;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.BoundsMap;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.products.ConcessioneDV;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.products.content.OtherContentDV;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.products.content.WorkspaceContentDV;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.products.model.AbstractRelazioneScavoDV;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.products.model.LayerConcessioneDV;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.products.model.RelazioneScavoDV;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.products.model.UploadedImageDV;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* The Class ConvertToGUIModel.
|
||||
*
|
||||
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
|
||||
*
|
||||
* Nov 2, 2020
|
||||
*/
|
||||
public class ConvertToDataViewModel {
|
||||
|
||||
private static final String NO_TIME = "T00:00";
|
||||
|
||||
/** The Constant LOG. */
|
||||
private static final Logger LOG = LoggerFactory.getLogger(ConvertToDataViewModel.class);
|
||||
|
||||
public static final String DATE_FORMAT = "dd-MM-yyyy";
|
||||
|
||||
public static final String HOURS_MINUTES_SEPARATOR = ":";
|
||||
|
||||
public static final String TIME_FORMAT = "HH" + HOURS_MINUTES_SEPARATOR + "mm";
|
||||
|
||||
|
||||
/**
|
||||
* To concessione.
|
||||
*
|
||||
* @param concessione the concessione
|
||||
* @return the concessione
|
||||
* @throws Exception the exception
|
||||
*/
|
||||
public static ConcessioneDV toConcessione(Concessione concessione) throws Exception {
|
||||
LOG.debug("called toConcessione for: "+concessione);
|
||||
|
||||
if (concessione == null)
|
||||
return null;
|
||||
|
||||
try {
|
||||
|
||||
ConcessioneDV theConcessione = new ConcessioneDV();
|
||||
theConcessione.setPolicy(toPolicy(concessione.getPolicy()));
|
||||
//theConcessione.setAuthors(concessione.getAuthors());
|
||||
theConcessione.setCentroidLat(concessione.getCentroidLat());
|
||||
theConcessione.setCentroidLong(concessione.getCentroidLong());
|
||||
theConcessione.setContributore(concessione.getContributore());
|
||||
theConcessione.setCreationTime(toDateFormatString(concessione.getCreationTime()));
|
||||
theConcessione.setCreationUser(toUser(concessione.getCreationUser()));
|
||||
theConcessione.setDataFineProgetto(toDateFormatString(concessione.getDataFineProgetto()));
|
||||
theConcessione.setDataInizioProgetto(toDateFormatString(concessione.getDataInizioProgetto()));
|
||||
theConcessione.setDescrizioneContenuto(concessione.getDescrizioneContenuto());
|
||||
theConcessione.setEditore(concessione.getEditore());
|
||||
theConcessione.setFontiFinanziamento(concessione.getFontiFinanziamento());
|
||||
theConcessione.setId(concessione.getId());
|
||||
theConcessione.setNome(concessione.getNome());
|
||||
|
||||
theConcessione.setIntroduzione(concessione.getIntroduzione());
|
||||
theConcessione.setLastUpdateTime(toDateFormatString(concessione.getLastUpdateTime()));
|
||||
theConcessione.setLastUpdateUser(toUser(concessione.getLastUpdateUser()));
|
||||
theConcessione.setLicenzaID(concessione.getLicenzaID());
|
||||
theConcessione.setNome(concessione.getNome());
|
||||
theConcessione.setParoleChiaveICCD(concessione.getParoleChiaveICCD());
|
||||
theConcessione.setParoleChiaveLibere(concessione.getParoleChiaveLibere());
|
||||
|
||||
theConcessione.setResponsabile(concessione.getResponsabile());
|
||||
theConcessione.setRisorseCorrelate(concessione.getRisorseCorrelate());
|
||||
theConcessione.setSoggetto(concessione.getSoggetto());
|
||||
theConcessione.setTitolariCopyright(concessione.getTitolareCopyright());
|
||||
theConcessione.setTitolariLicenza(concessione.getTitolareLicenza());
|
||||
theConcessione.setTitolari(concessione.getTitolari());
|
||||
theConcessione.setVersion(concessione.getVersion());
|
||||
|
||||
theConcessione.setRecordType(concessione.getRecordType().name());
|
||||
|
||||
theConcessione.setAbstractRelazioneScavo(toAbstractRelazioneScavo(concessione.getRelazioneScavo()));
|
||||
theConcessione.setRelazioneScavo(toRelazioneScavo(concessione.getRelazioneScavo()));
|
||||
|
||||
|
||||
if (concessione.getImmaginiRappresentative() != null) {
|
||||
List<UploadedImageDV> uploadedImagesDV = new ArrayList<UploadedImageDV>(
|
||||
concessione.getImmaginiRappresentative().size());
|
||||
for (UploadedImage ui : concessione.getImmaginiRappresentative()) {
|
||||
uploadedImagesDV.add(toUploadedImage(ui));
|
||||
}
|
||||
theConcessione.setImmaginiRappresentative(uploadedImagesDV);
|
||||
}
|
||||
|
||||
|
||||
if (concessione.getGenericContent() != null) {
|
||||
List<OtherContentDV> otherContentsDV = new ArrayList<OtherContentDV>(
|
||||
concessione.getGenericContent().size());
|
||||
for (OtherContent gc : concessione.getGenericContent()) {
|
||||
otherContentsDV.add(toOtherContentDV(gc));
|
||||
}
|
||||
theConcessione.setGenericContent(otherContentsDV);
|
||||
}
|
||||
|
||||
|
||||
if (concessione.getPianteFineScavo() != null) {
|
||||
List<LayerConcessioneDV> piantaScavoDV = new ArrayList<LayerConcessioneDV>(
|
||||
concessione.getPianteFineScavo().size());
|
||||
for (LayerConcessione lc : concessione.getPianteFineScavo()) {
|
||||
piantaScavoDV.add(toLayerConcessione(lc));
|
||||
}
|
||||
theConcessione.setPianteFineScavo(piantaScavoDV);
|
||||
}
|
||||
|
||||
if (concessione.getPosizionamentoScavo() != null) {
|
||||
LayerConcessioneDV thePosizScavo = toLayerConcessione(concessione.getPosizionamentoScavo());
|
||||
theConcessione.setPosizionamentoScavo(thePosizScavo);
|
||||
}
|
||||
|
||||
|
||||
LOG.debug("Returning concessione: " + theConcessione);
|
||||
return theConcessione;
|
||||
}catch (Exception e) {
|
||||
LOG.error("Error on converting concessione: "+concessione, e);
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//TO AVOID SERIALIZATION ISSUE AGAINST GWT
|
||||
// public static List<String> toListString(List<String> orginList){
|
||||
// if(orginList==null)
|
||||
// return null;
|
||||
//
|
||||
// List<String> destList = new ArrayList<String>(orginList.size());
|
||||
// for (String orgValue : orginList) {
|
||||
// destList.add(orgValue);
|
||||
// }
|
||||
//
|
||||
// return destList;
|
||||
// }
|
||||
|
||||
/**
|
||||
* To user.
|
||||
*
|
||||
* @param username the username
|
||||
* @return the string
|
||||
*/
|
||||
public static String toUser(String username) {
|
||||
|
||||
if(username==null)
|
||||
return null;
|
||||
|
||||
return username;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* To policy.
|
||||
*
|
||||
* @param policy the policy
|
||||
* @return the string
|
||||
*/
|
||||
public static String toPolicy(AccessPolicy policy) {
|
||||
|
||||
if(policy==null)
|
||||
return null;
|
||||
|
||||
return policy.name();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* To date format string.
|
||||
*
|
||||
* @param dateTime the date time
|
||||
* @return the string
|
||||
*/
|
||||
public static String toDateFormatString(LocalDateTime dateTime) {
|
||||
|
||||
if(dateTime==null)
|
||||
return null;
|
||||
|
||||
String time = dateTime.toString();
|
||||
DateTimeFormatter formatter = null;
|
||||
try {
|
||||
if(!time.endsWith(NO_TIME)) {
|
||||
formatter = DateTimeFormatter.ofPattern(DATE_FORMAT + " " + TIME_FORMAT);
|
||||
}else {
|
||||
time = time.replace(NO_TIME, "");
|
||||
formatter = DateTimeFormatter.ofPattern(DATE_FORMAT);
|
||||
}
|
||||
}catch (Exception e) {
|
||||
LOG.warn("Parsing error: ",e);
|
||||
}
|
||||
|
||||
try {
|
||||
if(formatter!=null)
|
||||
return dateTime.format(formatter);
|
||||
}catch (Exception e) {
|
||||
LOG.warn("Date format error: ",e);
|
||||
}
|
||||
|
||||
return dateTime.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* To abstract relazione scavo.
|
||||
*
|
||||
* @param relazioneScavo the relazione scavo
|
||||
* @return the abstract relazione scavo DV
|
||||
*/
|
||||
public static AbstractRelazioneScavoDV toAbstractRelazioneScavo(RelazioneScavo relazioneScavo) {
|
||||
|
||||
if (relazioneScavo == null)
|
||||
return null;
|
||||
|
||||
AbstractRelazioneScavoDV theRelazioneDiScavo = new AbstractRelazioneScavoDV();
|
||||
theRelazioneDiScavo.setAbstractSectionIta(relazioneScavo.getAbstractIta());
|
||||
theRelazioneDiScavo.setAbstractSectionEng(relazioneScavo.getAbstractEng());
|
||||
|
||||
theRelazioneDiScavo.setCreationTime(toDateFormatString(relazioneScavo.getCreationTime()));
|
||||
theRelazioneDiScavo.setId(relazioneScavo.getId());
|
||||
theRelazioneDiScavo.setLicenseID(relazioneScavo.getLicenseID());
|
||||
theRelazioneDiScavo.setPolicy(toPolicy(relazioneScavo.getPolicy()));
|
||||
//theRelazioneDiScavo.setRecord(recordDV);
|
||||
theRelazioneDiScavo.setResponsabili(relazioneScavo.getResponsabili());
|
||||
theRelazioneDiScavo.setSoggetto(relazioneScavo.getSoggetto());
|
||||
theRelazioneDiScavo.setTitolo(relazioneScavo.getTitolo());
|
||||
|
||||
LOG.debug("Returning: " + theRelazioneDiScavo);
|
||||
return theRelazioneDiScavo;
|
||||
}
|
||||
|
||||
/**
|
||||
* To relazione scavo.
|
||||
*
|
||||
* @param relazioneScavo the relazione scavo
|
||||
* @return the relazione scavo data view
|
||||
*/
|
||||
public static RelazioneScavoDV toRelazioneScavo(RelazioneScavo relazioneScavo) {
|
||||
|
||||
if (relazioneScavo == null)
|
||||
return null;
|
||||
|
||||
RelazioneScavoDV theRelazioneDiScavo = new RelazioneScavoDV();
|
||||
theRelazioneDiScavo.setCreationTime(toDateFormatString(relazioneScavo.getCreationTime()));
|
||||
theRelazioneDiScavo.setId(relazioneScavo.getId());
|
||||
theRelazioneDiScavo.setLicenseID(relazioneScavo.getLicenseID());
|
||||
theRelazioneDiScavo.setPolicy(toPolicy(relazioneScavo.getPolicy()));
|
||||
//theRelazioneDiScavo.setRecord(recordDV);
|
||||
theRelazioneDiScavo.setResponsabili(relazioneScavo.getResponsabili());
|
||||
theRelazioneDiScavo.setSoggetto(relazioneScavo.getSoggetto());
|
||||
theRelazioneDiScavo.setTitolo(relazioneScavo.getTitolo());
|
||||
|
||||
List<PersistedContent> actContent = relazioneScavo.getActualContent();
|
||||
if(actContent!=null && actContent.size()>0) {
|
||||
List<WorkspaceContentDV> listWsContent = new ArrayList<WorkspaceContentDV>();
|
||||
|
||||
for (PersistedContent content : actContent) {
|
||||
if(content!=null && content instanceof WorkspaceContent) {
|
||||
listWsContent.add(toWorkspaceContent((WorkspaceContent)content));
|
||||
}
|
||||
}
|
||||
theRelazioneDiScavo.setListWsContent(listWsContent);
|
||||
}
|
||||
|
||||
LOG.debug("Returning: " + theRelazioneDiScavo);
|
||||
return theRelazioneDiScavo;
|
||||
}
|
||||
|
||||
/**
|
||||
* To uploaded image.
|
||||
*
|
||||
* @param uploadedImage the uploaded image
|
||||
* @return the uploaded image data-view
|
||||
*/
|
||||
public static UploadedImageDV toUploadedImage(UploadedImage uploadedImage) {
|
||||
|
||||
if (uploadedImage == null)
|
||||
return null;
|
||||
|
||||
UploadedImageDV theUploadedImageDV = new UploadedImageDV();
|
||||
theUploadedImageDV.setCreationTime(toDateFormatString(uploadedImage.getCreationTime()));
|
||||
theUploadedImageDV.setDidascalia(uploadedImage.getDidascalia());
|
||||
theUploadedImageDV.setFormat(uploadedImage.getFormat());
|
||||
theUploadedImageDV.setId(uploadedImage.getId());
|
||||
theUploadedImageDV.setLicenseID(uploadedImage.getLicenseID());
|
||||
theUploadedImageDV.setPolicy(toPolicy(uploadedImage.getPolicy()));
|
||||
//theUploadedImageDV.setRecord(recordDV);
|
||||
theUploadedImageDV.setResponsabili(uploadedImage.getResponsabili());
|
||||
theUploadedImageDV.setSoggetto(uploadedImage.getSoggetto());
|
||||
theUploadedImageDV.setTitolo(uploadedImage.getTitolo());
|
||||
|
||||
List<PersistedContent> actContent = uploadedImage.getActualContent();
|
||||
if(actContent!=null && actContent.size()>0) {
|
||||
List<WorkspaceContentDV> listWsContent = new ArrayList<WorkspaceContentDV>();
|
||||
|
||||
for (PersistedContent content : actContent) {
|
||||
if(content!=null && content instanceof WorkspaceContent) {
|
||||
listWsContent.add(toWorkspaceContent((WorkspaceContent)content));
|
||||
}
|
||||
}
|
||||
theUploadedImageDV.setListWsContent(listWsContent);
|
||||
}
|
||||
|
||||
LOG.debug("Returning: " + theUploadedImageDV);
|
||||
return theUploadedImageDV;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* To workspace content.
|
||||
*
|
||||
* @param wContent the w content
|
||||
* @return the workspace content DV
|
||||
*/
|
||||
public static WorkspaceContentDV toWorkspaceContent(WorkspaceContent wContent){
|
||||
if (wContent == null)
|
||||
return null;
|
||||
|
||||
WorkspaceContentDV theWSDV = new WorkspaceContentDV();
|
||||
theWSDV.setLink(wContent.getLink());
|
||||
theWSDV.setMimetype(wContent.getMimetype());
|
||||
theWSDV.setStorageID(wContent.getStorageID());
|
||||
theWSDV.setId(wContent.getId());
|
||||
|
||||
return theWSDV;
|
||||
}
|
||||
|
||||
/**
|
||||
* To layer concessione.
|
||||
*
|
||||
* @param layerConcessione the layer concessione
|
||||
* @return the layer concessione data view
|
||||
*/
|
||||
public static LayerConcessioneDV toLayerConcessione(LayerConcessione layerConcessione) {
|
||||
|
||||
if (layerConcessione == null)
|
||||
return null;
|
||||
|
||||
LOG.debug("Converting: "+layerConcessione);
|
||||
LayerConcessioneDV theLayerConessione = new LayerConcessioneDV();
|
||||
theLayerConessione.setAbstractSection(layerConcessione.getAbstractSection());
|
||||
|
||||
String wmsLink = layerConcessione.getWmsLink();
|
||||
String layerName = null;
|
||||
BoundsMap bounds = null;
|
||||
|
||||
//reading layer name from wmsLink
|
||||
//string bbox
|
||||
if(wmsLink!=null) {
|
||||
layerName = URLParserUtil.extractValueOfParameterFromURL("layers", wmsLink);
|
||||
String bbox = URLParserUtil.extractValueOfParameterFromURL("bbox", wmsLink);
|
||||
String wmsVersion = URLParserUtil.extractValueOfParameterFromURL("version", wmsLink);
|
||||
bounds = toBoundMap(wmsVersion, bbox, ",");
|
||||
LOG.debug("Built bounds from wmsLInk: "+bounds);
|
||||
}
|
||||
|
||||
if(layerName!=null)
|
||||
theLayerConessione.setLayerName(layerName);
|
||||
else
|
||||
theLayerConessione.setLayerName(layerConcessione.getLayerName());
|
||||
|
||||
|
||||
theLayerConessione.setWmsLink(wmsLink);
|
||||
theLayerConessione.setLayerID(layerConcessione.getLayerID());
|
||||
theLayerConessione.setLayerUUID(layerConcessione.getLayerUUID());
|
||||
theLayerConessione.setAuthors(layerConcessione.getAuthors());
|
||||
|
||||
if(bounds==null)
|
||||
bounds = toBoundMap(layerConcessione.getBbox());
|
||||
|
||||
theLayerConessione.setBbox(bounds);
|
||||
theLayerConessione.setCreationTime(toDateFormatString(layerConcessione.getCreationTime()));
|
||||
theLayerConessione.setId(layerConcessione.getId());
|
||||
theLayerConessione.setLicenseID(layerConcessione.getLicenseID());
|
||||
theLayerConessione.setMetodoRaccoltaDati(layerConcessione.getMetodoRaccoltaDati());
|
||||
theLayerConessione.setPolicy(toPolicy(layerConcessione.getPolicy()));
|
||||
//theLayerConessione.setRecord(recordDV);
|
||||
theLayerConessione.setScalaAcquisizione(layerConcessione.getScalaAcquisizione());
|
||||
theLayerConessione.setSubTopic(layerConcessione.getSubTopic());
|
||||
theLayerConessione.setTitolo(layerConcessione.getTitolo());
|
||||
theLayerConessione.setTopicCategory(layerConcessione.getTopicCategory());
|
||||
theLayerConessione.setValutazioneQualita(layerConcessione.getValutazioneQualita());
|
||||
|
||||
|
||||
LOG.debug("Returning: " + theLayerConessione);
|
||||
return theLayerConessione;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* To other content DV.
|
||||
*
|
||||
* @param otherContent the other content
|
||||
* @return the other content DV
|
||||
*/
|
||||
public static OtherContentDV toOtherContentDV(OtherContent otherContent) {
|
||||
|
||||
if (otherContent == null)
|
||||
return null;
|
||||
|
||||
OtherContentDV theOtherContent = new OtherContentDV();
|
||||
theOtherContent.setCreationTime(toDateFormatString(otherContent.getCreationTime()));
|
||||
theOtherContent.setId(otherContent.getId());
|
||||
theOtherContent.setLicenseID(otherContent.getLicenseID());
|
||||
theOtherContent.setPolicy(toPolicy(otherContent.getPolicy()));
|
||||
//theOtherContent.setRecord(recordDV);
|
||||
theOtherContent.setTitolo(otherContent.getTitolo());
|
||||
|
||||
return theOtherContent;
|
||||
}
|
||||
|
||||
/**
|
||||
* To bound map.
|
||||
*
|
||||
* @param bbox the bbox
|
||||
* @return the bounds map
|
||||
*/
|
||||
public static BoundsMap toBoundMap(BBOX bbox) {
|
||||
|
||||
if (bbox == null)
|
||||
return null;
|
||||
|
||||
return new BoundsMap(bbox.getMinLong(), bbox.getMinLat(), bbox.getMaxLong(), bbox.getMaxLat(), null);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* To bound map.
|
||||
*
|
||||
* @param wmsVersion the wms version
|
||||
* @param bbox the bbox
|
||||
* @param separator the separator
|
||||
* @return the bounds map
|
||||
*/
|
||||
public static BoundsMap toBoundMap(String wmsVersion, String bbox, String separator) {
|
||||
|
||||
if (bbox == null)
|
||||
return null;
|
||||
|
||||
if(wmsVersion==null)
|
||||
return null;
|
||||
|
||||
if(separator==null)
|
||||
separator = ",";
|
||||
|
||||
try {
|
||||
|
||||
String[] bboxArr = bbox.split(separator);
|
||||
|
||||
if(wmsVersion.startsWith("1.3")) {
|
||||
//is 1.3.x
|
||||
return new BoundsMap(toDouble(bboxArr[1]), toDouble(bboxArr[0]), toDouble(bboxArr[3]), toDouble(bboxArr[2]), wmsVersion);
|
||||
}else {
|
||||
//should be 1.1.X
|
||||
return new BoundsMap(toDouble(bboxArr[0]), toDouble(bboxArr[1]), toDouble(bboxArr[2]), toDouble(bboxArr[3]), wmsVersion);
|
||||
}
|
||||
}catch (Exception e) {
|
||||
LOG.warn("Error on creating Bounds for wmsVersion "+wmsVersion+" and bbox "+bbox+" : ",e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* To double.
|
||||
*
|
||||
* @param value the value
|
||||
* @return the double
|
||||
*/
|
||||
public static Double toDouble(String value) {
|
||||
try {
|
||||
return Double.parseDouble(value);
|
||||
}catch (Exception e) {
|
||||
LOG.warn("Error on parsing "+value+" as double: ",e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,124 +0,0 @@
|
||||
//package org.gcube.portlets.user.geoportaldataviewer.server;
|
||||
//
|
||||
//import java.time.LocalDateTime;
|
||||
//import java.util.ArrayList;
|
||||
//import java.util.Arrays;
|
||||
//import java.util.List;
|
||||
//
|
||||
//import org.gcube.application.geoportal.common.model.legacy.AccessPolicy;
|
||||
//import org.gcube.application.geoportal.common.model.legacy.BBOX;
|
||||
//import org.gcube.application.geoportal.common.model.legacy.Concessione;
|
||||
//import org.gcube.application.geoportal.common.model.legacy.LayerConcessione;
|
||||
//import org.gcube.application.geoportal.common.model.legacy.PersistedContent;
|
||||
//import org.gcube.application.geoportal.common.model.legacy.RelazioneScavo;
|
||||
//import org.gcube.application.geoportal.common.model.legacy.UploadedImage;
|
||||
//import org.gcube.application.geoportal.common.model.legacy.WorkspaceContent;
|
||||
//
|
||||
//
|
||||
//public class TestModel {
|
||||
//
|
||||
// public static Concessione prepareEmptyConcessione() {
|
||||
// Concessione concessione = new Concessione();
|
||||
//
|
||||
// // Generic fields
|
||||
//
|
||||
// // Concessione fields
|
||||
//
|
||||
// concessione.setNome("Italia, forse");
|
||||
// concessione.setIntroduzione("This is my project");
|
||||
// concessione.setDescrizioneContenuto("It contains this and that");
|
||||
//
|
||||
// concessione.setAuthors(Arrays.asList(new String[] { "Some one", "Some, oneelse" }));
|
||||
//
|
||||
// concessione.setContributore("Contrib 1");
|
||||
// concessione.setTitolari(Arrays.asList(new String[] { "Some one", "Some, oneelse" }));
|
||||
// concessione.setResponsabile("Someone");
|
||||
// concessione.setEditore("Editore");
|
||||
//
|
||||
// concessione.setFontiFinanziamento(Arrays.asList(new String[] { "Big pharma", "Pentagon" }));
|
||||
//
|
||||
// concessione.setSoggetto(Arrays.asList(new String[] { "Research Excavation", "Archeology" }));
|
||||
//
|
||||
// concessione
|
||||
// .setRisorseCorrelate(Arrays.asList(new String[] { "https://google.com", "https://www.repubblica.it" }));
|
||||
//
|
||||
// concessione.setDataInizioProgetto(LocalDateTime.now());
|
||||
// concessione.setDataFineProgetto(LocalDateTime.now());
|
||||
//
|
||||
// concessione.setLicenzaID("CC-BY");
|
||||
//
|
||||
// concessione.setTitolareLicenza("Qualcun altro");
|
||||
// concessione.setTitolareCopyright("Chiedilo in giro");
|
||||
//
|
||||
// concessione.setParoleChiaveLibere(Arrays.asList(new String[] { "Robba", "Stuff" }));
|
||||
// concessione.setParoleChiaveICCD(Arrays.asList(new String[] { "vattelapesca", "somthing something" }));
|
||||
//
|
||||
// concessione.setLastUpdateTime(LocalDateTime.now());
|
||||
// concessione.setCreationTime(LocalDateTime.now());
|
||||
// concessione.setLastUpdateUser("fake user");
|
||||
//
|
||||
// concessione.setCentroidLat(43.0); // N-S
|
||||
// concessione.setCentroidLong(9.0); // E-W
|
||||
//
|
||||
// return concessione;
|
||||
// }
|
||||
//
|
||||
// public static Concessione prepareConcessione() {
|
||||
//
|
||||
// Concessione concessione = prepareEmptyConcessione();
|
||||
//
|
||||
// // Attachments
|
||||
//
|
||||
// // Relazione scavo
|
||||
// RelazioneScavo relScavo = new RelazioneScavo();
|
||||
//
|
||||
// relScavo.setAbstractSection("simple abstract section");
|
||||
// relScavo.setResponsabili(concessione.getAuthors());
|
||||
//
|
||||
// concessione.setRelazioneScavo(relScavo);
|
||||
// // Immagini rappresentative
|
||||
// ArrayList<UploadedImage> imgs = new ArrayList<>();
|
||||
// for (int i = 0; i < 5; i++) {
|
||||
// UploadedImage img = new UploadedImage();
|
||||
// img.setTitolo("My image number " + i);
|
||||
// img.setDidascalia("You can see my image number " + i);
|
||||
// img.setFormat("TIFF");
|
||||
// img.setCreationTime(LocalDateTime.now());
|
||||
// img.setResponsabili(concessione.getAuthors());
|
||||
// List<PersistedContent> actualContentList = new ArrayList<PersistedContent>(1);
|
||||
// WorkspaceContent ws = new WorkspaceContent();
|
||||
// ws.setLink("https://data.dev.d4science.org/shub/E_azRkaVhqTFExMzZvTG9pY0hwSFJNV2tVTHBEMGEycFVsQitvWjZvb29WZjkwRU84b1hXQnp0QjRuSGhrODJqQg==");
|
||||
// actualContentList.add(ws);
|
||||
// img.setActualContent(actualContentList);
|
||||
// imgs.add(img);
|
||||
// }
|
||||
// concessione.setImmaginiRappresentative(imgs);
|
||||
// // Posizionamento
|
||||
// LayerConcessione posizionamento = new LayerConcessione();
|
||||
// posizionamento.setValutazioneQualita("Secondo me si");
|
||||
// posizionamento.setMetodoRaccoltaDati("Fattobbene");
|
||||
// posizionamento.setScalaAcquisizione("1:10000");
|
||||
// posizionamento.setAuthors(concessione.getAuthors());
|
||||
// concessione.setPosizionamentoScavo(posizionamento);
|
||||
//
|
||||
// // Piante fine scavo
|
||||
// ArrayList<LayerConcessione> piante = new ArrayList<LayerConcessione>();
|
||||
// for (int i = 0; i < 4; i++) {
|
||||
// LayerConcessione pianta = new LayerConcessione();
|
||||
// pianta.setValutazioneQualita("Secondo me si");
|
||||
// pianta.setMetodoRaccoltaDati("Fattobbene");
|
||||
// pianta.setScalaAcquisizione("1:10000");
|
||||
// pianta.setAuthors(concessione.getAuthors());
|
||||
// pianta.setPolicy(AccessPolicy.RESTRICTED);
|
||||
// pianta.setLayerName("gna_conc_12:pos");
|
||||
// pianta.setWmsLink(
|
||||
// "https://geoserver1.dev.d4science.org/geoserver/gna_conc_12/wms?service=WMS&version=1.1.0&request=GetMap&layers=gna_conc_12:pos&styles=&bbox=8.62091913167495,40.62975046683799,8.621178639172953,40.630257904721645&width=392&height=768&srs=EPSG:4326&format=application/openlayers#toggle");
|
||||
//
|
||||
// pianta.setBbox(new BBOX(40.630257904721645,8.621178639172953,40.62975046683799,8.62091913167495));
|
||||
// piante.add(pianta);
|
||||
// }
|
||||
// concessione.setPianteFineScavo(piante);
|
||||
//
|
||||
// return concessione;
|
||||
// }
|
||||
//}
|
@ -0,0 +1,66 @@
|
||||
package org.gcube.portlets.user.geoportaldataviewer.server.mongoservice;
|
||||
|
||||
import static org.gcube.application.geoportal.client.GeoportalAbstractPlugin.statefulMongoConcessioni;
|
||||
|
||||
import org.gcube.application.geoportal.client.legacy.ConcessioniManagerI;
|
||||
import org.gcube.application.geoportal.common.model.legacy.Concessione;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
||||
/**
|
||||
* The Class ConcessioniMongoService.
|
||||
*
|
||||
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
|
||||
*
|
||||
* Sep 23, 2021
|
||||
*/
|
||||
public class ConcessioniMongoService {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(ConcessioniMongoService.class);
|
||||
|
||||
/**
|
||||
* Instantiates a new concessioni mongo service.
|
||||
*/
|
||||
protected ConcessioniMongoService() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the item by id.
|
||||
*
|
||||
* @param mongoItemId the mongo item id
|
||||
* @return the item by id
|
||||
* @throws Exception the exception
|
||||
*/
|
||||
protected Concessione getItemById(String mongoItemId) throws Exception {
|
||||
LOG.info("called getItemById: " + mongoItemId);
|
||||
ConcessioniManagerI concessioniManager = statefulMongoConcessioni().build();
|
||||
// Returning item by Id
|
||||
return concessioniManager.getById(mongoItemId);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* To concessione.
|
||||
*
|
||||
* @param jsonString the json string
|
||||
* @return the concessione
|
||||
*/
|
||||
protected Concessione toConcessione(String jsonString) {
|
||||
LOG.info("toConcessione called");
|
||||
try {
|
||||
return org.gcube.application.geoportal.client.utils.Serialization.read(jsonString, Concessione.class);
|
||||
} catch (Exception e) {
|
||||
LOG.warn("Error on serializing: ", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* For testing public Concessione iamClientGetItemBy(HttpServletRequest request,
|
||||
* String mongoItemId, String clientId, String secret) throws Exception { String
|
||||
* scope = SessionUtil.getCurrentContext(request, true); return
|
||||
* iamClientGetItemBy(scope, mongoItemId, clientId, secret); }
|
||||
*/
|
||||
|
||||
}
|
@ -0,0 +1,77 @@
|
||||
package org.gcube.portlets.user.geoportaldataviewer.server.mongoservice;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.gcube.application.geoportal.common.model.legacy.Concessione;
|
||||
import org.gcube.common.portal.PortalContext;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.server.mongoservice.accessidentity.GcubeIdentity;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.server.mongoservice.accessidentity.IAMClientIdentity;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.server.mongoservice.accessidentity.UserIdentity;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.server.util.SessionUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
||||
/**
|
||||
* The Class ConcessioniMongoServiceIdentityProxy.
|
||||
*
|
||||
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
|
||||
*
|
||||
* Sep 23, 2021
|
||||
*/
|
||||
public class ConcessioniMongoServiceIdentityProxy {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(ConcessioniMongoServiceIdentityProxy.class);
|
||||
|
||||
private GcubeIdentity gCubeIdentity;
|
||||
|
||||
|
||||
/**
|
||||
* Instantiates a new concessioni mongo service proxy.
|
||||
*
|
||||
* @param request the request
|
||||
* @throws Exception the exception
|
||||
*/
|
||||
public ConcessioniMongoServiceIdentityProxy(HttpServletRequest request) throws Exception {
|
||||
SessionUtil.getCurrentContext(request, true);
|
||||
PortalContext pContext = PortalContext.getConfiguration();
|
||||
String username = null;
|
||||
try {
|
||||
username = pContext.getCurrentUser(request).getUsername();
|
||||
}catch (Exception e) {
|
||||
LOG.info("Username not detected in session");
|
||||
}
|
||||
if (username != null) {
|
||||
LOG.info("User detected, using its identity");
|
||||
gCubeIdentity = new UserIdentity();
|
||||
} else {
|
||||
LOG.info("User not detected, using IAM Client identity");
|
||||
gCubeIdentity = new IAMClientIdentity();
|
||||
}
|
||||
|
||||
gCubeIdentity.setIdentity(request);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the item by id.
|
||||
*
|
||||
* @param mongoItemId the mongo item id
|
||||
* @return the item by id
|
||||
* @throws Exception the exception
|
||||
*/
|
||||
public Concessione getItemById(String mongoItemId) throws Exception {
|
||||
|
||||
try {
|
||||
// Obtain the client
|
||||
ConcessioniMongoService concessioniManager = new ConcessioniMongoService();
|
||||
// Returning item by Id
|
||||
return concessioniManager.getItemById(mongoItemId);
|
||||
}catch(Exception e) {
|
||||
LOG.error("Error on reading itemById: "+mongoItemId, e);
|
||||
throw(e);
|
||||
}finally {
|
||||
gCubeIdentity.resetIdentity();
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,82 @@
|
||||
package org.gcube.portlets.user.geoportaldataviewer.server.mongoservice;
|
||||
|
||||
import static org.gcube.resources.discovery.icclient.ICFactory.clientFor;
|
||||
import static org.gcube.resources.discovery.icclient.ICFactory.queryFor;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import org.gcube.common.encryption.StringEncrypter;
|
||||
import org.gcube.common.resources.gcore.ServiceEndpoint;
|
||||
import org.gcube.common.resources.gcore.ServiceEndpoint.AccessPoint;
|
||||
import org.gcube.common.scope.api.ScopeProvider;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.server.mongoservice.accessidentity.IAMClientCredentials;
|
||||
import org.gcube.resources.discovery.client.api.DiscoveryClient;
|
||||
import org.gcube.resources.discovery.client.queries.api.SimpleQuery;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* The Class IAMClientCredentialsReader.
|
||||
*
|
||||
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
|
||||
*
|
||||
* Sep 23, 2021
|
||||
*/
|
||||
public class IAMClientCredentialsReader {
|
||||
|
||||
private static Logger LOG = LoggerFactory.getLogger(IAMClientCredentialsReader.class);
|
||||
|
||||
private static final String SE_PROFILE_NAME = "geoportal-data-viewer-app";
|
||||
private static final String SE_CATEGORY_NAME = "SystemClient";
|
||||
|
||||
/**
|
||||
* Gets the credentials.
|
||||
*
|
||||
* @return the credentials
|
||||
* @throws Exception the exception
|
||||
*/
|
||||
public static IAMClientCredentials getCredentials() throws Exception {
|
||||
|
||||
LOG.info("Searching SE in the scope: " + ScopeProvider.instance.get() + " with profile name: " + SE_PROFILE_NAME
|
||||
+ " and category name: " + SE_CATEGORY_NAME);
|
||||
|
||||
SimpleQuery query = queryFor(ServiceEndpoint.class);
|
||||
query.addCondition("$resource/Profile/Name/text() eq '" + SE_PROFILE_NAME + "'");
|
||||
query.addCondition("$resource/Profile/Category/text() eq '" + SE_CATEGORY_NAME + "'");
|
||||
|
||||
DiscoveryClient<ServiceEndpoint> client = clientFor(ServiceEndpoint.class);
|
||||
List<ServiceEndpoint> resources = client.submit(query);
|
||||
|
||||
if (resources.size() > 0)
|
||||
LOG.info("The query returned " + resources.size() + " ServiceEndpoint/s");
|
||||
else
|
||||
throw new RuntimeException("ServiceEndpoint not found. Searching for profile name: " + SE_PROFILE_NAME
|
||||
+ " and category name: " + SE_CATEGORY_NAME + "in the scope: " + ScopeProvider.instance.get());
|
||||
|
||||
ServiceEndpoint se = resources.get(0);
|
||||
Collection<AccessPoint> theAccessPoints = se.profile().accessPoints().asCollection();
|
||||
String clientId = null;
|
||||
String secredPwd = null;
|
||||
for (AccessPoint accessPoint : theAccessPoints) {
|
||||
clientId = accessPoint.username();
|
||||
secredPwd = accessPoint.password();
|
||||
LOG.debug("Found clientId: " + clientId + " and encrypted secret: " + secredPwd);
|
||||
// decrypting the pwd
|
||||
try {
|
||||
if (secredPwd != null) {
|
||||
secredPwd = StringEncrypter.getEncrypter().decrypt(secredPwd);
|
||||
LOG.debug("Secret decrypted is: " + secredPwd.substring(0, secredPwd.length() / 2)
|
||||
+ "_MASKED_TOKEN_");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("Error on decrypting the pwd: ", e);
|
||||
}
|
||||
}
|
||||
|
||||
LOG.info("Returning keycloack credentials read from SE");
|
||||
return new IAMClientCredentials(clientId, secredPwd);
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package org.gcube.portlets.user.geoportaldataviewer.server.mongoservice.accessidentity;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
|
||||
/**
|
||||
* The Interface GcubeIdentity.
|
||||
*
|
||||
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
|
||||
*
|
||||
* Sep 23, 2021
|
||||
*/
|
||||
public interface GcubeIdentity {
|
||||
|
||||
/**
|
||||
* Sets the identity.
|
||||
*
|
||||
* @param httpRequest the new identity
|
||||
* @throws Exception the exception
|
||||
*/
|
||||
public void setIdentity(HttpServletRequest httpRequest) throws Exception;
|
||||
|
||||
/**
|
||||
* Reset identity.
|
||||
*/
|
||||
public void resetIdentity();
|
||||
|
||||
}
|
@ -0,0 +1,91 @@
|
||||
package org.gcube.portlets.user.geoportaldataviewer.server.mongoservice.accessidentity;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* The Class IAMClientCredentials.
|
||||
*
|
||||
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
|
||||
*
|
||||
* Sep 23, 2021
|
||||
*/
|
||||
public class IAMClientCredentials implements Serializable {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 7242909633989611318L;
|
||||
private String clientId;
|
||||
private String clientSecret;
|
||||
|
||||
/**
|
||||
* Instantiates a new IAM client credentials.
|
||||
*/
|
||||
public IAMClientCredentials() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Instantiates a new IAM client credentials.
|
||||
*
|
||||
* @param clientId the client id
|
||||
* @param clientSecret the client secret
|
||||
*/
|
||||
public IAMClientCredentials(String clientId, String clientSecret) {
|
||||
this.clientId = clientId;
|
||||
this.clientSecret = clientSecret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the client id.
|
||||
*
|
||||
* @return the client id
|
||||
*/
|
||||
public String getClientId() {
|
||||
return clientId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the client secret.
|
||||
*
|
||||
* @return the client secret
|
||||
*/
|
||||
public String getClientSecret() {
|
||||
return clientSecret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the client id.
|
||||
*
|
||||
* @param clientId the new client id
|
||||
*/
|
||||
public void setClientId(String clientId) {
|
||||
this.clientId = clientId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the client secret.
|
||||
*
|
||||
* @param clientSecret the new client secret
|
||||
*/
|
||||
public void setClientSecret(String clientSecret) {
|
||||
this.clientSecret = clientSecret;
|
||||
}
|
||||
|
||||
/**
|
||||
* To string.
|
||||
*
|
||||
* @return the string
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append("IAMClientCredentials [clientId=");
|
||||
builder.append(clientId);
|
||||
builder.append(", clientSecret=");
|
||||
builder.append(clientSecret);
|
||||
builder.append("]");
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,117 @@
|
||||
package org.gcube.portlets.user.geoportaldataviewer.server.mongoservice.accessidentity;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
import org.gcube.common.authorization.library.provider.AccessTokenProvider;
|
||||
import org.gcube.common.keycloak.KeycloakClientFactory;
|
||||
import org.gcube.common.keycloak.model.TokenResponse;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.server.mongoservice.IAMClientCredentialsReader;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.server.util.SessionUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class IAMClientIdentity implements GcubeIdentity {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(IAMClientIdentity.class);
|
||||
|
||||
private String previousUMAToken = null;
|
||||
|
||||
private static final String IAM_CLIENT_CREDENTIALS = "IAM_CLIENT_CREDENTIALS";
|
||||
|
||||
@Override
|
||||
public void setIdentity(HttpServletRequest httpRequest) throws Exception {
|
||||
LOG.info("setIdentity called");
|
||||
String currentScope = SessionUtil.getCurrentContext(httpRequest, true);
|
||||
IAMClientCredentials credentials = sessionGetIAMClientCredentials(httpRequest);
|
||||
try {
|
||||
if(credentials==null) {
|
||||
credentials = IAMClientCredentialsReader.getCredentials();
|
||||
sessionSetIAMClientCredentials(httpRequest,credentials);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
LOG.error("Error on discovering IAM Client credentials", e);
|
||||
throw new Exception("IAM Client discovery failed");
|
||||
}
|
||||
|
||||
LOG.trace("Read credentials: " + credentials);
|
||||
String umaAcessToken = null;
|
||||
String clientId = credentials.getClientId();
|
||||
String clientSecret = credentials.getClientSecret();
|
||||
try {
|
||||
|
||||
LOG.info("Querying KeycloakClientFactory to get UMA token..");
|
||||
TokenResponse tr = KeycloakClientFactory.newInstance().queryUMAToken(clientId, clientSecret, currentScope,
|
||||
null);
|
||||
umaAcessToken = tr.getAccessToken();
|
||||
if (umaAcessToken != null && !umaAcessToken.isEmpty()) {
|
||||
LOG.info("UMA Access Token read correctly");
|
||||
} else {
|
||||
LOG.error("UMA Access Token NOT RETRIEVED!!!");
|
||||
throw new Exception("UMA Access Token is null or empty");
|
||||
}
|
||||
} catch (Exception e2) {
|
||||
throw new Exception("Error occurred on reading UMA access token:", e2);
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
try {
|
||||
// Here the previousUMAToken should be null
|
||||
previousUMAToken = AccessTokenProvider.instance.get();
|
||||
} catch (Exception e) {
|
||||
// catching excpetion to be sure
|
||||
// silent
|
||||
}
|
||||
|
||||
LOG.debug("JWT token: " + umaAcessToken.substring(0, 20) + "_MASKED_TOKEN_");
|
||||
LOG.info("Setting clientId '" + clientId + "' identity by JWT token in the "
|
||||
+ AccessTokenProvider.class.getSimpleName());
|
||||
AccessTokenProvider.instance.set(umaAcessToken);
|
||||
} catch (Exception e) {
|
||||
LOG.error(e.getMessage(), e);
|
||||
throw new Exception(e.getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resetIdentity() {
|
||||
LOG.info("resetIdentity called");
|
||||
AccessTokenProvider.instance.set(previousUMAToken);
|
||||
LOG.info("resetIdentity to previous AccessToken");
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the IAM client credentials.
|
||||
*
|
||||
* @param httpRequest the http request
|
||||
* @return the IAM client credentials
|
||||
*/
|
||||
public static IAMClientCredentials sessionGetIAMClientCredentials(HttpServletRequest httpRequest) {
|
||||
HttpSession session = httpRequest.getSession();
|
||||
try {
|
||||
return (IAMClientCredentials) session.getAttribute(IAM_CLIENT_CREDENTIALS);
|
||||
} catch (Exception e) {
|
||||
LOG.warn("Error occurred when reading " + IAM_CLIENT_CREDENTIALS + " from session");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the IAM client credentials.
|
||||
*
|
||||
* @param httpRequest the http request
|
||||
* @param iamCC the iam CC
|
||||
*/
|
||||
public static void sessionSetIAMClientCredentials(HttpServletRequest httpRequest, IAMClientCredentials iamCC) {
|
||||
HttpSession session = httpRequest.getSession();
|
||||
try {
|
||||
session.setAttribute(IAM_CLIENT_CREDENTIALS, iamCC);
|
||||
} catch (Exception e) {
|
||||
LOG.warn("Error occurred when setting " + IAM_CLIENT_CREDENTIALS + " into session");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package org.gcube.portlets.user.geoportaldataviewer.server.mongoservice.accessidentity;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.gcube.portlets.user.geoportaldataviewer.server.util.SessionUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class UserIdentity implements GcubeIdentity {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(UserIdentity.class);
|
||||
|
||||
public UserIdentity() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentity(HttpServletRequest httpRequest) throws Exception {
|
||||
LOG.info("setIdentity called");
|
||||
SessionUtil.getCurrentToken(httpRequest, true);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resetIdentity() {
|
||||
LOG.info("resetIdentity called, doing nothing");
|
||||
// doing nothing
|
||||
}
|
||||
}
|
@ -0,0 +1,93 @@
|
||||
package org.gcube.portlets.user.geoportaldataviewer.server.mongoservice.accesspolicy;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* The Class GeoNACheckAccessPolicy.
|
||||
*
|
||||
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
|
||||
*
|
||||
* Sep 9, 2021
|
||||
*/
|
||||
public class GeoNACheckAccessPolicy {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(GeoNACheckAccessPolicy.class);
|
||||
/**
|
||||
* The Enum ACCESS_POLICY.
|
||||
*
|
||||
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
|
||||
*
|
||||
* Sep 8, 2021
|
||||
*/
|
||||
public static enum ACCESS_POLICY {
|
||||
OPEN, RESTICTED
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if is open access.
|
||||
*
|
||||
* @param policy the policy
|
||||
* @return true, if is open access
|
||||
*/
|
||||
private static boolean isOpenAccess(String policy) {
|
||||
if (policy == null || policy.equalsIgnoreCase(ACCESS_POLICY.OPEN.name())) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if is restricted access.
|
||||
*
|
||||
* @param policy the policy
|
||||
* @return true, if is restricted access
|
||||
*/
|
||||
private static boolean isRestrictedAccess(String policy) {
|
||||
if (policy == null || policy.equalsIgnoreCase(ACCESS_POLICY.RESTICTED.name())) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if is accessible accoding to access policies
|
||||
*
|
||||
* @param policy the policy
|
||||
* @param myLogin the my login
|
||||
* @return true, if is accessible
|
||||
*/
|
||||
public static boolean isAccessible(String policy, String myLogin) {
|
||||
|
||||
boolean bool = isOpenAccess(policy);
|
||||
|
||||
if (bool) {
|
||||
// is open access
|
||||
return true;
|
||||
}
|
||||
|
||||
//From here managing is NOT OPEN access
|
||||
|
||||
if (myLogin == null || myLogin.isEmpty()) {
|
||||
// here is not open and the user is not authenticated
|
||||
return false;
|
||||
}
|
||||
|
||||
// Here the login is not null, so checking if the access to item is RESTICTED
|
||||
bool = isRestrictedAccess(policy);
|
||||
|
||||
if (bool) {
|
||||
// is restricted access
|
||||
return true;
|
||||
}
|
||||
|
||||
// Here the user is authenticated, but the policy is not managed, so returning
|
||||
// true
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
@ -1,170 +0,0 @@
|
||||
package org.gcube.portlets.user.geoportaldataviewer.shared.gis;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* The Class BoundsMap.
|
||||
*
|
||||
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
|
||||
*
|
||||
* Oct 27, 2020
|
||||
*/
|
||||
public class BoundsMap implements Serializable{
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 69005924452960006L;
|
||||
|
||||
/** The lower left X. */
|
||||
private double lowerLeftX = 0.0;
|
||||
|
||||
/** The lower left Y. */
|
||||
private double lowerLeftY = 0.0;
|
||||
|
||||
/** The upper right X. */
|
||||
private double upperRightX = 0.0;
|
||||
|
||||
/** The upper right Y. */
|
||||
private double upperRightY = 0.0;
|
||||
|
||||
/** The crs. */
|
||||
private String crs = "";
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Instantiates a new bounds map.
|
||||
*/
|
||||
public BoundsMap() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Instantiates a new bounds map.
|
||||
*
|
||||
* @param lowerLeftX the lower left X
|
||||
* @param lowerLeftY the lower left Y
|
||||
* @param upperRightX the upper right X
|
||||
* @param upperRightY the upper right Y
|
||||
* @param crs the crs
|
||||
*/
|
||||
public BoundsMap(double lowerLeftX, double lowerLeftY, double upperRightX,
|
||||
double upperRightY, String crs) {
|
||||
super();
|
||||
this.lowerLeftX = lowerLeftX;
|
||||
this.lowerLeftY = lowerLeftY;
|
||||
this.upperRightX = upperRightX;
|
||||
this.upperRightY = upperRightY;
|
||||
this.crs = crs;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the lower left X.
|
||||
*
|
||||
* @return the lower left X
|
||||
*/
|
||||
public double getLowerLeftX() {
|
||||
return lowerLeftX;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the lower left X.
|
||||
*
|
||||
* @param lowerLeftX the new lower left X
|
||||
*/
|
||||
public void setLowerLeftX(double lowerLeftX) {
|
||||
this.lowerLeftX = lowerLeftX;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the lower left Y.
|
||||
*
|
||||
* @return the lower left Y
|
||||
*/
|
||||
public double getLowerLeftY() {
|
||||
return lowerLeftY;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the lower left Y.
|
||||
*
|
||||
* @param lowerLeftY the new lower left Y
|
||||
*/
|
||||
public void setLowerLeftY(double lowerLeftY) {
|
||||
this.lowerLeftY = lowerLeftY;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the upper right X.
|
||||
*
|
||||
* @return the upper right X
|
||||
*/
|
||||
public double getUpperRightX() {
|
||||
return upperRightX;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the upper right X.
|
||||
*
|
||||
* @param upperRightX the new upper right X
|
||||
*/
|
||||
public void setUpperRightX(double upperRightX) {
|
||||
this.upperRightX = upperRightX;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the upper right Y.
|
||||
*
|
||||
* @return the upper right Y
|
||||
*/
|
||||
public double getUpperRightY() {
|
||||
return upperRightY;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the upper right Y.
|
||||
*
|
||||
* @param upperRightY the new upper right Y
|
||||
*/
|
||||
public void setUpperRightY(double upperRightY) {
|
||||
this.upperRightY = upperRightY;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the crs.
|
||||
*
|
||||
* @return the crs
|
||||
*/
|
||||
public String getCrs() {
|
||||
return crs;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the crs.
|
||||
*
|
||||
* @param crs the new crs
|
||||
*/
|
||||
public void setCrs(String crs) {
|
||||
this.crs = crs;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append("BoundsMap [lowerLeftX=");
|
||||
builder.append(lowerLeftX);
|
||||
builder.append(", lowerLeftY=");
|
||||
builder.append(lowerLeftY);
|
||||
builder.append(", upperRightX=");
|
||||
builder.append(upperRightX);
|
||||
builder.append(", upperRightY=");
|
||||
builder.append(upperRightY);
|
||||
builder.append(", crs=");
|
||||
builder.append(crs);
|
||||
builder.append("]");
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,60 +0,0 @@
|
||||
package org.gcube.portlets.user.geoportaldataviewer.shared.gis.wfs;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Arrays;
|
||||
|
||||
|
||||
/**
|
||||
* The Class PointsPath.
|
||||
*
|
||||
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
|
||||
*
|
||||
* Nov 16, 2020
|
||||
*/
|
||||
public class PointsPath implements Serializable{
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -3295493507974317970L;
|
||||
|
||||
private Coordinate[] coordinates;
|
||||
|
||||
/**
|
||||
* Instantiates a new points path.
|
||||
*/
|
||||
public PointsPath() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Instantiates a new points path.
|
||||
*
|
||||
* @param coordinates the coordinates
|
||||
*/
|
||||
public PointsPath(Coordinate[] coordinates) {
|
||||
super();
|
||||
this.coordinates = coordinates;
|
||||
}
|
||||
|
||||
public Coordinate[] getCoordinates() {
|
||||
return coordinates;
|
||||
}
|
||||
|
||||
/**
|
||||
* To string.
|
||||
*
|
||||
* @return the string
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append("PointsPath [coordinates=");
|
||||
builder.append(Arrays.toString(coordinates));
|
||||
builder.append("]");
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -1,597 +0,0 @@
|
||||
package org.gcube.portlets.user.geoportaldataviewer.shared.products;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.products.content.OtherContentDV;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.products.model.AbstractRelazioneScavoDV;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.products.model.LayerConcessioneDV;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.products.model.RecordDV;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.products.model.RelazioneScavoDV;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.products.model.UploadedImageDV;
|
||||
|
||||
import com.google.gwt.user.client.rpc.IsSerializable;
|
||||
|
||||
/**
|
||||
* The Class ConcessioneDV.
|
||||
*
|
||||
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
|
||||
*
|
||||
* Nov 4, 2020
|
||||
*/
|
||||
public class ConcessioneDV extends RecordDV implements Serializable, IsSerializable {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1387327199157005059L;
|
||||
|
||||
/** The introduzione. */
|
||||
private String introduzione;
|
||||
|
||||
/** The descrizione contenuto. */
|
||||
private String descrizioneContenuto;
|
||||
|
||||
/** The authors. */
|
||||
private List<String> authors;
|
||||
|
||||
/** The contributore. */
|
||||
private String contributore;
|
||||
|
||||
/** The titolari. */
|
||||
private List<String> titolari;
|
||||
|
||||
/** The responsabile. */
|
||||
private String responsabile;
|
||||
|
||||
/** The editore. */
|
||||
private String editore;
|
||||
|
||||
/** The fonti finanziamento. */
|
||||
private List<String> fontiFinanziamento;
|
||||
|
||||
/** The soggetto. */
|
||||
private List<String> soggetto;
|
||||
|
||||
/** The risorse correlate. */
|
||||
private List<String> risorseCorrelate;
|
||||
|
||||
/** The data inizio progetto. */
|
||||
private String dataInizioProgetto;
|
||||
|
||||
/** The data fine progetto. */
|
||||
private String dataFineProgetto;
|
||||
|
||||
/** The titolare licenza. */
|
||||
private List<String> titolariLicenza;
|
||||
|
||||
/** The titolare copyright. */
|
||||
private List<String> titolariCopyright;
|
||||
|
||||
/** The parole chiave libere. */
|
||||
private List<String> paroleChiaveLibere;
|
||||
|
||||
/** The parole chiave ICCD. */
|
||||
private List<String> paroleChiaveICCD;
|
||||
|
||||
/** The centroid lat. */
|
||||
private Double centroidLat;
|
||||
|
||||
/** The centroid long. */
|
||||
private Double centroidLong;
|
||||
|
||||
/** The relazione scavo. */
|
||||
private AbstractRelazioneScavoDV abstractRelazioneScavo;
|
||||
|
||||
/** The relazione scavo. */
|
||||
private RelazioneScavoDV relazioneScavo;
|
||||
|
||||
/** The immagini rappresentative. */
|
||||
private List<UploadedImageDV> immaginiRappresentative = new ArrayList<UploadedImageDV>();
|
||||
|
||||
/** The posizionamento scavo. */
|
||||
private LayerConcessioneDV posizionamentoScavo;
|
||||
|
||||
/** The piante fine scavo. */
|
||||
private List<LayerConcessioneDV> pianteFineScavo = new ArrayList<LayerConcessioneDV>();
|
||||
|
||||
/** The generic content. */
|
||||
private List<OtherContentDV> genericContent = new ArrayList<OtherContentDV>();
|
||||
|
||||
/**
|
||||
* Instantiates a new concessione.
|
||||
*/
|
||||
public ConcessioneDV() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the introduzione.
|
||||
*
|
||||
* @return the introduzione
|
||||
*/
|
||||
public String getIntroduzione() {
|
||||
return introduzione;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the introduzione.
|
||||
*
|
||||
* @param introduzione the new introduzione
|
||||
*/
|
||||
public void setIntroduzione(String introduzione) {
|
||||
this.introduzione = introduzione;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the descrizione contenuto.
|
||||
*
|
||||
* @return the descrizione contenuto
|
||||
*/
|
||||
public String getDescrizioneContenuto() {
|
||||
return descrizioneContenuto;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the descrizione contenuto.
|
||||
*
|
||||
* @param descrizioneContenuto the new descrizione contenuto
|
||||
*/
|
||||
public void setDescrizioneContenuto(String descrizioneContenuto) {
|
||||
this.descrizioneContenuto = descrizioneContenuto;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the authors.
|
||||
*
|
||||
* @return the authors
|
||||
*/
|
||||
public List<String> getAuthors() {
|
||||
return authors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the authors.
|
||||
*
|
||||
* @param authors the new authors
|
||||
*/
|
||||
public void setAuthors(List<String> authors) {
|
||||
this.authors = authors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the contributore.
|
||||
*
|
||||
* @return the contributore
|
||||
*/
|
||||
public String getContributore() {
|
||||
return contributore;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the contributore.
|
||||
*
|
||||
* @param contributore the new contributore
|
||||
*/
|
||||
public void setContributore(String contributore) {
|
||||
this.contributore = contributore;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the titolari.
|
||||
*
|
||||
* @return the titolari
|
||||
*/
|
||||
public List<String> getTitolari() {
|
||||
return titolari;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the titolari.
|
||||
*
|
||||
* @param titolari the new titolari
|
||||
*/
|
||||
public void setTitolari(List<String> titolari) {
|
||||
this.titolari = titolari;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the responsabile.
|
||||
*
|
||||
* @return the responsabile
|
||||
*/
|
||||
public String getResponsabile() {
|
||||
return responsabile;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the responsabile.
|
||||
*
|
||||
* @param responsabile the new responsabile
|
||||
*/
|
||||
public void setResponsabile(String responsabile) {
|
||||
this.responsabile = responsabile;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the editore.
|
||||
*
|
||||
* @return the editore
|
||||
*/
|
||||
public String getEditore() {
|
||||
return editore;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the editore.
|
||||
*
|
||||
* @param editore the new editore
|
||||
*/
|
||||
public void setEditore(String editore) {
|
||||
this.editore = editore;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the fonti finanziamento.
|
||||
*
|
||||
* @return the fonti finanziamento
|
||||
*/
|
||||
public List<String> getFontiFinanziamento() {
|
||||
return fontiFinanziamento;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the fonti finanziamento.
|
||||
*
|
||||
* @param fontiFinanziamento the new fonti finanziamento
|
||||
*/
|
||||
public void setFontiFinanziamento(List<String> fontiFinanziamento) {
|
||||
this.fontiFinanziamento = fontiFinanziamento;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the soggetto.
|
||||
*
|
||||
* @return the soggetto
|
||||
*/
|
||||
public List<String> getSoggetto() {
|
||||
return soggetto;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the soggetto.
|
||||
*
|
||||
* @param soggetto the new soggetto
|
||||
*/
|
||||
public void setSoggetto(List<String> soggetto) {
|
||||
this.soggetto = soggetto;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the risorse correlate.
|
||||
*
|
||||
* @return the risorse correlate
|
||||
*/
|
||||
public List<String> getRisorseCorrelate() {
|
||||
return risorseCorrelate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the risorse correlate.
|
||||
*
|
||||
* @param risorseCorrelate the new risorse correlate
|
||||
*/
|
||||
public void setRisorseCorrelate(List<String> risorseCorrelate) {
|
||||
this.risorseCorrelate = risorseCorrelate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the data inizio progetto.
|
||||
*
|
||||
* @return the data inizio progetto
|
||||
*/
|
||||
public String getDataInizioProgetto() {
|
||||
return dataInizioProgetto;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the data inizio progetto.
|
||||
*
|
||||
* @param dataInizioProgetto the new data inizio progetto
|
||||
*/
|
||||
public void setDataInizioProgetto(String dataInizioProgetto) {
|
||||
this.dataInizioProgetto = dataInizioProgetto;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the data fine progetto.
|
||||
*
|
||||
* @return the data fine progetto
|
||||
*/
|
||||
public String getDataFineProgetto() {
|
||||
return dataFineProgetto;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the data fine progetto.
|
||||
*
|
||||
* @param dataFineProgetto the new data fine progetto
|
||||
*/
|
||||
public void setDataFineProgetto(String dataFineProgetto) {
|
||||
this.dataFineProgetto = dataFineProgetto;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the titolari licenza.
|
||||
*
|
||||
* @return the titolari licenza
|
||||
*/
|
||||
public List<String> getTitolariLicenza() {
|
||||
return titolariLicenza;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the titolari licenza.
|
||||
*
|
||||
* @param titolariLicenza the new titolari licenza
|
||||
*/
|
||||
public void setTitolariLicenza(List<String> titolariLicenza) {
|
||||
this.titolariLicenza = titolariLicenza;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the titolari copyright.
|
||||
*
|
||||
* @return the titolari copyright
|
||||
*/
|
||||
public List<String> getTitolariCopyright() {
|
||||
return titolariCopyright;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the titolari copyright.
|
||||
*
|
||||
* @param titolariCopyright the new titolari copyright
|
||||
*/
|
||||
public void setTitolariCopyright(List<String> titolariCopyright) {
|
||||
this.titolariCopyright = titolariCopyright;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the parole chiave libere.
|
||||
*
|
||||
* @return the parole chiave libere
|
||||
*/
|
||||
public List<String> getParoleChiaveLibere() {
|
||||
return paroleChiaveLibere;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the parole chiave libere.
|
||||
*
|
||||
* @param paroleChiaveLibere the new parole chiave libere
|
||||
*/
|
||||
public void setParoleChiaveLibere(List<String> paroleChiaveLibere) {
|
||||
this.paroleChiaveLibere = paroleChiaveLibere;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the parole chiave ICCD.
|
||||
*
|
||||
* @return the parole chiave ICCD
|
||||
*/
|
||||
public List<String> getParoleChiaveICCD() {
|
||||
return paroleChiaveICCD;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the parole chiave ICCD.
|
||||
*
|
||||
* @param paroleChiaveICCD the new parole chiave ICCD
|
||||
*/
|
||||
public void setParoleChiaveICCD(List<String> paroleChiaveICCD) {
|
||||
this.paroleChiaveICCD = paroleChiaveICCD;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the centroid lat.
|
||||
*
|
||||
* @return the centroid lat
|
||||
*/
|
||||
public Double getCentroidLat() {
|
||||
return centroidLat;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the centroid lat.
|
||||
*
|
||||
* @param centroidLat the new centroid lat
|
||||
*/
|
||||
public void setCentroidLat(Double centroidLat) {
|
||||
this.centroidLat = centroidLat;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the centroid long.
|
||||
*
|
||||
* @return the centroid long
|
||||
*/
|
||||
public Double getCentroidLong() {
|
||||
return centroidLong;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the centroid long.
|
||||
*
|
||||
* @param centroidLong the new centroid long
|
||||
*/
|
||||
public void setCentroidLong(Double centroidLong) {
|
||||
this.centroidLong = centroidLong;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the relazione scavo.
|
||||
*
|
||||
* @return the relazione scavo
|
||||
*/
|
||||
public RelazioneScavoDV getRelazioneScavo() {
|
||||
return relazioneScavo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the relazione scavo.
|
||||
*
|
||||
* @param relazioneScavo the new relazione scavo
|
||||
*/
|
||||
public void setRelazioneScavo(RelazioneScavoDV relazioneScavo) {
|
||||
this.relazioneScavo = relazioneScavo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the immagini rappresentative.
|
||||
*
|
||||
* @return the immagini rappresentative
|
||||
*/
|
||||
public List<UploadedImageDV> getImmaginiRappresentative() {
|
||||
return immaginiRappresentative;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the immagini rappresentative.
|
||||
*
|
||||
* @param immaginiRappresentative the new immagini rappresentative
|
||||
*/
|
||||
public void setImmaginiRappresentative(List<UploadedImageDV> immaginiRappresentative) {
|
||||
this.immaginiRappresentative = immaginiRappresentative;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the posizionamento scavo.
|
||||
*
|
||||
* @return the posizionamento scavo
|
||||
*/
|
||||
public LayerConcessioneDV getPosizionamentoScavo() {
|
||||
return posizionamentoScavo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the posizionamento scavo.
|
||||
*
|
||||
* @param posizionamentoScavo the new posizionamento scavo
|
||||
*/
|
||||
public void setPosizionamentoScavo(LayerConcessioneDV posizionamentoScavo) {
|
||||
this.posizionamentoScavo = posizionamentoScavo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the piante fine scavo.
|
||||
*
|
||||
* @return the piante fine scavo
|
||||
*/
|
||||
public List<LayerConcessioneDV> getPianteFineScavo() {
|
||||
return pianteFineScavo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the piante fine scavo.
|
||||
*
|
||||
* @param pianteFineScavo the new piante fine scavo
|
||||
*/
|
||||
public void setPianteFineScavo(List<LayerConcessioneDV> pianteFineScavo) {
|
||||
this.pianteFineScavo = pianteFineScavo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the generic content.
|
||||
*
|
||||
* @return the generic content
|
||||
*/
|
||||
public List<OtherContentDV> getGenericContent() {
|
||||
return genericContent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the generic content.
|
||||
*
|
||||
* @param genericContent the new generic content
|
||||
*/
|
||||
public void setGenericContent(List<OtherContentDV> genericContent) {
|
||||
this.genericContent = genericContent;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the abstract relazione scavo.
|
||||
*
|
||||
* @return the abstract relazione scavo
|
||||
*/
|
||||
public AbstractRelazioneScavoDV getAbstractRelazioneScavo() {
|
||||
return abstractRelazioneScavo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the abstract relazione scavo.
|
||||
*
|
||||
* @param abstractRelazioneScavo the new abstract relazione scavo
|
||||
*/
|
||||
public void setAbstractRelazioneScavo(AbstractRelazioneScavoDV abstractRelazioneScavo) {
|
||||
this.abstractRelazioneScavo = abstractRelazioneScavo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append("ConcessioneDV [introduzione=");
|
||||
builder.append(introduzione);
|
||||
builder.append(", descrizioneContenuto=");
|
||||
builder.append(descrizioneContenuto);
|
||||
builder.append(", authors=");
|
||||
builder.append(authors);
|
||||
builder.append(", contributore=");
|
||||
builder.append(contributore);
|
||||
builder.append(", titolari=");
|
||||
builder.append(titolari);
|
||||
builder.append(", responsabile=");
|
||||
builder.append(responsabile);
|
||||
builder.append(", editore=");
|
||||
builder.append(editore);
|
||||
builder.append(", fontiFinanziamento=");
|
||||
builder.append(fontiFinanziamento);
|
||||
builder.append(", soggetto=");
|
||||
builder.append(soggetto);
|
||||
builder.append(", risorseCorrelate=");
|
||||
builder.append(risorseCorrelate);
|
||||
builder.append(", dataInizioProgetto=");
|
||||
builder.append(dataInizioProgetto);
|
||||
builder.append(", dataFineProgetto=");
|
||||
builder.append(dataFineProgetto);
|
||||
builder.append(", titolariLicenza=");
|
||||
builder.append(titolariLicenza);
|
||||
builder.append(", titolariCopyright=");
|
||||
builder.append(titolariCopyright);
|
||||
builder.append(", paroleChiaveLibere=");
|
||||
builder.append(paroleChiaveLibere);
|
||||
builder.append(", paroleChiaveICCD=");
|
||||
builder.append(paroleChiaveICCD);
|
||||
builder.append(", centroidLat=");
|
||||
builder.append(centroidLat);
|
||||
builder.append(", centroidLong=");
|
||||
builder.append(centroidLong);
|
||||
builder.append(", abstractRelazioneScavo=");
|
||||
builder.append(abstractRelazioneScavo);
|
||||
builder.append(", relazioneScavo=");
|
||||
builder.append(relazioneScavo);
|
||||
builder.append(", immaginiRappresentative=");
|
||||
builder.append(immaginiRappresentative);
|
||||
builder.append(", posizionamentoScavo=");
|
||||
builder.append(posizionamentoScavo);
|
||||
builder.append(", pianteFineScavo=");
|
||||
builder.append(pianteFineScavo);
|
||||
builder.append(", genericContent=");
|
||||
builder.append(genericContent);
|
||||
builder.append("]");
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
}
|
@ -1,202 +0,0 @@
|
||||
package org.gcube.portlets.user.geoportaldataviewer.shared.products.content;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.products.model.RecordDV;
|
||||
|
||||
import com.google.gwt.user.client.rpc.IsSerializable;
|
||||
|
||||
/**
|
||||
* The Class AssociatedContent.
|
||||
*
|
||||
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
|
||||
*
|
||||
* Nov 2, 2020
|
||||
*/
|
||||
public abstract class AssociatedContentDV implements IsSerializable, Serializable{
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -3666420861504055117L;
|
||||
|
||||
/** The id. */
|
||||
private long id;
|
||||
|
||||
/** The policy. */
|
||||
private String policy;
|
||||
|
||||
/** The license ID. */
|
||||
private String licenseID;
|
||||
|
||||
/** The titolo. */
|
||||
private String titolo;
|
||||
|
||||
/** The creation time. */
|
||||
private String creationTime;
|
||||
|
||||
/** The record. */
|
||||
private RecordDV record;
|
||||
|
||||
|
||||
/**
|
||||
* Instantiates a new associated content.
|
||||
*/
|
||||
public AssociatedContentDV() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Instantiates a new associated content.
|
||||
*
|
||||
* @param id the id
|
||||
* @param policy the policy
|
||||
* @param licenseID the license ID
|
||||
* @param titolo the titolo
|
||||
* @param creationTime the creation time
|
||||
* @param record the record
|
||||
*/
|
||||
public AssociatedContentDV(long id, String policy, String licenseID, String titolo, String creationTime,
|
||||
RecordDV record) {
|
||||
super();
|
||||
this.id = id;
|
||||
this.policy = policy;
|
||||
this.licenseID = licenseID;
|
||||
this.titolo = titolo;
|
||||
this.creationTime = creationTime;
|
||||
this.record = record;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the id.
|
||||
*
|
||||
* @return the id
|
||||
*/
|
||||
public long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the id.
|
||||
*
|
||||
* @param id the new id
|
||||
*/
|
||||
public void setId(long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the policy.
|
||||
*
|
||||
* @return the policy
|
||||
*/
|
||||
public String getPolicy() {
|
||||
return policy;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the policy.
|
||||
*
|
||||
* @param policy the new policy
|
||||
*/
|
||||
public void setPolicy(String policy) {
|
||||
this.policy = policy;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the license ID.
|
||||
*
|
||||
* @return the license ID
|
||||
*/
|
||||
public String getLicenseID() {
|
||||
return licenseID;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the license ID.
|
||||
*
|
||||
* @param licenseID the new license ID
|
||||
*/
|
||||
public void setLicenseID(String licenseID) {
|
||||
this.licenseID = licenseID;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the titolo.
|
||||
*
|
||||
* @return the titolo
|
||||
*/
|
||||
public String getTitolo() {
|
||||
return titolo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the titolo.
|
||||
*
|
||||
* @param titolo the new titolo
|
||||
*/
|
||||
public void setTitolo(String titolo) {
|
||||
this.titolo = titolo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the creation time.
|
||||
*
|
||||
* @return the creation time
|
||||
*/
|
||||
public String getCreationTime() {
|
||||
return creationTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the creation time.
|
||||
*
|
||||
* @param creationTime the new creation time
|
||||
*/
|
||||
public void setCreationTime(String creationTime) {
|
||||
this.creationTime = creationTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the record.
|
||||
*
|
||||
* @return the record
|
||||
*/
|
||||
public RecordDV getRecord() {
|
||||
return record;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the record.
|
||||
*
|
||||
* @param record the new record
|
||||
*/
|
||||
public void setRecord(RecordDV record) {
|
||||
this.record = record;
|
||||
}
|
||||
|
||||
/**
|
||||
* To string.
|
||||
*
|
||||
* @return the string
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append("AssociatedContent [id=");
|
||||
builder.append(id);
|
||||
builder.append(", policy=");
|
||||
builder.append(policy);
|
||||
builder.append(", licenseID=");
|
||||
builder.append(licenseID);
|
||||
builder.append(", titolo=");
|
||||
builder.append(titolo);
|
||||
builder.append(", creationTime=");
|
||||
builder.append(creationTime);
|
||||
builder.append(", record=");
|
||||
builder.append(record);
|
||||
builder.append("]");
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
}
|
@ -1,41 +0,0 @@
|
||||
package org.gcube.portlets.user.geoportaldataviewer.shared.products.content;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* The Class OtherContent.
|
||||
*
|
||||
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
|
||||
*
|
||||
* Nov 2, 2020
|
||||
*/
|
||||
public class OtherContentDV extends AssociatedContentDV implements Serializable{
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -2550361768550673836L;
|
||||
|
||||
/**
|
||||
* Instantiates a new other content.
|
||||
*/
|
||||
public OtherContentDV() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* To string.
|
||||
*
|
||||
* @return the string
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append("OtherContent [toString()=");
|
||||
builder.append(super.toString());
|
||||
builder.append("]");
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
}
|
@ -1,85 +0,0 @@
|
||||
package org.gcube.portlets.user.geoportaldataviewer.shared.products.content;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.google.gwt.user.client.rpc.IsSerializable;
|
||||
|
||||
/**
|
||||
* The Class WorkspaceContentDV.
|
||||
*
|
||||
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
|
||||
*
|
||||
* Nov 5, 2020
|
||||
*/
|
||||
public class WorkspaceContentDV implements IsSerializable, Serializable {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -3919923007831416696L;
|
||||
|
||||
/** The mimetype. */
|
||||
private String mimetype;
|
||||
|
||||
/** The storage ID. */
|
||||
private String storageID;
|
||||
|
||||
/** The link. */
|
||||
private String link;
|
||||
|
||||
private Long id;
|
||||
|
||||
public WorkspaceContentDV() {
|
||||
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getMimetype() {
|
||||
return mimetype;
|
||||
}
|
||||
|
||||
public void setMimetype(String mimetype) {
|
||||
this.mimetype = mimetype;
|
||||
}
|
||||
|
||||
public String getStorageID() {
|
||||
return storageID;
|
||||
}
|
||||
|
||||
public void setStorageID(String storageID) {
|
||||
this.storageID = storageID;
|
||||
}
|
||||
|
||||
public String getLink() {
|
||||
return link;
|
||||
}
|
||||
|
||||
public void setLink(String link) {
|
||||
this.link = link;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append("WorkspaceContentDV [mimetype=");
|
||||
builder.append(mimetype);
|
||||
builder.append(", storageID=");
|
||||
builder.append(storageID);
|
||||
builder.append(", link=");
|
||||
builder.append(link);
|
||||
builder.append(", id=");
|
||||
builder.append(id);
|
||||
builder.append("]");
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -1,152 +0,0 @@
|
||||
package org.gcube.portlets.user.geoportaldataviewer.shared.products.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.products.content.AssociatedContentDV;
|
||||
|
||||
|
||||
/**
|
||||
* The Class AbstractRelazioneScavoDV.
|
||||
*
|
||||
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
|
||||
*
|
||||
* Dec 21, 2020
|
||||
*/
|
||||
public class AbstractRelazioneScavoDV extends AssociatedContentDV implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 8768745863185590509L;
|
||||
|
||||
/** The abstract section. */
|
||||
private String abstractSectionIta;
|
||||
|
||||
private String abstractSectionEng;
|
||||
|
||||
/** The responsabili. */
|
||||
private List<String> responsabili;
|
||||
|
||||
/** The soggetto. */
|
||||
private List<String> soggetto;
|
||||
|
||||
/**
|
||||
* Instantiates a new abstract relazione scavo.
|
||||
*/
|
||||
public AbstractRelazioneScavoDV() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Instantiates a new abstract relazione scavo.
|
||||
*
|
||||
* @param abstractSectionIta the abstract section ita
|
||||
* @param abstractSectionEng the abstract section eng
|
||||
* @param responsabili the responsabili
|
||||
* @param soggetto the soggetto
|
||||
*/
|
||||
public AbstractRelazioneScavoDV(String abstractSectionIta, String abstractSectionEng, List<String> responsabili, List<String> soggetto) {
|
||||
super();
|
||||
this.abstractSectionIta = abstractSectionIta;
|
||||
this.abstractSectionEng = abstractSectionEng;
|
||||
this.responsabili = responsabili;
|
||||
this.soggetto = soggetto;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the abstract section ita.
|
||||
*
|
||||
* @return the abstract section ita
|
||||
*/
|
||||
public String getAbstractSectionIta() {
|
||||
return abstractSectionIta;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the abstract section ita.
|
||||
*
|
||||
* @param abstractSectionIta the new abstract section ita
|
||||
*/
|
||||
public void setAbstractSectionIta(String abstractSectionIta) {
|
||||
this.abstractSectionIta = abstractSectionIta;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the abstract section eng.
|
||||
*
|
||||
* @return the abstract section eng
|
||||
*/
|
||||
public String getAbstractSectionEng() {
|
||||
return abstractSectionEng;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the abstract section eng.
|
||||
*
|
||||
* @param abstractSectionEng the new abstract section eng
|
||||
*/
|
||||
public void setAbstractSectionEng(String abstractSectionEng) {
|
||||
this.abstractSectionEng = abstractSectionEng;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the responsabili.
|
||||
*
|
||||
* @return the responsabili
|
||||
*/
|
||||
public List<String> getResponsabili() {
|
||||
return responsabili;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the responsabili.
|
||||
*
|
||||
* @param responsabili the new responsabili
|
||||
*/
|
||||
public void setResponsabili(List<String> responsabili) {
|
||||
this.responsabili = responsabili;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the soggetto.
|
||||
*
|
||||
* @return the soggetto
|
||||
*/
|
||||
public List<String> getSoggetto() {
|
||||
return soggetto;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the soggetto.
|
||||
*
|
||||
* @param soggetto the new soggetto
|
||||
*/
|
||||
public void setSoggetto(List<String> soggetto) {
|
||||
this.soggetto = soggetto;
|
||||
}
|
||||
|
||||
/**
|
||||
* To string.
|
||||
*
|
||||
* @return the string
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append("RelazioneScavoDV [abstractSectionIta=");
|
||||
builder.append(abstractSectionIta);
|
||||
builder.append(", abstractSectionEng=");
|
||||
builder.append(abstractSectionEng);
|
||||
builder.append(", responsabili=");
|
||||
builder.append(responsabili);
|
||||
builder.append(", soggetto=");
|
||||
builder.append(soggetto);
|
||||
builder.append("]");
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -1,135 +0,0 @@
|
||||
package org.gcube.portlets.user.geoportaldataviewer.shared.products.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.BoundsMap;
|
||||
|
||||
import com.google.gwt.user.client.rpc.IsSerializable;
|
||||
|
||||
public class LayerConcessioneDV extends SDILayerDescriptorDV implements IsSerializable, Serializable{
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 2633250621043744245L;
|
||||
|
||||
// 1.Identificazione
|
||||
private String abstractSection;
|
||||
|
||||
// 2.Classificazione
|
||||
private String topicCategory;
|
||||
|
||||
// 3.Keyword
|
||||
private String subTopic;
|
||||
|
||||
// 4. Delimitazione geographica
|
||||
private BoundsMap bbox;
|
||||
|
||||
// 5. Temporal
|
||||
|
||||
// 6. Quality
|
||||
private String valutazioneQualita;
|
||||
|
||||
private String metodoRaccoltaDati;
|
||||
|
||||
private String scalaAcquisizione;
|
||||
|
||||
private List<String> authors;
|
||||
|
||||
public LayerConcessioneDV() {
|
||||
|
||||
}
|
||||
|
||||
public String getAbstractSection() {
|
||||
return abstractSection;
|
||||
}
|
||||
|
||||
public void setAbstractSection(String abstractSection) {
|
||||
this.abstractSection = abstractSection;
|
||||
}
|
||||
|
||||
public String getTopicCategory() {
|
||||
return topicCategory;
|
||||
}
|
||||
|
||||
public void setTopicCategory(String topicCategory) {
|
||||
this.topicCategory = topicCategory;
|
||||
}
|
||||
|
||||
public String getSubTopic() {
|
||||
return subTopic;
|
||||
}
|
||||
|
||||
public void setSubTopic(String subTopic) {
|
||||
this.subTopic = subTopic;
|
||||
}
|
||||
|
||||
public BoundsMap getBbox() {
|
||||
return bbox;
|
||||
}
|
||||
|
||||
public void setBbox(BoundsMap bbox) {
|
||||
this.bbox = bbox;
|
||||
}
|
||||
|
||||
public String getValutazioneQualita() {
|
||||
return valutazioneQualita;
|
||||
}
|
||||
|
||||
public void setValutazioneQualita(String valutazioneQualita) {
|
||||
this.valutazioneQualita = valutazioneQualita;
|
||||
}
|
||||
|
||||
public String getMetodoRaccoltaDati() {
|
||||
return metodoRaccoltaDati;
|
||||
}
|
||||
|
||||
public void setMetodoRaccoltaDati(String metodoRaccoltaDati) {
|
||||
this.metodoRaccoltaDati = metodoRaccoltaDati;
|
||||
}
|
||||
|
||||
public String getScalaAcquisizione() {
|
||||
return scalaAcquisizione;
|
||||
}
|
||||
|
||||
public void setScalaAcquisizione(String scalaAcquisizione) {
|
||||
this.scalaAcquisizione = scalaAcquisizione;
|
||||
}
|
||||
|
||||
public List<String> getAuthors() {
|
||||
return authors;
|
||||
}
|
||||
|
||||
public void setAuthors(List<String> authors) {
|
||||
this.authors = authors;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append("LayerConcessione [abstractSection=");
|
||||
builder.append(abstractSection);
|
||||
builder.append(", topicCategory=");
|
||||
builder.append(topicCategory);
|
||||
builder.append(", subTopic=");
|
||||
builder.append(subTopic);
|
||||
builder.append(", bbox=");
|
||||
builder.append(bbox);
|
||||
builder.append(", valutazioneQualita=");
|
||||
builder.append(valutazioneQualita);
|
||||
builder.append(", metodoRaccoltaDati=");
|
||||
builder.append(metodoRaccoltaDati);
|
||||
builder.append(", scalaAcquisizione=");
|
||||
builder.append(scalaAcquisizione);
|
||||
builder.append(", authors=");
|
||||
builder.append(authors);
|
||||
builder.append(", wmsLink=");
|
||||
builder.append(super.getWmsLink());
|
||||
builder.append(", layerName=");
|
||||
builder.append(super.getLayerName());
|
||||
builder.append("]");
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
}
|
@ -1,291 +0,0 @@
|
||||
package org.gcube.portlets.user.geoportaldataviewer.shared.products.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.google.gwt.user.client.rpc.IsSerializable;
|
||||
|
||||
/**
|
||||
* The Class Record.
|
||||
*
|
||||
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
|
||||
*
|
||||
* Nov 2, 2020
|
||||
*/
|
||||
public abstract class RecordDV implements Serializable, IsSerializable {
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 2913726613820175679L;
|
||||
|
||||
/** The id. */
|
||||
private Long id;
|
||||
|
||||
/** The record type. */
|
||||
private String recordType;
|
||||
|
||||
/** The version. */
|
||||
private String version = "1.0.0";
|
||||
|
||||
/** The licenza ID. */
|
||||
private String licenzaID;
|
||||
|
||||
private String policy;
|
||||
|
||||
/** The nome. */
|
||||
// Nome del progetto
|
||||
private String nome;
|
||||
|
||||
/** The folder id. */
|
||||
// Storage Info
|
||||
private String folderId;
|
||||
|
||||
/** The last update time. */
|
||||
// Accounting
|
||||
private String lastUpdateTime;
|
||||
|
||||
/** The last update user. */
|
||||
private String lastUpdateUser;
|
||||
|
||||
/** The creation time. */
|
||||
private String creationTime;
|
||||
|
||||
/** The creation user. */
|
||||
private String creationUser;
|
||||
|
||||
/**
|
||||
* Instantiates a new record.
|
||||
*/
|
||||
public RecordDV() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the id.
|
||||
*
|
||||
* @return the id
|
||||
*/
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the id.
|
||||
*
|
||||
* @param id the new id
|
||||
*/
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the record type.
|
||||
*
|
||||
* @return the record type
|
||||
*/
|
||||
public String getRecordType() {
|
||||
return recordType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the record type.
|
||||
*
|
||||
* @param recordType the new record type
|
||||
*/
|
||||
public void setRecordType(String recordType) {
|
||||
this.recordType = recordType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the version.
|
||||
*
|
||||
* @return the version
|
||||
*/
|
||||
public String getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the version.
|
||||
*
|
||||
* @param version the new version
|
||||
*/
|
||||
public void setVersion(String version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the licenza ID.
|
||||
*
|
||||
* @return the licenza ID
|
||||
*/
|
||||
public String getLicenzaID() {
|
||||
return licenzaID;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the licenza ID.
|
||||
*
|
||||
* @param licenzaID the new licenza ID
|
||||
*/
|
||||
public void setLicenzaID(String licenzaID) {
|
||||
this.licenzaID = licenzaID;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the accesso.
|
||||
*
|
||||
* @return the accesso
|
||||
*/
|
||||
public String getPolicy() {
|
||||
return policy;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the accesso.
|
||||
*
|
||||
* @param policy the new policy
|
||||
*/
|
||||
public void setPolicy(String policy) {
|
||||
this.policy = policy;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the nome.
|
||||
*
|
||||
* @return the nome
|
||||
*/
|
||||
public String getNome() {
|
||||
return nome;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the nome.
|
||||
*
|
||||
* @param nome the new nome
|
||||
*/
|
||||
public void setNome(String nome) {
|
||||
this.nome = nome;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the folder id.
|
||||
*
|
||||
* @return the folder id
|
||||
*/
|
||||
public String getFolderId() {
|
||||
return folderId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the folder id.
|
||||
*
|
||||
* @param folderId the new folder id
|
||||
*/
|
||||
public void setFolderId(String folderId) {
|
||||
this.folderId = folderId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the last update time.
|
||||
*
|
||||
* @return the last update time
|
||||
*/
|
||||
public String getLastUpdateTime() {
|
||||
return lastUpdateTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the last update time.
|
||||
*
|
||||
* @param lastUpdateTime the new last update time
|
||||
*/
|
||||
public void setLastUpdateTime(String lastUpdateTime) {
|
||||
this.lastUpdateTime = lastUpdateTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the last update user.
|
||||
*
|
||||
* @return the last update user
|
||||
*/
|
||||
public String getLastUpdateUser() {
|
||||
return lastUpdateUser;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the last update user.
|
||||
*
|
||||
* @param lastUpdateUser the new last update user
|
||||
*/
|
||||
public void setLastUpdateUser(String lastUpdateUser) {
|
||||
this.lastUpdateUser = lastUpdateUser;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the creation time.
|
||||
*
|
||||
* @return the creation time
|
||||
*/
|
||||
public String getCreationTime() {
|
||||
return creationTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the creation time.
|
||||
*
|
||||
* @param creationTime the new creation time
|
||||
*/
|
||||
public void setCreationTime(String creationTime) {
|
||||
this.creationTime = creationTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the creation user.
|
||||
*
|
||||
* @return the creation user
|
||||
*/
|
||||
public String getCreationUser() {
|
||||
return creationUser;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the creation user.
|
||||
*
|
||||
* @param creationUser the new creation user
|
||||
*/
|
||||
public void setCreationUser(String creationUser) {
|
||||
this.creationUser = creationUser;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append("RecordDV [id=");
|
||||
builder.append(id);
|
||||
builder.append(", recordType=");
|
||||
builder.append(recordType);
|
||||
builder.append(", version=");
|
||||
builder.append(version);
|
||||
builder.append(", licenzaID=");
|
||||
builder.append(licenzaID);
|
||||
builder.append(", policy=");
|
||||
builder.append(policy);
|
||||
builder.append(", nome=");
|
||||
builder.append(nome);
|
||||
builder.append(", folderId=");
|
||||
builder.append(folderId);
|
||||
builder.append(", lastUpdateTime=");
|
||||
builder.append(lastUpdateTime);
|
||||
builder.append(", lastUpdateUser=");
|
||||
builder.append(lastUpdateUser);
|
||||
builder.append(", creationTime=");
|
||||
builder.append(creationTime);
|
||||
builder.append(", creationUser=");
|
||||
builder.append(creationUser);
|
||||
builder.append("]");
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
}
|
@ -1,125 +0,0 @@
|
||||
package org.gcube.portlets.user.geoportaldataviewer.shared.products.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.products.content.AssociatedContentDV;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.products.content.WorkspaceContentDV;
|
||||
|
||||
|
||||
/**
|
||||
* The Class RelazioneScavoDV.
|
||||
*
|
||||
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
|
||||
*
|
||||
* Dec 21, 2020
|
||||
*/
|
||||
public class RelazioneScavoDV extends AssociatedContentDV implements Serializable {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 2456950567302197554L;
|
||||
|
||||
/** The responsabili. */
|
||||
private List<String> responsabili;
|
||||
|
||||
/** The soggetto. */
|
||||
private List<String> soggetto;
|
||||
|
||||
private List<WorkspaceContentDV> listWsContent;
|
||||
|
||||
/**
|
||||
* Instantiates a new relazione scavo DV.
|
||||
*/
|
||||
public RelazioneScavoDV() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Instantiates a new relazione scavo DV.
|
||||
*
|
||||
* @param responsabili the responsabili
|
||||
* @param soggetto the soggetto
|
||||
*/
|
||||
public RelazioneScavoDV(List<String> responsabili, List<String> soggetto) {
|
||||
super();
|
||||
this.responsabili = responsabili;
|
||||
this.soggetto = soggetto;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the responsabili.
|
||||
*
|
||||
* @return the responsabili
|
||||
*/
|
||||
public List<String> getResponsabili() {
|
||||
return responsabili;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the responsabili.
|
||||
*
|
||||
* @param responsabili the new responsabili
|
||||
*/
|
||||
public void setResponsabili(List<String> responsabili) {
|
||||
this.responsabili = responsabili;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the soggetto.
|
||||
*
|
||||
* @return the soggetto
|
||||
*/
|
||||
public List<String> getSoggetto() {
|
||||
return soggetto;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the soggetto.
|
||||
*
|
||||
* @param soggetto the new soggetto
|
||||
*/
|
||||
public void setSoggetto(List<String> soggetto) {
|
||||
this.soggetto = soggetto;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the list ws content.
|
||||
*
|
||||
* @return the list ws content
|
||||
*/
|
||||
public List<WorkspaceContentDV> getListWsContent() {
|
||||
return listWsContent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the list ws content.
|
||||
*
|
||||
* @param listWsContent the new list ws content
|
||||
*/
|
||||
public void setListWsContent(List<WorkspaceContentDV> listWsContent) {
|
||||
this.listWsContent = listWsContent;
|
||||
}
|
||||
|
||||
/**
|
||||
* To string.
|
||||
*
|
||||
* @return the string
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append("RelazioneScavoDV [responsabili=");
|
||||
builder.append(responsabili);
|
||||
builder.append(", soggetto=");
|
||||
builder.append(soggetto);
|
||||
builder.append(", listWsContent=");
|
||||
builder.append(listWsContent);
|
||||
builder.append("]");
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -1,143 +0,0 @@
|
||||
package org.gcube.portlets.user.geoportaldataviewer.shared.products.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.products.content.AssociatedContentDV;
|
||||
|
||||
import com.google.gwt.user.client.rpc.IsSerializable;
|
||||
|
||||
|
||||
/**
|
||||
* The Class SDILayerDescriptorDV.
|
||||
*
|
||||
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
|
||||
*
|
||||
* Nov 4, 2020
|
||||
*/
|
||||
public class SDILayerDescriptorDV extends AssociatedContentDV implements IsSerializable, Serializable {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 6137246723753812015L;
|
||||
// meta
|
||||
private String layerUUID;
|
||||
private Long layerID;
|
||||
|
||||
// layer
|
||||
private String layerName;
|
||||
private String wmsLink;
|
||||
|
||||
/**
|
||||
* Instantiates a new SDI layer descriptor DV.
|
||||
*/
|
||||
public SDILayerDescriptorDV() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Instantiates a new SDI layer descriptor DV.
|
||||
*
|
||||
* @param layerUUID the layer UUID
|
||||
* @param layerID the layer ID
|
||||
* @param layerName the layer name
|
||||
* @param wmsLink the wms link
|
||||
*/
|
||||
public SDILayerDescriptorDV(String layerUUID, Long layerID, String layerName, String wmsLink) {
|
||||
super();
|
||||
this.layerUUID = layerUUID;
|
||||
this.layerID = layerID;
|
||||
this.layerName = layerName;
|
||||
this.wmsLink = wmsLink;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the layer UUID.
|
||||
*
|
||||
* @return the layer UUID
|
||||
*/
|
||||
public String getLayerUUID() {
|
||||
return layerUUID;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the layer UUID.
|
||||
*
|
||||
* @param layerUUID the new layer UUID
|
||||
*/
|
||||
public void setLayerUUID(String layerUUID) {
|
||||
this.layerUUID = layerUUID;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the layer ID.
|
||||
*
|
||||
* @return the layer ID
|
||||
*/
|
||||
public Long getLayerID() {
|
||||
return layerID;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the layer ID.
|
||||
*
|
||||
* @param layerID the new layer ID
|
||||
*/
|
||||
public void setLayerID(Long layerID) {
|
||||
this.layerID = layerID;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the layer name.
|
||||
*
|
||||
* @return the layer name
|
||||
*/
|
||||
public String getLayerName() {
|
||||
return layerName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the layer name.
|
||||
*
|
||||
* @param layerName the new layer name
|
||||
*/
|
||||
public void setLayerName(String layerName) {
|
||||
this.layerName = layerName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the wms link.
|
||||
*
|
||||
* @return the wms link
|
||||
*/
|
||||
public String getWmsLink() {
|
||||
return wmsLink;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the wms link.
|
||||
*
|
||||
* @param wmsLink the new wms link
|
||||
*/
|
||||
public void setWmsLink(String wmsLink) {
|
||||
this.wmsLink = wmsLink;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.gcube.portlets.user.geoportaldataviewer.shared.products.content.AssociatedContentDV#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append("SDILayerDescriptor [layerUUID=");
|
||||
builder.append(layerUUID);
|
||||
builder.append(", layerID=");
|
||||
builder.append(layerID);
|
||||
builder.append(", layerName=");
|
||||
builder.append(layerName);
|
||||
builder.append(", wmsLink=");
|
||||
builder.append(wmsLink);
|
||||
builder.append("]");
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
}
|
@ -1,141 +0,0 @@
|
||||
package org.gcube.portlets.user.geoportaldataviewer.shared.products.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.products.content.AssociatedContentDV;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.products.content.WorkspaceContentDV;
|
||||
|
||||
import com.google.gwt.user.client.rpc.IsSerializable;
|
||||
|
||||
/**
|
||||
* The Class UploadedImage.
|
||||
*
|
||||
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
|
||||
*
|
||||
* Nov 2, 2020
|
||||
*/
|
||||
public class UploadedImageDV extends AssociatedContentDV implements IsSerializable, Serializable {
|
||||
|
||||
/** The Constant serialVersionUID. */
|
||||
private static final long serialVersionUID = 809167060189883015L;
|
||||
|
||||
/** The didascalia. */
|
||||
private String didascalia;
|
||||
|
||||
/** The format. */
|
||||
private String format;
|
||||
|
||||
/** The responsabili. */
|
||||
private List<String> responsabili;
|
||||
|
||||
/** The soggetto. */
|
||||
private List<String> soggetto;
|
||||
|
||||
private List<WorkspaceContentDV> listWsContent;
|
||||
|
||||
/**
|
||||
* Instantiates a new uploaded image.
|
||||
*/
|
||||
public UploadedImageDV() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the didascalia.
|
||||
*
|
||||
* @return the didascalia
|
||||
*/
|
||||
public String getDidascalia() {
|
||||
return didascalia;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the didascalia.
|
||||
*
|
||||
* @param didascalia the new didascalia
|
||||
*/
|
||||
public void setDidascalia(String didascalia) {
|
||||
this.didascalia = didascalia;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the format.
|
||||
*
|
||||
* @return the format
|
||||
*/
|
||||
public String getFormat() {
|
||||
return format;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the format.
|
||||
*
|
||||
* @param format the new format
|
||||
*/
|
||||
public void setFormat(String format) {
|
||||
this.format = format;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the responsabili.
|
||||
*
|
||||
* @return the responsabili
|
||||
*/
|
||||
public List<String> getResponsabili() {
|
||||
return responsabili;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the responsabili.
|
||||
*
|
||||
* @param responsabili the new responsabili
|
||||
*/
|
||||
public void setResponsabili(List<String> responsabili) {
|
||||
this.responsabili = responsabili;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the soggetto.
|
||||
*
|
||||
* @return the soggetto
|
||||
*/
|
||||
public List<String> getSoggetto() {
|
||||
return soggetto;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the soggetto.
|
||||
*
|
||||
* @param soggetto the new soggetto
|
||||
*/
|
||||
public void setSoggetto(List<String> soggetto) {
|
||||
this.soggetto = soggetto;
|
||||
}
|
||||
|
||||
public List<WorkspaceContentDV> getListWsContent() {
|
||||
return listWsContent;
|
||||
}
|
||||
|
||||
public void setListWsContent(List<WorkspaceContentDV> listWsContent) {
|
||||
this.listWsContent = listWsContent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append("UploadedImageDV [didascalia=");
|
||||
builder.append(didascalia);
|
||||
builder.append(", format=");
|
||||
builder.append(format);
|
||||
builder.append(", responsabili=");
|
||||
builder.append(responsabili);
|
||||
builder.append(", soggetto=");
|
||||
builder.append(soggetto);
|
||||
builder.append(", listWsContent=");
|
||||
builder.append(listWsContent);
|
||||
builder.append("]");
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
package org.gcube.portlets.user.geoportaldataviewer;
|
||||
|
||||
import static org.gcube.application.geoportal.client.GeoportalAbstractPlugin.statefulMongoConcessioni;
|
||||
|
||||
import org.gcube.application.geoportal.client.legacy.ConcessioniManagerI;
|
||||
import org.gcube.application.geoportal.common.model.legacy.Concessione;
|
||||
import org.gcube.application.geoportalcommon.ConvertToDataViewModel;
|
||||
import org.gcube.application.geoportalcommon.shared.products.ConcessioneDV;
|
||||
import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
|
||||
import org.gcube.common.scope.api.ScopeProvider;
|
||||
|
||||
public class ConcessioneReader {
|
||||
|
||||
private static final String YOUR_TOKEN = "";
|
||||
|
||||
public static String SCOPE = "/gcube/devsec/devVRE";
|
||||
public static String mongoConcessioneID = "6102c07002ad3d05b5f81ddc";
|
||||
|
||||
//@Before
|
||||
public void setEnviroment() {
|
||||
ScopeProvider.instance.set(SCOPE);
|
||||
SecurityTokenProvider.instance.set(YOUR_TOKEN);
|
||||
|
||||
}
|
||||
|
||||
//@Test
|
||||
public void readConcessione() throws Exception {
|
||||
System.out.println("getConcessioneForId " + mongoConcessioneID + "called");
|
||||
|
||||
ConcessioneDV concessionDV = null;
|
||||
|
||||
if (mongoConcessioneID == null)
|
||||
throw new Exception("Invalid parameter. The Id is null");
|
||||
|
||||
try {
|
||||
System.out.println("Trying to get record for id " + mongoConcessioneID);
|
||||
ConcessioniManagerI concessioniManager = statefulMongoConcessioni().build();
|
||||
Concessione concessione = concessioniManager.getById(mongoConcessioneID);
|
||||
System.out.println("For id " + mongoConcessioneID + ", got concessione " + concessione);
|
||||
System.out.println("Immagini Rappresentative are: " + concessione.getImmaginiRappresentative());
|
||||
System.out.println("Relazione scavo: " + concessione.getRelazioneScavo());
|
||||
System.out.println("Pianta Fine scavo: " + concessione.getPianteFineScavo());
|
||||
System.out.println("Posizionamento scavo: " + concessione.getPosizionamentoScavo());
|
||||
|
||||
if (concessione != null) {
|
||||
concessionDV = ConvertToDataViewModel.toConcessione(concessione);
|
||||
}
|
||||
|
||||
if (concessionDV == null)
|
||||
throw new Exception("Concessione not retrieved");
|
||||
|
||||
System.out.println("Got concessione: " + concessionDV);
|
||||
|
||||
} catch (Exception e) {
|
||||
String erroMsg = Concessione.class.getSimpleName() + " with id " + mongoConcessioneID + " not available";
|
||||
throw new Exception(erroMsg);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,64 +0,0 @@
|
||||
package org.gcube.portlets.user.geoportaldataviewer;
|
||||
|
||||
import org.gcube.application.geoportal.client.legacy.ConcessioniManager;
|
||||
import org.gcube.application.geoportal.common.model.legacy.Concessione;
|
||||
import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
|
||||
import org.gcube.common.scope.api.ScopeProvider;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.server.ConvertToDataViewModel;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.products.ConcessioneDV;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class GetConcessione {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(GetConcessione.class);
|
||||
|
||||
private static final String YOUR_TOKEN = "";
|
||||
|
||||
public static String SCOPE = "/gcube/devsec/devVRE";
|
||||
public static long concessioneId = 8;
|
||||
|
||||
public static ConcessioneDV getConcessioneForId(Long id) throws Exception{
|
||||
LOG.info("getConcessioneForId "+id+ "called");
|
||||
|
||||
ConcessioneDV concessionDV = null;
|
||||
|
||||
if(id==null)
|
||||
throw new Exception("Invalid parameter. The Id is null");
|
||||
|
||||
try {
|
||||
LOG.info("Trying to get record for id "+id);
|
||||
Concessione concessione = new ConcessioniManager().getById(id+"");
|
||||
LOG.info("For id "+id+", got concessione "+concessione);
|
||||
LOG.info("Immagini Rappresentative are: "+concessione.getImmaginiRappresentative());
|
||||
LOG.info("Relazione scavo: "+concessione.getRelazioneScavo());
|
||||
LOG.info("Pianta Fine scavo: "+concessione.getPianteFineScavo());
|
||||
LOG.info("Posizionamento scavo: "+concessione.getPosizionamentoScavo());
|
||||
|
||||
if(concessione !=null) {
|
||||
concessionDV = ConvertToDataViewModel.toConcessione(concessione);
|
||||
}
|
||||
|
||||
if(concessionDV==null)
|
||||
throw new Exception("Concessione not retrieved");
|
||||
|
||||
return concessionDV;
|
||||
|
||||
}catch (Exception e) {
|
||||
String erroMsg = Concessione.class.getSimpleName() +" with id "+id+" not available";
|
||||
LOG.error(erroMsg,e);
|
||||
throw new Exception(erroMsg);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
ScopeProvider.instance.set(SCOPE);
|
||||
SecurityTokenProvider.instance.set(YOUR_TOKEN);
|
||||
LOG.info("Trying to get record for id "+concessioneId);
|
||||
ConcessioneDV concessione = getConcessioneForId(concessioneId);
|
||||
LOG.info("Got record for id "+concessione);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
package org.gcube.portlets.user.geoportaldataviewer;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.gcube.application.geoportal.common.model.legacy.Concessione;
|
||||
import org.gcube.common.scope.api.ScopeProvider;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.server.mongoservice.IAMClientCredentialsReader;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.server.mongoservice.accessidentity.IAMClientCredentials;
|
||||
import org.junit.Test;
|
||||
|
||||
public class IAMClient {
|
||||
|
||||
private static final String SCOPE = "/gcube/devsec/devVRE";
|
||||
private static final String MONGO_ITEM_ID = "614af6a502ad3d6128abd43f";
|
||||
|
||||
@Test
|
||||
public void readCredentials() {
|
||||
System.out.println("called readCredentials test");
|
||||
ScopeProvider.instance.set(SCOPE);
|
||||
IAMClientCredentials credentials = null;
|
||||
try {
|
||||
credentials = IAMClientCredentialsReader.getCredentials();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
System.out.println("Read credentials: " + credentials);
|
||||
Concessione concessione;
|
||||
try {
|
||||
// concessione = new ConcessioniMongoServiceIdentityProxy();
|
||||
|
||||
// System.out.println("Get concessione: " + concessione);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue