Fixed integration with workspace uploader
git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace@119433 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
52b1bd4fa0
commit
1458192468
|
@ -1363,32 +1363,38 @@ public class AppController implements SubscriberInterface {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void addedFile(String itemIdentifier, FileModel parent, WS_UPLOAD_TYPE uploadType) {
|
||||
public void addedFile(String itemIdentifier, String parentId, WS_UPLOAD_TYPE uploadType) {
|
||||
// updateStoreByRpc(parent);
|
||||
if(parent==null){
|
||||
GWT.log("addedFile skipping, parent is null");
|
||||
if(parentId==null){
|
||||
GWT.log("addedFile skipping, parentId is null");
|
||||
return;
|
||||
}
|
||||
|
||||
//UPDATE GRID ONLY IF TREE AND GRID DISPLAYING THE SAME PARENT
|
||||
if(parentIsBreadcrumbLastParent(parent)){
|
||||
if(parentIsBreadcrumbLastParent(parentId)){
|
||||
|
||||
if(uploadType.equals(WS_UPLOAD_TYPE.File)){
|
||||
GWT.log("Calling addFileToStoreById "+parent.getIdentifier());
|
||||
addFileToStoreById(itemIdentifier, parent);
|
||||
GWT.log("Calling addFileToStoreById "+parentId);
|
||||
addFileToStoreById(itemIdentifier, parentId);
|
||||
}else{ //is ARCHIVE
|
||||
updateStoreByRpc(parent);
|
||||
updateStoreByRpc(wsPortlet.getToolBarPath().getLastParent());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean parentIsBreadcrumbLastParent(FileModel parent){
|
||||
GxtBreadcrumbPathPanel breadCrumb = this.wsPortlet.getToolBarPath();
|
||||
FileModel breadParent = breadCrumb.getLastParent();
|
||||
return ((breadParent!=null) && (parent!=null) && (breadParent.getIdentifier().compareTo(parent.getIdentifier())==0));
|
||||
|
||||
/**
|
||||
* Parent is breadcrumb last parent.
|
||||
*
|
||||
* @param parentId the parent id
|
||||
* @return true, if successful
|
||||
*/
|
||||
private boolean parentIsBreadcrumbLastParent(String parentId){
|
||||
FileModel breadParent = wsPortlet.getToolBarPath().getLastParent();
|
||||
return ((breadParent!=null) && (parentId!=null) && (breadParent.getIdentifier().compareTo(parentId)==0));
|
||||
}
|
||||
|
||||
private void addFileToStoreById(String itemIdentifier, FileModel parent){
|
||||
private void addFileToStoreById(String itemIdentifier, String parentId){
|
||||
|
||||
appContrExplorer.getRpcWorkspaceService().getItemForFileGrid(itemIdentifier, new AsyncCallback<FileGridModel>() {
|
||||
|
||||
|
|
Loading…
Reference in New Issue