From ed5b9111ea7f7a730dd56cf77f33be447c907bf2 Mon Sep 17 00:00:00 2001 From: Giancarlo Panichi Date: Fri, 11 May 2018 17:14:11 +0000 Subject: [PATCH] ref 11719: Add management of VREs to the NLPHub interface https://support.d4science.org/issues/11719 Fixed some issue on webapp: Errors of shared variables on servlets Added slf4j over the whole application and logs in nlphub.log Problem of checking nulls on arrays in Javascript Added the ability to retrieve the context and token from the RequestUri git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/data-analysis/nlphub@167441 82a268e6-3cf1-43bd-a215-b396298e98cf --- src/main/java/org/gcube/data/analysis/nlphub/NLPMapper.java | 2 +- src/main/java/org/gcube/data/analysis/nlphub/NLPUploader.java | 2 +- .../gcube/data/analysis/nlphub/nlp/NLpLanguageRecognizer.java | 2 +- .../org/gcube/data/analysis/nlphub/nlp/NlpAsyncNerRunner.java | 2 +- .../org/gcube/data/analysis/nlphub/nlp/RunnerCommander.java | 2 +- .../org/gcube/data/analysis/nlphub/session/SessionUtils.java | 2 +- .../data/analysis/nlphub/{legacy => shared}/Constants.java | 2 +- .../gcube/data/analysis/nlphub/workspace/WorkspaceManager.java | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) rename src/main/java/org/gcube/data/analysis/nlphub/{legacy => shared}/Constants.java (96%) diff --git a/src/main/java/org/gcube/data/analysis/nlphub/NLPMapper.java b/src/main/java/org/gcube/data/analysis/nlphub/NLPMapper.java index 3833f64..b2180fd 100644 --- a/src/main/java/org/gcube/data/analysis/nlphub/NLPMapper.java +++ b/src/main/java/org/gcube/data/analysis/nlphub/NLPMapper.java @@ -14,12 +14,12 @@ import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import org.gcube.data.analysis.nlphub.legacy.Constants; import org.gcube.data.analysis.nlphub.legacy.JsonManager; import org.gcube.data.analysis.nlphub.legacy.NlpHubException; import org.gcube.data.analysis.nlphub.mapper.DefaultMapper; import org.gcube.data.analysis.nlphub.mapper.JsonMapper; import org.gcube.data.analysis.nlphub.session.SessionUtils; +import org.gcube.data.analysis.nlphub.shared.Constants; import org.gcube.data.analysis.nlphub.workspace.WorkspaceManager; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/org/gcube/data/analysis/nlphub/NLPUploader.java b/src/main/java/org/gcube/data/analysis/nlphub/NLPUploader.java index 5bdce2f..7ce4fe2 100644 --- a/src/main/java/org/gcube/data/analysis/nlphub/NLPUploader.java +++ b/src/main/java/org/gcube/data/analysis/nlphub/NLPUploader.java @@ -14,12 +14,12 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.Part; -import org.gcube.data.analysis.nlphub.legacy.Constants; import org.gcube.data.analysis.nlphub.legacy.JsonManager; import org.gcube.data.analysis.nlphub.legacy.NlpHubException; import org.gcube.data.analysis.nlphub.nlp.NLpLanguageRecognizer; import org.gcube.data.analysis.nlphub.nlp.NlpUtils; import org.gcube.data.analysis.nlphub.session.SessionUtils; +import org.gcube.data.analysis.nlphub.shared.Constants; import org.gcube.data.analysis.nlphub.workspace.WorkspaceManager; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/org/gcube/data/analysis/nlphub/nlp/NLpLanguageRecognizer.java b/src/main/java/org/gcube/data/analysis/nlphub/nlp/NLpLanguageRecognizer.java index 2d79c28..b3178df 100644 --- a/src/main/java/org/gcube/data/analysis/nlphub/nlp/NLpLanguageRecognizer.java +++ b/src/main/java/org/gcube/data/analysis/nlphub/nlp/NLpLanguageRecognizer.java @@ -9,9 +9,9 @@ import java.net.URLEncoder; import javax.servlet.http.HttpServletResponse; import javax.xml.parsers.DocumentBuilderFactory; -import org.gcube.data.analysis.nlphub.legacy.Constants; import org.gcube.data.analysis.nlphub.legacy.JsonManager; import org.gcube.data.analysis.nlphub.legacy.NlpHubException; +import org.gcube.data.analysis.nlphub.shared.Constants; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.w3c.dom.Document; diff --git a/src/main/java/org/gcube/data/analysis/nlphub/nlp/NlpAsyncNerRunner.java b/src/main/java/org/gcube/data/analysis/nlphub/nlp/NlpAsyncNerRunner.java index 98a4182..c7e378f 100644 --- a/src/main/java/org/gcube/data/analysis/nlphub/nlp/NlpAsyncNerRunner.java +++ b/src/main/java/org/gcube/data/analysis/nlphub/nlp/NlpAsyncNerRunner.java @@ -12,8 +12,8 @@ import java.util.ArrayList; import javax.xml.parsers.DocumentBuilderFactory; import org.gcube.data.analysis.nlphub.legacy.AsyncHttpRequest; -import org.gcube.data.analysis.nlphub.legacy.Constants; import org.gcube.data.analysis.nlphub.legacy.NerOutput; +import org.gcube.data.analysis.nlphub.shared.Constants; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.w3c.dom.Document; diff --git a/src/main/java/org/gcube/data/analysis/nlphub/nlp/RunnerCommander.java b/src/main/java/org/gcube/data/analysis/nlphub/nlp/RunnerCommander.java index 38cdf85..0b80b5e 100644 --- a/src/main/java/org/gcube/data/analysis/nlphub/nlp/RunnerCommander.java +++ b/src/main/java/org/gcube/data/analysis/nlphub/nlp/RunnerCommander.java @@ -5,8 +5,8 @@ import java.util.ArrayList; import javax.servlet.http.HttpServletResponse; -import org.gcube.data.analysis.nlphub.legacy.Constants; import org.gcube.data.analysis.nlphub.legacy.JsonManager; +import org.gcube.data.analysis.nlphub.shared.Constants; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/org/gcube/data/analysis/nlphub/session/SessionUtils.java b/src/main/java/org/gcube/data/analysis/nlphub/session/SessionUtils.java index 2bf368a..73a53e4 100644 --- a/src/main/java/org/gcube/data/analysis/nlphub/session/SessionUtils.java +++ b/src/main/java/org/gcube/data/analysis/nlphub/session/SessionUtils.java @@ -2,7 +2,7 @@ package org.gcube.data.analysis.nlphub.session; import javax.servlet.http.HttpServletRequest; -import org.gcube.data.analysis.nlphub.legacy.Constants; +import org.gcube.data.analysis.nlphub.shared.Constants; public class SessionUtils { diff --git a/src/main/java/org/gcube/data/analysis/nlphub/legacy/Constants.java b/src/main/java/org/gcube/data/analysis/nlphub/shared/Constants.java similarity index 96% rename from src/main/java/org/gcube/data/analysis/nlphub/legacy/Constants.java rename to src/main/java/org/gcube/data/analysis/nlphub/shared/Constants.java index 4303590..55f881c 100644 --- a/src/main/java/org/gcube/data/analysis/nlphub/legacy/Constants.java +++ b/src/main/java/org/gcube/data/analysis/nlphub/shared/Constants.java @@ -1,4 +1,4 @@ -package org.gcube.data.analysis.nlphub.legacy; +package org.gcube.data.analysis.nlphub.shared; public class Constants { public static final boolean DEBUG = false; diff --git a/src/main/java/org/gcube/data/analysis/nlphub/workspace/WorkspaceManager.java b/src/main/java/org/gcube/data/analysis/nlphub/workspace/WorkspaceManager.java index 5ee5246..ccb8924 100644 --- a/src/main/java/org/gcube/data/analysis/nlphub/workspace/WorkspaceManager.java +++ b/src/main/java/org/gcube/data/analysis/nlphub/workspace/WorkspaceManager.java @@ -10,8 +10,8 @@ import java.net.HttpURLConnection; import java.net.URL; import java.net.URLEncoder; -import org.gcube.data.analysis.nlphub.legacy.Constants; import org.gcube.data.analysis.nlphub.legacy.NlpHubException; +import org.gcube.data.analysis.nlphub.shared.Constants; import org.slf4j.Logger; import org.slf4j.LoggerFactory;