bug fixed on file position upload after a "got to folder"

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace@81240 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2013-09-11 08:30:35 +00:00
parent 35aaa45853
commit 083914fdf5
1 changed files with 23 additions and 7 deletions

View File

@ -112,6 +112,7 @@ public class AppController implements SubscriberInterface {
private HasWidgets rootPanel;
public AppController(AppControllerExplorer appControllerExplorer) {
this.appContrExplorer = appControllerExplorer;
this.appContrExplorer.subscribe(this, new EventsTypeEnum[] {
@ -665,17 +666,32 @@ public class AppController implements SubscriberInterface {
//FILE UPLOAD CASES..
if(fileUploadEvent.getTargetFolderModel()!=null){
parent = fileUploadEvent.getTargetFolderModel();
GWT.log("get parent item for uploading from parent of file model: " +fileUploadEvent.getTargetFolderModel().getName());
}else if(wsPortlet.getGridGroupContainer().getCurrentFolderView()!=null){
parent = wsPortlet.getGridGroupContainer().getCurrentFolderView();
GWT.log("get parent item for uploading from CurrentFolderView: " +parent.getName());
GWT.log("Search is not active, get parent item for uploading from parent of file model: " +fileUploadEvent.getTargetFolderModel().getName());
}else if(wsPortlet.getToolBarPath().getLastParent()!=null){
parent = wsPortlet.getToolBarPath().getLastParent();
GWT.log("get parent item for uploading from breadcrumb: " +parent.getName());
GWT.log("Search is not active get parent item for uploading from breadcrumb: " +parent.getName());
}else if(wsPortlet.getGridGroupContainer().getCurrentFolderView()!=null){
parent = wsPortlet.getGridGroupContainer().getCurrentFolderView();
GWT.log("Search is not active get parent item for uploading from CurrentFolderView: " +parent.getName());
}
// }else if(wsPortlet.getGridGroupContainer().getCurrentFolderView()!=null){
// parent = wsPortlet.getGridGroupContainer().getCurrentFolderView();
// GWT.log("get parent item for uploading from CurrentFolderView: " +parent.getName());
// }else if(wsPortlet.getToolBarPath().getLastParent()!=null){
// parent = wsPortlet.getToolBarPath().getLastParent();
// GWT.log("get parent item for uploading from breadcrumb: " +parent.getName());
// }
}
else{ //IF IS SEARCH ACTIVE
//is BREADCRUMB fully?
if(wsPortlet.getToolBarPath().getLastParent()!=null){
parent = wsPortlet.getToolBarPath().getLastParent();
GWT.log("Search is active get parent item for uploading from breadcrumb: " +parent.getName());
}else
parent = null; //also SET null AS PARENT
}
else
parent = null; //IF IS SEARCH ACTIVE SET null AS PARENT
AppControllerExplorer.getEventBus().fireEvent(new FileUploadEvent(parent,fileUploadEvent.getUploadType()));