use of edu.harvard.iq.dataverse.MapLayerMetadata in project dataverse by IQSS.
the class Geoconnect method checkStatus.
private JsonObjectBuilder checkStatus(MapLayerMetadata unmodified) {
JsonObjectBuilder jsonObjectBuilder = Json.createObjectBuilder();
jsonObjectBuilder.add("fileId", unmodified.getDataFile().getId());
jsonObjectBuilder.add("mapLayerMetadataId", unmodified.getId());
jsonObjectBuilder.add("layerLink", unmodified.getLayerLink());
jsonObjectBuilder.add("fileLandingPage", systemConfig.getDataverseSiteUrl() + "/file.xhtml?fileId=" + unmodified.getDataFile().getId());
MapLayerMetadata modified = updateLastVerifiedTimeAndStatusCode(unmodified);
if (modified != null) {
jsonObjectBuilder.add("lastVerifiedStatus", modified.getLastVerifiedStatus());
} else {
jsonObjectBuilder.add("error", "Could not check status of map associate with file id " + unmodified.getDataFile().getId());
}
return jsonObjectBuilder;
}
use of edu.harvard.iq.dataverse.MapLayerMetadata in project dataverse by IQSS.
the class WorldMapPermissionHelper method loadMapLayerMetadataLookup.
/**
* Create a hashmap consisting of { DataFile.id : MapLayerMetadata object}
*
* Very few DataFiles will have associated MapLayerMetadata objects so only
* use 1 query to get them
*/
private void loadMapLayerMetadataLookup(Dataset dataset) {
mapLayerMetadataLookup = new HashMap<>();
if (dataset == null) {
}
if (dataset.getId() == null) {
return;
}
List<MapLayerMetadata> mapLayerMetadataList = mapLayerMetadataService.getMapLayerMetadataForDataset(dataset);
if (mapLayerMetadataList == null) {
return;
}
for (MapLayerMetadata layer_metadata : mapLayerMetadataList) {
mapLayerMetadataLookup.put(layer_metadata.getDataFile().getId(), layer_metadata);
}
}
Aggregations