diff --git a/src/main/java/org/gcube/portlets/user/workspace/client/AppControllerExplorer.java b/src/main/java/org/gcube/portlets/user/workspace/client/AppControllerExplorer.java index 062b36d..635c540 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/client/AppControllerExplorer.java +++ b/src/main/java/org/gcube/portlets/user/workspace/client/AppControllerExplorer.java @@ -219,7 +219,7 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt @Override public void onSuccess(Boolean result) { if(result) - eventBus.fireEvent(new RefreshFolderEvent(source.getParentFileModel(), true)); + eventBus.fireEvent(new RefreshFolderEvent(source.getParentFileModel(), true, false)); } }); @@ -332,7 +332,7 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt else parentToRefresh = parentFileModel; - eventBus.fireEvent(new RefreshFolderEvent(parentToRefresh, true)); + eventBus.fireEvent(new RefreshFolderEvent(parentToRefresh, true, false)); GWT.log("share completed refresh folder : "+parentModel.getName()); } explorerPanel.unmask(); @@ -548,7 +548,7 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt public void onSuccess(Boolean result) { if(result) - eventBus.fireEvent(new RefreshFolderEvent(explorerPanel.getAsycTreePanel().getFileModelByIdentifier(pasteItemEvent.getFolderDestinationId()), false)); + eventBus.fireEvent(new RefreshFolderEvent(explorerPanel.getAsycTreePanel().getFileModelByIdentifier(pasteItemEvent.getFolderDestinationId()), false, true)); notifySubscriber(pasteItemEvent); } @@ -1652,7 +1652,7 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt RefreshFolderEvent refresh = (RefreshFolderEvent) event; - sub.refreshFolder(refresh.getFolderTarget()); + sub.refreshFolder(refresh.getFolderTarget(), refresh.isForceRefresh()); }else if(event instanceof SendMessageEvent){ diff --git a/src/main/java/org/gcube/portlets/user/workspace/client/event/RefreshFolderEvent.java b/src/main/java/org/gcube/portlets/user/workspace/client/event/RefreshFolderEvent.java index f3aa18e..00d3277 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/client/event/RefreshFolderEvent.java +++ b/src/main/java/org/gcube/portlets/user/workspace/client/event/RefreshFolderEvent.java @@ -12,10 +12,13 @@ public class RefreshFolderEvent extends GwtEvent implem private FileModel folderTarget= null; private boolean expandFolder = true; //DEFAULT EXPAND FOLDER + + private boolean forceRefresh; - public RefreshFolderEvent(FileModel folderTarget, boolean expandFolder) { + public RefreshFolderEvent(FileModel folderTarget, boolean expandFolder, boolean forceRefresh) { this.folderTarget = folderTarget; this.expandFolder = expandFolder; + this.forceRefresh = forceRefresh; } @@ -48,4 +51,14 @@ public class RefreshFolderEvent extends GwtEvent implem public void setExpandFolder(boolean expandFolder) { this.expandFolder = expandFolder; } + + + public boolean isForceRefresh() { + return forceRefresh; + } + + + public void setForceRefresh(boolean forceRefresh) { + this.forceRefresh = forceRefresh; + } } diff --git a/src/main/java/org/gcube/portlets/user/workspace/client/interfaces/SubscriberInterface.java b/src/main/java/org/gcube/portlets/user/workspace/client/interfaces/SubscriberInterface.java index 20537ae..f2ae5be 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/client/interfaces/SubscriberInterface.java +++ b/src/main/java/org/gcube/portlets/user/workspace/client/interfaces/SubscriberInterface.java @@ -30,7 +30,7 @@ public interface SubscriberInterface { void smartFolderSelected(String folderId, String category); void movedItems(String sourceParentIdentifier, FileModel targetParent); void switchView(ViewSwitchType type); - void refreshFolder(FileModel fileModel); + void refreshFolder(FileModel fileModel, boolean forzed); // void updatePrevieMessage(String fromLogin, String subject, String date, String body, List attachs); void createNewMessage(HashMap hashAttachs); diff --git a/src/main/java/org/gcube/portlets/user/workspace/client/view/tree/ContextMenuTree.java b/src/main/java/org/gcube/portlets/user/workspace/client/view/tree/ContextMenuTree.java index 637fa02..cd2440e 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/client/view/tree/ContextMenuTree.java +++ b/src/main/java/org/gcube/portlets/user/workspace/client/view/tree/ContextMenuTree.java @@ -561,7 +561,7 @@ public class ContextMenuTree { public void componentSelected(MenuEvent ce) { for (FileModel sel : listSelectedItems) { - eventBus.fireEvent(new RefreshFolderEvent(sel, true)); + eventBus.fireEvent(new RefreshFolderEvent(sel, true, false)); } } }); diff --git a/src/main/java/org/gcube/portlets/user/workspace/server/util/WsUtil.java b/src/main/java/org/gcube/portlets/user/workspace/server/util/WsUtil.java index 653e8c0..124f080 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/server/util/WsUtil.java +++ b/src/main/java/org/gcube/portlets/user/workspace/server/util/WsUtil.java @@ -74,10 +74,10 @@ public class WsUtil { /*USE ANOTHER ACCOUNT (OTHERWHISE BY TEST_USER) FOR RUNNING * COMMENT THIS IN DEVELOP ENVIROMENT (UNCOMMENT IN PRODUCTION)*/ -// user=TEST_USER; + user=TEST_USER; //UNCOMMENT THIS IN DEVELOP ENVIROMENT - user = "francesco.mangiacrapa"; +// user = "francesco.mangiacrapa"; defaultLogger.warn("WORKSPACE PORTLET STARTING IN TEST MODE - NO USER FOUND - PORTLETS STARTING WITH FOLLOWING SETTINGS:"); defaultLogger.warn("session id: "+sessionID);