3892: Workspace Enhancement: use a cache to the list of users during Workspace init

Task-Url: https://support.d4science.org/issues/3892

Updated GWTWorkspaceBuilder init

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace-tree-widget@128472 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2016-05-05 11:00:04 +00:00
parent 4fa170fa62
commit ca0f8a1754
2 changed files with 84 additions and 73 deletions

View File

@ -1504,7 +1504,8 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
workspaceLogger.trace("Home Library User Manager getting list Gcube Group"); workspaceLogger.trace("Home Library User Manager getting list Gcube Group");
listContactsModel.addAll(builder.buildGXTListContactsModelFromGcubeGroup(hlUserManager.getGroups())); listContactsModel.addAll(builder.buildGXTListContactsModelFromGcubeGroup(hlUserManager.getGroups()));
workspaceLogger.debug("Returning list of contacts!"); workspaceLogger.debug("Returning list of contacts");
return listContactsModel; return listContactsModel;
} catch (Exception e) { } catch (Exception e) {

View File

@ -204,6 +204,7 @@ public class WsUtil {
} }
*/ */
/*
if (session.getAttribute(WORKSPACEBUILDER_ATTRIBUTE) == null) if (session.getAttribute(WORKSPACEBUILDER_ATTRIBUTE) == null)
{ {
logger.trace("Initializing the workspace area builder"); logger.trace("Initializing the workspace area builder");
@ -214,7 +215,7 @@ public class WsUtil {
builder.setUserLogged(new InfoContactModel(session.getUsername(), session.getUsername(), session.getUserFullName(), false)); builder.setUserLogged(new InfoContactModel(session.getUsername(), session.getUsername(), session.getUserFullName(), false));
session.setAttribute(WORKSPACEBUILDER_ATTRIBUTE, builder); session.setAttribute(WORKSPACEBUILDER_ATTRIBUTE, builder);
} }*/
return workspace; return workspace;
@ -248,7 +249,16 @@ public class WsUtil {
public static GWTWorkspaceBuilder getGWTWorkspaceBuilder(HttpSession httpSession) public static GWTWorkspaceBuilder getGWTWorkspaceBuilder(HttpSession httpSession)
{ {
ASLSession session = getAslSession(httpSession); ASLSession session = getAslSession(httpSession);
return (GWTWorkspaceBuilder) session.getAttribute(WsUtil.WORKSPACEBUILDER_ATTRIBUTE); GWTWorkspaceBuilder builder = (GWTWorkspaceBuilder) session.getAttribute(WORKSPACEBUILDER_ATTRIBUTE);
if (builder == null){
logger.info("Initializing the workspace area builder");
builder = new GWTWorkspaceBuilder();
//ADDED 03/09/2013
builder.setUserLogged(new InfoContactModel(session.getUsername(), session.getUsername(), session.getUserFullName(), false));
session.setAttribute(WORKSPACEBUILDER_ATTRIBUTE, builder);
}
return builder;
} }
public static NotificationsManager getNotificationManager(ASLSession session) public static NotificationsManager getNotificationManager(ASLSession session)