updated breadcrumb on share link

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace@76982 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2013-06-11 13:09:05 +00:00
parent 9d7f6de26c
commit edc0525220
1 changed files with 30 additions and 8 deletions

View File

@ -5,6 +5,7 @@ import java.util.Date;
import java.util.HashMap;
import java.util.List;
import org.apache.bcel.generic.LADD;
import org.gcube.portlets.user.workspace.client.ConstantsExplorer.ViewSwitchType;
import org.gcube.portlets.user.workspace.client.ConstantsPortlet.ViewSwitchTypeInResult;
import org.gcube.portlets.user.workspace.client.event.AccountingHistoryEvent;
@ -498,6 +499,9 @@ public class AppController implements SubscriberInterface {
listResult.add(result);
wsPortlet.getGridGroupContainer().updateStore(listResult);
wsPortlet.getGridGroupContainer().unmask();
if(result!=null)
loadBreadcrumbById(result, false); //ADDED 13-06-2013
}
});
}
@ -673,7 +677,7 @@ public class AppController implements SubscriberInterface {
*/
private void loadBreadcrumbById(final FileModel item, final boolean isLastParent){
System.out.println("Reload Breadcrumb...");
GWT.log("Reload Breadcrumb: [FileModel name: "+item.getName()+ ", isLastParent: "+isLastParent+"]");
AppControllerExplorer.rpcWorkspaceService.getListParentsByItemIdentifier(item.getIdentifier(), new AsyncCallback<List<FileModel>>() {
@ -686,7 +690,7 @@ public class AppController implements SubscriberInterface {
@Override
public void onSuccess(List<FileModel> result) {
if(isLastParent){
if(isLastParent && item.isDirectory()){
result.add(item);
}
@ -887,21 +891,22 @@ public class AppController implements SubscriberInterface {
if(currentFolder!=null){
if(item.isDirectory()) //ADDED 11-06-2013
parents.add(item);
setPathInView(parents); //set path
//CASE IS A SEARCH
if(wsPortlet.getSearchAndFilterContainer().isSearchActive()){ //ADDED 12-04-12
wsPortlet.getSearchAndFilterContainer().searchCancel(); //TODO added in 05/04/2012
AppController.getEventBus().fireEvent(new SearchTextEvent(null));
wsPortlet.getSearchAndFilterContainer().setSearchActive(false);
// setSearchActive(false);
if(item.isDirectory())
updateStoreByRpc(item);
else
updateStoreByRpc(item.getParentFileModel());
updatGridViewForSelectedItem(item);
return;
}
//CASE IS NOT A SEARCH
if (item.isDirectory())
updateStoreByRpc(item); //View children of folder
else{
@ -912,8 +917,25 @@ public class AppController implements SubscriberInterface {
}
}
}
else{
updatGridViewForSelectedItem(item); //No operation is running.. view only items of same level tree of selected item
loadBreadcrumbById(item, true);
}
}
/**
*
* @param item
*/
private void updatGridViewForSelectedItem(FileModel item){
if(item==null)
return;
if(item.isDirectory())
updateStoreByRpc(item);
else
updateStoreByRpc(item); //View children of root
updateStoreByRpc(item.getParentFileModel());
}
@Override