Fixed: list of users

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace-tree-widget@82372 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2013-10-03 12:45:25 +00:00
parent dbf751f6d4
commit a029e402a5
3 changed files with 24 additions and 56 deletions

View File

@ -1142,9 +1142,9 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt
FileModel fileModel = event.getFileTarget(); FileModel fileModel = event.getFileTarget();
if(explorerPanel.getAsycTreePanel().deleteItem(fileModel.getIdentifier())){ if(explorerPanel.getAsycTreePanel().deleteItem(fileModel.getIdentifier())){
explorerPanel.getAsycTreePanel().selectItem(fileModel.getParentFileModel().getIdentifier()); //Select parent of item deleted explorerPanel.getAsycTreePanel().selectItem(fileModel.getParentFileModel().getIdentifier()); //Select parent of item deleted
notifySubscriber(event);
} }
notifySubscriber(event);
} }
}; };

View File

@ -1137,7 +1137,7 @@ public class GWTWorkspaceBuilder {
if(searchFolderItem.getFolderItemType()==null){ if(searchFolderItem.getFolderItemType()==null){
logger.trace("Search folder item type is null for "+searchFolderItem.getId() + " name: "+searchFolderItem.getName()); logger.trace("Search folder item type is null for "+searchFolderItem.getId() + " name: "+searchFolderItem.getName());
//FOR DEBUG //FOR DEBUG
System.out.println("Search folder item type is null for "+searchFolderItem.getId() + " name: "+searchFolderItem.getName()); // System.out.println("Search folder item type is null for "+searchFolderItem.getId() + " name: "+searchFolderItem.getName());
return fileModel; return fileModel;
} }
@ -1577,7 +1577,7 @@ public class GWTWorkspaceBuilder {
if(listUsers==null) if(listUsers==null)
return listContactsModel; return listContactsModel;
logger.trace("List<UserModel> size returned from Portal is: "+ listUsers.size()); logger.trace("List<UserModel> size returned from Portal VO is: "+ listUsers.size());
logger.trace("Building list contact model list user model"); logger.trace("Building list contact model list user model");
for (UserModel userModel : listUsers) { for (UserModel userModel : listUsers) {

View File

@ -62,8 +62,11 @@ import org.gcube.portlets.user.workspace.shared.SessionExpiredException;
import org.gcube.portlets.user.workspace.shared.accounting.GxtAccountingEntryType; import org.gcube.portlets.user.workspace.shared.accounting.GxtAccountingEntryType;
import org.gcube.portlets.user.workspace.shared.accounting.GxtAccountingField; import org.gcube.portlets.user.workspace.shared.accounting.GxtAccountingField;
import org.gcube.portlets.user.workspaceapplicationhandler.ApplicationReaderFromGenericResource; import org.gcube.portlets.user.workspaceapplicationhandler.ApplicationReaderFromGenericResource;
import org.gcube.vomanagement.usermanagement.GroupManager;
import org.gcube.vomanagement.usermanagement.UserManager; import org.gcube.vomanagement.usermanagement.UserManager;
import org.gcube.vomanagement.usermanagement.impl.liferay.LiferayGroupManager;
import org.gcube.vomanagement.usermanagement.impl.liferay.LiferayUserManager; import org.gcube.vomanagement.usermanagement.impl.liferay.LiferayUserManager;
import org.gcube.vomanagement.usermanagement.model.UserModel;
import com.google.gwt.user.server.rpc.RemoteServiceServlet; import com.google.gwt.user.server.rpc.RemoteServiceServlet;
@ -1260,8 +1263,10 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
} }
UserManager userManag = new LiferayUserManager(); UserManager userManag = new LiferayUserManager();
workspaceLogger.trace("user manager getting list users..."); GroupManager gm = new LiferayGroupManager();
return builder.buildGXTListContactsModel(userManag.listUsers()); String groupId = gm.getRootVO().getGroupId();
workspaceLogger.trace("user manager getting list users by group: "+groupId);
return builder.buildGXTListContactsModel(userManag.listUsersByGroup(groupId));
} catch (Exception e) { } catch (Exception e) {
workspaceLogger.error("Error in server get all contacts ", e); workspaceLogger.error("Error in server get all contacts ", e);
@ -2339,64 +2344,27 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
String userUsername = WsUtil.getAslSession(this.getThreadLocalRequest().getSession()).getUsername(); String userUsername = WsUtil.getAslSession(this.getThreadLocalRequest().getSession()).getUsername();
boolean isTestUser = userUsername.compareTo(WsUtil.TEST_USER)==0; boolean isTestUser = userUsername.compareTo(WsUtil.TEST_USER)==0;
workspaceLogger.trace("is valid user: "+isTestUser + " is test mode: "+isTestMode()); // //TODO COMMENT THIS FOR RELEASE
// workspaceLogger.trace("is "+WsUtil.TEST_USER+" user: "+isTestUser + " is test mode: "+isTestMode());
//
// if(isTestUser && !isTestMode()){
// workspaceLogger.error("workspace session is expired! username is: "+WsUtil.TEST_USER);
// return true; //is TEST_USER, session is expired
// }
if(isTestUser && !isTestMode()){
//TODO UNCOMMENT THIS FOR RELEASE
workspaceLogger.trace("is "+WsUtil.TEST_USER+" user: "+isTestUser);
if(isTestUser){
workspaceLogger.error("workspace session is expired! username is: "+WsUtil.TEST_USER); workspaceLogger.error("workspace session is expired! username is: "+WsUtil.TEST_USER);
return true; //is TEST_USER, session is expired return true; //is TEST_USER, session is expired
} }
workspaceLogger.trace("workspace session is valid! current username is: "+userUsername); workspaceLogger.trace("workspace session is valid! current username is: "+userUsername);
return false; return false;
} }
// @Override
// public List<FileModel> getFullPathByItemIdentifier(String itemIdentifier) throws Exception {
// List<FileModel> listParents = new ArrayList<FileModel>();
// workspaceLogger.trace("get Full Path Parents By Item Identifier "+ itemIdentifier);
// try {
// Workspace workspace = getWorkspace();
//
// WorkspaceItem wsItem = workspace.getItem(itemIdentifier);
//
// workspaceLogger.trace("workspace retrieve item name: "+wsItem.getName());
//
// GWTWorkspaceBuilder builder = getGWTWorkspaceBuilder();
//
// if(wsItem.getType().equals(WorkspaceItemType.FOLDER)){
// listParents.add(builder.buildGXTFolderModelItem((WorkspaceFolder) wsItem, null));
// }
//
//
// while(wsItem!=null && wsItem.getParent()!=null){
//
// WorkspaceFolder wsFolder = wsItem.getParent();
//
// listParents.add(builder.buildGXTFolderModelItem(wsFolder, null));
// wsItem = wsFolder;
// }
//
// Collections.reverse(listParents);
//
// //SET PARENTS
// for(int i=0; i<listParents.size()-1; i++){
//
// FileModel parent = listParents.get(i);
// FileModel fileModel = listParents.get(i+1);
//
// fileModel.setParentFileModel(parent);
// }
//
// workspaceLogger.trace("list parents return size: "+listParents.size());
//
// } catch (Exception e) {
// workspaceLogger.error("Error in get List Parents By Item Identifier ", e);
// e.printStackTrace();
// throw new Exception(e.getMessage());
// }
//
// return listParents;
// }
} }