|
|
|
@ -19,6 +19,7 @@ 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;
|
|
|
|
@ -95,6 +96,7 @@ public class ConvertToDataViewModel {
|
|
|
|
|
|
|
|
|
|
theConcessione.setRecordType(concessione.getRecordType().name());
|
|
|
|
|
|
|
|
|
|
theConcessione.setAbstractRelazioneScavo(toAbstractRelazioneScavo(concessione.getRelazioneScavo()));
|
|
|
|
|
theConcessione.setRelazioneScavo(toRelazioneScavo(concessione.getRelazioneScavo()));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -155,6 +157,12 @@ public class ConvertToDataViewModel {
|
|
|
|
|
// return destList;
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* To user.
|
|
|
|
|
*
|
|
|
|
|
* @param username the username
|
|
|
|
|
* @return the string
|
|
|
|
|
*/
|
|
|
|
|
public static String toUser(String username) {
|
|
|
|
|
|
|
|
|
|
if(username==null)
|
|
|
|
@ -164,6 +172,12 @@ public class ConvertToDataViewModel {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* To policy.
|
|
|
|
|
*
|
|
|
|
|
* @param policy the policy
|
|
|
|
|
* @return the string
|
|
|
|
|
*/
|
|
|
|
|
public static String toPolicy(AccessPolicy policy) {
|
|
|
|
|
|
|
|
|
|
if(policy==null)
|
|
|
|
@ -173,6 +187,12 @@ public class ConvertToDataViewModel {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* To date format string.
|
|
|
|
|
*
|
|
|
|
|
* @param dateTime the date time
|
|
|
|
|
* @return the string
|
|
|
|
|
*/
|
|
|
|
|
public static String toDateFormatString(LocalDateTime dateTime) {
|
|
|
|
|
|
|
|
|
|
if(dateTime==null)
|
|
|
|
@ -200,12 +220,39 @@ public class ConvertToDataViewModel {
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
* @param recordDV the record data view
|
|
|
|
|
* @return the relazione scavo data view
|
|
|
|
|
*/
|
|
|
|
|
public static RelazioneScavoDV toRelazioneScavo(RelazioneScavo relazioneScavo) {
|
|
|
|
@ -214,7 +261,6 @@ public class ConvertToDataViewModel {
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
|
|
RelazioneScavoDV theRelazioneDiScavo = new RelazioneScavoDV();
|
|
|
|
|
theRelazioneDiScavo.setAbstractSection(relazioneScavo.getAbstractSection());
|
|
|
|
|
theRelazioneDiScavo.setCreationTime(toDateFormatString(relazioneScavo.getCreationTime()));
|
|
|
|
|
theRelazioneDiScavo.setId(relazioneScavo.getId());
|
|
|
|
|
theRelazioneDiScavo.setLicenseID(relazioneScavo.getLicenseID());
|
|
|
|
@ -223,16 +269,27 @@ public class ConvertToDataViewModel {
|
|
|
|
|
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
|
|
|
|
|
* @param recordDV the record data-view
|
|
|
|
|
* @return the uploaded image data-view
|
|
|
|
|
*/
|
|
|
|
|
public static UploadedImageDV toUploadedImage(UploadedImage uploadedImage) {
|
|
|
|
@ -292,7 +349,6 @@ public class ConvertToDataViewModel {
|
|
|
|
|
* To layer concessione.
|
|
|
|
|
*
|
|
|
|
|
* @param layerConcessione the layer concessione
|
|
|
|
|
* @param recordDV the record DV
|
|
|
|
|
* @return the layer concessione data view
|
|
|
|
|
*/
|
|
|
|
|
public static LayerConcessioneDV toLayerConcessione(LayerConcessione layerConcessione) {
|
|
|
|
@ -355,7 +411,6 @@ public class ConvertToDataViewModel {
|
|
|
|
|
* To other content DV.
|
|
|
|
|
*
|
|
|
|
|
* @param otherContent the other content
|
|
|
|
|
* @param recordDV the record DV
|
|
|
|
|
* @return the other content DV
|
|
|
|
|
*/
|
|
|
|
|
public static OtherContentDV toOtherContentDV(OtherContent otherContent) {
|
|
|
|
@ -392,7 +447,9 @@ public class ConvertToDataViewModel {
|
|
|
|
|
/**
|
|
|
|
|
* 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) {
|
|
|
|
@ -423,6 +480,12 @@ public class ConvertToDataViewModel {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* To double.
|
|
|
|
|
*
|
|
|
|
|
* @param value the value
|
|
|
|
|
* @return the double
|
|
|
|
|
*/
|
|
|
|
|
public static Double toDouble(String value) {
|
|
|
|
|
try {
|
|
|
|
|
return Double.parseDouble(value);
|
|
|
|
|