Bug fixed: Session expired.
git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace-tree-widget@80972 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
9f7c3095f6
commit
e617ba61ac
|
@ -169,4 +169,6 @@ public interface GWTWorkspaceService extends RemoteService{
|
||||||
String getPublicLinkForFolderItemId(String itemId, boolean shortenUrl)
|
String getPublicLinkForFolderItemId(String itemId, boolean shortenUrl)
|
||||||
throws Exception;
|
throws Exception;
|
||||||
|
|
||||||
|
boolean isSessionExpired() throws Exception;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -157,5 +157,10 @@ public interface GWTWorkspaceServiceAsync {
|
||||||
void getPublicLinkForFolderItemId(String itemId, boolean shortenUrl,
|
void getPublicLinkForFolderItemId(String itemId, boolean shortenUrl,
|
||||||
AsyncCallback<String> callback);
|
AsyncCallback<String> callback);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
void isSessionExpired(AsyncCallback<Boolean> callback);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2289,4 +2289,21 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.gcube.portlets.user.workspace.client.rpc.GWTWorkspaceService#isSessionExpired()
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean isSessionExpired() throws Exception {
|
||||||
|
|
||||||
|
//READING USERNAME FROM ASL SESSION
|
||||||
|
String userUsername = WsUtil.getAslSession(this.getThreadLocalRequest().getSession()).getUsername();
|
||||||
|
|
||||||
|
if(userUsername.compareTo(WsUtil.TEST_USER)==0){
|
||||||
|
return true; //is TEST_USER, session is expired
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,7 +72,8 @@ public class WsUtil {
|
||||||
if (user == null) {
|
if (user == null) {
|
||||||
|
|
||||||
user=TEST_USER;
|
user=TEST_USER;
|
||||||
|
// user = "francesco.mangiacrapa";
|
||||||
|
|
||||||
defaultLogger.warn("WORKSPACE PORTLET STARTING IN TEST MODE - NO USER FOUND - PORTLETS STARTING WITH FOLLOWING SETTINGS:");
|
defaultLogger.warn("WORKSPACE PORTLET STARTING IN TEST MODE - NO USER FOUND - PORTLETS STARTING WITH FOLLOWING SETTINGS:");
|
||||||
defaultLogger.warn("session id: "+sessionID);
|
defaultLogger.warn("session id: "+sessionID);
|
||||||
defaultLogger.warn("TEST_USER: "+user);
|
defaultLogger.warn("TEST_USER: "+user);
|
||||||
|
@ -80,6 +81,7 @@ public class WsUtil {
|
||||||
defaultLogger.warn("USERNAME_ATTRIBUTE: "+USERNAME_ATTRIBUTE);
|
defaultLogger.warn("USERNAME_ATTRIBUTE: "+USERNAME_ATTRIBUTE);
|
||||||
session = SessionManager.getInstance().getASLSession(sessionID, user);
|
session = SessionManager.getInstance().getASLSession(sessionID, user);
|
||||||
session.setScope(TEST_SCOPE);
|
session.setScope(TEST_SCOPE);
|
||||||
|
|
||||||
|
|
||||||
//MANDATORY FOR SOCIAL LIBRARY
|
//MANDATORY FOR SOCIAL LIBRARY
|
||||||
session.setUserAvatarId(user + "Avatar");
|
session.setUserAvatarId(user + "Avatar");
|
||||||
|
|
Loading…
Reference in New Issue