Managed case of overwrite
git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace@119832 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
3606011470
commit
654b15f70d
|
@ -104,7 +104,6 @@ import org.gcube.portlets.user.workspace.client.view.windows.DialogConfirm;
|
||||||
import org.gcube.portlets.user.workspace.client.view.windows.DialogGetInfo;
|
import org.gcube.portlets.user.workspace.client.view.windows.DialogGetInfo;
|
||||||
import org.gcube.portlets.user.workspace.client.view.windows.InfoDisplay;
|
import org.gcube.portlets.user.workspace.client.view.windows.InfoDisplay;
|
||||||
import org.gcube.portlets.user.workspace.client.view.windows.MessageBoxAlert;
|
import org.gcube.portlets.user.workspace.client.view.windows.MessageBoxAlert;
|
||||||
import org.gcube.portlets.user.workspace.client.view.windows.MessageBoxConfirm;
|
|
||||||
import org.gcube.portlets.user.workspace.shared.ExtendedWorkspaceACL;
|
import org.gcube.portlets.user.workspace.shared.ExtendedWorkspaceACL;
|
||||||
import org.gcube.portlets.user.workspace.shared.SessionExpiredException;
|
import org.gcube.portlets.user.workspace.shared.SessionExpiredException;
|
||||||
import org.gcube.portlets.user.workspace.shared.TrashContent;
|
import org.gcube.portlets.user.workspace.shared.TrashContent;
|
||||||
|
@ -114,9 +113,6 @@ import org.gcube.portlets.user.workspace.shared.WorkspaceUserQuote;
|
||||||
import org.gcube.portlets.widgets.sessionchecker.client.CheckSession;
|
import org.gcube.portlets.widgets.sessionchecker.client.CheckSession;
|
||||||
import org.gcube.portlets.widgets.wsmail.client.forms.MailForm;
|
import org.gcube.portlets.widgets.wsmail.client.forms.MailForm;
|
||||||
|
|
||||||
import com.extjs.gxt.ui.client.event.Listener;
|
|
||||||
import com.extjs.gxt.ui.client.event.MessageBoxEvent;
|
|
||||||
import com.extjs.gxt.ui.client.widget.Dialog;
|
|
||||||
import com.extjs.gxt.ui.client.widget.LayoutContainer;
|
import com.extjs.gxt.ui.client.widget.LayoutContainer;
|
||||||
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
|
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
|
||||||
import com.google.gwt.core.client.GWT;
|
import com.google.gwt.core.client.GWT;
|
||||||
|
@ -1392,7 +1388,10 @@ public class AppController implements SubscriberInterface {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Following methods implements SubscriberInterface
|
* Following methods implements SubscriberInterface.
|
||||||
|
*
|
||||||
|
* @param itemIdentifier the item identifier
|
||||||
|
* @param parent the parent
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1400,8 +1399,11 @@ public class AppController implements SubscriberInterface {
|
||||||
updateStoreByRpc(parent);
|
updateStoreByRpc(parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.gcube.portlets.user.workspace.client.interfaces.SubscriberInterface#addedFile(java.lang.String, java.lang.String, org.gcube.portlets.user.workspace.client.ConstantsExplorer.WS_UPLOAD_TYPE, boolean)
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void addedFile(String itemIdentifier, String parentId, WS_UPLOAD_TYPE uploadType) {
|
public void addedFile(String itemIdentifier, String parentId, WS_UPLOAD_TYPE uploadType, boolean isOverwrite) {
|
||||||
// updateStoreByRpc(parent);
|
// updateStoreByRpc(parent);
|
||||||
if(parentId==null){
|
if(parentId==null){
|
||||||
GWT.log("addedFile skipping, parentId is null");
|
GWT.log("addedFile skipping, parentId is null");
|
||||||
|
@ -1413,7 +1415,8 @@ public class AppController implements SubscriberInterface {
|
||||||
|
|
||||||
if(uploadType.equals(WS_UPLOAD_TYPE.File)){
|
if(uploadType.equals(WS_UPLOAD_TYPE.File)){
|
||||||
GWT.log("Calling addFileToStoreById "+parentId);
|
GWT.log("Calling addFileToStoreById "+parentId);
|
||||||
addFileToStoreById(itemIdentifier, parentId);
|
//IF IS OVERWRITE DELETE BEFORE THE ITEM FORM STORE
|
||||||
|
addFileToStoreById(itemIdentifier, parentId, isOverwrite);
|
||||||
}else{ //is ARCHIVE
|
}else{ //is ARCHIVE
|
||||||
updateStoreByRpc(wsPortlet.getToolBarPath().getLastParent());
|
updateStoreByRpc(wsPortlet.getToolBarPath().getLastParent());
|
||||||
}
|
}
|
||||||
|
@ -1432,7 +1435,15 @@ public class AppController implements SubscriberInterface {
|
||||||
return ((breadParent!=null) && (parentId!=null) && (breadParent.getIdentifier().compareTo(parentId)==0));
|
return ((breadParent!=null) && (parentId!=null) && (breadParent.getIdentifier().compareTo(parentId)==0));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addFileToStoreById(String itemIdentifier, String parentId){
|
|
||||||
|
/**
|
||||||
|
* Adds the file to store by id.
|
||||||
|
*
|
||||||
|
* @param itemIdentifier the item identifier
|
||||||
|
* @param parentId the parent id
|
||||||
|
* @param deleteCurrentItem the delete current item from store
|
||||||
|
*/
|
||||||
|
private void addFileToStoreById(final String itemIdentifier, String parentId, final boolean deleteCurrentItem){
|
||||||
|
|
||||||
appContrExplorer.getRpcWorkspaceService().getItemForFileGrid(itemIdentifier, new AsyncCallback<FileGridModel>() {
|
appContrExplorer.getRpcWorkspaceService().getItemForFileGrid(itemIdentifier, new AsyncCallback<FileGridModel>() {
|
||||||
|
|
||||||
|
@ -1443,6 +1454,10 @@ public class AppController implements SubscriberInterface {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(FileGridModel result) {
|
public void onSuccess(FileGridModel result) {
|
||||||
|
|
||||||
|
if(deleteCurrentItem)
|
||||||
|
wsPortlet.getGridGroupContainer().deleteItem(itemIdentifier);
|
||||||
|
|
||||||
wsPortlet.getGridGroupContainer().addToStore(result);
|
wsPortlet.getGridGroupContainer().addToStore(result);
|
||||||
// wsPortlet.getGridGroupContainer().unmask();
|
// wsPortlet.getGridGroupContainer().unmask();
|
||||||
}
|
}
|
||||||
|
|
|
@ -557,7 +557,6 @@ public class GxtGridFilterGroupPanel extends LayoutContainer {
|
||||||
}
|
}
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue