removed client context dpenendncy

git-svn-id: https://svn.research-infrastructures.eu/d4science/gcube/trunk/portal/portal-manager@133916 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Massimiliano Assante 2016-11-04 17:42:16 +00:00
parent 05383891ae
commit 306b1f8dcd
3 changed files with 8 additions and 10 deletions

View File

@ -41,11 +41,6 @@
</dependencies> </dependencies>
</dependencyManagement> </dependencyManagement>
<dependencies> <dependencies>
<dependency>
<groupId>org.gcube.portal</groupId>
<artifactId>client-context-library</artifactId>
<version>[1.0.0-SNAPSHOT,)</version>
</dependency>
<dependency> <dependency>
<groupId>org.gcube.dvos</groupId> <groupId>org.gcube.dvos</groupId>
<artifactId>usermanagement-core</artifactId> <artifactId>usermanagement-core</artifactId>

View File

@ -18,4 +18,7 @@ public class GCubePortalConstants {
public static final String SENDER_EMAIL = "notificationSenderEmail"; public static final String SENDER_EMAIL = "notificationSenderEmail";
public static final String GATEWAY_NAME = "portalinstancename"; public static final String GATEWAY_NAME = "portalinstancename";
public static final String ADMIN_USERNAME = "administratorUsername"; public static final String ADMIN_USERNAME = "administratorUsername";
public static final String VRE_ID_ATTR_NAME = "gcube-vreid";
public static final String USER_ID_ATTR_NAME = "gcube-userId";
} }

View File

@ -13,7 +13,6 @@ import javax.servlet.http.HttpServletRequest;
import org.gcube.common.authorization.library.provider.UserInfo; import org.gcube.common.authorization.library.provider.UserInfo;
import org.gcube.common.scope.api.ScopeProvider; import org.gcube.common.scope.api.ScopeProvider;
import org.gcube.portal.clientcontext.client.GCubeClientContext;
import org.gcube.vomanagement.usermanagement.impl.LiferayGroupManager; import org.gcube.vomanagement.usermanagement.impl.LiferayGroupManager;
import org.gcube.vomanagement.usermanagement.impl.LiferayUserManager; import org.gcube.vomanagement.usermanagement.impl.LiferayUserManager;
import org.gcube.vomanagement.usermanagement.model.CustomAttributeKeys; import org.gcube.vomanagement.usermanagement.model.CustomAttributeKeys;
@ -42,7 +41,8 @@ import com.liferay.portal.util.PortalUtil;
*/ */
public class PortalContext { public class PortalContext {
private static final Logger _log = LoggerFactory.getLogger(PortalContext.class); private static final Logger _log = LoggerFactory.getLogger(PortalContext.class);
public static final String VRE_ID_ATTR_NAME = "gcube-vreid";
public static final String USER_ID_ATTR_NAME = "gcube-userId";
/** /**
* Scope separators used in linear syntax. * Scope separators used in linear syntax.
*/ */
@ -130,7 +130,7 @@ public class PortalContext {
* @see GCubeUser * @see GCubeUser
*/ */
public GCubeUser getCurrentUser(HttpServletRequest httpServletRequest) { public GCubeUser getCurrentUser(HttpServletRequest httpServletRequest) {
String userIdNo = httpServletRequest.getHeader(GCubeClientContext.USER_ID_ATTR_NAME); String userIdNo = httpServletRequest.getHeader(USER_ID_ATTR_NAME);
if (userIdNo != null) { if (userIdNo != null) {
long userId = -1; long userId = -1;
try { try {
@ -161,7 +161,7 @@ public class PortalContext {
* @see GCubeUser * @see GCubeUser
*/ */
public String getCurrentScope(HttpServletRequest httpServletRequest) { public String getCurrentScope(HttpServletRequest httpServletRequest) {
String groupIdNo = httpServletRequest.getHeader(GCubeClientContext.VRE_ID_ATTR_NAME); String groupIdNo = httpServletRequest.getHeader(VRE_ID_ATTR_NAME);
if (groupIdNo != null) { if (groupIdNo != null) {
long groupId = -1; long groupId = -1;
try { try {
@ -197,7 +197,7 @@ public class PortalContext {
* @see GCubeUser * @see GCubeUser
*/ */
public String getCurrentUserToken(HttpServletRequest httpServletRequest) { public String getCurrentUserToken(HttpServletRequest httpServletRequest) {
String groupIdNo = httpServletRequest.getHeader(GCubeClientContext.VRE_ID_ATTR_NAME); String groupIdNo = httpServletRequest.getHeader(VRE_ID_ATTR_NAME);
if (groupIdNo != null) { if (groupIdNo != null) {
String scope = getCurrentScope(httpServletRequest); String scope = getCurrentScope(httpServletRequest);
String username = getCurrentUser(httpServletRequest).getUsername(); String username = getCurrentUser(httpServletRequest).getUsername();