Revision 4d869bf1 src/gr/grnet/pithos/web/client/FilePermissionsDialog.java
b/src/gr/grnet/pithos/web/client/FilePermissionsDialog.java | ||
---|---|---|
49 | 49 |
import com.google.gwt.event.dom.client.KeyCodes; |
50 | 50 |
import com.google.gwt.http.client.Response; |
51 | 51 |
import com.google.gwt.http.client.URL; |
52 |
import com.google.gwt.http.client.UrlBuilder; |
|
53 |
import com.google.gwt.i18n.client.Dictionary; |
|
52 | 54 |
import com.google.gwt.resources.client.ImageResource; |
53 | 55 |
import com.google.gwt.user.client.Command; |
54 | 56 |
import com.google.gwt.user.client.Window; |
... | ... | |
77 | 79 |
|
78 | 80 |
private TextBox path; |
79 | 81 |
|
82 |
private Dictionary otherProperties = Dictionary.getDictionary("otherProperties"); |
|
83 |
|
|
80 | 84 |
/** |
81 | 85 |
* An image bundle for this widgets images. |
82 | 86 |
*/ |
... | ... | |
148 | 152 |
private VerticalPanel createSharingPanel() { |
149 | 153 |
VerticalPanel permPanel = new VerticalPanel(); |
150 | 154 |
|
151 |
permList = new PermissionsList(images, file.getPermissions(), file.getOwner(), false); |
|
155 |
permList = new PermissionsList(images, file.getPermissions(), file.getOwner(), false, new Command() { |
|
156 |
|
|
157 |
@Override |
|
158 |
public void execute() { |
|
159 |
accept(); |
|
160 |
} |
|
161 |
}); |
|
152 | 162 |
permPanel.add(permList); |
153 | 163 |
|
154 | 164 |
HorizontalPanel permButtons = new HorizontalPanel(); |
... | ... | |
241 | 251 |
} |
242 | 252 |
|
243 | 253 |
void showLinkIfPublished() { |
244 |
if (file.isPublished()) { |
|
245 |
path.setText(Window.Location.getHost() + file.getPublicUri()); |
|
254 |
if (file.isShared()) { |
|
255 |
UrlBuilder b = Window.Location.createUrlBuilder(); |
|
256 |
if (file.isPublished()) { |
|
257 |
b.setPath(file.getPublicUri()); |
|
258 |
path.setText(b.buildString()); |
|
259 |
} |
|
260 |
else { |
|
261 |
b.setPath(app.getApiPath() + file.getOwner() + file.getUri()); |
|
262 |
path.setText(GWT.getModuleBaseURL() + "?goto=" + b.buildString()); |
|
263 |
} |
|
246 | 264 |
pathPanel.setVisible(true); |
247 | 265 |
} |
248 | 266 |
else { |
... | ... | |
255 | 273 |
*/ |
256 | 274 |
@Override |
257 | 275 |
protected void accept() { |
258 |
final Map<String, Boolean[]> perms = (permList.hasChanges() ? permList.getPermissions() : null); |
|
259 |
|
|
260 | 276 |
Boolean published = null; |
261 | 277 |
if (readForAll.getValue() != file.isPublished()) |
262 | 278 |
if (file.getOwner().equals(app.getUsername())) |
263 | 279 |
published = readForAll.getValue(); |
264 |
updateMetaData(app.getApiPath(), app.getUsername(), file.getUri() + "?update=", published, perms);
|
|
280 |
updateMetaData(app.getApiPath(), app.getUsername(), file.getUri() + "?update=", published, permList.getPermissions());
|
|
265 | 281 |
} |
266 | 282 |
|
267 | 283 |
protected void updateMetaData(String api, String owner, final String path, final Boolean published, final Map<String, Boolean[]> newPermissions) { |
Also available in: Unified diff