ref 13024: DataMiner - The service must support the https protocol

https://support.d4science.org/issues/13024

Updated DataMiner now support https

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-analysis/wps@174937 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2018-12-17 15:11:57 +00:00
parent d1ec871c00
commit f2ffbba298
19 changed files with 181 additions and 86 deletions

View File

@ -25,6 +25,7 @@
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">

View File

@ -5,11 +5,31 @@
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>de.walware.statet.r.builders.RSupport</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>de.walware.docmlet.tex.builders.Tex</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
@ -17,7 +37,14 @@
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
<nature>de.walware.statet.base.StatetNature</nature>
<nature>de.walware.statet.r.RNature</nature>
<nature>de.walware.docmlet.tex.natures.Tex</nature>
</natures>
</projectDescription>

13
.settings/.jsdtscope Normal file
View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry excluding="**/bower_components/*|**/node_modules/*|**/*.min.js" kind="src" path="src/main/webapp"/>
<classpathentry kind="src" path="target/m2e-wtp/web-resources"/>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject">
<attributes>
<attribute name="hide" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
<classpathentry kind="output" path=""/>
</classpath>

View File

@ -1,5 +1,8 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.8

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="wps">
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
<dependent-module archiveName="dataminer-1.5.6-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/dataminer/dataminer">
<dependency-type>uses</dependency-type>
</dependent-module>
<property name="context-root" value="wps"/>
<property name="java-output-path" value="/wps/target/classes"/>
</wb-module>
</project-modules>

View File

@ -0,0 +1,7 @@
<root>
<facet id="jst.jaxrs">
<node name="libprov">
<attribute name="provider-id" value="jaxrs-no-op-library-provider"/>
</node>
</facet>
</root>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<fixed facet="wst.jsdt.web"/>
<installed facet="java" version="1.8"/>
<installed facet="jst.web" version="3.0"/>
<installed facet="jst.jaxrs" version="2.0"/>
<installed facet="wst.jsdt.web" version="1.0"/>
</faceted-project>

View File

@ -0,0 +1 @@
org.eclipse.wst.jsdt.launching.baseBrowserLibrary

View File

@ -0,0 +1 @@
Window

View File

@ -0,0 +1,2 @@
disabled=06target
eclipse.preferences.version=1

View File

