Revision f55cf326 web_client/src/gr/grnet/pithos/web/client/CellTreeView.java
b/web_client/src/gr/grnet/pithos/web/client/CellTreeView.java | ||
---|---|---|
193 | 193 |
public void onSelectionChange(com.google.gwt.view.client.SelectionChangeEvent event) { |
194 | 194 |
NodeInfo<RestResource> nodeInfo = (NodeInfo<RestResource>) getModel().getNodeInfo(selectionModel.getSelectedObject()); |
195 | 195 |
if(nodeInfo==null || nodeInfo.getValueUpdater()==null){ |
196 |
GSS.get().showFileList(getSelection());
|
|
196 |
Pithos.get().showFileList(getSelection());
|
|
197 | 197 |
} |
198 | 198 |
else |
199 | 199 |
nodeInfo.getValueUpdater().update(selectionModel.getSelectedObject()); |
200 |
GSS.get().setCurrentSelection(selectionModel.getSelectedObject());
|
|
200 |
Pithos.get().setCurrentSelection(selectionModel.getSelectedObject());
|
|
201 | 201 |
|
202 | 202 |
|
203 | 203 |
} |
... | ... | |
341 | 341 |
} |
342 | 342 |
private boolean init=false; |
343 | 343 |
public boolean fetchRootFolders() { |
344 |
UserResource userResource = GSS.get().getCurrentUserResource();
|
|
344 |
UserResource userResource = Pithos.get().getCurrentUserResource();
|
|
345 | 345 |
if (userResource == null) |
346 | 346 |
return !DONE; |
347 | 347 |
if(!init){ |
... | ... | |
359 | 359 |
@Override |
360 | 360 |
public void onError(Throwable t) { |
361 | 361 |
GWT.log("Error fetching root folder", t); |
362 |
GSS.get().displayError("Unable to fetch root folder");
|
|
362 |
Pithos.get().displayError("Unable to fetch root folder");
|
|
363 | 363 |
} |
364 | 364 |
|
365 | 365 |
}; |
366 | 366 |
DeferredCommand.addCommand(gf); |
367 |
DeferredCommand.addCommand(new GetCommand<TrashResource>(TrashResource.class, GSS.get().getCurrentUserResource().getTrashPath(), null) {
|
|
367 |
DeferredCommand.addCommand(new GetCommand<TrashResource>(TrashResource.class, Pithos.get().getCurrentUserResource().getTrashPath(), null) {
|
|
368 | 368 |
@Override |
369 | 369 |
public void onComplete() { |
370 | 370 |
trash = getResult(); |
... | ... | |
376 | 376 |
int statusCode = ((RestException)t).getHttpStatusCode(); |
377 | 377 |
// On IE status code 1223 may be returned instead of 204. |
378 | 378 |
if(statusCode == 204 || statusCode == 1223){ |
379 |
trash = new TrashResource(GSS.get().getCurrentUserResource().getTrashPath());
|
|
379 |
trash = new TrashResource(Pithos.get().getCurrentUserResource().getTrashPath());
|
|
380 | 380 |
} |
381 | 381 |
else{ |
382 | 382 |
GWT.log("", t); |
383 |
GSS.get().displayError("Unable to fetch trash folder:"+t.getMessage());
|
|
384 |
trash = new TrashResource(GSS.get().getCurrentUserResource().getTrashPath());
|
|
383 |
Pithos.get().displayError("Unable to fetch trash folder:"+t.getMessage());
|
|
384 |
trash = new TrashResource(Pithos.get().getCurrentUserResource().getTrashPath());
|
|
385 | 385 |
} |
386 | 386 |
} |
387 | 387 |
} |
... | ... | |
396 | 396 |
@Override |
397 | 397 |
public void onError(Throwable t) { |
398 | 398 |
GWT.log("Error fetching Shared Root folder", t); |
399 |
GSS.get().displayError("Unable to fetch Shared Root folder");
|
|
399 |
Pithos.get().displayError("Unable to fetch Shared Root folder");
|
|
400 | 400 |
} |
401 | 401 |
}; |
402 | 402 |
DeferredCommand.addCommand(gs); |
... | ... | |
411 | 411 |
@Override |
412 | 412 |
public void onError(Throwable t) { |
413 | 413 |
GWT.log("Error fetching Others Root folder", t); |
414 |
GSS.get().displayError("Unable to fetch Others Root folder");
|
|
414 |
Pithos.get().displayError("Unable to fetch Others Root folder");
|
|
415 | 415 |
} |
416 | 416 |
}; |
417 | 417 |
DeferredCommand.addCommand(go); |
... | ... | |
430 | 430 |
|
431 | 431 |
|
432 | 432 |
public void updateTrashNode(){ |
433 |
DeferredCommand.addCommand(new GetCommand<TrashResource>(TrashResource.class, GSS.get().getCurrentUserResource().getTrashPath(), null) {
|
|
433 |
DeferredCommand.addCommand(new GetCommand<TrashResource>(TrashResource.class, Pithos.get().getCurrentUserResource().getTrashPath(), null) {
|
|
434 | 434 |
@Override |
435 | 435 |
public void onComplete() { |
436 | 436 |
trash = getResult(); |
... | ... | |
446 | 446 |
int statusCode = ((RestException)t).getHttpStatusCode(); |
447 | 447 |
// On IE status code 1223 may be returned instead of 204. |
448 | 448 |
if(statusCode == 204 || statusCode == 1223){ |
449 |
trash = new TrashResource(GSS.get().getCurrentUserResource().getTrashPath());
|
|
449 |
trash = new TrashResource(Pithos.get().getCurrentUserResource().getTrashPath());
|
|
450 | 450 |
model.getRootNodes().getList().set(1, trash); |
451 | 451 |
//model.getRootNodes().refresh(); |
452 | 452 |
} |
453 | 453 |
else{ |
454 | 454 |
GWT.log("", t); |
455 |
GSS.get().displayError("Unable to fetch trash folder:"+t.getMessage());
|
|
456 |
trash = new TrashResource(GSS.get().getCurrentUserResource().getTrashPath());
|
|
455 |
Pithos.get().displayError("Unable to fetch trash folder:"+t.getMessage());
|
|
456 |
trash = new TrashResource(Pithos.get().getCurrentUserResource().getTrashPath());
|
|
457 | 457 |
model.getRootNodes().getList().set(1, trash); |
458 | 458 |
//model.getRootNodes().refresh(); |
459 | 459 |
} |
... | ... | |
463 | 463 |
} |
464 | 464 |
|
465 | 465 |
public void updateRootNode(){ |
466 |
final String path = GSS.get().getCurrentUserResource().getFilesPath();
|
|
466 |
final String path = Pithos.get().getCurrentUserResource().getFilesPath();
|
|
467 | 467 |
GetCommand<FolderResource> gf = new GetCommand<FolderResource>(FolderResource.class, path, null) { |
468 | 468 |
|
469 | 469 |
@Override |
... | ... | |
478 | 478 |
@Override |
479 | 479 |
public void onError(Throwable t) { |
480 | 480 |
GWT.log("Error fetching root folder", t); |
481 |
GSS.get().displayError("Unable to fetch root folder");
|
|
481 |
Pithos.get().displayError("Unable to fetch root folder");
|
|
482 | 482 |
} |
483 | 483 |
|
484 | 484 |
}; |
... | ... | |
486 | 486 |
} |
487 | 487 |
|
488 | 488 |
public void updateMySharedNode(){ |
489 |
GetCommand<SharedResource> gs = new GetCommand<SharedResource>(SharedResource.class, GSS.get().getCurrentUserResource().getSharedPath(), null) {
|
|
489 |
GetCommand<SharedResource> gs = new GetCommand<SharedResource>(SharedResource.class, Pithos.get().getCurrentUserResource().getSharedPath(), null) {
|
|
490 | 490 |
|
491 | 491 |
@Override |
492 | 492 |
public void onComplete() { |
... | ... | |
497 | 497 |
@Override |
498 | 498 |
public void onError(Throwable t) { |
499 | 499 |
GWT.log("Error fetching Shared Root folder", t); |
500 |
GSS.get().displayError("Unable to fetch Shared Root folder");
|
|
500 |
Pithos.get().displayError("Unable to fetch Shared Root folder");
|
|
501 | 501 |
} |
502 | 502 |
}; |
503 | 503 |
DeferredCommand.addCommand(gs); |
... | ... | |
505 | 505 |
|
506 | 506 |
public void updateOtherNode(){ |
507 | 507 |
GetCommand<OthersResource> go = new GetCommand<OthersResource>(OthersResource.class, |
508 |
GSS.get().getCurrentUserResource().getOthersPath(), null) {
|
|
508 |
Pithos.get().getCurrentUserResource().getOthersPath(), null) {
|
|
509 | 509 |
|
510 | 510 |
@Override |
511 | 511 |
public void onComplete() { |
... | ... | |
516 | 516 |
@Override |
517 | 517 |
public void onError(Throwable t) { |
518 | 518 |
GWT.log("Error fetching Others Root folder", t); |
519 |
GSS.get().displayError("Unable to fetch Others Root folder");
|
|
519 |
Pithos.get().displayError("Unable to fetch Others Root folder");
|
|
520 | 520 |
} |
521 | 521 |
}; |
522 | 522 |
DeferredCommand.addCommand(go); |
... | ... | |
528 | 528 |
} |
529 | 529 |
|
530 | 530 |
public void clearSelection(){ |
531 |
if(GSS.get().getCurrentSelection().equals(getSelection()))
|
|
532 |
GSS.get().setCurrentSelection(null);
|
|
531 |
if(Pithos.get().getCurrentSelection().equals(getSelection()))
|
|
532 |
Pithos.get().setCurrentSelection(null);
|
|
533 | 533 |
selectionModel.setSelected(getSelection(), false); |
534 | 534 |
} |
535 | 535 |
|
... | ... | |
623 | 623 |
public void refreshCurrentNode(boolean clearSelection){ |
624 | 624 |
NodeInfo<RestResource> nodeInfo = (NodeInfo<RestResource>) getModel().getNodeInfo(selectionModel.getSelectedObject()); |
625 | 625 |
if(nodeInfo==null || nodeInfo.getValueUpdater()==null){ |
626 |
GSS.get().showFileList(getSelection(),clearSelection);
|
|
626 |
Pithos.get().showFileList(getSelection(),clearSelection);
|
|
627 | 627 |
} |
628 | 628 |
else{ |
629 | 629 |
if(!clearSelection) |
Also available in: Unified diff