git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-analysis/EcologicalEngineGeoSpatialExtension@131922 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
4f37b11790
commit
83fa41bc88
|
@ -13,14 +13,14 @@ import org.gcube.dataanalysis.ecoengine.datatypes.InputTable;
|
||||||
import org.gcube.dataanalysis.ecoengine.datatypes.OutputTable;
|
import org.gcube.dataanalysis.ecoengine.datatypes.OutputTable;
|
||||||
import org.gcube.dataanalysis.ecoengine.datatypes.StatisticalType;
|
import org.gcube.dataanalysis.ecoengine.datatypes.StatisticalType;
|
||||||
import org.gcube.dataanalysis.ecoengine.datatypes.enumtypes.TableTemplates;
|
import org.gcube.dataanalysis.ecoengine.datatypes.enumtypes.TableTemplates;
|
||||||
import org.gcube.dataanalysis.ecoengine.interfaces.StandardLocalExternalAlgorithm;
|
import org.gcube.dataanalysis.ecoengine.interfaces.StandardLocalInfraAlgorithm;
|
||||||
import org.gcube.dataanalysis.ecoengine.utils.DatabaseFactory;
|
import org.gcube.dataanalysis.ecoengine.utils.DatabaseFactory;
|
||||||
import org.gcube.dataanalysis.ecoengine.utils.DatabaseUtils;
|
import org.gcube.dataanalysis.ecoengine.utils.DatabaseUtils;
|
||||||
import org.gcube.dataanalysis.ecoengine.utils.IOHelper;
|
import org.gcube.dataanalysis.ecoengine.utils.IOHelper;
|
||||||
import org.gcube.dataanalysis.geo.utils.CSquareCodesConverter;
|
import org.gcube.dataanalysis.geo.utils.CSquareCodesConverter;
|
||||||
import org.hibernate.SessionFactory;
|
import org.hibernate.SessionFactory;
|
||||||
|
|
||||||
public class CSquaresCreator extends StandardLocalExternalAlgorithm {
|
public class CSquaresCreator extends StandardLocalInfraAlgorithm {
|
||||||
|
|
||||||
static String xDim = "Longitude_Column";
|
static String xDim = "Longitude_Column";
|
||||||
static String yDim = "Latitude_Column";
|
static String yDim = "Latitude_Column";
|
||||||
|
|
|
@ -360,7 +360,7 @@ public class MapsComparator extends DataAnalysis {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public LinkedHashMap<String, String> analyze() throws Exception {
|
public LinkedHashMap<String, String> analyze() throws Exception {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ import org.gcube.common.scope.api.ScopeProvider;
|
||||||
import org.gcube.dataanalysis.ecoengine.configuration.AlgorithmConfiguration;
|
import org.gcube.dataanalysis.ecoengine.configuration.AlgorithmConfiguration;
|
||||||
import org.gcube.dataanalysis.ecoengine.datatypes.PrimitiveType;
|
import org.gcube.dataanalysis.ecoengine.datatypes.PrimitiveType;
|
||||||
import org.gcube.dataanalysis.ecoengine.datatypes.enumtypes.PrimitiveTypes;
|
import org.gcube.dataanalysis.ecoengine.datatypes.enumtypes.PrimitiveTypes;
|
||||||
import org.gcube.dataanalysis.ecoengine.interfaces.StandardLocalExternalAlgorithm;
|
import org.gcube.dataanalysis.ecoengine.interfaces.StandardLocalInfraAlgorithm;
|
||||||
import org.gcube.dataanalysis.ecoengine.utils.DatabaseFactory;
|
import org.gcube.dataanalysis.ecoengine.utils.DatabaseFactory;
|
||||||
import org.gcube.dataanalysis.ecoengine.utils.DatabaseUtils;
|
import org.gcube.dataanalysis.ecoengine.utils.DatabaseUtils;
|
||||||
import org.gcube.dataanalysis.geo.meta.PolyMapMetadata;
|
import org.gcube.dataanalysis.geo.meta.PolyMapMetadata;
|
||||||
|
@ -20,7 +20,7 @@ import org.hibernate.SessionFactory;
|
||||||
|
|
||||||
import scala.collection.Iterator;
|
import scala.collection.Iterator;
|
||||||
|
|
||||||
public abstract class MapsCreator extends StandardLocalExternalAlgorithm {
|
public abstract class MapsCreator extends StandardLocalInfraAlgorithm {
|
||||||
|
|
||||||
static String databaseParameterName = "TimeSeriesDataStore";
|
static String databaseParameterName = "TimeSeriesDataStore";
|
||||||
static String dbuserParameterName = "user";
|
static String dbuserParameterName = "user";
|
||||||
|
|
|
@ -13,12 +13,12 @@ import org.gcube.dataanalysis.ecoengine.datatypes.ServiceType;
|
||||||
import org.gcube.dataanalysis.ecoengine.datatypes.enumtypes.PrimitiveTypes;
|
import org.gcube.dataanalysis.ecoengine.datatypes.enumtypes.PrimitiveTypes;
|
||||||
import org.gcube.dataanalysis.ecoengine.datatypes.enumtypes.ServiceParameters;
|
import org.gcube.dataanalysis.ecoengine.datatypes.enumtypes.ServiceParameters;
|
||||||
import org.gcube.dataanalysis.ecoengine.evaluation.bioclimate.InterpolateTables;
|
import org.gcube.dataanalysis.ecoengine.evaluation.bioclimate.InterpolateTables;
|
||||||
import org.gcube.dataanalysis.ecoengine.interfaces.StandardLocalExternalAlgorithm;
|
import org.gcube.dataanalysis.ecoengine.interfaces.StandardLocalInfraAlgorithm;
|
||||||
import org.gcube.dataanalysis.executor.scripts.OSCommand;
|
import org.gcube.dataanalysis.executor.scripts.OSCommand;
|
||||||
import org.gcube.dataanalysis.geo.utils.GeospatialDataPublicationLevel;
|
import org.gcube.dataanalysis.geo.utils.GeospatialDataPublicationLevel;
|
||||||
import org.gcube.dataanalysis.geo.utils.ThreddsPublisher;
|
import org.gcube.dataanalysis.geo.utils.ThreddsPublisher;
|
||||||
|
|
||||||
public class RasterDataPublisher extends StandardLocalExternalAlgorithm{
|
public class RasterDataPublisher extends StandardLocalInfraAlgorithm{
|
||||||
private static String layerTitleParam = "DatasetTitle";
|
private static String layerTitleParam = "DatasetTitle";
|
||||||
private static String layerAbstractParam = "DatasetAbstract";
|
private static String layerAbstractParam = "DatasetAbstract";
|
||||||
private static String layerInnerNameParam = "InnerLayerName";
|
private static String layerInnerNameParam = "InnerLayerName";
|
||||||
|
|
|
@ -12,14 +12,14 @@ import org.gcube.dataanalysis.ecoengine.datatypes.PrimitiveTypesList;
|
||||||
import org.gcube.dataanalysis.ecoengine.datatypes.ServiceType;
|
import org.gcube.dataanalysis.ecoengine.datatypes.ServiceType;
|
||||||
import org.gcube.dataanalysis.ecoengine.datatypes.enumtypes.PrimitiveTypes;
|
import org.gcube.dataanalysis.ecoengine.datatypes.enumtypes.PrimitiveTypes;
|
||||||
import org.gcube.dataanalysis.ecoengine.datatypes.enumtypes.ServiceParameters;
|
import org.gcube.dataanalysis.ecoengine.datatypes.enumtypes.ServiceParameters;
|
||||||
import org.gcube.dataanalysis.ecoengine.interfaces.StandardLocalExternalAlgorithm;
|
import org.gcube.dataanalysis.ecoengine.interfaces.StandardLocalInfraAlgorithm;
|
||||||
import org.gcube.dataanalysis.ecoengine.utils.ZipTools;
|
import org.gcube.dataanalysis.ecoengine.utils.ZipTools;
|
||||||
import org.gcube.dataanalysis.geo.meta.PolyMapMetadata;
|
import org.gcube.dataanalysis.geo.meta.PolyMapMetadata;
|
||||||
import org.gcube.dataanalysis.geo.utils.GdalConverter;
|
import org.gcube.dataanalysis.geo.utils.GdalConverter;
|
||||||
import org.gcube.dataanalysis.geo.utils.GeospatialDataPublicationLevel;
|
import org.gcube.dataanalysis.geo.utils.GeospatialDataPublicationLevel;
|
||||||
import org.gcube.spatial.data.gis.model.report.PublishResponse;
|
import org.gcube.spatial.data.gis.model.report.PublishResponse;
|
||||||
|
|
||||||
public class ShapefilePublisher extends StandardLocalExternalAlgorithm{
|
public class ShapefilePublisher extends StandardLocalInfraAlgorithm{
|
||||||
|
|
||||||
private static String layerTitleParam = "MapTitle";
|
private static String layerTitleParam = "MapTitle";
|
||||||
private static String layerAbstractParam = "MapAbstract";
|
private static String layerAbstractParam = "MapAbstract";
|
||||||
|
|
|
@ -201,7 +201,7 @@ public class TimeExtraction extends XYExtraction{
|
||||||
ImageIO.write(ImageTools.toBufferedImage(spectrogramImage), "png", new File("spectrogram.png"));
|
ImageIO.write(ImageTools.toBufferedImage(spectrogramImage), "png", new File("spectrogram.png"));
|
||||||
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
// TODO Auto-generated catch block
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -173,7 +173,7 @@ public class XYExtraction implements Transducerer {
|
||||||
AnalysisLogger.getLogger().debug("Extractor: ****Rasterizing grid into table****");
|
AnalysisLogger.getLogger().debug("Extractor: ****Rasterizing grid into table****");
|
||||||
|
|
||||||
|
|
||||||
//TODO: Check the Raster Table to avoid writing blanks and y flipping
|
|
||||||
status = 30;
|
status = 30;
|
||||||
RasterTable raster = new RasterTable(BBxLL, BBxUR, BByLL, BByUR, zValue, time, xResValue, yResValue, matrix, polygonsFeatures,config);
|
RasterTable raster = new RasterTable(BBxLL, BBxUR, BByLL, BByUR, zValue, time, xResValue, yResValue, matrix, polygonsFeatures,config);
|
||||||
raster.setTablename(tableNameValue);
|
raster.setTablename(tableNameValue);
|
||||||
|
|
|
@ -0,0 +1,273 @@
|
||||||
|
package org.gcube.dataanalysis.geo.batch;
|
||||||
|
|
||||||
|
import it.geosolutions.geonetwork.GN210Client;
|
||||||
|
import it.geosolutions.geonetwork.GN26Client;
|
||||||
|
import it.geosolutions.geonetwork.GNClient;
|
||||||
|
import it.geosolutions.geonetwork.util.GNInsertConfiguration;
|
||||||
|
import it.geosolutions.geonetwork.util.GNSearchRequest;
|
||||||
|
import it.geosolutions.geonetwork.util.GNSearchResponse;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.net.URL;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import org.apache.commons.httpclient.protocol.Protocol;
|
||||||
|
import org.gcube.common.scope.api.ScopeProvider;
|
||||||
|
import org.gcube.dataanalysis.geo.meta.GenericLayerMetadata;
|
||||||
|
import org.gcube.spatial.data.geonetwork.GeoNetwork;
|
||||||
|
import org.gcube.spatial.data.geonetwork.GeoNetworkAdministration;
|
||||||
|
import org.gcube.spatial.data.geonetwork.LoginLevel;
|
||||||
|
import org.gcube.spatial.data.geonetwork.configuration.DefaultConfiguration;
|
||||||
|
import org.gcube.spatial.data.geonetwork.model.Account;
|
||||||
|
import org.gcube.spatial.data.geonetwork.model.ScopeConfiguration;
|
||||||
|
import org.gcube.spatial.data.geonetwork.model.faults.MissingConfigurationException;
|
||||||
|
import org.gcube.spatial.data.geonetwork.utils.UserUtils;
|
||||||
|
import org.geotoolkit.metadata.iso.DefaultMetadata;
|
||||||
|
import org.geotoolkit.metadata.iso.citation.DefaultOnlineResource;
|
||||||
|
import org.geotoolkit.metadata.iso.distribution.DefaultDigitalTransferOptions;
|
||||||
|
import org.geotoolkit.metadata.iso.distribution.DefaultDistribution;
|
||||||
|
import org.geotoolkit.util.DefaultInternationalString;
|
||||||
|
import org.opengis.metadata.Metadata;
|
||||||
|
import org.opengis.metadata.citation.OnlineResource;
|
||||||
|
import org.opengis.metadata.distribution.DigitalTransferOptions;
|
||||||
|
import org.opengis.metadata.identification.Identification;
|
||||||
|
|
||||||
|
public class AddFileIdentifierForThreddsLayers {
|
||||||
|
|
||||||
|
/* production settings */
|
||||||
|
|
||||||
|
static String geonetworkurl = "http://geonetwork.d4science.org/geonetwork/";
|
||||||
|
static String geonetworkUser = "admin";
|
||||||
|
static String geonetworkPwd = "kee9GeeK";
|
||||||
|
static String targetScope = "/d4science.research-infrastructures.eu/gCubeApps";
|
||||||
|
|
||||||
|
/* dev settings */
|
||||||
|
/*
|
||||||
|
static String geonetworkurl = "http://geoserver-dev2.d4science-ii.research-infrastructures.eu/geonetwork/"; static String geonetworkUser = "admin"; static String geonetworkPwd = "Geey6ohz"; static String targetScope = "/gcube/devsec";
|
||||||
|
*/
|
||||||
|
|
||||||
|
public static void main(String[] args) throws Exception {
|
||||||
|
//String title = "thredds";
|
||||||
|
String title = "VLIZ";
|
||||||
|
changeScope2(title, targetScope, targetScope);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void changeScope2(String title, String startScope, String targetScope) throws Exception {
|
||||||
|
|
||||||
|
ScopeProvider.instance.set(startScope);
|
||||||
|
|
||||||
|
GeoNetworkAdministration reader = GeoNetwork.get();
|
||||||
|
reader.login(LoginLevel.SCOPE);
|
||||||
|
DefaultConfiguration geonetworkCfg = (DefaultConfiguration) reader.getConfiguration();
|
||||||
|
|
||||||
|
Map<Account.Type, Account> accounts = geonetworkCfg.getScopeConfiguration().getAccounts();
|
||||||
|
Account account = accounts.get(Account.Type.SCOPE);
|
||||||
|
|
||||||
|
String geonetworkScopeUser = account.getUser();
|
||||||
|
String geonetworkScopePassword = account.getPassword();
|
||||||
|
Integer scopePublicGroup = geonetworkCfg.getScopeConfiguration().getPublicGroup();
|
||||||
|
|
||||||
|
System.out.println("GeoNetwork user " + geonetworkScopeUser);
|
||||||
|
System.out.println("GeoNetwork password " + geonetworkScopePassword);
|
||||||
|
System.out.println("GeoNetwork scope Public Group " + scopePublicGroup);
|
||||||
|
|
||||||
|
System.out.println("GeoNetwork Admin user " + geonetworkCfg.getAdminAccount().getUser());
|
||||||
|
System.out.println("GeoNetwork Admin password " + geonetworkCfg.getAdminAccount().getPassword());
|
||||||
|
System.out.println("GeoNetwork scope Public Group " + scopePublicGroup);
|
||||||
|
|
||||||
|
reader = GeoNetwork.get();
|
||||||
|
reader.login(LoginLevel.ADMIN);
|
||||||
|
|
||||||
|
// Configure search request
|
||||||
|
GNSearchRequest req = new GNSearchRequest();
|
||||||
|
req.addParam(GNSearchRequest.Param.any, title);
|
||||||
|
req.addConfig(GNSearchRequest.Config.similarity, "1");
|
||||||
|
GNSearchResponse resp = reader.query(req);
|
||||||
|
|
||||||
|
// Iterate through results and access found metadata
|
||||||
|
Long id = 0L;
|
||||||
|
Metadata meta = null;
|
||||||
|
int N = resp.getCount();
|
||||||
|
System.out.println("Found N layers: " + N);
|
||||||
|
int i = 1;
|
||||||
|
for (GNSearchResponse.GNMetadata metadata : resp) {
|
||||||
|
System.out.println("Layer " + i + " of " + N);
|
||||||
|
i++;
|
||||||
|
id = metadata.getId();
|
||||||
|
System.out.println("ID " + id);
|
||||||
|
System.out.println("Name " + metadata.getInfo().getName());
|
||||||
|
meta = reader.getById(id);
|
||||||
|
Identification idf = meta.getIdentificationInfo().iterator().next();
|
||||||
|
String otitle = idf.getCitation().getTitle().toString();
|
||||||
|
String oabstract = idf.getAbstract().toString();
|
||||||
|
|
||||||
|
System.out.println("Title " + otitle);
|
||||||
|
|
||||||
|
System.out.println("Publishing " + id);
|
||||||
|
// look for target configuration
|
||||||
|
ScopeConfiguration targetConfiguration = null;
|
||||||
|
targetScope = targetScope.substring(targetScope.lastIndexOf("/") + 1);
|
||||||
|
System.out.println("target scope " + targetScope);
|
||||||
|
for (ScopeConfiguration configuration : reader.getConfiguration().getExistingConfigurations())
|
||||||
|
if (configuration.getAssignedScope().equals(targetScope))
|
||||||
|
targetConfiguration = configuration;
|
||||||
|
|
||||||
|
if (targetConfiguration == null)
|
||||||
|
throw new MissingConfigurationException("Scope " + targetScope + " has no configuration");
|
||||||
|
|
||||||
|
int targetUserId = UserUtils.getByName(reader.getUsers(), targetConfiguration.getAccounts().get(Account.Type.SCOPE).getUser()).getId();
|
||||||
|
int targetGroup = targetConfiguration.getDefaultGroup();
|
||||||
|
|
||||||
|
System.out.println("ID " + id + " targetUserId " + targetUserId + " targetGroup " + targetGroup + " Public group " + scopePublicGroup);
|
||||||
|
|
||||||
|
String fileIdentifier = ((DefaultMetadata) meta).getFileIdentifier();
|
||||||
|
System.out.println("File identifier: " + fileIdentifier);
|
||||||
|
|
||||||
|
GNClient client = null;
|
||||||
|
File tmetafile = null;
|
||||||
|
try {
|
||||||
|
System.out.println("deleting meta " + id);
|
||||||
|
client = new GN210Client(geonetworkurl,geonetworkUser,geonetworkPwd);
|
||||||
|
|
||||||
|
client.deleteMetadata(id);
|
||||||
|
System.out.println("inserting meta");
|
||||||
|
client = new GN210Client(geonetworkurl,geonetworkScopeUser,geonetworkScopePassword);
|
||||||
|
|
||||||
|
tmetafile = GenericLayerMetadata.meta2File(meta);
|
||||||
|
GeoNetworkAdministration readerScope = GeoNetwork.get();
|
||||||
|
readerScope.login(LoginLevel.SCOPE);
|
||||||
|
GNInsertConfiguration configuration = readerScope.getCurrentUserConfiguration("datasets", "_none_");
|
||||||
|
if (fileIdentifier == null) {
|
||||||
|
((DefaultMetadata) meta).setFileIdentifier(UUID.randomUUID().toString());
|
||||||
|
} else
|
||||||
|
System.out.println("File identifier already present! " + fileIdentifier);
|
||||||
|
|
||||||
|
DefaultMetadata fullmeta = (DefaultMetadata) meta;
|
||||||
|
DefaultDistribution distributionInfo = (DefaultDistribution) fullmeta.getDistributionInfo();
|
||||||
|
|
||||||
|
// DefaultDigitalTransferOptions transferOptions = (DefaultDigitalTransferOptions) distributionInfo.getTransferOptions();
|
||||||
|
for (DigitalTransferOptions options : distributionInfo.getTransferOptions()) {
|
||||||
|
DefaultDigitalTransferOptions transferOptions = (DefaultDigitalTransferOptions) options;
|
||||||
|
for (OnlineResource resource : transferOptions.getOnLines()) {
|
||||||
|
DefaultOnlineResource onlineres = (DefaultOnlineResource) resource;
|
||||||
|
String url = onlineres.getLinkage().toURL().toString();
|
||||||
|
String estdescription = getDescription(url);
|
||||||
|
String estProtocol = getProtocol(url);
|
||||||
|
String estName = getName(otitle, oabstract, estProtocol, url);
|
||||||
|
System.out.println("*****" + otitle + "*****");
|
||||||
|
System.out.println("URL:" + url + "\nDescription:" + estdescription + "\nName:" + estName + "\nProtocol:" + estProtocol);
|
||||||
|
System.out.println("*****************");
|
||||||
|
onlineres.setDescription(new DefaultInternationalString(estdescription));
|
||||||
|
onlineres.setName(estName);
|
||||||
|
onlineres.setProtocol(estProtocol);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tmetafile.delete();
|
||||||
|
readerScope.insertMetadata(configuration, meta);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
System.out.println("Using standard client");
|
||||||
|
long metaid = client.insertMetadata(new GNInsertConfiguration("" + scopePublicGroup, "datasets", "_none_", true), tmetafile);
|
||||||
|
System.out.println("Generated Metaid " + metaid);
|
||||||
|
}
|
||||||
|
|
||||||
|
System.out.println("Done with " + otitle);
|
||||||
|
Thread.sleep(2000);
|
||||||
|
// break;
|
||||||
|
}
|
||||||
|
|
||||||
|
System.out.println("All done");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getProtocol(String url) {
|
||||||
|
|
||||||
|
if (url.toLowerCase().contains("service=wfs"))
|
||||||
|
return "OGC:WFS-1.1.0-http-get-feature";
|
||||||
|
|
||||||
|
else if (url.toLowerCase().contains("service=wms"))
|
||||||
|
return "OGC:WMS-1.3.0-http-get-map";
|
||||||
|
|
||||||
|
else if (url.toLowerCase().contains("service=wcs"))
|
||||||
|
return "OGC:WCS-1.0.0-http-get-coverage";
|
||||||
|
|
||||||
|
else if (url.toLowerCase().contains("/dodsC"))
|
||||||
|
return "OGC:OPeNDAP-2.0.0";
|
||||||
|
|
||||||
|
else
|
||||||
|
return "WWW:LINK-1.0-http--link";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getDescription(String url) {
|
||||||
|
|
||||||
|
if (url.toLowerCase().contains("service=wfs"))
|
||||||
|
return "GIS data (WFS - JSON)";
|
||||||
|
|
||||||
|
else if (url.toLowerCase().contains("service=wms")) {
|
||||||
|
if (url.toLowerCase().contains("openlayers"))
|
||||||
|
return "GIS data (WMS - OpenLayers)";
|
||||||
|
else
|
||||||
|
return "GIS data (WMS)";
|
||||||
|
} else if (url.toLowerCase().contains("service=wcs"))
|
||||||
|
return "GIS data (WCS - Geotiff)";
|
||||||
|
|
||||||
|
else if (url.toLowerCase().contains("/dodsc"))
|
||||||
|
return "GIS data (OPenNDAP - NetCDF)";
|
||||||
|
|
||||||
|
else
|
||||||
|
return "Direct HTTP link";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getName(String title, String abstractTitle, String protocol, String url) {
|
||||||
|
|
||||||
|
if (abstractTitle.matches(".+: ")) {
|
||||||
|
String variablename = title.substring(title.indexOf(":"));
|
||||||
|
System.out.println("detected variable " + variablename);
|
||||||
|
return variablename;
|
||||||
|
} else {
|
||||||
|
if (url.contains("catalog.xml")) {
|
||||||
|
return "Catalogue";
|
||||||
|
} else if (protocol.equals("WWW:LINK-1.0-http--link") || protocol.equals("OGC:OPeNDAP-2.0.0")) {
|
||||||
|
int slash = url.lastIndexOf("/");
|
||||||
|
if (slash > 0) {
|
||||||
|
String file = url.substring(slash + 1);
|
||||||
|
if (file.trim().length() > 0 && file.contains("."))
|
||||||
|
return file;
|
||||||
|
else
|
||||||
|
return "Direct link to resource";
|
||||||
|
} else
|
||||||
|
return "Direct link to resource";
|
||||||
|
} else {
|
||||||
|
int check = -1;
|
||||||
|
String checker = "";
|
||||||
|
if (protocol.equals("OGC:WMS-1.3.0-http-get-map")) {
|
||||||
|
checker = "layers=";
|
||||||
|
} else if (protocol.equals("OGC:WFS-1.0.0-http-get-feature")) {
|
||||||
|
checker = "typename=";
|
||||||
|
} else if (protocol.equals("OGC:WCS-1.0.0-http-get-coverage")) {
|
||||||
|
checker = "coverage=";
|
||||||
|
}
|
||||||
|
|
||||||
|
check = url.toLowerCase().indexOf(checker);
|
||||||
|
if (check > 0) {
|
||||||
|
String cutUrl = url.substring(check + checker.length());
|
||||||
|
int end = cutUrl.indexOf("&");
|
||||||
|
String layerName = cutUrl;
|
||||||
|
if (end > -1)
|
||||||
|
layerName = cutUrl.substring(0, end);
|
||||||
|
|
||||||
|
int column = -1;
|
||||||
|
if ((column = layerName.indexOf(":")) > 0)
|
||||||
|
layerName = layerName.substring(column + 1);
|
||||||
|
System.out.println("Layer Name: " + layerName);
|
||||||
|
return layerName;
|
||||||
|
} else
|
||||||
|
return title;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -9,6 +9,7 @@ import java.io.File;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
import org.gcube.common.scope.api.ScopeProvider;
|
import org.gcube.common.scope.api.ScopeProvider;
|
||||||
import org.gcube.dataanalysis.geo.meta.GenericLayerMetadata;
|
import org.gcube.dataanalysis.geo.meta.GenericLayerMetadata;
|
||||||
|
@ -21,6 +22,7 @@ import org.gcube.spatial.data.geonetwork.model.Account;
|
||||||
import org.gcube.spatial.data.geonetwork.model.ScopeConfiguration;
|
import org.gcube.spatial.data.geonetwork.model.ScopeConfiguration;
|
||||||
import org.gcube.spatial.data.geonetwork.model.faults.MissingConfigurationException;
|
import org.gcube.spatial.data.geonetwork.model.faults.MissingConfigurationException;
|
||||||
import org.gcube.spatial.data.geonetwork.utils.UserUtils;
|
import org.gcube.spatial.data.geonetwork.utils.UserUtils;
|
||||||
|
import org.geotoolkit.metadata.iso.DefaultMetadata;
|
||||||
import org.opengis.metadata.Metadata;
|
import org.opengis.metadata.Metadata;
|
||||||
import org.opengis.metadata.identification.Identification;
|
import org.opengis.metadata.identification.Identification;
|
||||||
import org.opengis.metadata.identification.TopicCategory;
|
import org.opengis.metadata.identification.TopicCategory;
|
||||||
|
@ -57,11 +59,16 @@ public class CheckLayerRetrieval {
|
||||||
System.out.println("scopePublicGroup "+scopePublicGroup );
|
System.out.println("scopePublicGroup "+scopePublicGroup );
|
||||||
for(GNSearchResponse.GNMetadata metadata:resp){
|
for(GNSearchResponse.GNMetadata metadata:resp){
|
||||||
id = metadata.getId();
|
id = metadata.getId();
|
||||||
|
|
||||||
|
//
|
||||||
|
|
||||||
System.out.println("ID "+id );
|
System.out.println("ID "+id );
|
||||||
System.out.println("Name "+metadata.getInfo().getName());
|
System.out.println("Name "+metadata.getInfo().getName());
|
||||||
meta = reader.getById(id);
|
meta = reader.getById(id);
|
||||||
Identification idf = meta.getIdentificationInfo().iterator().next();
|
Identification idf = meta.getIdentificationInfo().iterator().next();
|
||||||
String otitle = idf.getCitation().getTitle().toString();
|
String otitle = idf.getCitation().getTitle().toString();
|
||||||
|
|
||||||
|
((DefaultMetadata) meta).setFileIdentifier(UUID.randomUUID().toString());
|
||||||
System.out.println("Title "+otitle);
|
System.out.println("Title "+otitle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,253 +0,0 @@
|
||||||
package org.gcube.dataanalysis.geo.batch;
|
|
||||||
|
|
||||||
import it.geosolutions.geonetwork.GNClient;
|
|
||||||
import it.geosolutions.geonetwork.util.GNInsertConfiguration;
|
|
||||||
import it.geosolutions.geonetwork.util.GNSearchRequest;
|
|
||||||
import it.geosolutions.geonetwork.util.GNSearchResponse;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import org.gcube.common.scope.api.ScopeProvider;
|
|
||||||
import org.gcube.dataanalysis.geo.meta.GenericLayerMetadata;
|
|
||||||
import org.gcube.spatial.data.geonetwork.GeoNetwork;
|
|
||||||
import org.gcube.spatial.data.geonetwork.GeoNetworkAdministration;
|
|
||||||
import org.gcube.spatial.data.geonetwork.LoginLevel;
|
|
||||||
import org.gcube.spatial.data.geonetwork.configuration.DefaultConfiguration;
|
|
||||||
import org.gcube.spatial.data.geonetwork.model.Account;
|
|
||||||
import org.gcube.spatial.data.geonetwork.model.ScopeConfiguration;
|
|
||||||
import org.gcube.spatial.data.geonetwork.model.faults.MissingConfigurationException;
|
|
||||||
import org.gcube.spatial.data.geonetwork.utils.UserUtils;
|
|
||||||
import org.opengis.metadata.Metadata;
|
|
||||||
import org.opengis.metadata.identification.Identification;
|
|
||||||
import org.opengis.metadata.identification.TopicCategory;
|
|
||||||
|
|
||||||
public class OpenLayerToVREs {
|
|
||||||
|
|
||||||
static String geonetworkurl = "http://geonetwork.d4science.org/geonetwork/";
|
|
||||||
// static String geonetworkurl = "http://geoserver-dev2.d4science-ii.research-infrastructures.eu/geonetwork/";
|
|
||||||
|
|
||||||
// static String geoserverurl = "http://geoserver-dev.d4science-ii.research-infrastructures.eu/geoserver";
|
|
||||||
|
|
||||||
static String geonetworkUser = "admin";
|
|
||||||
// static String geonetworkPwd = "Geey6ohz";
|
|
||||||
static String geonetworkPwd = "kee9GeeK";
|
|
||||||
|
|
||||||
public static void main(String[] args) throws Exception {
|
|
||||||
// String startScope = "/d4science.research-infrastructures.eu/gCubeApps/ScalableDataMining";
|
|
||||||
String targetScope = "/d4science.research-infrastructures.eu/gCubeApps";
|
|
||||||
// String targetScope = "/gcube/devsec";
|
|
||||||
// String title ="Ocean Surface Zonal Currents (u) in 1992 from OSCAR Third Degree Sea Surface Velocity [oscar_vel1992_180.nc]";
|
|
||||||
String title ="Oscar";
|
|
||||||
// String title = "Ocean Surface Meridional Currents (v) in 1992 from OSCAR Third Degree Sea Surface Velocity [oscar_vel1992_180.nc]";
|
|
||||||
// String searchtitle ="Oscar";
|
|
||||||
//changeScope3(searchtitle,title, targetScope, targetScope);
|
|
||||||
changeScope2(title, targetScope, targetScope);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void changeScope3(String searchTitle, String title, String startScope, String targetScope) throws Exception {
|
|
||||||
|
|
||||||
ScopeProvider.instance.set("/gcube/devsec");
|
|
||||||
GeoNetworkAdministration reader = GeoNetwork.get();
|
|
||||||
reader.login(LoginLevel.ADMIN);
|
|
||||||
|
|
||||||
// Configure search request
|
|
||||||
GNSearchRequest req = new GNSearchRequest();
|
|
||||||
req.addParam(GNSearchRequest.Param.any, searchTitle);
|
|
||||||
req.addConfig(GNSearchRequest.Config.similarity, "1");
|
|
||||||
GNSearchResponse resp = reader.query(req);
|
|
||||||
|
|
||||||
// Iterate through results and access found metadata
|
|
||||||
Long id = 0L;
|
|
||||||
Metadata meta = null;
|
|
||||||
int N = resp.getCount();
|
|
||||||
System.out.println("Found N layers: " + N);
|
|
||||||
int i = 1;
|
|
||||||
for (GNSearchResponse.GNMetadata metadata : resp) {
|
|
||||||
System.out.println("Layer " + i + " of " + N);
|
|
||||||
i++;
|
|
||||||
id = metadata.getId();
|
|
||||||
System.out.println("ID " + id);
|
|
||||||
System.out.println("Name " + metadata.getInfo().getName());
|
|
||||||
meta = reader.getById(id);
|
|
||||||
Identification idf = meta.getIdentificationInfo().iterator().next();
|
|
||||||
String otitle = idf.getCitation().getTitle().toString();
|
|
||||||
System.out.println("Title " + otitle);
|
|
||||||
if (!otitle.toLowerCase().contains(title.toLowerCase())) {
|
|
||||||
System.out.println("Invalid layer");
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
System.out.println("Inserting meta in prod " + otitle);
|
|
||||||
GNClient client = new GNClient(geonetworkurl);
|
|
||||||
client.login(geonetworkUser, geonetworkPwd);
|
|
||||||
|
|
||||||
File tmetafile = GenericLayerMetadata.meta2File(meta);
|
|
||||||
|
|
||||||
int scopePublicGroup = 23;
|
|
||||||
client.insertMetadata(new GNInsertConfiguration("" + scopePublicGroup, "datasets", "_none_", true), tmetafile);
|
|
||||||
|
|
||||||
tmetafile.delete();
|
|
||||||
System.out.println("Done with " + otitle);
|
|
||||||
Thread.sleep(2000);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
System.out.println("All done");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void changeScope2(String title, String startScope, String targetScope) throws Exception {
|
|
||||||
|
|
||||||
ScopeProvider.instance.set(startScope);
|
|
||||||
|
|
||||||
GeoNetworkAdministration reader = GeoNetwork.get();
|
|
||||||
reader.login(LoginLevel.SCOPE);
|
|
||||||
DefaultConfiguration geonetworkCfg = (DefaultConfiguration) reader.getConfiguration();
|
|
||||||
|
|
||||||
Map<Account.Type, Account> accounts = geonetworkCfg.getScopeConfiguration().getAccounts();
|
|
||||||
Account account = accounts.get(Account.Type.SCOPE);
|
|
||||||
|
|
||||||
String geonetworkScopeUser = account.getUser();
|
|
||||||
String geonetworkScopePassword = account.getPassword();
|
|
||||||
Integer scopePublicGroup = geonetworkCfg.getScopeConfiguration().getPublicGroup();
|
|
||||||
|
|
||||||
System.out.println("GeoNetwork user " + geonetworkScopeUser);
|
|
||||||
System.out.println("GeoNetwork password " + geonetworkScopePassword);
|
|
||||||
System.out.println("GeoNetwork scope Public Group " + scopePublicGroup);
|
|
||||||
|
|
||||||
System.out.println("GeoNetwork Admin user " + geonetworkCfg.getAdminAccount().getUser());
|
|
||||||
System.out.println("GeoNetwork Admin password " + geonetworkCfg.getAdminAccount().getPassword());
|
|
||||||
System.out.println("GeoNetwork scope Public Group " + scopePublicGroup);
|
|
||||||
|
|
||||||
reader = GeoNetwork.get();
|
|
||||||
reader.login(LoginLevel.ADMIN);
|
|
||||||
|
|
||||||
// Configure search request
|
|
||||||
GNSearchRequest req = new GNSearchRequest();
|
|
||||||
req.addParam(GNSearchRequest.Param.any, title);
|
|
||||||
req.addConfig(GNSearchRequest.Config.similarity, "1");
|
|
||||||
GNSearchResponse resp = reader.query(req);
|
|
||||||
|
|
||||||
// Iterate through results and access found metadata
|
|
||||||
Long id = 0L;
|
|
||||||
Metadata meta = null;
|
|
||||||
int N = resp.getCount();
|
|
||||||
System.out.println("Found N layers: " + N);
|
|
||||||
int i = 1;
|
|
||||||
for (GNSearchResponse.GNMetadata metadata : resp) {
|
|
||||||
System.out.println("Layer " + i + " of " + N);
|
|
||||||
i++;
|
|
||||||
id = metadata.getId();
|
|
||||||
System.out.println("ID " + id);
|
|
||||||
System.out.println("Name " + metadata.getInfo().getName());
|
|
||||||
meta = reader.getById(id);
|
|
||||||
Identification idf = meta.getIdentificationInfo().iterator().next();
|
|
||||||
String otitle = idf.getCitation().getTitle().toString();
|
|
||||||
System.out.println("Title " + otitle);
|
|
||||||
if (!otitle.toLowerCase().contains(title.toLowerCase())) {
|
|
||||||
System.out.println("Invalid layer");
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
System.out.println("Publishing " + id);
|
|
||||||
// look for target configuration
|
|
||||||
ScopeConfiguration targetConfiguration = null;
|
|
||||||
targetScope = targetScope.substring(targetScope.lastIndexOf("/") + 1);
|
|
||||||
System.out.println("target scope " + targetScope);
|
|
||||||
for (ScopeConfiguration configuration : reader.getConfiguration().getExistingConfigurations())
|
|
||||||
if (configuration.getAssignedScope().equals(targetScope))
|
|
||||||
targetConfiguration = configuration;
|
|
||||||
|
|
||||||
if (targetConfiguration == null)
|
|
||||||
throw new MissingConfigurationException("Scope " + targetScope + " has no configuration");
|
|
||||||
|
|
||||||
int targetUserId = UserUtils.getByName(reader.getUsers(), targetConfiguration.getAccounts().get(Account.Type.SCOPE).getUser()).getId();
|
|
||||||
int targetGroup = targetConfiguration.getDefaultGroup();
|
|
||||||
|
|
||||||
System.out.println("ID " + id + " targetUserId " + targetUserId + " targetGroup " + targetGroup + " Public group " + scopePublicGroup);
|
|
||||||
// reader.assignOwnership(ids,(int) targetUserId, (int)targetGroup);
|
|
||||||
|
|
||||||
System.out.println("deleting meta " + id);
|
|
||||||
|
|
||||||
GNClient client = new GNClient(geonetworkurl);
|
|
||||||
client.login(geonetworkUser, geonetworkPwd);
|
|
||||||
|
|
||||||
client.deleteMetadata(id);
|
|
||||||
|
|
||||||
System.out.println("inserting meta");
|
|
||||||
client = new GNClient(geonetworkurl);
|
|
||||||
client.login(geonetworkScopeUser, geonetworkScopePassword);
|
|
||||||
File tmetafile = GenericLayerMetadata.meta2File(meta);
|
|
||||||
|
|
||||||
try{
|
|
||||||
GeoNetworkAdministration readerScope = GeoNetwork.get();
|
|
||||||
readerScope.login(LoginLevel.SCOPE);
|
|
||||||
GNInsertConfiguration configuration = readerScope.getCurrentUserConfiguration("datasets", "_none_");
|
|
||||||
readerScope.insertMetadata(configuration,meta);
|
|
||||||
}catch(Exception e){
|
|
||||||
e.printStackTrace();
|
|
||||||
System.out.println("Using standard client");
|
|
||||||
long metaid = client.insertMetadata(new GNInsertConfiguration(""+scopePublicGroup, "datasets", "_none_", true), tmetafile);
|
|
||||||
System.out.println("Generated Metaid " + metaid);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
tmetafile.delete();
|
|
||||||
System.out.println("Done with " + otitle);
|
|
||||||
Thread.sleep(2000);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
System.out.println("All done");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void changeScope(String title, String startScope, String targetScope) throws Exception {
|
|
||||||
|
|
||||||
ScopeProvider.instance.set(startScope);
|
|
||||||
GeoNetworkAdministration reader = GeoNetwork.get();
|
|
||||||
reader.login(LoginLevel.ADMIN);
|
|
||||||
|
|
||||||
// Configure search request
|
|
||||||
GNSearchRequest req = new GNSearchRequest();
|
|
||||||
req.addParam(GNSearchRequest.Param.any, title);
|
|
||||||
req.addConfig(GNSearchRequest.Config.similarity, "1");
|
|
||||||
GNSearchResponse resp = reader.query(req);
|
|
||||||
|
|
||||||
// Iterate through results and access found metadata
|
|
||||||
Long id = 0L;
|
|
||||||
for (GNSearchResponse.GNMetadata metadata : resp) {
|
|
||||||
id = metadata.getId();
|
|
||||||
System.out.println("ID " + id);
|
|
||||||
System.out.println("Name " + metadata.getInfo().getName());
|
|
||||||
Metadata meta = reader.getById(id);
|
|
||||||
Identification idf = meta.getIdentificationInfo().iterator().next();
|
|
||||||
String otitle = idf.getCitation().getTitle().toString();
|
|
||||||
System.out.println("Title " + otitle);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
System.out.println("Publishing " + id);
|
|
||||||
// look for target configuration
|
|
||||||
ScopeConfiguration targetConfiguration = null;
|
|
||||||
targetScope = "gCubeApps";
|
|
||||||
|
|
||||||
for (ScopeConfiguration configuration : reader.getConfiguration().getExistingConfigurations())
|
|
||||||
if (configuration.getAssignedScope().equals(targetScope))
|
|
||||||
targetConfiguration = configuration;
|
|
||||||
|
|
||||||
if (targetConfiguration == null)
|
|
||||||
throw new MissingConfigurationException("Scope " + targetScope + " has no configuration");
|
|
||||||
|
|
||||||
int targetUserId = UserUtils.getByName(reader.getUsers(), targetConfiguration.getAccounts().get(Account.Type.SCOPE).getUser()).getId();
|
|
||||||
int targetGroup = targetConfiguration.getDefaultGroup();
|
|
||||||
System.out.println("ID " + id + " targetUserId " + targetUserId + " targetGroup " + targetGroup);
|
|
||||||
List<Long> ids = Collections.singletonList((long) id);
|
|
||||||
reader.assignOwnership(ids, (int) targetUserId, (int) targetGroup);
|
|
||||||
|
|
||||||
System.out.println("Assigned " + id);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,155 +0,0 @@
|
||||||
package org.gcube.dataanalysis.geo.batch;
|
|
||||||
|
|
||||||
import it.geosolutions.geonetwork.GNClient;
|
|
||||||
import it.geosolutions.geonetwork.util.GNInsertConfiguration;
|
|
||||||
import it.geosolutions.geonetwork.util.GNSearchRequest;
|
|
||||||
import it.geosolutions.geonetwork.util.GNSearchResponse;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.gcube.common.scope.api.ScopeProvider;
|
|
||||||
import org.gcube.dataanalysis.geo.meta.GenericLayerMetadata;
|
|
||||||
import org.gcube.spatial.data.geonetwork.GeoNetwork;
|
|
||||||
import org.gcube.spatial.data.geonetwork.GeoNetworkAdministration;
|
|
||||||
import org.gcube.spatial.data.geonetwork.LoginLevel;
|
|
||||||
import org.gcube.spatial.data.geonetwork.model.Account;
|
|
||||||
import org.gcube.spatial.data.geonetwork.model.ScopeConfiguration;
|
|
||||||
import org.gcube.spatial.data.geonetwork.model.faults.MissingConfigurationException;
|
|
||||||
import org.gcube.spatial.data.geonetwork.utils.UserUtils;
|
|
||||||
import org.opengis.metadata.Metadata;
|
|
||||||
import org.opengis.metadata.identification.Identification;
|
|
||||||
import org.opengis.metadata.identification.TopicCategory;
|
|
||||||
|
|
||||||
public class OpenLayerToVREs_Dev_ {
|
|
||||||
|
|
||||||
//static String geonetworkurl = "http://geonetwork.d4science.org/geonetwork/";
|
|
||||||
static String geonetworkurl = "http://geoserver-dev2.d4science-ii.research-infrastructures.eu/geonetwork/";
|
|
||||||
|
|
||||||
//static String geoserverurl = "http://geoserver-dev.d4science-ii.research-infrastructures.eu/geoserver";
|
|
||||||
|
|
||||||
static String geonetworkUser = "admin";
|
|
||||||
static String geonetworkPwd = "Geey6ohz";
|
|
||||||
|
|
||||||
|
|
||||||
public static void main(String[] args) throws Exception{
|
|
||||||
//String startScope = "/d4science.research-infrastructures.eu/gCubeApps/ScalableDataMining";
|
|
||||||
//String targetScope = "/d4science.research-infrastructures.eu/gCubeApps";
|
|
||||||
String targetScope = "/gcube/devsec";
|
|
||||||
//String title ="Ocean Surface Zonal Currents (u) in 1992 from OSCAR Third Degree Sea Surface Velocity [oscar_vel1992_180.nc]";
|
|
||||||
String title ="Oscar";
|
|
||||||
changeScope2(title, targetScope, targetScope);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void changeScope2(String title,String startScope,String targetScope) throws Exception{
|
|
||||||
|
|
||||||
ScopeProvider.instance.set(startScope);
|
|
||||||
GeoNetworkAdministration reader=GeoNetwork.get();
|
|
||||||
reader.login(LoginLevel.ADMIN);
|
|
||||||
|
|
||||||
|
|
||||||
//Configure search request
|
|
||||||
GNSearchRequest req=new GNSearchRequest();
|
|
||||||
req.addParam(GNSearchRequest.Param.any,title);
|
|
||||||
req.addConfig(GNSearchRequest.Config.similarity, "1");
|
|
||||||
GNSearchResponse resp=reader.query(req);
|
|
||||||
|
|
||||||
//Iterate through results and access found metadata
|
|
||||||
Long id = 0L;
|
|
||||||
Metadata meta = null;
|
|
||||||
for(GNSearchResponse.GNMetadata metadata:resp){
|
|
||||||
id = metadata.getId();
|
|
||||||
System.out.println("ID "+id );
|
|
||||||
System.out.println("Name "+metadata.getInfo().getName());
|
|
||||||
meta = reader.getById(id);
|
|
||||||
Identification idf = meta.getIdentificationInfo().iterator().next();
|
|
||||||
String otitle = idf.getCitation().getTitle().toString();
|
|
||||||
System.out.println("Title "+otitle);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
System.out.println("Publishing "+id);
|
|
||||||
//look for target configuration
|
|
||||||
ScopeConfiguration targetConfiguration=null;
|
|
||||||
targetScope = targetScope.substring(targetScope.lastIndexOf("/")+1);
|
|
||||||
System.out.println("target scope "+targetScope);
|
|
||||||
for(ScopeConfiguration configuration : reader.getConfiguration().getExistingConfigurations())
|
|
||||||
if(configuration.getAssignedScope().equals(targetScope)) targetConfiguration= configuration;
|
|
||||||
|
|
||||||
if(targetConfiguration==null)
|
|
||||||
throw new MissingConfigurationException("Scope "+targetScope+" has no configuration");
|
|
||||||
|
|
||||||
int targetUserId=UserUtils.getByName(reader.getUsers(),targetConfiguration.getAccounts().get(Account.Type.SCOPE).getUser()).getId();
|
|
||||||
int targetGroup=targetConfiguration.getDefaultGroup();
|
|
||||||
|
|
||||||
System.out.println("ID "+id +" targetUserId "+ targetUserId + " targetGroup "+ targetGroup);
|
|
||||||
List<Long> ids = Collections.singletonList((long)id);
|
|
||||||
//reader.assignOwnership(ids,(int) targetUserId, (int)targetGroup);
|
|
||||||
|
|
||||||
GNClient client = new GNClient(geonetworkurl);
|
|
||||||
client.login(geonetworkUser, geonetworkPwd);
|
|
||||||
System.out.println("deleting meta "+id);
|
|
||||||
|
|
||||||
client.deleteMetadata(id);
|
|
||||||
|
|
||||||
System.out.println("inserting meta");
|
|
||||||
|
|
||||||
File tmetafile = GenericLayerMetadata.meta2File(meta);
|
|
||||||
client.insertMetadata(new GNInsertConfiguration(""+targetGroup, "datasets", "_none_", true), tmetafile);
|
|
||||||
tmetafile.delete();
|
|
||||||
|
|
||||||
System.out.println("All done");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void changeScope(String title,String startScope,String targetScope) throws Exception{
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ScopeProvider.instance.set(startScope);
|
|
||||||
GeoNetworkAdministration reader=GeoNetwork.get();
|
|
||||||
reader.login(LoginLevel.ADMIN);
|
|
||||||
|
|
||||||
|
|
||||||
//Configure search request
|
|
||||||
GNSearchRequest req=new GNSearchRequest();
|
|
||||||
req.addParam(GNSearchRequest.Param.any,title);
|
|
||||||
req.addConfig(GNSearchRequest.Config.similarity, "1");
|
|
||||||
GNSearchResponse resp=reader.query(req);
|
|
||||||
|
|
||||||
//Iterate through results and access found metadata
|
|
||||||
Long id = 0L;
|
|
||||||
for(GNSearchResponse.GNMetadata metadata:resp){
|
|
||||||
id = metadata.getId();
|
|
||||||
System.out.println("ID "+id );
|
|
||||||
System.out.println("Name "+metadata.getInfo().getName());
|
|
||||||
Metadata meta = reader.getById(id);
|
|
||||||
Identification idf = meta.getIdentificationInfo().iterator().next();
|
|
||||||
String otitle = idf.getCitation().getTitle().toString();
|
|
||||||
System.out.println("Title "+otitle);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
System.out.println("Publishing "+id);
|
|
||||||
//look for target configuration
|
|
||||||
ScopeConfiguration targetConfiguration=null;
|
|
||||||
targetScope = "gCubeApps";
|
|
||||||
|
|
||||||
for(ScopeConfiguration configuration : reader.getConfiguration().getExistingConfigurations())
|
|
||||||
if(configuration.getAssignedScope().equals(targetScope)) targetConfiguration= configuration;
|
|
||||||
|
|
||||||
if(targetConfiguration==null)
|
|
||||||
throw new MissingConfigurationException("Scope "+targetScope+" has no configuration");
|
|
||||||
|
|
||||||
int targetUserId=UserUtils.getByName(reader.getUsers(),targetConfiguration.getAccounts().get(Account.Type.SCOPE).getUser()).getId();
|
|
||||||
int targetGroup=targetConfiguration.getDefaultGroup();
|
|
||||||
System.out.println("ID "+id +" targetUserId "+ targetUserId + " targetGroup "+ targetGroup);
|
|
||||||
List<Long> ids = Collections.singletonList((long)id);
|
|
||||||
reader.assignOwnership(ids,(int) targetUserId, (int)targetGroup);
|
|
||||||
|
|
||||||
System.out.println("Assigned "+id);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
|
@ -310,9 +310,10 @@ public class GeoNetworkInspector {
|
||||||
|
|
||||||
public GeoNetworkReader initGeoNetworkReader() throws Exception {
|
public GeoNetworkReader initGeoNetworkReader() throws Exception {
|
||||||
AnalysisLogger.getLogger().debug("Features Manager: configuring GeoNetwork");
|
AnalysisLogger.getLogger().debug("Features Manager: configuring GeoNetwork");
|
||||||
|
/*
|
||||||
if (scope != null)
|
if (scope != null)
|
||||||
ScopeProvider.instance.set(scope);
|
ScopeProvider.instance.set(scope);
|
||||||
|
*/
|
||||||
AnalysisLogger.getLogger().debug("Initializing GeoNetwork");
|
AnalysisLogger.getLogger().debug("Initializing GeoNetwork");
|
||||||
|
|
||||||
GeoNetworkReader gn = GeoNetwork.get();
|
GeoNetworkReader gn = GeoNetwork.get();
|
||||||
|
|
|
@ -15,12 +15,15 @@ import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.UUID;
|
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
import javax.xml.bind.JAXBException;
|
import javax.xml.bind.JAXBException;
|
||||||
|
|
||||||
import org.gcube.contentmanagement.lexicalmatcher.utils.AnalysisLogger;
|
import org.gcube.contentmanagement.lexicalmatcher.utils.AnalysisLogger;
|
||||||
|
import org.gcube.spatial.data.geonetwork.GeoNetwork;
|
||||||
|
import org.gcube.spatial.data.geonetwork.GeoNetworkAdministration;
|
||||||
|
import org.gcube.spatial.data.geonetwork.LoginLevel;
|
||||||
import org.geotoolkit.metadata.iso.DefaultIdentifier;
|
import org.geotoolkit.metadata.iso.DefaultIdentifier;
|
||||||
import org.geotoolkit.metadata.iso.DefaultMetadata;
|
import org.geotoolkit.metadata.iso.DefaultMetadata;
|
||||||
import org.geotoolkit.metadata.iso.citation.DefaultCitation;
|
import org.geotoolkit.metadata.iso.citation.DefaultCitation;
|
||||||
|
@ -396,8 +399,16 @@ public class GenericLayerMetadata {
|
||||||
// layers access:
|
// layers access:
|
||||||
DefaultDistribution distribution = new DefaultDistribution();
|
DefaultDistribution distribution = new DefaultDistribution();
|
||||||
DefaultDigitalTransferOptions transferOptions = new DefaultDigitalTransferOptions();
|
DefaultDigitalTransferOptions transferOptions = new DefaultDigitalTransferOptions();
|
||||||
for (String uri : layerUris)
|
for (String uri : layerUris){
|
||||||
transferOptions.getOnLines().add(new DefaultOnlineResource(new URI(uri)));
|
DefaultOnlineResource onlineresource = new DefaultOnlineResource(new URI(uri));
|
||||||
|
/*
|
||||||
|
onlineresource.setName(arg0);
|
||||||
|
onlineresource.setLinkage(arg0);
|
||||||
|
onlineresource.setProtocol(arg0);
|
||||||
|
onlineresource.setDescription(arg0);
|
||||||
|
*/
|
||||||
|
transferOptions.getOnLines().add(onlineresource);
|
||||||
|
}
|
||||||
distribution.getTransferOptions().add(transferOptions);
|
distribution.getTransferOptions().add(transferOptions);
|
||||||
DefaultFormat format1 = new DefaultFormat();
|
DefaultFormat format1 = new DefaultFormat();
|
||||||
format1.setName(new DefaultInternationalString("WMS"));
|
format1.setName(new DefaultInternationalString("WMS"));
|
||||||
|
@ -465,16 +476,25 @@ public class GenericLayerMetadata {
|
||||||
meta.getDataQualityInfo().add(processQuality);
|
meta.getDataQualityInfo().add(processQuality);
|
||||||
meta.setLanguage(Locale.ENGLISH);
|
meta.setLanguage(Locale.ENGLISH);
|
||||||
// System.out.println(meta);
|
// System.out.println(meta);
|
||||||
|
|
||||||
|
/*
|
||||||
GNClient client = new GNClient(geonetworkUrl);
|
GNClient client = new GNClient(geonetworkUrl);
|
||||||
client.login(geonetworkUser, geonetworkPwd);
|
client.login(geonetworkUser, geonetworkPwd);
|
||||||
File tmetafile = meta2File(meta);
|
File tmetafile = meta2File(meta);
|
||||||
client.insertMetadata(new GNInsertConfiguration(geonetworkGroup, "datasets", "_none_", true), tmetafile);
|
client.insertMetadata(new GNInsertConfiguration(geonetworkGroup, "datasets", "_none_", true), tmetafile);
|
||||||
tmetafile.delete();
|
tmetafile.delete();
|
||||||
|
*/
|
||||||
|
GeoNetworkAdministration readerScope = GeoNetwork.get();
|
||||||
|
readerScope.login(LoginLevel.SCOPE);
|
||||||
|
GNInsertConfiguration configuration = readerScope.getCurrentUserConfiguration("datasets", "_none_");
|
||||||
|
readerScope.insertAndPromoteMetadata(configuration, meta);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void customMetaDataInsert(String[] urls, String[] protocols) throws Exception {
|
public void customMetaDataInsert(String[] urls, String[] protocols) throws Exception {
|
||||||
|
customMetaDataInsert(urls,protocols,true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void customMetaDataInsert(String[] urls, String[] protocols, boolean isprivate) throws Exception {
|
||||||
|
|
||||||
// layer uri: wms, wfs wcs
|
// layer uri: wms, wfs wcs
|
||||||
List<String> layerUris = new ArrayList<String>();
|
List<String> layerUris = new ArrayList<String>();
|
||||||
|
@ -573,8 +593,21 @@ public class GenericLayerMetadata {
|
||||||
// layers access:
|
// layers access:
|
||||||
DefaultDistribution distribution = new DefaultDistribution();
|
DefaultDistribution distribution = new DefaultDistribution();
|
||||||
DefaultDigitalTransferOptions transferOptions = new DefaultDigitalTransferOptions();
|
DefaultDigitalTransferOptions transferOptions = new DefaultDigitalTransferOptions();
|
||||||
for (String uri : layerUris)
|
for (String uri : layerUris){
|
||||||
|
DefaultOnlineResource onlineres = new DefaultOnlineResource(new URI(uri));
|
||||||
|
String url = onlineres.getLinkage().toURL().toString();
|
||||||
|
String estdescription = getDescription(url);
|
||||||
|
String estProtocol = getProtocol(url);
|
||||||
|
String estName = getName(title, abstractField, estProtocol, url);
|
||||||
|
AnalysisLogger.getLogger().debug("URL:" + url + "\nDescription:" + estdescription + "\nName:" + estName + "\nProtocol:" + estProtocol);
|
||||||
|
onlineres.setDescription(new DefaultInternationalString(estdescription));
|
||||||
|
onlineres.setName(estName);
|
||||||
|
onlineres.setProtocol(estProtocol);
|
||||||
|
|
||||||
transferOptions.getOnLines().add(new DefaultOnlineResource(new URI(uri)));
|
transferOptions.getOnLines().add(new DefaultOnlineResource(new URI(uri)));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
distribution.getTransferOptions().add(transferOptions);
|
distribution.getTransferOptions().add(transferOptions);
|
||||||
|
|
||||||
DefaultFormat [] formats = new DefaultFormat[protocols.length];
|
DefaultFormat [] formats = new DefaultFormat[protocols.length];
|
||||||
|
@ -641,13 +674,31 @@ public class GenericLayerMetadata {
|
||||||
meta.getMetadataConstraints().add(constraints);
|
meta.getMetadataConstraints().add(constraints);
|
||||||
meta.getDataQualityInfo().add(processQuality);
|
meta.getDataQualityInfo().add(processQuality);
|
||||||
meta.setLanguage(Locale.ENGLISH);
|
meta.setLanguage(Locale.ENGLISH);
|
||||||
// System.out.println(meta);
|
|
||||||
|
// AnalysisLogger.getLogger().debug(meta);
|
||||||
|
|
||||||
|
|
||||||
|
GeoNetworkAdministration readerScope = GeoNetwork.get();
|
||||||
|
if (isprivate)
|
||||||
|
readerScope.login(LoginLevel.PRIVATE);
|
||||||
|
else
|
||||||
|
readerScope.login(LoginLevel.SCOPE);
|
||||||
|
|
||||||
|
GNInsertConfiguration configuration = readerScope.getCurrentUserConfiguration("datasets", "_none_");
|
||||||
|
|
||||||
|
if (isprivate)
|
||||||
|
readerScope.insertMetadata(configuration, meta);
|
||||||
|
else
|
||||||
|
readerScope.insertAndPromoteMetadata(configuration, meta);
|
||||||
|
|
||||||
|
//old command
|
||||||
|
/*
|
||||||
GNClient client = new GNClient(geonetworkUrl);
|
GNClient client = new GNClient(geonetworkUrl);
|
||||||
client.login(geonetworkUser, geonetworkPwd);
|
client.login(geonetworkUser, geonetworkPwd);
|
||||||
File tmetafile = meta2File(meta);
|
File tmetafile = meta2File(meta);
|
||||||
|
|
||||||
client.insertMetadata(new GNInsertConfiguration(geonetworkGroup, "datasets", "_none_", true), tmetafile);
|
|
||||||
tmetafile.delete();
|
tmetafile.delete();
|
||||||
|
client.insertMetadata(new GNInsertConfiguration(geonetworkGroup, "datasets", "_none_", true), tmetafile);
|
||||||
|
*/
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -836,7 +887,98 @@ public class GenericLayerMetadata {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static String getProtocol(String url) {
|
||||||
|
|
||||||
|
if (url.toLowerCase().contains("service=wfs"))
|
||||||
|
return "OGC:WFS-1.1.0-http-get-feature";
|
||||||
|
|
||||||
|
else if (url.toLowerCase().contains("service=wms"))
|
||||||
|
return "OGC:WMS-1.3.0-http-get-map";
|
||||||
|
|
||||||
|
else if (url.toLowerCase().contains("service=wcs"))
|
||||||
|
return "OGC:WCS-1.0.0-http-get-coverage";
|
||||||
|
|
||||||
|
else if (url.toLowerCase().contains("/dodsC"))
|
||||||
|
return "OGC:OPeNDAP-2.0.0";
|
||||||
|
|
||||||
|
else
|
||||||
|
return "WWW:LINK-1.0-http--link";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getDescription(String url) {
|
||||||
|
|
||||||
|
if (url.toLowerCase().contains("service=wfs"))
|
||||||
|
return "GIS data (WFS - JSON)";
|
||||||
|
|
||||||
|
else if (url.toLowerCase().contains("service=wms")) {
|
||||||
|
if (url.toLowerCase().contains("openlayers"))
|
||||||
|
return "GIS data (WMS - OpenLayers)";
|
||||||
|
else
|
||||||
|
return "GIS data (WMS)";
|
||||||
|
} else if (url.toLowerCase().contains("service=wcs"))
|
||||||
|
return "GIS data (WCS - Geotiff)";
|
||||||
|
|
||||||
|
else if (url.toLowerCase().contains("/dodsc"))
|
||||||
|
return "GIS data (OPenNDAP - NetCDF)";
|
||||||
|
|
||||||
|
else
|
||||||
|
return "Direct HTTP link";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getName(String title, String abstractTitle, String protocol, String url) {
|
||||||
|
try{
|
||||||
|
|
||||||
|
if (abstractTitle.matches(".+: ")) {
|
||||||
|
String variablename = title.substring(title.indexOf(":"));
|
||||||
|
AnalysisLogger.getLogger().debug("detected variable " + variablename);
|
||||||
|
return variablename;
|
||||||
|
} else {
|
||||||
|
if (url.contains("catalog.xml")) {
|
||||||
|
return "Catalogue";
|
||||||
|
} else if (protocol.equals("WWW:LINK-1.0-http--link") || protocol.equals("OGC:OPeNDAP-2.0.0")) {
|
||||||
|
int slash = url.lastIndexOf("/");
|
||||||
|
if (slash > 0) {
|
||||||
|
String file = url.substring(slash + 1);
|
||||||
|
if (file.trim().length() > 0 && file.contains("."))
|
||||||
|
return file;
|
||||||
|
else
|
||||||
|
return "Direct link to resource";
|
||||||
|
} else
|
||||||
|
return "Direct link to resource";
|
||||||
|
} else {
|
||||||
|
int check = -1;
|
||||||
|
String checker = "";
|
||||||
|
if (protocol.equals("OGC:WMS-1.3.0-http-get-map")) {
|
||||||
|
checker = "layers=";
|
||||||
|
} else if (protocol.equals("OGC:WFS-1.0.0-http-get-feature")) {
|
||||||
|
checker = "typename=";
|
||||||
|
} else if (protocol.equals("OGC:WCS-1.0.0-http-get-coverage")) {
|
||||||
|
checker = "coverage=";
|
||||||
|
}
|
||||||
|
|
||||||
|
check = url.toLowerCase().indexOf(checker);
|
||||||
|
if (check > 0) {
|
||||||
|
String cutUrl = url.substring(check + checker.length());
|
||||||
|
int end = cutUrl.indexOf("&");
|
||||||
|
String layerName = cutUrl;
|
||||||
|
if (end > -1)
|
||||||
|
layerName = cutUrl.substring(0, end);
|
||||||
|
|
||||||
|
int column = -1;
|
||||||
|
if ((column = layerName.indexOf(":")) > 0)
|
||||||
|
layerName = layerName.substring(column + 1);
|
||||||
|
AnalysisLogger.getLogger().debug("Layer Name: " + layerName);
|
||||||
|
return layerName;
|
||||||
|
} else
|
||||||
|
return title;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}catch(Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
return "LINK";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,9 @@ import java.util.Map.Entry;
|
||||||
import javax.xml.bind.JAXBException;
|
import javax.xml.bind.JAXBException;
|
||||||
|
|
||||||
import org.gcube.contentmanagement.lexicalmatcher.utils.AnalysisLogger;
|
import org.gcube.contentmanagement.lexicalmatcher.utils.AnalysisLogger;
|
||||||
|
import org.gcube.spatial.data.geonetwork.GeoNetwork;
|
||||||
|
import org.gcube.spatial.data.geonetwork.GeoNetworkAdministration;
|
||||||
|
import org.gcube.spatial.data.geonetwork.LoginLevel;
|
||||||
import org.geotoolkit.metadata.iso.DefaultIdentifier;
|
import org.geotoolkit.metadata.iso.DefaultIdentifier;
|
||||||
import org.geotoolkit.metadata.iso.DefaultMetadata;
|
import org.geotoolkit.metadata.iso.DefaultMetadata;
|
||||||
import org.geotoolkit.metadata.iso.citation.DefaultCitation;
|
import org.geotoolkit.metadata.iso.citation.DefaultCitation;
|
||||||
|
@ -471,12 +474,19 @@ public class NetCDFMetadata {
|
||||||
meta.getDataQualityInfo().add(processQuality);
|
meta.getDataQualityInfo().add(processQuality);
|
||||||
meta.setLanguage(Locale.ENGLISH);
|
meta.setLanguage(Locale.ENGLISH);
|
||||||
// System.out.println(meta);
|
// System.out.println(meta);
|
||||||
|
/*
|
||||||
GNClient client = new GNClient(geonetworkUrl);
|
GNClient client = new GNClient(geonetworkUrl);
|
||||||
client.login(geonetworkUser, geonetworkPwd);
|
client.login(geonetworkUser, geonetworkPwd);
|
||||||
File tmetafile = meta2File(meta);
|
File tmetafile = meta2File(meta);
|
||||||
client.insertMetadata(new GNInsertConfiguration(group, category, stylesheet,validate), tmetafile);
|
client.insertMetadata(new GNInsertConfiguration(group, category, stylesheet,validate), tmetafile);
|
||||||
tmetafile.delete();
|
tmetafile.delete();
|
||||||
|
*/
|
||||||
|
|
||||||
|
GeoNetworkAdministration readerScope = GeoNetwork.get();
|
||||||
|
readerScope.login(LoginLevel.SCOPE);
|
||||||
|
GNInsertConfiguration configuration = readerScope.getCurrentUserConfiguration("datasets", "_none_");
|
||||||
|
readerScope.insertAndPromoteMetadata(configuration, meta);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<TopicCategory> guessTopicCategory(String refString){
|
public static List<TopicCategory> guessTopicCategory(String refString){
|
||||||
|
|
|
@ -51,7 +51,8 @@ public class PolyMapMetadata {
|
||||||
level = LoginLevel.PRIVATE;
|
level = LoginLevel.PRIVATE;
|
||||||
|
|
||||||
// PublishResponse resp = gis.publishDBTable(workspace, datastore, fte, le, meta.getMetadata(), new GNInsertConfiguration(gnConfig.getScopeGroup() + "", "datasets", "_none_", true), LoginLevel.DEFAULT);
|
// PublishResponse resp = gis.publishDBTable(workspace, datastore, fte, le, meta.getMetadata(), new GNInsertConfiguration(gnConfig.getScopeGroup() + "", "datasets", "_none_", true), LoginLevel.DEFAULT);
|
||||||
PublishResponse resp = gis.publishDBTable(workspace, datastore, fte, le, meta.getMetadata(), "datasets", "_none_", level);
|
|
||||||
|
PublishResponse resp = gis.publishDBTable(workspace, datastore, fte, le, meta.getMetadata(), "datasets", "_none_", level,!isprivate);
|
||||||
|
|
||||||
AnalysisLogger.getLogger().debug(resp);
|
AnalysisLogger.getLogger().debug(resp);
|
||||||
AnalysisLogger.getLogger().debug("ID:" + resp.getReturnedMetaId());
|
AnalysisLogger.getLogger().debug("ID:" + resp.getReturnedMetaId());
|
||||||
|
@ -64,11 +65,13 @@ public class PolyMapMetadata {
|
||||||
|
|
||||||
private static GcubeISOMetadata fillMeta(double resolution, String username, String title, String scope, String tableName, String purpose, String credits, String keyword) throws Exception {
|
private static GcubeISOMetadata fillMeta(double resolution, String username, String title, String scope, String tableName, String purpose, String credits, String keyword) throws Exception {
|
||||||
|
|
||||||
|
/*
|
||||||
if (scope == null)
|
if (scope == null)
|
||||||
scope = ScopeProvider.instance.get();
|
scope = ScopeProvider.instance.get();
|
||||||
|
*/
|
||||||
|
|
||||||
AnalysisLogger.getLogger().debug("Setting scope for filling Meta");
|
AnalysisLogger.getLogger().debug("Setting scope for filling Meta");
|
||||||
ScopeProvider.instance.set(scope);
|
// ScopeProvider.instance.set(scope);
|
||||||
|
|
||||||
AnalysisLogger.getLogger().debug("Fulfilling metadata");
|
AnalysisLogger.getLogger().debug("Fulfilling metadata");
|
||||||
GcubeISOMetadata meta = new GcubeISOMetadata();
|
GcubeISOMetadata meta = new GcubeISOMetadata();
|
||||||
|
|
|
@ -140,7 +140,7 @@ public class ThreddsPublisher {
|
||||||
|
|
||||||
AnalysisLogger.getLogger().debug("Publishing in group: "+metadataInserter.getGeonetworkGroup());
|
AnalysisLogger.getLogger().debug("Publishing in group: "+metadataInserter.getGeonetworkGroup());
|
||||||
AnalysisLogger.getLogger().debug("Inserting custom metadata ");
|
AnalysisLogger.getLogger().debug("Inserting custom metadata ");
|
||||||
metadataInserter.customMetaDataInsert(urls,protocols);
|
metadataInserter.customMetaDataInsert(urls,protocols,isprivate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -205,7 +205,7 @@ public class ThreddsPublisher {
|
||||||
metadataInserter.setYRightUpper(maxY);
|
metadataInserter.setYRightUpper(maxY);
|
||||||
AnalysisLogger.getLogger().debug("Publishing in group: "+metadataInserter.getGeonetworkGroup());
|
AnalysisLogger.getLogger().debug("Publishing in group: "+metadataInserter.getGeonetworkGroup());
|
||||||
AnalysisLogger.getLogger().debug("Inserting metadata ");
|
AnalysisLogger.getLogger().debug("Inserting metadata ");
|
||||||
metadataInserter.customMetaDataInsert(urls,protocols);
|
metadataInserter.customMetaDataInsert(urls,protocols,isprivate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -13,14 +13,14 @@ import org.gcube.dataanalysis.ecoengine.datatypes.InputTable;
|
||||||
import org.gcube.dataanalysis.ecoengine.datatypes.OutputTable;
|
import org.gcube.dataanalysis.ecoengine.datatypes.OutputTable;
|
||||||
import org.gcube.dataanalysis.ecoengine.datatypes.StatisticalType;
|
import org.gcube.dataanalysis.ecoengine.datatypes.StatisticalType;
|
||||||
import org.gcube.dataanalysis.ecoengine.datatypes.enumtypes.TableTemplates;
|
import org.gcube.dataanalysis.ecoengine.datatypes.enumtypes.TableTemplates;
|
||||||
import org.gcube.dataanalysis.ecoengine.interfaces.StandardLocalExternalAlgorithm;
|
import org.gcube.dataanalysis.ecoengine.interfaces.StandardLocalInfraAlgorithm;
|
||||||
import org.gcube.dataanalysis.ecoengine.utils.DatabaseFactory;
|
import org.gcube.dataanalysis.ecoengine.utils.DatabaseFactory;
|
||||||
import org.gcube.dataanalysis.ecoengine.utils.DatabaseUtils;
|
import org.gcube.dataanalysis.ecoengine.utils.DatabaseUtils;
|
||||||
import org.gcube.dataanalysis.ecoengine.utils.IOHelper;
|
import org.gcube.dataanalysis.ecoengine.utils.IOHelper;
|
||||||
import org.gcube.dataanalysis.geo.utils.GridCWPConverter;
|
import org.gcube.dataanalysis.geo.utils.GridCWPConverter;
|
||||||
import org.hibernate.SessionFactory;
|
import org.hibernate.SessionFactory;
|
||||||
|
|
||||||
public class GridCWP2Coordinates extends StandardLocalExternalAlgorithm{
|
public class GridCWP2Coordinates extends StandardLocalInfraAlgorithm{
|
||||||
|
|
||||||
static String CodeColumn = "ColumnWithCodes";
|
static String CodeColumn = "ColumnWithCodes";
|
||||||
static String inputTableParameter = "InputTable";
|
static String inputTableParameter = "InputTable";
|
||||||
|
|
Loading…
Reference in New Issue