@ -1,7 +1,12 @@
<ReleaseNotes>
<Changeset component="org.gcube.data-analysis.wps.1-1-3"
date="2018-12-13">
<Change>Added https support [ticket #13024]</Change>
</Changeset>
<Changeset component="org.gcube.data-analysis.wps.1-1-0"
date="2017-09-24">
<Change>Dynamic adding, removing and updating of algorithms added</Change>
<Change>Dynamic adding, removing and updating of algorithms added
</Change>
<Change>Moved to SocialNetworkingService 2.0</Change>
</Changeset>
<Changeset component="org.gcube.data-analysis.wps.1-0-0"

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_3_0.xsd"
version="3.0">
<display-name>52°North Web Processing Service, Git:
1665e1b7b2188755161d4f0f3a6acf562d0444e1 @ 2015-03-21 00:30:20
</display-name>

View File

@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.gcube.data-analysis</groupId>
<artifactId>wps</artifactId>
<version>1.1.2-SNAPSHOT</version>
<version>1.1.3-SNAPSHOT</version>
<name>WPS</name>
<parent>

View File

@ -23,42 +23,46 @@ import org.slf4j.LoggerFactory;
public class GetCapabilitiesBuilder {
public static String processString = "<wps:Process wps:processVersion=\"1.1.0\">\n\t<ows:Identifier>#CLASS#</ows:Identifier>\n\t<ows:Title>#TITLE#</ows:Title>\n</wps:Process>";
private static final Logger LOGGER= LoggerFactory.getLogger(GetCapabilitiesBuilder.class);
public String getClassification(String algorithmName, ConfigurationManager configManager) throws Exception{
//get algorithms classification:
LOGGER.debug("Searching for a classification of "+algorithmName);
HashMap<String, List<String>> algorithmsClassification = ProcessorsFactory.getAllFeaturesUser(configManager.getConfig());
private static final Logger LOGGER = LoggerFactory.getLogger(GetCapabilitiesBuilder.class);
public String getClassification(String algorithmName, ConfigurationManager configManager) throws Exception {
// get algorithms classification:
LOGGER.debug("Searching for a classification of " + algorithmName);
HashMap<String, List<String>> algorithmsClassification = ProcessorsFactory
.getAllFeaturesUser(configManager.getConfig());
String rightClassification = "Others";
for (String classification:algorithmsClassification.keySet()){
for (String classification : algorithmsClassification.keySet()) {
List<String> algorithms = algorithmsClassification.get(classification);
if (algorithms.contains(algorithmName)){
LOGGER.debug("Found classification"+classification);
return classification;
if (algorithms.contains(algorithmName)) {
LOGGER.debug("Found classification" + classification);
return classification;
}
}
LOGGER.debug("No classification found for "+algorithmName);
LOGGER.debug("No classification found for " + algorithmName);
return rightClassification;
}
public String buildGetCapabilities(Map<String, String[]> parameters) throws Exception {
LinkedHashMap<String, Object> basicInputs = new LinkedHashMap<String, Object>();
//DONE get scope and username from SmartGears to build the get capabilities
/* OLD CODE
if (parameters != null) {
if (parameters.get(ConfigurationManager.scopeParameter) != null)
basicInputs.put(ConfigurationManager.scopeParameter, parameters.get(ConfigurationManager.scopeParameter)[0]);
if (parameters.get(ConfigurationManager.usernameParameter) != null)
basicInputs.put(ConfigurationManager.usernameParameter, parameters.get(ConfigurationManager.usernameParameter)[0]);
} else {// case for testing purposes only
if (AbstractEcologicalEngineMapper.simulationMode){
basicInputs.put(ConfigurationManager.scopeParameter, ConfigurationManager.defaultScope);
basicInputs.put(ConfigurationManager.usernameParameter, ConfigurationManager.defaultUsername);
}
}
*/
// DONE get scope and username from SmartGears to build the get
// capabilities
/*
* OLD CODE if (parameters != null) { if
* (parameters.get(ConfigurationManager.scopeParameter) != null)
* basicInputs.put(ConfigurationManager.scopeParameter,
* parameters.get(ConfigurationManager.scopeParameter)[0]); if
* (parameters.get(ConfigurationManager.usernameParameter) != null)
* basicInputs.put(ConfigurationManager.usernameParameter,
* parameters.get(ConfigurationManager.usernameParameter)[0]); } else
* {// case for testing purposes only if
* (AbstractEcologicalEngineMapper.simulationMode){
* basicInputs.put(ConfigurationManager.scopeParameter,
* ConfigurationManager.defaultScope);
* basicInputs.put(ConfigurationManager.usernameParameter,
* ConfigurationManager.defaultUsername); } }
*/
ConfigurationManager configManager = new ConfigurationManager();
TokenManager tokenm = new TokenManager();
tokenm.getCredentials();
@ -68,63 +72,70 @@ public class GetCapabilitiesBuilder {
basicInputs.put(ConfigurationManager.scopeParameter, scope);
basicInputs.put(ConfigurationManager.usernameParameter, username);
basicInputs.put(ConfigurationManager.tokenParameter, token);
configManager.configAlgorithmEnvironment(basicInputs);
LOGGER.debug("Initializing Capabilities Skeleton in scope " + configManager.getScope() + " with user " + configManager.getUsername());
LOGGER.debug("Initializing Capabilities Skeleton in scope " + configManager.getScope() + " with user "
+ configManager.getUsername());
InputStream is = this.getClass().getClassLoader().getResourceAsStream("templates/wpsCapabilitiesSkeleton.xml");
String stringTemplate = IOUtils.toString(is, "UTF-8");
//TODO: GET HOSTNAME AND PORT from container
// TODO: GET HOSTNAME AND PORT from container
String protocol = WPSConfig.getInstance().getWPSConfig().getServer().getProtocol();
String host = WPSConfig.getInstance().getWPSConfig().getServer().getHostname();
String port = WPSConfig.getInstance().getWPSConfig().getServer().getHostport();
stringTemplate = stringTemplate.replace("#HOST#", host).replace("#PORT#", port);
stringTemplate = stringTemplate.replace("#PROTOCOL#", protocol).replace("#HOST#", host).replace("#PORT#", port);
LOGGER.debug("Protocol: "+protocol);
LOGGER.debug("Host: " + host);
LOGGER.debug("Port: " + port);
LOGGER.debug("Host: " + host + " Port: " + port);
LinkedHashMap<String, String> allalgorithms = new LinkedHashMap<String, String>();
/*
String packageS = "org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses";
List<Class<?>> classes = null;
try{
LOGGER.debug("Taking classes from /classes");
classes = GetCapabilitiesChecker.find(packageS);
}catch(Exception e){
LOGGER.debug("Taking classes from the Jar");
classes=GetCapabilitiesChecker.getClassesInSamePackageFromJar(packageS);
}*/
LOGGER.info("using classloader class {} ",Thread.currentThread().getContextClassLoader().getClass().getSimpleName());
Set<Class<?>> algorithmsClass = GcubeAlgorithmRepository.getAllAlgorithms();
LOGGER.info("class found with annotation Algorithm are {}",algorithmsClass.size());
* String packageS =
* "org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses";
* List<Class<?>> classes = null; try{
* LOGGER.debug("Taking classes from /classes"); classes =
* GetCapabilitiesChecker.find(packageS); }catch(Exception e){
* LOGGER.debug("Taking classes from the Jar");
* classes=GetCapabilitiesChecker.getClassesInSamePackageFromJar(
* packageS); }
*/
LOGGER.info("using classloader class {} ",
Thread.currentThread().getContextClassLoader().getClass().getSimpleName());
Set<Class<?>> algorithmsClass = GcubeAlgorithmRepository.getAllAlgorithms();
LOGGER.info("class found with annotation Algorithm are {}", algorithmsClass.size());
for (Class<?> classfind : algorithmsClass) {
org.n52.wps.algorithm.annotation.Algorithm algorithmInfo = classfind.getAnnotation(org.n52.wps.algorithm.annotation.Algorithm.class);
org.n52.wps.algorithm.annotation.Algorithm algorithmInfo = classfind
.getAnnotation(org.n52.wps.algorithm.annotation.Algorithm.class);
if (algorithmInfo != null) {
LOGGER.debug("Retrieving local declared Algorithm: " + algorithmInfo.title());
allalgorithms.put(algorithmInfo.title(), classfind.getName());
}
}
}
LOGGER.debug("Getting algorithms from the infrastructure");
InfrastructureDialoguer dialoguer = new InfrastructureDialoguer(configManager.getScope());
List<String> algorithmsInScope = dialoguer.getAlgorithmsInScope();
LOGGER.debug("Found {} algorithms in scope {} ",algorithmsInScope.size() ,ScopeProvider.instance.get());
LOGGER.debug("Found {} algorithms in scope {} ", algorithmsInScope.size(), ScopeProvider.instance.get());
StringBuffer capabilities = new StringBuffer();
//TO eliminate duplicate coming from IS
// TO eliminate duplicate coming from IS
Set<String> algorithmsSet = new HashSet<String>(algorithmsInScope);
algorithmsSet.addAll(dialoguer.getPrivateAlgorithmsInScope(AuthorizationProvider.instance.get().getClient().getId()));
for (String algorithmInScope : algorithmsSet ) {
algorithmsSet.addAll(
dialoguer.getPrivateAlgorithmsInScope(AuthorizationProvider.instance.get().getClient().getId()));
for (String algorithmInScope : algorithmsSet) {
String classAlgorithm = allalgorithms.get(algorithmInScope);
if (classAlgorithm != null) {
LOGGER.debug("Approving " + classAlgorithm + " to capabilities ");
String algorithmTitle = getClassification(algorithmInScope, configManager)+":"+algorithmInScope;
// String algorithmTitle = algorithmInScope;
capabilities.append(processString.replace("#TITLE#", algorithmTitle).replace("#CLASS#", classAlgorithm));
String algorithmTitle = getClassification(algorithmInScope, configManager) + ":" + algorithmInScope;
// String algorithmTitle = algorithmInScope;
capabilities
.append(processString.replace("#TITLE#", algorithmTitle).replace("#CLASS#", classAlgorithm));
}
}
@ -133,6 +144,4 @@ public class GetCapabilitiesBuilder {
return stringTemplate;
}
}

View File

@ -9,23 +9,23 @@ open-source software toolkit used for building and operating Hybrid Data
Infrastructures enabling the dynamic deployment of Virtual Research Environments
by favouring the realisation of reuse oriented policies.
The projects leading to this software have received funding from a series of
European Union programmes including:
* the Sixth Framework Programme for Research and Technological Development -
DILIGENT (grant no. 004260);
* the Seventh Framework Programme for research, technological development and
demonstration - D4Science (grant no. 212488), D4Science-II (grant no.
239019),ENVRI (grant no. 283465), EUBrazilOpenBio (grant no. 288754), iMarine
(grant no. 283644);
* the H2020 research and innovation programme - BlueBRIDGE (grant no. 675680),
EGIEngage (grant no. 654142), ENVRIplus (grant no. 654182), Parthenos (grant
no. 654119), SoBigData (grant no. 654024), AGINFRA PLUS (grant no. 731001).
The projects leading to this software have received funding from a series of
European Union programmes including:
* the Sixth Framework Programme for Research and Technological Development -
DILIGENT (grant no. 004260);
* the Seventh Framework Programme for research, technological development and
demonstration - D4Science (grant no. 212488), D4Science-II (grant no.
239019),ENVRI (grant no. 283465), EUBrazilOpenBio (grant no. 288754), iMarine
(grant no. 283644);
* the H2020 research and innovation programme - BlueBRIDGE (grant no. 675680),
EGIEngage (grant no. 654142), ENVRIplus (grant no. 654182), Parthenos (grant
no. 654119), SoBigData (grant no. 654024);
Version
--------------------------------------------------
1.1.1-SNAPSHOT (2018-10-12)
1.1.3-SNAPSHOT (2018-12-17)
Please see the file named "changelog.xml" in this directory for the release notes.

View File

@ -1,7 +1,12 @@
<ReleaseNotes>
<Changeset component="org.gcube.data-analysis.wps.1-1-3"
date="2018-12-13">
<Change>Added https support [ticket #13024]</Change>
</Changeset>
<Changeset component="org.gcube.data-analysis.wps.1-1-0"
date="2017-09-24">
<Change>Dynamic adding, removing and updating of algorithms added</Change>
<Change>Dynamic adding, removing and updating of algorithms added
</Change>
<Change>Moved to SocialNetworkingService 2.0</Change>
</Changeset>
<Changeset component="org.gcube.data-analysis.wps.1-0-0"

View File

@ -9,7 +9,7 @@
<baseDirectory>/</baseDirectory>
<fileSets>
<fileSet>
<directory>/home/lucio/workspace/imarine/wps/distro</directory>
<directory>/home/giancarlo/workspaceDataMinerService/wps/distro</directory>
<outputDirectory>/</outputDirectory>
<useDefaultExcludes>true</useDefaultExcludes>
<includes>

View File

@ -10,11 +10,11 @@
<Packages>
<Software>
<Name>wps</Name>
<Version>1.1.1-SNAPSHOT</Version>
<Version>1.1.3-SNAPSHOT</Version>
<MavenCoordinates>
<groupId>org.gcube.data-analysis</groupId>
<artifactId>wps</artifactId>
<version>1.1.1-SNAPSHOT</version>
<version>1.1.3-SNAPSHOT</version>
</MavenCoordinates>
<Files>
<File>wps.jar</File>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_3_0.xsd"
version="3.0">
<display-name>52°North Web Processing Service, Git:
1665e1b7b2188755161d4f0f3a6acf562d0444e1 @ 2015-03-21 00:30:20
</display-name>