diff --git a/.classpath b/.classpath index ace8266..6acf3ee 100644 --- a/.classpath +++ b/.classpath @@ -25,6 +25,7 @@ + diff --git a/.project b/.project index 267ae28..a5a17a9 100644 --- a/.project +++ b/.project @@ -5,11 +5,31 @@ + + org.eclipse.wst.common.project.facet.core.builder + + + org.eclipse.jdt.core.javabuilder + + org.eclipse.wst.validation.validationbuilder + + + + + de.walware.statet.r.builders.RSupport + + + + + de.walware.docmlet.tex.builders.Tex + + + org.eclipse.m2e.core.maven2Builder @@ -17,7 +37,14 @@ + org.eclipse.jem.workbench.JavaEMFNature + org.eclipse.wst.common.modulecore.ModuleCoreNature org.eclipse.jdt.core.javanature org.eclipse.m2e.core.maven2Nature + org.eclipse.wst.common.project.facet.core.nature + org.eclipse.wst.jsdt.core.jsNature + de.walware.statet.base.StatetNature + de.walware.statet.r.RNature + de.walware.docmlet.tex.natures.Tex diff --git a/.settings/.jsdtscope b/.settings/.jsdtscope new file mode 100644 index 0000000..2418123 --- /dev/null +++ b/.settings/.jsdtscope @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs index 714351a..6e80039 100644 --- a/.settings/org.eclipse.jdt.core.prefs +++ b/.settings/org.eclipse.jdt.core.prefs @@ -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 diff --git a/.settings/org.eclipse.wst.common.component b/.settings/org.eclipse.wst.common.component new file mode 100644 index 0000000..337ba6d --- /dev/null +++ b/.settings/org.eclipse.wst.common.component @@ -0,0 +1,13 @@ + + + + + + + + uses + + + + + diff --git a/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml b/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml new file mode 100644 index 0000000..cc81385 --- /dev/null +++ b/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/.settings/org.eclipse.wst.common.project.facet.core.xml b/.settings/org.eclipse.wst.common.project.facet.core.xml new file mode 100644 index 0000000..fac1799 --- /dev/null +++ b/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/.settings/org.eclipse.wst.jsdt.ui.superType.container b/.settings/org.eclipse.wst.jsdt.ui.superType.container new file mode 100644 index 0000000..3bd5d0a --- /dev/null +++ b/.settings/org.eclipse.wst.jsdt.ui.superType.container @@ -0,0 +1 @@ +org.eclipse.wst.jsdt.launching.baseBrowserLibrary \ No newline at end of file diff --git a/.settings/org.eclipse.wst.jsdt.ui.superType.name b/.settings/org.eclipse.wst.jsdt.ui.superType.name new file mode 100644 index 0000000..05bd71b --- /dev/null +++ b/.settings/org.eclipse.wst.jsdt.ui.superType.name @@ -0,0 +1 @@ +Window \ No newline at end of file diff --git a/.settings/org.eclipse.wst.validation.prefs b/.settings/org.eclipse.wst.validation.prefs new file mode 100644 index 0000000..04cad8c --- /dev/null +++ b/.settings/org.eclipse.wst.validation.prefs @@ -0,0 +1,2 @@ +disabled=06target +eclipse.preferences.version=1 diff --git a/distro/changelog.xml b/distro/changelog.xml index 7d01c91..7885397 100644 --- a/distro/changelog.xml +++ b/distro/changelog.xml @@ -1,7 +1,12 @@ + + Added https support [ticket #13024] + - Dynamic adding, removing and updating of algorithms added + Dynamic adding, removing and updating of algorithms added + Moved to SocialNetworkingService 2.0 + xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_3_0.xsd" + version="3.0"> 52°North Web Processing Service, Git: 1665e1b7b2188755161d4f0f3a6acf562d0444e1 @ 2015-03-21 00:30:20 diff --git a/pom.xml b/pom.xml index fe4757b..c32a60c 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.gcube.data-analysis wps - 1.1.2-SNAPSHOT + 1.1.3-SNAPSHOT WPS diff --git a/src/main/java/org/gcube/data/analysis/wps/GetCapabilitiesBuilder.java b/src/main/java/org/gcube/data/analysis/wps/GetCapabilitiesBuilder.java index 98da539..fa7b7e9 100644 --- a/src/main/java/org/gcube/data/analysis/wps/GetCapabilitiesBuilder.java +++ b/src/main/java/org/gcube/data/analysis/wps/GetCapabilitiesBuilder.java @@ -23,42 +23,46 @@ import org.slf4j.LoggerFactory; public class GetCapabilitiesBuilder { public static String processString = "\n\t#CLASS#\n\t#TITLE#\n"; - - 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> 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> algorithmsClassification = ProcessorsFactory + .getAllFeaturesUser(configManager.getConfig()); String rightClassification = "Others"; - for (String classification:algorithmsClassification.keySet()){ + for (String classification : algorithmsClassification.keySet()) { List 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 parameters) throws Exception { LinkedHashMap basicInputs = new LinkedHashMap(); - //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 allalgorithms = new LinkedHashMap(); /* - String packageS = "org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses"; - List> 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> algorithmsClass = GcubeAlgorithmRepository.getAllAlgorithms(); - - LOGGER.info("class found with annotation Algorithm are {}",algorithmsClass.size()); - + * String packageS = + * "org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses"; + * List> 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> 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 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 algorithmsSet = new HashSet(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; } - - } diff --git a/src/main/webapp/WEB-INF/README b/src/main/webapp/WEB-INF/README index 1304c31..f7cc6dc 100644 --- a/src/main/webapp/WEB-INF/README +++ b/src/main/webapp/WEB-INF/README @@ -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. diff --git a/src/main/webapp/WEB-INF/changelog.xml b/src/main/webapp/WEB-INF/changelog.xml index 7d01c91..7885397 100644 --- a/src/main/webapp/WEB-INF/changelog.xml +++ b/src/main/webapp/WEB-INF/changelog.xml @@ -1,7 +1,12 @@ + + Added https support [ticket #13024] + - Dynamic adding, removing and updating of algorithms added + Dynamic adding, removing and updating of algorithms added + Moved to SocialNetworkingService 2.0 / - /home/lucio/workspace/imarine/wps/distro + /home/giancarlo/workspaceDataMinerService/wps/distro / true diff --git a/src/main/webapp/WEB-INF/profile.xml b/src/main/webapp/WEB-INF/profile.xml index 550fdbe..67c8fb8 100644 --- a/src/main/webapp/WEB-INF/profile.xml +++ b/src/main/webapp/WEB-INF/profile.xml @@ -10,11 +10,11 @@ wps - 1.1.1-SNAPSHOT + 1.1.3-SNAPSHOT org.gcube.data-analysis wps - 1.1.1-SNAPSHOT + 1.1.3-SNAPSHOT wps.jar diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml index e5ee400..826191b 100644 --- a/src/main/webapp/WEB-INF/web.xml +++ b/src/main/webapp/WEB-INF/web.xml @@ -1,7 +1,7 @@ + xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_3_0.xsd" + version="3.0"> 52°North Web Processing Service, Git: 1665e1b7b2188755161d4f0f3a6acf562d0444e1 @ 2015-03-21 00:30:20