package gr.ebs.gss.client;
import gr.ebs.gss.client.clipboard.Clipboard;
+import gr.ebs.gss.client.commands.GetUserCommand;
import gr.ebs.gss.client.dnd.DnDFocusPanel;
import gr.ebs.gss.client.dnd.DnDSimpleFocusPanel;
import gr.ebs.gss.client.rest.GetCommand;
import gr.ebs.gss.client.rest.resource.UserResource;
import java.util.Arrays;
+import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
private PickupDragController dragController;
+ public HashMap<String, String> userFullNameMap = new HashMap<String, String>();
+
@Override
public void onModuleLoad() {
// Initialize the singleton before calling the constructors of the
PopupTree popupTree = GSS.get().getFolders().getPopupTree();
TreeItem treeObj = GSS.get().getFolders().getPopupTree().getTreeItem(historyToken);
SelectionEvent.fire(popupTree, treeObj);
- }
- } catch (IndexOutOfBoundsException e) {
- inner.selectTab(0);
- }
}
- });
+ } catch (IndexOutOfBoundsException e) {
+ inner.selectTab(0);
+ }
+ }
+ });
// Add the left and right panels to the split panel.
splitPanel.setLeftWidget(folders);
}
/**
- * Reject illegal resource names, like '.' or '..'.
+ * Reject illegal resource names, like '.' or '..' or slashes '/'.
*/
static boolean isValidResourceName(String name) {
- if (".".equals(name) || "..".equals(name))
+ if (".".equals(name) || "..".equals(name) || name.contains("/"))
return false;
return true;
}
+ public void putUserToMap(String _userName, String _userFullName){
+ userFullNameMap.put(_userName, _userFullName);
+ }
+
+ public String findUserFullName(String _userName){
+ return userFullNameMap.get(_userName);
+ }
+ public String getUserFullName(String _userName) {
+ if (GSS.get().findUserFullName(_userName) == null)
+ //if there is no userFullName found then the map fills with the given _userName,
+ //so userFullName = _userName
+ GSS.get().putUserToMap(_userName, _userName);
+ else if(GSS.get().findUserFullName(_userName).indexOf('@') != -1){
+ //if the userFullName = _userName the GetUserCommand updates the userFullName in the map
+ GetUserCommand guc = new GetUserCommand(_userName);
+ guc.execute();
+ }
+ return GSS.get().findUserFullName(_userName);
+ }
}