Revision 9ab5db6d

b/src/gr/ebs/gss/client/AbstractPropertiesDialog.java
1 1
/*
2
 * Copyright 2007, 2008, 2009 Electronic Business Systems Ltd.
2
 * Copyright 2007, 2008, 2009, 2010 Electronic Business Systems Ltd.
3 3
 *
4 4
 * This file is part of GSS.
5 5
 *
......
87 87
				TagsResource tagr = getResult();
88 88
				List<String> userTags = tagr.getTags();
89 89
				Anchor tag = null;
90
				Label label = null;
91 90
				for(String usrTag : userTags){
92 91
					tag = new Anchor(usrTag.toString(), false);
93 92
					tag.addStyleName("gss-tag");
......
111 110
						}
112 111
					});
113 112
				}
114

  
115
				allTagsContent.add(label);
116 113
			}
117 114

  
118 115
			@Override
b/src/gr/ebs/gss/client/FileList.java
53 53
import com.google.gwt.user.client.ui.Composite;
54 54
import com.google.gwt.user.client.ui.Grid;
55 55
import com.google.gwt.user.client.ui.HTML;
56
import com.google.gwt.user.client.ui.HTMLTable.Cell;
57 56
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
58 57
import com.google.gwt.user.client.ui.HorizontalPanel;
59 58
import com.google.gwt.user.client.ui.TreeItem;
60 59
import com.google.gwt.user.client.ui.Widget;
60
import com.google.gwt.user.client.ui.HTMLTable.Cell;
61 61

  
62 62
/**
63 63
 * A composite that displays the list of files in a particular folder.
b/src/gr/ebs/gss/client/FilePropertiesDialog.java
1 1
/*
2
 * Copyright 2007, 2008, 2009 Electronic Business Systems Ltd.
2
 * Copyright 2007, 2008, 2009, 2010 Electronic Business Systems Ltd.
3 3
 *
4 4
 * This file is part of GSS.
5 5
 *
......
96 96

  
97 97
	final FileResource file;
98 98

  
99
	private String userFullName;
100

  
99 101
	/**
100 102
	 * The widget's constructor.
101 103
	 *
......
103 105
	 * @param groups
104 106
	 * @param bodies
105 107
	 */
106
	public FilePropertiesDialog(final Images images, final List<GroupResource> groups, List<FileResource> bodies) {
108
	public FilePropertiesDialog(final Images images, final List<GroupResource> groups, List<FileResource> bodies, String _userFullName) {
107 109

  
108 110
		// Set the dialog's caption.
109 111
		setText("File properties");
110 112

  
111 113
		file = (FileResource) GSS.get().getCurrentSelection();
112 114
		permList = new PermissionsList(images, file.getPermissions(), file.getOwner());
115
		userFullName = _userFullName;
113 116

  
114 117
		// Outer contains inner and buttons.
115 118
		final VerticalPanel outer = new VerticalPanel();
......
146 149
			generalTable.setText(1, 1, file.getFolderName());
147 150
		else
148 151
			generalTable.setText(1, 1, "-");
149
		generalTable.setText(2, 1, file.getOwner());
152
		generalTable.setText(2, 1,userFullName);
153

  
150 154
		final DateTimeFormat formatter = DateTimeFormat.getFormat("d/M/yyyy h:mm a");
151 155
		generalTable.setText(3, 1, formatter.format(file.getModificationDate()));
152 156
		// Get the tags.
......
493 497
		};
494 498
		DeferredCommand.addCommand(cf);
495 499
	}
496

  
500
	private boolean hasOwner(String _userName) {
501
		if (GSS.get().findUserFullName(_userName) == null)
502
			return false;
503
		return true;
504
	}
497 505

  
498 506
}
b/src/gr/ebs/gss/client/GSS.java
29 29
import gr.ebs.gss.client.rest.resource.UserResource;
30 30

  
31 31
import java.util.Arrays;
32
import java.util.HashMap;
32 33
import java.util.Iterator;
33 34
import java.util.List;
34 35

  
......
203 204

  
204 205
	private PickupDragController dragController;
205 206

  
207
	public HashMap<String, String> userFullNameMap = new HashMap<String, String>();
208

  
206 209
	@Override
207 210
	public void onModuleLoad() {
208 211
		// Initialize the singleton before calling the constructors of the
......
820 823
		return true;
821 824
	}
822 825

  
826
	public void putUserToMap(String _userName, String _userFullName){
827
		userFullNameMap.put(_userName, _userFullName);
828
	}
829

  
830
	public String findUserFullName(String _userName){
831
		return userFullNameMap.get(_userName);
832
	}
