bug fixed: on refresh store
git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace@81426 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
c8fb0b7482
commit
507c5b5830
|
@ -115,6 +115,7 @@ public class AppController implements SubscriberInterface {
|
||||||
private HasWidgets rootPanel;
|
private HasWidgets rootPanel;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public AppController(AppControllerExplorer appControllerExplorer) {
|
public AppController(AppControllerExplorer appControllerExplorer) {
|
||||||
this.appContrExplorer = appControllerExplorer;
|
this.appContrExplorer = appControllerExplorer;
|
||||||
this.appContrExplorer.subscribe(this, new EventsTypeEnum[] {
|
this.appContrExplorer.subscribe(this, new EventsTypeEnum[] {
|
||||||
|
@ -275,8 +276,8 @@ public class AppController implements SubscriberInterface {
|
||||||
FileModel parent = wsPortlet.getToolBarPath().getLastParent();
|
FileModel parent = wsPortlet.getToolBarPath().getLastParent();
|
||||||
|
|
||||||
//CREATE FOLDER PARENT FOR RPC
|
//CREATE FOLDER PARENT FOR RPC
|
||||||
FolderModel folder = new FolderModel(parent.getIdentifier(), parent.getName(), parent.getParentFileModel(), true, parent.isShared());
|
// FolderModel folder = new FolderModel(parent.getIdentifier(), parent.getName(), parent.getParentFileModel(), true, parent.isShared());
|
||||||
updateStoreByRpc(folder);
|
updateStoreByRpc(parent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -694,38 +695,43 @@ public class AppController implements SubscriberInterface {
|
||||||
|
|
||||||
FileModel parent = null;
|
FileModel parent = null;
|
||||||
|
|
||||||
if(!wsPortlet.getSearchAndFilterContainer().isSearchActive()){ //IF IS NOT SEARCH ACTIVE
|
try{
|
||||||
//FILE UPLOAD CASES..
|
if(!wsPortlet.getSearchAndFilterContainer().isSearchActive()){ //IF IS NOT SEARCH ACTIVE
|
||||||
if(fileUploadEvent.getTargetFolderModel()!=null){
|
//FILE UPLOAD CASES..
|
||||||
parent = fileUploadEvent.getTargetFolderModel();
|
if(fileUploadEvent.getTargetFolderModel()!=null){
|
||||||
GWT.log("Search is not active, get parent item for uploading from parent of file model: " +fileUploadEvent.getTargetFolderModel().getName());
|
parent = fileUploadEvent.getTargetFolderModel();
|
||||||
}else if(wsPortlet.getToolBarPath().getLastParent()!=null){
|
GWT.log("Search is not active, get parent item for uploading from parent of file model: " +fileUploadEvent.getTargetFolderModel().getName());
|
||||||
parent = wsPortlet.getToolBarPath().getLastParent();
|
}else if(wsPortlet.getToolBarPath().getLastParent()!=null){
|
||||||
GWT.log("Search is not active get parent item for uploading from breadcrumb: " +parent.getName());
|
parent = wsPortlet.getToolBarPath().getLastParent();
|
||||||
}else if(wsPortlet.getGridGroupContainer().getCurrentFolderView()!=null){
|
GWT.log("Search is not active get parent item for uploading from breadcrumb: " +parent.getName());
|
||||||
parent = wsPortlet.getGridGroupContainer().getCurrentFolderView();
|
}else if(wsPortlet.getGridGroupContainer().getCurrentFolderView()!=null){
|
||||||
GWT.log("Search is not active get parent item for uploading from CurrentFolderView: " +parent.getName());
|
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(wsPortlet.getGridGroupContainer().getCurrentFolderView()!=null){
|
else{ //IF IS SEARCH ACTIVE
|
||||||
// parent = wsPortlet.getGridGroupContainer().getCurrentFolderView();
|
|
||||||
// GWT.log("get parent item for uploading from CurrentFolderView: " +parent.getName());
|
//is BREADCRUMB fully?
|
||||||
// }else if(wsPortlet.getToolBarPath().getLastParent()!=null){
|
if(wsPortlet.getToolBarPath().getLastParent()!=null){
|
||||||
// parent = wsPortlet.getToolBarPath().getLastParent();
|
parent = wsPortlet.getToolBarPath().getLastParent();
|
||||||
// GWT.log("get parent item for uploading from breadcrumb: " +parent.getName());
|
GWT.log("Search is active get parent item for uploading from breadcrumb: " +parent.getName());
|
||||||
// }
|
}else
|
||||||
|
parent = null; //also SET null AS PARENT
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
AppControllerExplorer.getEventBus().fireEvent(new FileUploadEvent(parent,fileUploadEvent.getUploadType()));
|
||||||
|
|
||||||
|
}catch (Exception e) {
|
||||||
|
GWT.log("Error onFileUploadEvent", e);
|
||||||
}
|
}
|
||||||
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
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
AppControllerExplorer.getEventBus().fireEvent(new FileUploadEvent(parent,fileUploadEvent.getUploadType()));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -1049,13 +1055,20 @@ public class AppController implements SubscriberInterface {
|
||||||
|
|
||||||
private void updateStoreByRpc(final FileModel folder){
|
private void updateStoreByRpc(final FileModel folder){
|
||||||
|
|
||||||
|
|
||||||
|
if(folder==null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
//CREATE FOLDER PARENT FOR RPC
|
||||||
|
final FileModel parent = new FolderModel(folder.getIdentifier(), folder.getName(), folder.getParentFileModel(), true, folder.isShared());
|
||||||
|
|
||||||
wsPortlet.getGridGroupContainer().mask(ConstantsExplorer.LOADING,ConstantsExplorer.LOADINGSTYLE);
|
wsPortlet.getGridGroupContainer().mask(ConstantsExplorer.LOADING,ConstantsExplorer.LOADINGSTYLE);
|
||||||
|
|
||||||
System.out.println("In client new RPC getFolderChildrenForFileGrid "+folder.getName());
|
System.out.println("In client new RPC getFolderChildrenForFileGrid "+parent.getName());
|
||||||
|
|
||||||
System.out.println(folder);
|
System.out.println(parent);
|
||||||
|
|
||||||
appContrExplorer.getRpcWorkspaceService().getFolderChildrenForFileGrid(folder, new AsyncCallback<List<FileGridModel>>() {
|
appContrExplorer.getRpcWorkspaceService().getFolderChildrenForFileGrid(parent, new AsyncCallback<List<FileGridModel>>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
|
@ -1075,7 +1088,7 @@ public class AppController implements SubscriberInterface {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(List<FileGridModel> result) {
|
public void onSuccess(List<FileGridModel> result) {
|
||||||
wsPortlet.getGridGroupContainer().setCurrentFolderView(folder); //SET folder as current view
|
wsPortlet.getGridGroupContainer().setCurrentFolderView(parent); //SET folder as current view
|
||||||
|
|
||||||
wsPortlet.getGridGroupContainer().unmask();
|
wsPortlet.getGridGroupContainer().unmask();
|
||||||
wsPortlet.getGridGroupContainer().updateStore(result);
|
wsPortlet.getGridGroupContainer().updateStore(result);
|
||||||
|
@ -1388,7 +1401,7 @@ public class AppController implements SubscriberInterface {
|
||||||
@Override
|
@Override
|
||||||
public void pasteEventIsCompleted() {
|
public void pasteEventIsCompleted() {
|
||||||
|
|
||||||
Info.display("Info", "pasting...");
|
Info.display("Info", "paste submitting...");
|
||||||
wsPortlet.getGxtCardLayoutResultPanel().getToolBarItemFunctionalities().activePasteButton(false);
|
wsPortlet.getGxtCardLayoutResultPanel().getToolBarItemFunctionalities().activePasteButton(false);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue