Updated to new PortalContext

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-gwt-service@141794 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2017-01-25 17:30:37 +00:00
parent 5ff5b86e3b
commit be3c5cb6b9
11 changed files with 76 additions and 54 deletions

View File

@ -125,8 +125,6 @@
</dependency>
<!-- Authorization -->
<dependency>
<groupId>org.gcube.common</groupId>

View File

@ -70,7 +70,9 @@ public class CSVImportFileServlet extends HttpServlet {
ServiceCredentials serviceCredentials;
String scopeGroupId = request.getParameter(Constants.CURR_GROUP_ID);
String scopeGroupId = request.getHeader(Constants.CURR_GROUP_ID);
if (scopeGroupId == null || scopeGroupId.isEmpty()) {
scopeGroupId = request.getParameter(Constants.CURR_GROUP_ID);
if (scopeGroupId == null || scopeGroupId.isEmpty()) {
logger.error("CURR_GROUP_ID is null, it is a mandatory parameter in custom servlet: "
+ scopeGroupId);
@ -78,6 +80,7 @@ public class CSVImportFileServlet extends HttpServlet {
"CURR_GROUP_ID is null, it is a mandatory parameter in custom servlet: "
+ scopeGroupId);
}
}
try {
serviceCredentials = SessionUtil.getServiceCredentials(request,

View File

@ -68,7 +68,9 @@ public class CodelistMappingUploadServlet extends HttpServlet {
ServiceCredentials serviceCredentials;
String scopeGroupId = request.getParameter(Constants.CURR_GROUP_ID);
String scopeGroupId = request.getHeader(Constants.CURR_GROUP_ID);
if (scopeGroupId == null || scopeGroupId.isEmpty()) {
scopeGroupId = request.getParameter(Constants.CURR_GROUP_ID);
if (scopeGroupId == null || scopeGroupId.isEmpty()) {
logger.error("CURR_GROUP_ID is null, it is a mandatory parameter in custom servlet: "
+ scopeGroupId);
@ -76,6 +78,7 @@ public class CodelistMappingUploadServlet extends HttpServlet {
"CURR_GROUP_ID is null, it is a mandatory parameter in custom servlet: "
+ scopeGroupId);
}
}
try {
// String currUserId = request

View File

@ -68,7 +68,9 @@ public class LocalUploadServlet extends HttpServlet {
ServiceCredentials serviceCredentials;
String scopeGroupId = request.getParameter(Constants.CURR_GROUP_ID);
String scopeGroupId = request.getHeader(Constants.CURR_GROUP_ID);
if (scopeGroupId == null || scopeGroupId.isEmpty()) {
scopeGroupId = request.getParameter(Constants.CURR_GROUP_ID);
if (scopeGroupId == null || scopeGroupId.isEmpty()) {
logger.error("CURR_GROUP_ID is null, it is a mandatory parameter in custom servlet: "
+ scopeGroupId);
@ -76,6 +78,7 @@ public class LocalUploadServlet extends HttpServlet {
"CURR_GROUP_ID is null, it is a mandatory parameter in custom servlet: "
+ scopeGroupId);
}
}
try {
serviceCredentials = SessionUtil.getServiceCredentials(request,

View File

@ -70,7 +70,9 @@ public class RetrieveChartFileServlet extends HttpServlet {
@SuppressWarnings("unused")
ServiceCredentials serviceCredentials;
String scopeGroupId = request.getParameter(Constants.CURR_GROUP_ID);
String scopeGroupId = request.getHeader(Constants.CURR_GROUP_ID);
if (scopeGroupId == null || scopeGroupId.isEmpty()) {
scopeGroupId = request.getParameter(Constants.CURR_GROUP_ID);
if (scopeGroupId == null || scopeGroupId.isEmpty()) {
logger.error("CURR_GROUP_ID is null, it is a mandatory parameter in custom servlet: "
+ scopeGroupId);
@ -78,6 +80,7 @@ public class RetrieveChartFileServlet extends HttpServlet {
"CURR_GROUP_ID is null, it is a mandatory parameter in custom servlet: "
+ scopeGroupId);
}
}
try {
serviceCredentials = SessionUtil.getServiceCredentials(request,

View File

@ -67,7 +67,9 @@ public class RetrieveFileAndDiscoverMimeTypeServlet extends HttpServlet {
@SuppressWarnings("unused")
ServiceCredentials serviceCredentials;
String scopeGroupId = request.getParameter(Constants.CURR_GROUP_ID);
String scopeGroupId = request.getHeader(Constants.CURR_GROUP_ID);
if (scopeGroupId == null || scopeGroupId.isEmpty()) {
scopeGroupId = request.getParameter(Constants.CURR_GROUP_ID);
if (scopeGroupId == null || scopeGroupId.isEmpty()) {
logger.error("CURR_GROUP_ID is null, it is a mandatory parameter in custom servlet: "
+ scopeGroupId);
@ -75,6 +77,7 @@ public class RetrieveFileAndDiscoverMimeTypeServlet extends HttpServlet {
"CURR_GROUP_ID is null, it is a mandatory parameter in custom servlet: "
+ scopeGroupId);
}
}
try {
serviceCredentials = SessionUtil.getServiceCredentials(request,

View File

@ -125,7 +125,7 @@ public class SessionUtil {
logger.info("No credential found in session, use test user!");
InfoLocale infoLocale = getInfoLocale(httpServletRequest, null);
Locale locale = new Locale(infoLocale.getLanguage());
@SuppressWarnings("unused")
ResourceBundle messages = ResourceBundle.getBundle(
TDGWTServiceMessagesConstants.TDGWTServiceMessages, locale);

View File

@ -67,7 +67,9 @@ public class TDLogsServlet extends HttpServlet {
@SuppressWarnings("unused")
ServiceCredentials serviceCredentials;
String scopeGroupId = request.getParameter(Constants.CURR_GROUP_ID);
String scopeGroupId = request.getHeader(Constants.CURR_GROUP_ID);
if (scopeGroupId == null || scopeGroupId.isEmpty()) {
scopeGroupId = request.getParameter(Constants.CURR_GROUP_ID);
if (scopeGroupId == null || scopeGroupId.isEmpty()) {
logger.error("CURR_GROUP_ID is null, it is a mandatory parameter in custom servlet: "
+ scopeGroupId);
@ -75,6 +77,7 @@ public class TDLogsServlet extends HttpServlet {
"CURR_GROUP_ID is null, it is a mandatory parameter in custom servlet: "
+ scopeGroupId);
}
}
try {
serviceCredentials = SessionUtil.getServiceCredentials(request,

View File

@ -67,7 +67,9 @@ public class TDRStudioServlet extends HttpServlet {
ServiceCredentials serviceCredentials;
String scopeGroupId = request.getParameter(Constants.CURR_GROUP_ID);
String scopeGroupId = request.getHeader(Constants.CURR_GROUP_ID);
if (scopeGroupId == null || scopeGroupId.isEmpty()) {
scopeGroupId = request.getParameter(Constants.CURR_GROUP_ID);
if (scopeGroupId == null || scopeGroupId.isEmpty()) {
logger.error("CURR_GROUP_ID is null, it is a mandatory parameter in custom servlet: "
+ scopeGroupId);
@ -75,6 +77,7 @@ public class TDRStudioServlet extends HttpServlet {
"CURR_GROUP_ID is null, it is a mandatory parameter in custom servlet: "
+ scopeGroupId);
}
}
try {
serviceCredentials = SessionUtil.getServiceCredentials(request,

View File

@ -66,7 +66,9 @@ public class TabularDataRowsXServlet extends HttpServlet {
@SuppressWarnings("unused")
ServiceCredentials serviceCredentials;
String scopeGroupId = request.getParameter(Constants.CURR_GROUP_ID);
String scopeGroupId = request.getHeader(Constants.CURR_GROUP_ID);
if (scopeGroupId == null || scopeGroupId.isEmpty()) {
scopeGroupId = request.getParameter(Constants.CURR_GROUP_ID);
if (scopeGroupId == null || scopeGroupId.isEmpty()) {
logger.error("CURR_GROUP_ID is null, it is a mandatory parameter in custom servlet: "
+ scopeGroupId);
@ -74,6 +76,7 @@ public class TabularDataRowsXServlet extends HttpServlet {
"CURR_GROUP_ID is null, it is a mandatory parameter in custom servlet: "
+ scopeGroupId);
}
}
try {
serviceCredentials = SessionUtil.getServiceCredentials(request,

View File

@ -10,8 +10,8 @@ package org.gcube.portlets.user.td.gwtservice.shared;
*
*/
public class Constants {
public static final boolean DEBUG_MODE = true;
public static final boolean TEST_ENABLE = true;
public static final boolean DEBUG_MODE = false;
public static final boolean TEST_ENABLE = false;
public static final String CURR_GROUP_ID = "CURR_GROUP_ID";
//public static final String CURR_USER_ID = "CURR_USER_ID";