Fixed: refresh for smart folder

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace@82373 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2013-10-03 12:46:57 +00:00
parent 9ee2dbe224
commit 569db18c6a
2 changed files with 37 additions and 17 deletions

12
pom.xml
View File

@ -160,12 +160,12 @@
<version>[6.0.0-SNAPSHOT, 7.0.0-SNAPSHOT)</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.contentmanagement</groupId>
<artifactId>storage-resource-link-plugin</artifactId>
<version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
<scope>provided</scope>
</dependency>
<!-- <dependency> -->
<!-- <groupId>org.gcube.contentmanagement</groupId> -->
<!-- <artifactId>storage-resource-link-plugin</artifactId> -->
<!-- <version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version> -->
<!-- <scope>provided</scope> -->
<!-- </dependency> -->
<dependency>
<groupId>org.gcube.portlets.user</groupId>
<artifactId>wsmail-widget</artifactId>

View File

@ -113,10 +113,9 @@ public class AppController implements SubscriberInterface {
private String rootIdentifier = null;
// public static boolean isSearchActive = false;
private HasWidgets rootPanel;
private String selectedSmartFolderId;
private String selectedSmartFolderCategory;
public AppController(AppControllerExplorer appControllerExplorer) {
this.appContrExplorer = appControllerExplorer;
this.appContrExplorer.subscribe(this, new EventsTypeEnum[] {
@ -276,8 +275,15 @@ public class AppController implements SubscriberInterface {
public void onGridRefresh(GridRefreshEvent gridRefreshEvent) {
if(wsPortlet.getToolBarPath().getLastParent()!=null){
FileModel parent = wsPortlet.getToolBarPath().getLastParent();
//ID DISPLAYED SMART FOLDER CONTENTS?
if(selectedSmartFolderId!=null || selectedSmartFolderCategory!=null){
smartFolderSelected(selectedSmartFolderId, selectedSmartFolderCategory);
return;
}
FileModel parent = wsPortlet.getToolBarPath().getLastParent();
//CREATE FOLDER PARENT FOR RPC
// FolderModel folder = new FolderModel(parent.getIdentifier(), parent.getName(), parent.getParentFileModel(), true, parent.isShared());
updateStoreByRpc(parent);
@ -467,6 +473,7 @@ public class AppController implements SubscriberInterface {
if(wsPortlet.getSearchAndFilterContainer().isSearchActive()){
AppController.getEventBus().fireEvent(new SearchTextEvent(null));
wsPortlet.getSearchAndFilterContainer().setSearchActive(false);
resetSmartFolderSelected();
}
System.out.println("FILE MODEL DOUBLE CLICK: "+fileModel);
@ -818,6 +825,11 @@ public class AppController implements SubscriberInterface {
private FileGridModel getGridSelectedItem(){
return wsPortlet.getGridGroupContainer().getSelectedItem();
}
private void resetSmartFolderSelected(){
selectedSmartFolderId = null;
selectedSmartFolderCategory = null;
}
/**
@ -1058,6 +1070,7 @@ public class AppController implements SubscriberInterface {
private void updateStoreByRpc(final FileModel folder){
resetSmartFolderSelected();
if(folder==null)
return;
@ -1067,9 +1080,9 @@ public class AppController implements SubscriberInterface {
wsPortlet.getGridGroupContainer().mask(ConstantsExplorer.LOADING,ConstantsExplorer.LOADINGSTYLE);
System.out.println("In client new RPC getFolderChildrenForFileGrid "+parent.getName());
System.out.println(parent);
// System.out.println("In client new RPC getFolderChildrenForFileGrid "+parent.getName());
//
// System.out.println(parent);
appContrExplorer.getRpcWorkspaceService().getFolderChildrenForFileGrid(parent, new AsyncCallback<List<FileGridModel>>() {
@ -1138,6 +1151,9 @@ public class AppController implements SubscriberInterface {
AppController.getEventBus().fireEvent(new SearchTextEvent(null));
wsPortlet.getSearchAndFilterContainer().setSearchActive(false);
// setSearchActive(false);
resetSmartFolderSelected();
updatGridViewForSelectedItem(item);
return;
}
@ -1208,10 +1224,12 @@ public class AppController implements SubscriberInterface {
@Override
public void smartFolderSelected(final String folderId, final String category) {
System.out.println("In client folderId: " + folderId);
System.out.println("In client category: " + category);
selectedSmartFolderId = folderId;
selectedSmartFolderCategory = category;
GWT.log("Smart folder selected, folderId: " + selectedSmartFolderId);
GWT.log("Smart folder selected, category: " + selectedSmartFolderCategory);
wsPortlet.getGridGroupContainer().mask(ConstantsExplorer.LOADING,ConstantsExplorer.LOADINGSTYLE);
wsPortlet.getGridGroupContainer().setBorderAsOnSearch(true);
@ -1289,6 +1307,8 @@ public class AppController implements SubscriberInterface {
@Override
public void refreshFolder(FileModel folderTarget, boolean forceRefresh) {
resetSmartFolderSelected();
if(folderTarget!=null){
if(forceRefresh){