Added mask on moving item
git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace-tree-widget@115143 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
ead8c3a7da
commit
ef3339fde1
|
@ -172,7 +172,6 @@ import com.google.gwt.user.client.Window;
|
||||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||||
import com.google.gwt.user.client.ui.HasWidgets;
|
import com.google.gwt.user.client.ui.HasWidgets;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
||||||
*
|
*
|
||||||
|
@ -1601,12 +1600,12 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt
|
||||||
@Override
|
@Override
|
||||||
public void onMoveItem(final MoveItemEvent event) {
|
public void onMoveItem(final MoveItemEvent event) {
|
||||||
|
|
||||||
|
explorerPanel.getAsycTreePanel().mask(ConstantsExplorer.MOVING,ConstantsExplorer.LOADINGSTYLE);
|
||||||
rpcWorkspaceService.moveItem(event.getFileSourceModel().getIdentifier(), event.getTargetParentFileModel().getIdentifier(), new AsyncCallback<Boolean>() {
|
rpcWorkspaceService.moveItem(event.getFileSourceModel().getIdentifier(), event.getTargetParentFileModel().getIdentifier(), new AsyncCallback<Boolean>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
|
explorerPanel.getAsycTreePanel().unmask();
|
||||||
if(caught instanceof SessionExpiredException){
|
if(caught instanceof SessionExpiredException){
|
||||||
GWT.log("Session expired");
|
GWT.log("Session expired");
|
||||||
eventBus.fireEvent(new SessionExpiredEvent());
|
eventBus.fireEvent(new SessionExpiredEvent());
|
||||||
|
@ -1621,12 +1620,10 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(Boolean result) {
|
public void onSuccess(Boolean result) {
|
||||||
|
explorerPanel.getAsycTreePanel().unmask();
|
||||||
if(result){
|
if(result){
|
||||||
|
|
||||||
explorerPanel.getAsycTreePanel().reloadTreeLevelAndExpandFolder(event.getTargetParentFileModel().getIdentifier(), true);
|
explorerPanel.getAsycTreePanel().reloadTreeLevelAndExpandFolder(event.getTargetParentFileModel().getIdentifier(), true);
|
||||||
notifySubscriber(event);
|
notifySubscriber(event);
|
||||||
|
|
||||||
// explorerPanel.getAsycTreePanel().setExpandTreeLevel(event.getTargetParentFileModel(), true); //Expand level drop
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -86,6 +86,7 @@ public class ConstantsExplorer {
|
||||||
public static final String EDIT_PERMISSIONS = "Edit Permissions";
|
public static final String EDIT_PERMISSIONS = "Edit Permissions";
|
||||||
public static final String TITLEACCESSWEBDAV = "Access from Desktop";
|
public static final String TITLEACCESSWEBDAV = "Access from Desktop";
|
||||||
public static final String ACCESSWEBDAVMSG = "Files and folders can be managed directly from the file explorer of your desktop operating system.";
|
public static final String ACCESSWEBDAVMSG = "Files and folders can be managed directly from the file explorer of your desktop operating system.";
|
||||||
|
public static final String MOVING = "Moving...";
|
||||||
|
|
||||||
public static final String FILEUPLOADHEADER = "File upload in: ";
|
public static final String FILEUPLOADHEADER = "File upload in: ";
|
||||||
public static final String FILE = "File";
|
public static final String FILE = "File";
|
||||||
|
@ -217,4 +218,5 @@ public class ConstantsExplorer {
|
||||||
//PROPERTY
|
//PROPERTY
|
||||||
public static final String SPECIALFOLDERNAME = "SPECIALFOLDERNAME";
|
public static final String SPECIALFOLDERNAME = "SPECIALFOLDERNAME";
|
||||||
public static final String SPECIALFOLDERNAMEPROPERTIESFILE = "specialfoldername.properties";
|
public static final String SPECIALFOLDERNAMEPROPERTIESFILE = "specialfoldername.properties";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,10 +4,12 @@
|
||||||
package org.gcube.portlets.user.workspace;
|
package org.gcube.portlets.user.workspace;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpSession;
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
import org.gcube.application.framework.core.session.ASLSession;
|
||||||
import org.gcube.common.homelibrary.home.HomeLibrary;
|
import org.gcube.common.homelibrary.home.HomeLibrary;
|
||||||
import org.gcube.common.homelibrary.home.exceptions.HomeNotFoundException;
|
import org.gcube.common.homelibrary.home.exceptions.HomeNotFoundException;
|
||||||
import org.gcube.common.homelibrary.home.exceptions.InternalErrorException;
|
import org.gcube.common.homelibrary.home.exceptions.InternalErrorException;
|
||||||
|
@ -16,12 +18,14 @@ import org.gcube.common.homelibrary.home.workspace.Workspace;
|
||||||
import org.gcube.common.homelibrary.home.workspace.WorkspaceFolder;
|
import org.gcube.common.homelibrary.home.workspace.WorkspaceFolder;
|
||||||
import org.gcube.common.homelibrary.home.workspace.WorkspaceItem;
|
import org.gcube.common.homelibrary.home.workspace.WorkspaceItem;
|
||||||
import org.gcube.common.homelibrary.home.workspace.WorkspaceSharedFolder;
|
import org.gcube.common.homelibrary.home.workspace.WorkspaceSharedFolder;
|
||||||
import org.gcube.common.homelibrary.home.workspace.accessmanager.ACLType;
|
|
||||||
import org.gcube.common.homelibrary.home.workspace.exceptions.WorkspaceFolderNotFoundException;
|
import org.gcube.common.homelibrary.home.workspace.exceptions.WorkspaceFolderNotFoundException;
|
||||||
import org.gcube.common.homelibrary.home.workspace.folder.FolderItem;
|
import org.gcube.common.homelibrary.home.workspace.folder.FolderItem;
|
||||||
import org.gcube.common.scope.api.ScopeProvider;
|
import org.gcube.common.scope.api.ScopeProvider;
|
||||||
import org.gcube.common.scope.impl.ScopeBean;
|
import org.gcube.common.scope.impl.ScopeBean;
|
||||||
import org.gcube.portlets.user.workspace.server.util.AclTypeComparator;
|
import org.gcube.portlets.user.workspace.client.model.InfoContactModel;
|
||||||
|
import org.gcube.portlets.user.workspace.server.GWTWorkspaceBuilder;
|
||||||
|
import org.gcube.portlets.user.workspace.server.util.MetadataConverter;
|
||||||
|
import org.gcube.portlets.user.workspace.server.util.WorkspaceEventCollector;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -49,28 +53,49 @@ public class ItemRetrieving {
|
||||||
System.out.println("init HL");
|
System.out.println("init HL");
|
||||||
try {
|
try {
|
||||||
|
|
||||||
Workspace ws = HomeLibrary
|
// Workspace ws = HomeLibrary
|
||||||
.getHomeManagerFactory()
|
// .getHomeManagerFactory()
|
||||||
.getHomeManager()
|
// .getHomeManager()
|
||||||
.getHome(TEST_USER)
|
// .getHome(TEST_USER)
|
||||||
.getWorkspace();
|
// .getWorkspace();
|
||||||
|
|
||||||
retrieveFirstLevel(ws);
|
System.out.println("\n\nGetting Disk Usage");
|
||||||
|
Workspace ws = getWorkspace();
|
||||||
} catch (WorkspaceFolderNotFoundException e) {
|
System.out.println("Usage:" +ws.getDiskUsage());
|
||||||
// TODO Auto-generated catch block
|
Workspace ws2 = getWorkspace();
|
||||||
e.printStackTrace();
|
System.out.println("TotalItems:" +ws2.getTotalItems());
|
||||||
} catch (InternalErrorException e) {
|
Workspace ws3 = getWorkspace();
|
||||||
// TODO Auto-generated catch block
|
retrieveFirstLevel(ws3);
|
||||||
e.printStackTrace();
|
}catch(Exception e){
|
||||||
} catch (HomeNotFoundException e) {
|
|
||||||
// TODO Auto-generated catch block
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (UserNotFoundException e) {
|
|
||||||
// TODO Auto-generated catch block
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// } catch (WorkspaceFolderNotFoundException e) {
|
||||||
|
// // TODO Auto-generated catch block
|
||||||
|
// e.printStackTrace();
|
||||||
|
// } catch (InternalErrorException e) {
|
||||||
|
// // TODO Auto-generated catch block
|
||||||
|
// e.printStackTrace();
|
||||||
|
// } catch (HomeNotFoundException e) {
|
||||||
|
// // TODO Auto-generated catch block
|
||||||
|
// e.printStackTrace();
|
||||||
|
// } catch (UserNotFoundException e) {
|
||||||
|
// // TODO Auto-generated catch block
|
||||||
|
// e.printStackTrace();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Workspace getWorkspace() throws InternalErrorException, HomeNotFoundException, WorkspaceFolderNotFoundException
|
||||||
|
{
|
||||||
|
|
||||||
|
logger.trace("Get Workspace scope: "+DEFAULT_SCOPE + " username: "+TEST_USER);
|
||||||
|
ScopeProvider.instance.set(DEFAULT_SCOPE);
|
||||||
|
logger.trace("Scope provider instancied");
|
||||||
|
|
||||||
|
Workspace workspace = HomeLibrary.getUserWorkspace(TEST_USER);
|
||||||
|
|
||||||
|
return workspace;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue