added timer to delay the refresh due to back-end late sync
git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace-tree-widget@177213 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
8a6d54ae1d
commit
08096d34a8
|
@ -214,6 +214,8 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt
|
||||||
private WsThreddsWidget wsThreddsWidget = new WsThreddsWidget();
|
private WsThreddsWidget wsThreddsWidget = new WsThreddsWidget();
|
||||||
private WsTaskExecutorWidget taskExecutor = new WsTaskExecutorWidget();
|
private WsTaskExecutorWidget taskExecutor = new WsTaskExecutorWidget();
|
||||||
|
|
||||||
|
private int waitTiming = 3000;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instantiates a new app controller explorer.
|
* Instantiates a new app controller explorer.
|
||||||
*/
|
*/
|
||||||
|
@ -547,10 +549,22 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(Boolean result) {
|
public void onSuccess(Boolean result) {
|
||||||
explorerPanel.getAsycTreePanel().unmask();
|
GWT.log("Unshare was: "+result);
|
||||||
if(result) //REFRESH PARENT FOLDER
|
|
||||||
eventBus.fireEvent(new RefreshFolderEvent(source.getParentFileModel(), true, false, false));
|
|
||||||
|
|
||||||
|
GWT.log("Waiting "+waitTiming);
|
||||||
|
if(result){ //REFRESH PARENT FOLDER
|
||||||
|
Timer t = new Timer() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
GWT.log("Runing refresh after wait: "+waitTiming);
|
||||||
|
eventBus.fireEvent(new RefreshFolderEvent(source.getParentFileModel(), true, true, false));
|
||||||
|
explorerPanel.getAsycTreePanel().unmask();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
t.schedule(waitTiming);
|
||||||
|
}else
|
||||||
|
explorerPanel.getAsycTreePanel().unmask();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -748,7 +762,7 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt
|
||||||
Info.display("Info", "An operation of sharing was submitted");
|
Info.display("Info", "An operation of sharing was submitted");
|
||||||
explorerPanel.mask("Setting permissions", ConstantsExplorer.LOADINGSTYLE);
|
explorerPanel.mask("Setting permissions", ConstantsExplorer.LOADINGSTYLE);
|
||||||
|
|
||||||
rpcWorkspaceService.shareFolder(fileModel, finalDialog.getSharedListUsers(), isNewFolder, finalDialog.getSelectedACL(), new AsyncCallback<Boolean>() {
|
rpcWorkspaceService.shareFolder(fileModel, finalDialog.getSharedListUsers(), isNewFolder, finalDialog.getSelectedACL(), new AsyncCallback<FileModel>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
|
@ -765,25 +779,34 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(Boolean result) {
|
public void onSuccess(FileModel result) {
|
||||||
if(result){
|
|
||||||
FileModel parentToRefresh=null;
|
|
||||||
|
|
||||||
if(isNewFolder)
|
if(result!=null){
|
||||||
parentToRefresh = parentModel;
|
final FileModel parentToRefresh = result.getParentFileModel();
|
||||||
else
|
GWT.log("share completed throwing refresh folder: "+parentToRefresh.getName()+", its id is: "+parentToRefresh.getIdentifier());
|
||||||
parentToRefresh = parentFileModel;
|
|
||||||
|
|
||||||
GWT.log("share completed throwing refresh folder : "+parentToRefresh.getName() +" get id: "+parentToRefresh.getIdentifier());
|
GWT.log("Waiting "+waitTiming);
|
||||||
|
|
||||||
// eventBus.fireEvent(new RefreshFolderEvent(parentToRefresh, true, false, false));
|
//REFRESH PARENT FOLDER
|
||||||
|
Timer t = new Timer() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
GWT.log("Runing refresh after wait: "+waitTiming);
|
||||||
|
//TODO UPDATED ID
|
||||||
|
RefreshFolderEvent refEvent = new RefreshFolderEvent(parentToRefresh, true, true, false);
|
||||||
|
refEvent.setForceReloadBreadCrumb(true);
|
||||||
|
eventBus.fireEvent(refEvent);
|
||||||
|
explorerPanel.unmask();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
//TODO UPDATED ID
|
t.schedule(waitTiming);
|
||||||
RefreshFolderEvent refEvent = new RefreshFolderEvent(parentToRefresh, true, true, false);
|
|
||||||
refEvent.setForceReloadBreadCrumb(true);
|
|
||||||
eventBus.fireEvent(refEvent);
|
}else{
|
||||||
|
new MessageBoxAlert("Error", "Sharing error, please refresh and try again", null);
|
||||||
|
explorerPanel.unmask();
|
||||||
}
|
}
|
||||||
explorerPanel.unmask();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -898,7 +921,7 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt
|
||||||
|
|
||||||
if(refreshItemEvent.getFolderTarget()!=null && refreshItemEvent.getFolderTarget().getIdentifier()!=null){
|
if(refreshItemEvent.getFolderTarget()!=null && refreshItemEvent.getFolderTarget().getIdentifier()!=null){
|
||||||
|
|
||||||
if(!refreshItemEvent.isIfExists()){ //Called Tree side
|
if(!refreshItemEvent.isCalledTreeSide()){ //Called Tree side
|
||||||
explorerPanel.getAsycTreePanel().reloadTreeLevelAndExpandFolder(refreshItemEvent.getFolderTarget().getIdentifier(), refreshItemEvent.isExpandFolder());
|
explorerPanel.getAsycTreePanel().reloadTreeLevelAndExpandFolder(refreshItemEvent.getFolderTarget().getIdentifier(), refreshItemEvent.isExpandFolder());
|
||||||
notifySubscriber(refreshItemEvent);
|
notifySubscriber(refreshItemEvent);
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,91 +6,152 @@ import org.gcube.portlets.user.workspace.client.model.FileModel;
|
||||||
|
|
||||||
import com.google.gwt.event.shared.GwtEvent;
|
import com.google.gwt.event.shared.GwtEvent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Class RefreshFolderEvent.
|
||||||
|
*
|
||||||
|
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
|
||||||
|
* Feb 1, 2019
|
||||||
|
*/
|
||||||
public class RefreshFolderEvent extends GwtEvent<RefreshItemEventHandler> implements GuiEventInterface {
|
public class RefreshFolderEvent extends GwtEvent<RefreshItemEventHandler> implements GuiEventInterface {
|
||||||
public static Type<RefreshItemEventHandler> TYPE = new Type<RefreshItemEventHandler>();
|
public static Type<RefreshItemEventHandler> TYPE = new Type<RefreshItemEventHandler>();
|
||||||
|
|
||||||
private FileModel folderTarget= null;
|
private FileModel folderTarget= null;
|
||||||
|
|
||||||
private boolean expandFolder = true; //DEFAULT EXPAND FOLDER
|
private boolean expandFolder = true; //DEFAULT EXPAND FOLDER
|
||||||
|
|
||||||
private boolean forceRefresh;
|
private boolean forceRefresh;
|
||||||
|
|
||||||
private boolean ifExists = false;
|
private boolean isCalledTreeSide = false;
|
||||||
|
|
||||||
private boolean forceReloadBreadCrumb = false;
|
private boolean forceReloadBreadCrumb = false;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Instantiates a new refresh folder event.
|
||||||
* @param folderTarget
|
*
|
||||||
* @param expandFolder - used to expand the folder into tree after refresh
|
* @param folderTarget the folder target
|
||||||
* @param forceRefresh - used to force refresh into grid
|
* @param expandFolder the expand folder
|
||||||
* @param ifExists - refresh only if items exists (into tree)
|
* @param forceRefresh the force refresh
|
||||||
|
* @param calledTreeSide the called tree side
|
||||||
*/
|
*/
|
||||||
public RefreshFolderEvent(FileModel folderTarget, boolean expandFolder, boolean forceRefresh, boolean ifExists) {
|
public RefreshFolderEvent(FileModel folderTarget, boolean expandFolder, boolean forceRefresh, boolean calledTreeSide) {
|
||||||
this.folderTarget = folderTarget;
|
this.folderTarget = folderTarget;
|
||||||
this.expandFolder = expandFolder;
|
this.expandFolder = expandFolder;
|
||||||
this.forceRefresh = forceRefresh;
|
this.forceRefresh = forceRefresh;
|
||||||
this.ifExists = ifExists;
|
this.isCalledTreeSide = calledTreeSide;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see com.google.gwt.event.shared.GwtEvent#getAssociatedType()
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Type<RefreshItemEventHandler> getAssociatedType() {
|
public Type<RefreshItemEventHandler> getAssociatedType() {
|
||||||
return TYPE;
|
return TYPE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see com.google.gwt.event.shared.GwtEvent#dispatch(com.google.gwt.event.shared.EventHandler)
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected void dispatch(RefreshItemEventHandler handler) {
|
protected void dispatch(RefreshItemEventHandler handler) {
|
||||||
handler.onRefreshItem(this);
|
handler.onRefreshItem(this);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the folder target.
|
||||||
|
*
|
||||||
|
* @return the folder target
|
||||||
|
*/
|
||||||
public FileModel getFolderTarget() {
|
public FileModel getFolderTarget() {
|
||||||
return folderTarget;
|
return folderTarget;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.gcube.portlets.user.workspace.client.interfaces.GuiEventInterface#getKey()
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public EventsTypeEnum getKey() {
|
public EventsTypeEnum getKey() {
|
||||||
return EventsTypeEnum.REFRESH_FOLDER;
|
return EventsTypeEnum.REFRESH_FOLDER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if is expand folder.
|
||||||
|
*
|
||||||
|
* @return true, if is expand folder
|
||||||
|
*/
|
||||||
public boolean isExpandFolder() {
|
public boolean isExpandFolder() {
|
||||||
return expandFolder;
|
return expandFolder;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the expand folder.
|
||||||
|
*
|
||||||
|
* @param expandFolder the new expand folder
|
||||||
|
*/
|
||||||
public void setExpandFolder(boolean expandFolder) {
|
public void setExpandFolder(boolean expandFolder) {
|
||||||
this.expandFolder = expandFolder;
|
this.expandFolder = expandFolder;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if is force refresh.
|
||||||
|
*
|
||||||
|
* @return true, if is force refresh
|
||||||
|
*/
|
||||||
public boolean isForceRefresh() {
|
public boolean isForceRefresh() {
|
||||||
return forceRefresh;
|
return forceRefresh;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the force refresh.
|
||||||
|
*
|
||||||
|
* @param forceRefresh the new force refresh
|
||||||
|
*/
|
||||||
public void setForceRefresh(boolean forceRefresh) {
|
public void setForceRefresh(boolean forceRefresh) {
|
||||||
this.forceRefresh = forceRefresh;
|
this.forceRefresh = forceRefresh;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public boolean isIfExists() {
|
/**
|
||||||
return ifExists;
|
* Checks if is called tree side.
|
||||||
|
*
|
||||||
|
* @return true, if is called tree side
|
||||||
|
*/
|
||||||
|
public boolean isCalledTreeSide() {
|
||||||
|
return isCalledTreeSide;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if is force reload bread crumb.
|
||||||
|
*
|
||||||
|
* @return true, if is force reload bread crumb
|
||||||
|
*/
|
||||||
public boolean isForceReloadBreadCrumb() {
|
public boolean isForceReloadBreadCrumb() {
|
||||||
return forceReloadBreadCrumb;
|
return forceReloadBreadCrumb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the force reload bread crumb.
|
||||||
|
*
|
||||||
|
* @param forceReloadBreadCrumb the new force reload bread crumb
|
||||||
|
*/
|
||||||
public void setForceReloadBreadCrumb(boolean forceReloadBreadCrumb) {
|
public void setForceReloadBreadCrumb(boolean forceReloadBreadCrumb) {
|
||||||
this.forceReloadBreadCrumb = forceReloadBreadCrumb;
|
this.forceReloadBreadCrumb = forceReloadBreadCrumb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see java.lang.Object#toString()
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
|
|
||||||
StringBuilder builder = new StringBuilder();
|
StringBuilder builder = new StringBuilder();
|
||||||
builder.append("RefreshFolderEvent [folderTarget=");
|
builder.append("RefreshFolderEvent [folderTarget=");
|
||||||
builder.append(folderTarget);
|
builder.append(folderTarget);
|
||||||
|
@ -98,12 +159,11 @@ public class RefreshFolderEvent extends GwtEvent<RefreshItemEventHandler> implem
|
||||||
builder.append(expandFolder);
|
builder.append(expandFolder);
|
||||||
builder.append(", forceRefresh=");
|
builder.append(", forceRefresh=");
|
||||||
builder.append(forceRefresh);
|
builder.append(forceRefresh);
|
||||||
builder.append(", ifExists=");
|
|
||||||
builder.append(ifExists);
|
|
||||||
builder.append(", forceReloadBreadCrumb=");
|
builder.append(", forceReloadBreadCrumb=");
|
||||||
builder.append(forceReloadBreadCrumb);
|
builder.append(forceReloadBreadCrumb);
|
||||||
builder.append("]");
|
builder.append("]");
|
||||||
return builder.toString();
|
return builder.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -314,7 +314,7 @@ public interface GWTWorkspaceService extends RemoteService{
|
||||||
* @return true, if successful
|
* @return true, if successful
|
||||||
* @throws Exception the exception
|
* @throws Exception the exception
|
||||||
*/
|
*/
|
||||||
boolean shareFolder(FileModel folder, List<InfoContactModel> listContacts,
|
FileModel shareFolder(FileModel folder, List<InfoContactModel> listContacts,
|
||||||
boolean isNewFolder, WorkspaceACL acl) throws Exception;
|
boolean isNewFolder, WorkspaceACL acl) throws Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -285,18 +285,9 @@ public interface GWTWorkspaceServiceAsync {
|
||||||
void getTimeSeriesById(String identifier,
|
void getTimeSeriesById(String identifier,
|
||||||
AsyncCallback<GWTWorkspaceItem> callback);
|
AsyncCallback<GWTWorkspaceItem> callback);
|
||||||
|
|
||||||
/**
|
void shareFolder(
|
||||||
* Share folder.
|
FileModel folder, List<InfoContactModel> listContacts,
|
||||||
*
|
boolean isNewFolder, WorkspaceACL acl, AsyncCallback<FileModel> callback);
|
||||||
* @param folder the folder
|
|
||||||
* @param listContacts the list contacts
|
|
||||||
* @param isNewFolder the is new folder
|
|
||||||
* @param acl the acl
|
|
||||||
* @param callback the callback
|
|
||||||
*/
|
|
||||||
void shareFolder(FileModel folder, List<InfoContactModel> listContacts,
|
|
||||||
boolean isNewFolder, WorkspaceACL acl,
|
|
||||||
AsyncCallback<Boolean> callback);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the list user shared by folder shared id.
|
* Gets the list user shared by folder shared id.
|
||||||
|
|
|
@ -454,8 +454,6 @@ public class DialogShareFolder extends Dialog {
|
||||||
multiDrag.addTargetContact(infoContactModel);
|
multiDrag.addTargetContact(infoContactModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
// multiDrag.addAlreadySharedContacts(suggestPanel.getSelectedUser());
|
|
||||||
|
|
||||||
multiDrag.addAlreadySharedContacts(listAlreadyShared);
|
multiDrag.addAlreadySharedContacts(listAlreadyShared);
|
||||||
|
|
||||||
multiDrag.getButtonById(Dialog.OK).addSelectionListener(new SelectionListener<ButtonEvent>() {
|
multiDrag.getButtonById(Dialog.OK).addSelectionListener(new SelectionListener<ButtonEvent>() {
|
||||||
|
|
|
@ -825,6 +825,7 @@ public class AsyncTreePanel extends LayoutContainer {
|
||||||
* @param expandFolder the expand folder
|
* @param expandFolder the expand folder
|
||||||
*/
|
*/
|
||||||
private void reloadTreeLevelAndExpandFolder(final FolderModel folder, final boolean expandFolder){
|
private void reloadTreeLevelAndExpandFolder(final FolderModel folder, final boolean expandFolder){
|
||||||
|
GWT.log("Calling Reload Tree Level and Exand folder: "+expandFolder +" for folder : "+folder.getName());
|
||||||
|
|
||||||
AppControllerExplorer.rpcWorkspaceService.getFolderChildren(folder, new AsyncCallback<List<FileModel>>(){
|
AppControllerExplorer.rpcWorkspaceService.getFolderChildren(folder, new AsyncCallback<List<FileModel>>(){
|
||||||
|
|
||||||
|
@ -843,6 +844,7 @@ public class AsyncTreePanel extends LayoutContainer {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(List<FileModel> result) {
|
public void onSuccess(List<FileModel> result) {
|
||||||
|
GWT.log("Refresh TREE with results: "+result);
|
||||||
treePanel.mask(ConstantsExplorer.VALIDATINGOPERATION,ConstantsExplorer.LOADINGSTYLE);
|
treePanel.mask(ConstantsExplorer.VALIDATINGOPERATION,ConstantsExplorer.LOADINGSTYLE);
|
||||||
store.removeAll(folder);
|
store.removeAll(folder);
|
||||||
// addChildrenToFolder(folder.getIdentifier(), result);
|
// addChildrenToFolder(folder.getIdentifier(), result);
|
||||||
|
|
|
@ -1119,10 +1119,6 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
|
||||||
try {
|
try {
|
||||||
|
|
||||||
Workspace workspace = getWorkspace();
|
Workspace workspace = getWorkspace();
|
||||||
// workspaceLogger.trace("######### SEND TO: ");
|
|
||||||
// workspaceLogger.trace("subject " + subject);
|
|
||||||
// workspaceLogger.trace("body " + body);
|
|
||||||
|
|
||||||
//DEBUG
|
//DEBUG
|
||||||
for(String contactId : listContactsId)
|
for(String contactId : listContactsId)
|
||||||
workspaceLogger.trace("contactId " + contactId);
|
workspaceLogger.trace("contactId " + contactId);
|
||||||
|
@ -1193,18 +1189,8 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.gcube.portlets.user.workspace.client.rpc.GWTWorkspaceService#shareFolder(org.gcube.portlets.user.workspace.client.model.FileModel, java.util.List, boolean, org.gcube.portlets.user.workspace.shared.WorkspaceACL)
|
* @see org.gcube.portlets.user.workspace.client.rpc.GWTWorkspaceService#shareFolder(org.gcube.portlets.user.workspace.client.model.FileModel, java.util.List, boolean, org.gcube.portlets.user.workspace.shared.WorkspaceACL)
|
||||||
*/
|
*/
|
||||||
/**
|
|
||||||
* Share folder.
|
|
||||||
*
|
|
||||||
* @param folder the folder
|
|
||||||
* @param listContacts the list contacts
|
|
||||||
* @param isNewFolder the is new folder
|
|
||||||
* @param acl the acl
|
|
||||||
* @return true, if successful
|
|
||||||
* @throws Exception the exception
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public boolean shareFolder(FileModel folder, List<InfoContactModel> listContacts, boolean isNewFolder, WorkspaceACL acl) throws Exception {
|
public FileModel shareFolder(FileModel folder, List<InfoContactModel> listContacts, boolean isNewFolder, WorkspaceACL acl) throws Exception {
|
||||||
|
|
||||||
if(isSessionExpired())
|
if(isSessionExpired())
|
||||||
throw new SessionExpiredException();
|
throw new SessionExpiredException();
|
||||||
|
@ -1227,7 +1213,6 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
|
||||||
List<InfoContactModel> listSharedContact = null;
|
List<InfoContactModel> listSharedContact = null;
|
||||||
|
|
||||||
boolean sourceFolderIsShared = folder.isShared();
|
boolean sourceFolderIsShared = folder.isShared();
|
||||||
|
|
||||||
if(sourceFolderIsShared){ //if source folder is already share... retrieve old list of sharing to notify
|
if(sourceFolderIsShared){ //if source folder is already share... retrieve old list of sharing to notify
|
||||||
listSharedContact = getListUserSharedByFolderSharedId(folder.getIdentifier());
|
listSharedContact = getListUserSharedByFolderSharedId(folder.getIdentifier());
|
||||||
}
|
}
|
||||||
|
@ -1271,7 +1256,15 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
|
||||||
if(acl!=null)
|
if(acl!=null)
|
||||||
setACLs(sharedFolder.getId(), listLogin, acl.getId().toString());
|
setACLs(sharedFolder.getId(), listLogin, acl.getId().toString());
|
||||||
|
|
||||||
|
FileModel theSharedFolder = null;
|
||||||
|
|
||||||
if(created){
|
if(created){
|
||||||
|
|
||||||
|
GWTWorkspaceBuilder builder = getGWTWorkspaceBuilder();
|
||||||
|
WorkspaceFolder parent = sharedFolder.getParent();
|
||||||
|
FileModel theParent = builder.buildGXTFileModelItem(parent, null);
|
||||||
|
theSharedFolder = builder.buildGXTFileModelItem(sharedFolder, theParent);
|
||||||
|
|
||||||
NotificationsProducer np = getNotificationProducer();
|
NotificationsProducer np = getNotificationProducer();
|
||||||
if(!sourceFolderIsShared) //if source folder is not already shared
|
if(!sourceFolderIsShared) //if source folder is not already shared
|
||||||
np.notifyFolderSharing(listContacts, sharedFolder);
|
np.notifyFolderSharing(listContacts, sharedFolder);
|
||||||
|
@ -1281,7 +1274,8 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return created;
|
|
||||||
|
return theSharedFolder;
|
||||||
|
|
||||||
}catch (WorkspaceFolderLocked e1){
|
}catch (WorkspaceFolderLocked e1){
|
||||||
throw new Exception(e1.getMessage());
|
throw new Exception(e1.getMessage());
|
||||||
|
@ -3599,7 +3593,7 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
|
||||||
if(folder == null)
|
if(folder == null)
|
||||||
throw new Exception("Folder is null");
|
throw new Exception("Folder is null");
|
||||||
|
|
||||||
workspaceLogger.trace("getting workspace");
|
workspaceLogger.trace("Getting Workspace from SHUB");
|
||||||
shWorkspace = getWorkspaceFromStorageHub();
|
shWorkspace = getWorkspaceFromStorageHub();
|
||||||
//org.gcube.common.storagehubwrapper.shared.tohl.WorkspaceItem wsItem = workspace.getItem(folder.getIdentifier()); //removed for optimization
|
//org.gcube.common.storagehubwrapper.shared.tohl.WorkspaceItem wsItem = workspace.getItem(folder.getIdentifier()); //removed for optimization
|
||||||
|
|
||||||
|
@ -3609,6 +3603,10 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
|
||||||
List<? extends org.gcube.common.storagehubwrapper.shared.tohl.WorkspaceItem> children =
|
List<? extends org.gcube.common.storagehubwrapper.shared.tohl.WorkspaceItem> children =
|
||||||
shWorkspace.getFilteredChildren(folder.getIdentifier(),org.gcube.common.storagehub.model.items.FolderItem.class);
|
shWorkspace.getFilteredChildren(folder.getIdentifier(),org.gcube.common.storagehub.model.items.FolderItem.class);
|
||||||
|
|
||||||
|
for (org.gcube.common.storagehubwrapper.shared.tohl.WorkspaceItem workspaceItem : children) {
|
||||||
|
workspaceLogger.trace("The ITEM: "+workspaceItem.getName() + ", is shared: "+workspaceItem.isShared() + ", is folder: "+workspaceItem.isFolder() +" the id: "+workspaceItem.getId());
|
||||||
|
}
|
||||||
|
|
||||||
StorageHubToWorkpaceConverter converter = getStorageHubToWorkpaceConverter();
|
StorageHubToWorkpaceConverter converter = getStorageHubToWorkpaceConverter();
|
||||||
List<FileModel> listFileModels = new ArrayList<FileModel>(children.size());
|
List<FileModel> listFileModels = new ArrayList<FileModel>(children.size());
|
||||||
|
|
||||||
|
@ -3655,6 +3653,11 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
|
||||||
for (FileModel fileModel : listFileModels) {
|
for (FileModel fileModel : listFileModels) {
|
||||||
System.out.println(i++ +")"+fileModel);
|
System.out.println(i++ +")"+fileModel);
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
|
// if(!WsUtil.isWithinPortal()){
|
||||||
|
// workspaceLogger.trace("Sleeping 4 sec...");
|
||||||
|
// Thread.sleep(4000);
|
||||||
|
// }
|
||||||
return listFileModels;
|
return listFileModels;
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
Loading…
Reference in New Issue