diff --git a/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/server/SessionUtil.java b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/server/SessionUtil.java index 2e509ce..527d0ba 100644 --- a/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/server/SessionUtil.java +++ b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/server/SessionUtil.java @@ -3,17 +3,13 @@ */ package org.gcube.portlets.user.statisticalalgorithmsimporter.server; -import static org.gcube.common.authorization.client.Constants.authorizationService; - import java.util.ArrayList; -import java.util.List; import javax.servlet.ServletContext; import javax.servlet.http.HttpSession; import org.gcube.application.framework.core.session.ASLSession; import org.gcube.application.framework.core.session.SessionManager; -import org.gcube.common.authorization.library.provider.UserInfo; import org.gcube.portal.custom.scopemanager.scopehelper.ScopeHelper; import org.gcube.portlets.user.statisticalalgorithmsimporter.server.file.CodeFileUploadSession; import org.gcube.portlets.user.statisticalalgorithmsimporter.server.social.Recipient; @@ -74,24 +70,7 @@ public class SessionUtil { throws StatAlgoImporterServiceException { String token = null; if (Constants.DEBUG_MODE) { - List userRoles = new ArrayList<>(); - userRoles.add(Constants.DEFAULT_ROLE); - /* - * if (aslSession.getUsername().compareTo("lucio.lelii") == 0) - * userRoles.add("VRE-Manager"); - */ - try { - token = authorizationService().generateUserToken( - new UserInfo(aslSession.getUsername(), userRoles), - aslSession.getScope()); - } catch (Exception e) { - logger.error("Error generating the token for test: " - + e.getLocalizedMessage()); - e.printStackTrace(); - throw new StatAlgoImporterServiceException("Error generating the token for test: " - + e.getLocalizedMessage()); - } - + token = Constants.DEFAULT_TOKEN; } else { token = aslSession.getSecurityToken(); } @@ -100,6 +79,9 @@ public class SessionUtil { } + + + // public static ArrayList getRecipients( ServletContext servletContest) { diff --git a/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/shared/Constants.java b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/shared/Constants.java index 51799e8..3e3b707 100644 --- a/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/shared/Constants.java +++ b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/shared/Constants.java @@ -2,8 +2,8 @@ package org.gcube.portlets.user.statisticalalgorithmsimporter.shared; /** * - * @author giancarlo - * email: g.panichi@isti.cnr.it + * @author giancarlo email: g.panichi@isti.cnr.it * */ public class Constants { @@ -13,16 +13,16 @@ public class Constants { public static final String APPLICATION_ID = "org.gcube.portlets.user.statisticalalgorithmsimporter.server.portlet.StatAlgoImporterPortlet"; public static final String STATISTICAL_ALGORITHMS_IMPORTER_ID = "SAIId"; - public static final String STATISTICAL_ALGORITHMS_IMPORTER_COOKIE = "SAILangCookie"; + public static final String STATISTICAL_ALGORITHMS_IMPORTER_COOKIE = "SAILangCookie"; public static final String STATISTICAL_ALGORITHMS_IMPORTER_LANG = "SAILang"; - public final static String DEFAULT_USER = "giancarlo.panichi"; - public final static String DEFAULT_SCOPE = "/gcube/devsec/devVRE"; + + public static final String DEFAULT_USER = "giancarlo.panichi"; + public final static String DEFAULT_SCOPE = "/gcube/devNext"; + public final static String DEFAULT_TOKEN = "16e65d4f-11e0-4e4a-84b9-351688fccc12-98187548"; public static final String DEFAULT_ROLE = "OrganizationMember"; - - + public static final String FILE_UPLOADED_FIELD = "FileUploadedField"; public static final String STATISTICAL_ALGORITHMS_IMPORTER_JAR_PUBLIC_LINK = "JarPublicLink"; public static final String RECIPIENTS = "Recipients"; - - + }