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:
Francesco Mangiacrapa 2013-09-02 10:43:57 +00:00
parent 9f7c3095f6
commit e617ba61ac
4 changed files with 27 additions and 1 deletions

View File

@ -169,4 +169,6 @@ public interface GWTWorkspaceService extends RemoteService{
String getPublicLinkForFolderItemId(String itemId, boolean shortenUrl)
throws Exception;
boolean isSessionExpired() throws Exception;
}

View File

@ -157,5 +157,10 @@ public interface GWTWorkspaceServiceAsync {
void getPublicLinkForFolderItemId(String itemId, boolean shortenUrl,
AsyncCallback<String> callback);
/**
*
*/
void isSessionExpired(AsyncCallback<Boolean> callback);
}

View File

@ -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;
}
}

View File

@ -72,7 +72,8 @@ public class WsUtil {
if (user == null) {
user=TEST_USER;
// user = "francesco.mangiacrapa";
defaultLogger.warn("WORKSPACE PORTLET STARTING IN TEST MODE - NO USER FOUND - PORTLETS STARTING WITH FOLLOWING SETTINGS:");
defaultLogger.warn("session id: "+sessionID);
defaultLogger.warn("TEST_USER: "+user);
@ -80,6 +81,7 @@ public class WsUtil {
defaultLogger.warn("USERNAME_ATTRIBUTE: "+USERNAME_ATTRIBUTE);
session = SessionManager.getInstance().getASLSession(sessionID, user);
session.setScope(TEST_SCOPE);
//MANDATORY FOR SOCIAL LIBRARY
session.setUserAvatarId(user + "Avatar");