833

  
823 834

  
824 835
}
b/src/gr/ebs/gss/client/commands/PropertiesCommand.java
19 19
package gr.ebs.gss.client.commands;
20 20

  
21 21
import gr.ebs.gss.client.FileMenu;
22
import gr.ebs.gss.client.FileMenu.Images;
23 22
import gr.ebs.gss.client.FilePropertiesDialog;
24 23
import gr.ebs.gss.client.FilesPropertiesDialog;
25 24
import gr.ebs.gss.client.FolderPropertiesDialog;
26 25
import gr.ebs.gss.client.GSS;
26
import gr.ebs.gss.client.FileMenu.Images;
27 27
import gr.ebs.gss.client.rest.GetCommand;
28 28
import gr.ebs.gss.client.rest.HeadCommand;
29 29
import gr.ebs.gss.client.rest.MultipleGetCommand;
30
import gr.ebs.gss.client.rest.MultipleGetCommand.Cached;
31 30
import gr.ebs.gss.client.rest.MultipleHeadCommand;
32 31
import gr.ebs.gss.client.rest.RestException;
32
import gr.ebs.gss.client.rest.MultipleGetCommand.Cached;
33 33
import gr.ebs.gss.client.rest.resource.FileResource;
34 34
import gr.ebs.gss.client.rest.resource.FolderResource;
35 35
import gr.ebs.gss.client.rest.resource.GroupResource;
......
62 62

  
63 63
	private int tabToShow = 0;
64 64

  
65
	private String userName;
66

  
65 67
	/**
66 68
	 * @param _containerPanel
67 69
	 * @param _newImages the images of all the possible delete dialogs
......
156 158
	private void initialize(){
157 159
		getGroups();
158 160
		getVersions();
161
		getOwnerFullName();
159 162
		DeferredCommand.addCommand(new IncrementalCommand() {
160 163

  
161 164
			@Override
162 165
			public boolean execute() {
163 166
				boolean res = canContinue();
164 167
				if (res) {
165
					displayProperties(newImages);
168
					displayProperties(newImages, GSS.get().findUserFullName(userName));
166 169
					return false;
167 170
				}
168 171
				return true;
169

  
170 172
			}
171 173

  
172 174
		});
175

  
173 176
	}
174 177

  
175 178
	private boolean canContinue() {
176
		if (groups == null || versions == null)
179
		String userFullNameFromMap = GSS.get().findUserFullName(userName);
180
		if (groups == null || versions == null || userFullNameFromMap == null)
177 181
			return false;
178 182
		return true;
179 183
	}
......
184 188
	 *
185 189
	 * @param propImages the images of all the possible properties dialogs
186 190
	 */
187
	void displayProperties(final Images propImages) {
191
	void displayProperties(final Images propImages, final String _userName) {
188 192
		if (GSS.get().getCurrentSelection() instanceof FolderResource) {
189 193
			FolderPropertiesDialog dlg = new FolderPropertiesDialog(propImages, false, groups);
190 194
			dlg.selectTab(tabToShow);
191 195
			dlg.center();
192 196
		} else if (GSS.get().getCurrentSelection() instanceof FileResource) {
193
			FilePropertiesDialog dlg = new FilePropertiesDialog(propImages, groups, versions);
197
			FilePropertiesDialog dlg = new FilePropertiesDialog(propImages, groups, versions, _userName);
194 198
			dlg.selectTab(tabToShow);
195 199
			dlg.center();
196 200
		}
......
268 272
		} else
269 273
			versions = new ArrayList<FileResource>();
270 274
	}
275

  
276
	private void getOwnerFullName() {
277
		FileResource fileResource = (FileResource) GSS.get().getCurrentSelection();
278
		userName = fileResource.getOwner();
279
		GetUserCommand getUserCmd = new GetUserCommand(userName);
280
		getUserCmd.execute();
281

  
282
	}
283

  
271 284
}
b/src/gr/ebs/gss/client/tree/OthersSharesSubtree.java
19 19

  
20 20
package gr.ebs.gss.client.tree;
21 21

  
22
import gr.ebs.gss.client.Folders.Images;
23 22
import gr.ebs.gss.client.GSS;
24 23
import gr.ebs.gss.client.PopupTree;
24
import gr.ebs.gss.client.Folders.Images;
25 25
import gr.ebs.gss.client.dnd.DnDTreeItem;
26 26
import gr.ebs.gss.client.rest.GetCommand;
27 27
import gr.ebs.gss.client.rest.MultipleGetCommand;

Also available in: Unified diff