Working on move

updated pom versiona at 6.20

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace@171940 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2018-10-04 15:31:58 +00:00
parent 72922d053a
commit 4aff700bf6
4 changed files with 33 additions and 109 deletions

View File

@ -1,11 +1,17 @@
<ReleaseNotes>
<Changeset component="org.gcube.portlets-user.workspace-portlet.6-20-0"
date="${buildDate}">
<Change>Task #12604: Migrate Move operation to StorageHub
</Change>
</Changeset>
<Changeset component="org.gcube.portlets-user.workspace-portlet.6-19-1"
date="2018-07-02">
<Change>Revised Style sheet and updated to common set of icons
</Change>
<Change>[Task #12089] Migrate to workspace-uploader 2.0
</Change>
<Change>[Release #12006] Removed portlets-widgets.wsmail-widget dependency
<Change>[Release #12006] Removed portlets-widgets.wsmail-widget
dependency
</Change>
</Changeset>
<Changeset component="org.gcube.portlets-user.workspace-portlet.6-19-0"

View File

@ -11,7 +11,7 @@
<groupId>org.gcube.portlets.user</groupId>
<artifactId>workspace</artifactId>
<packaging>war</packaging>
<version>6.19.1-SNAPSHOT</version>
<version>6.20.0-SNAPSHOT</version>
<name>gCube Workspace Portlet</name>
<description>
gCube Workspace Portlet is a web-gui to manage the gCube workspace a collaborative area where users can exchange and organize information objects (workspace items) according to their specific needs.

View File

@ -57,13 +57,13 @@ import org.gcube.portlets.user.workspace.client.event.LoadAllScopeEvent;
import org.gcube.portlets.user.workspace.client.event.LoadAllScopeEventHandler;
import org.gcube.portlets.user.workspace.client.event.LoadBreadcrumbEvent;
import org.gcube.portlets.user.workspace.client.event.LoadBreadcrumbEventHandler;
import org.gcube.portlets.user.workspace.client.event.MoveItemsEvent;
import org.gcube.portlets.user.workspace.client.event.MoveItemsEventHandler;
import org.gcube.portlets.user.workspace.client.event.OpenContextMenuTreeEvent;
import org.gcube.portlets.user.workspace.client.event.OpenContextMenuTreeEventHandler;
import org.gcube.portlets.user.workspace.client.event.OpenReportsEvent;
import org.gcube.portlets.user.workspace.client.event.OpenReportsEventHandler;
import org.gcube.portlets.user.workspace.client.event.OpenUrlEvent;
import org.gcube.portlets.user.workspace.client.event.PasteItemEvent;
import org.gcube.portlets.user.workspace.client.event.PasteItemEventHandler;
import org.gcube.portlets.user.workspace.client.event.PathElementSelectedEvent;
import org.gcube.portlets.user.workspace.client.event.PathElementSelectedEventHandler;
import org.gcube.portlets.user.workspace.client.event.RefreshFolderEvent;
@ -189,7 +189,7 @@ public class AppController implements SubscriberInterface {
EventsTypeEnum.REPLY_FORWARD_MESSAGE,
EventsTypeEnum.FILE_DOWNLAD_EVENT,
EventsTypeEnum.SESSION_EXPIRED,
EventsTypeEnum.PASTED_EVENT,
EventsTypeEnum.MOVED_EVENT,
EventsTypeEnum.COPY_EVENT,
EventsTypeEnum.TRASH_EVENT,
EventsTypeEnum.UPDATE_WORKSPACE_SIZE,
@ -298,11 +298,11 @@ public class AppController implements SubscriberInterface {
});
//PASTE EVENT
eventBus.addHandler(PasteItemEvent.TYPE, new PasteItemEventHandler() {
eventBus.addHandler(MoveItemsEvent.TYPE, new MoveItemsEventHandler() {
@Override
public void onCutCopyAndPaste(PasteItemEvent pasteItemEvent) {
public void onMoveItems(MoveItemsEvent pasteItemEvent) {
String folderDestinationId = null;
if(pasteItemEvent.getFolderDestinationId()!=null){ //IF FOLDER DESTINATION EXISTS
@ -320,7 +320,7 @@ public class AppController implements SubscriberInterface {
if(folderDestinationId!=null){
// Info.display("Info", "pasting...");
AppControllerExplorer.getEventBus().fireEvent(new PasteItemEvent(pasteItemEvent.getIds(), folderDestinationId, pasteItemEvent.getOperationType()));
AppControllerExplorer.getEventBus().fireEvent(new MoveItemsEvent(pasteItemEvent.getIds(), folderDestinationId));
}
}
});
@ -743,7 +743,7 @@ public class AppController implements SubscriberInterface {
private void doPathElementSelected(PathElementSelectedEvent event) {
// appContrExplorer.selectItemInTree(event.getSourceFile().getIdentifier());
//appContrExplorer.expandFolder(event.getSourceFile().getIdentifier()); //removed tree sync
updatGridViewForSelectedItem(event.getSourceFile());
updatGridViewForSelectedItem(event.getSourceFile());
loadBreadcrumbByFileModel(event.getSourceFile(), true);
}
@ -1967,7 +1967,7 @@ public class AppController implements SubscriberInterface {
}
}
// Info.display("Info", "paste submitting...");
wsPortlet.getGxtCardLayoutResultPanel().getToolBarItemFunctionalities().activePasteButton(false);
//wsPortlet.getGxtCardLayoutResultPanel().getToolBarItemFunctionalities().activePasteButton(false);
}
@ -1977,7 +1977,7 @@ public class AppController implements SubscriberInterface {
*/
@Override
public void copyEventIsCompleted() {
wsPortlet.getGxtCardLayoutResultPanel().getToolBarItemFunctionalities().activePasteButton(true);
//wsPortlet.getGxtCardLayoutResultPanel().getToolBarItemFunctionalities().activePasteButton(true);
}

View File

@ -17,7 +17,6 @@ import org.gcube.portlets.user.workspace.client.event.GetPublicLinkEvent;
import org.gcube.portlets.user.workspace.client.event.GetShareLinkEvent;
import org.gcube.portlets.user.workspace.client.event.GridRefreshEvent;
import org.gcube.portlets.user.workspace.client.event.ImagePreviewEvent;
import org.gcube.portlets.user.workspace.client.event.PasteItemEvent;
import org.gcube.portlets.user.workspace.client.event.RenameItemEvent;
import org.gcube.portlets.user.workspace.client.event.ShowUrlEvent;
import org.gcube.portlets.user.workspace.client.event.VREChangePermissionsEvent;
@ -28,8 +27,6 @@ import org.gcube.portlets.user.workspace.client.model.FileGridModel;
import org.gcube.portlets.user.workspace.client.model.FileModel;
import org.gcube.portlets.user.workspace.client.resources.Resources;
import org.gcube.portlets.user.workspace.client.view.grids.GxtGridFilterGroupPanel;
import org.gcube.portlets.user.workspace.client.view.tree.CutCopyAndPaste;
import org.gcube.portlets.user.workspace.client.view.tree.CutCopyAndPaste.OperationType;
import com.extjs.gxt.ui.client.Style.ButtonArrowAlign;
import com.extjs.gxt.ui.client.Style.ButtonScale;
@ -70,8 +67,8 @@ public class GxtToolBarItemFunctionality {
private Button btnGetSharedLink;
private Button btnPublicLink;
private Button btnFolderLink;
private Button btnCopyItem;
private Button btnPasteItem;
private Button btnMoveItem;
//private Button btnPasteItem;
private Button btnCutItem;
private Button btnSetPermission;
private GxtBreadcrumbPathPanel breadcrumbPanel;
@ -88,7 +85,7 @@ public class GxtToolBarItemFunctionality {
* Instantiates a new gxt tool bar item functionality.
*
* @param gridFilterGroupContainer the grid filter group container
* @param breadcrumbPanel
* @param breadcrumbPanel
*/
public GxtToolBarItemFunctionality(GxtGridFilterGroupPanel gridFilterGroupContainer, GxtBreadcrumbPathPanel breadcrumbPanel) {
this();
@ -195,12 +192,12 @@ public class GxtToolBarItemFunctionality {
btnFolderLink.setArrowAlign(ButtonArrowAlign.BOTTOM);
toolBar.add(btnFolderLink);
//COPY
btnCopyItem = new Button("Copy", Resources.getIconCopy());
btnCopyItem.setScale(ButtonScale.SMALL);
btnCopyItem.setIconAlign(IconAlign.TOP);
toolBar.add(btnCopyItem);
btnMoveItem = new Button("Move", Resources.getIconCopy());
btnMoveItem.setScale(ButtonScale.SMALL);
btnMoveItem.setIconAlign(IconAlign.TOP);
toolBar.add(btnMoveItem);
//CUT
@ -209,14 +206,6 @@ public class GxtToolBarItemFunctionality {
btnCutItem.setIconAlign(IconAlign.TOP);
// toolBar.add(btnCutItem);
//PASTE
btnPasteItem = new Button("Paste", Resources.getIconPaste());
btnPasteItem.setScale(ButtonScale.SMALL);
btnPasteItem.setIconAlign(IconAlign.TOP);
btnPasteItem.setEnabled(false); //BY DEFAULT IS DISABLED
toolBar.add(btnPasteItem);
toolBar.add(new SeparatorToolItem());
btnAccessFromDesktop = new Button(ConstantsPortlet.TITLEACCESSWEBDAV, Resources.getIconWebDav());
@ -334,21 +323,13 @@ public class GxtToolBarItemFunctionality {
btnCopyItem.addSelectionListener(new SelectionListener<ButtonEvent>() {
btnMoveItem.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
List<String> listTarget = gridGroupViewContainer.getIdsSelectedItems();
if(listTarget!=null && listTarget.size()>0){
CutCopyAndPaste.copy(listTarget, OperationType.COPY);
btnPasteItem.setEnabled(true);
}
// final FileGridModel fileGridModel = gridGroupViewContainer.getSelectedItem();
//
// if(fileGridModel.getIdentifier()!=null){
// CopyAndPaste.copy(fileGridModel.getIdentifier());
// btnPasteItem.setEnabled(true);
// }
}
}
});
@ -359,52 +340,8 @@ public class GxtToolBarItemFunctionality {
List<String> listTarget = gridGroupViewContainer.getIdsSelectedItems();
if(listTarget!=null && listTarget.size()>0){
CutCopyAndPaste.copy(listTarget, OperationType.CUT);
btnPasteItem.setEnabled(true);
}
// final FileGridModel fileGridModel = gridGroupViewContainer.getSelectedItem();
//
// if(fileGridModel.getIdentifier()!=null){
// CopyAndPaste.copy(fileGridModel.getIdentifier());
// btnPasteItem.setEnabled(true);
// }
}
});
btnPasteItem.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
final FileGridModel fileGridModel = gridGroupViewContainer.getSelectedItem();
FileModel parentTarget = getParentDirectory(fileGridModel);
if(parentTarget==null) {
parentTarget = breadcrumbPanel.getLastParent();
GWT.log("Target is breadcrumb folder: "+parentTarget);
}
// if(fileGridModel.isDirectory()){
// GWT.log("Forcing internal pasting..");
// parentTarget = fileGridModel;
// }
String parentId = null;
if(parentTarget!=null)
parentId=parentTarget.getIdentifier();
PasteItemEvent event = new PasteItemEvent(CutCopyAndPaste.getCopiedIdsFilesModel(), parentId, CutCopyAndPaste.getOperationType());
if(event.getOperationType().equals(OperationType.CUT))
event.setFolderSourceId(null);
AppController.getEventBus().fireEvent(event);
CutCopyAndPaste.setCopiedIdsFileModels(null);
CutCopyAndPaste.setOperationType(null);
btnPasteItem.setEnabled(false);
}
});
@ -726,10 +663,6 @@ public class GxtToolBarItemFunctionality {
else
activeButtonForSharing(false);
//IF TARGET IS NOT NULL AND AN ITEM IS COPIED, PASTE IS ENABLING
if(CutCopyAndPaste.getCopiedIdsFilesModel()!=null){
this.btnPasteItem.enable();
}
}
//TARGET (SELECTED ITEM) CAN BE NULL, HIS PARENT IS NOT NULL ACTIVING BUTTONS
@ -773,14 +706,14 @@ public class GxtToolBarItemFunctionality {
this.btnRenameItem.disable();
this.btnDownloadFile.disable();
this.btnOpen.disable();
this.btnCopyItem.disable();
this.btnMoveItem.disable();
this.btnCutItem.disable();
} else {
this.btnRemoveItem.enable();
this.btnRenameItem.enable();
this.btnDownloadFile.enable();
this.btnOpen.enable();
this.btnCopyItem.enable();
this.btnMoveItem.enable();
this.btnCutItem.enable();
}
@ -830,7 +763,7 @@ public class GxtToolBarItemFunctionality {
//ONLY ENABLED
this.btnRemoveItem.setEnabled(active);
this.btnCopyItem.setEnabled(active);
this.btnMoveItem.setEnabled(active);
this.btnCutItem.setEnabled(active);
}
@ -852,25 +785,14 @@ public class GxtToolBarItemFunctionality {
btnRefreshFolder.setEnabled(!b);
}
/**
* Active paste button.
*
* @param b the b
*/
public void activePasteButton(boolean b){
btnPasteItem.setEnabled(b);
}
/**
* Disable button special folder selected.
*/
public void disableButtonSpecialFolderSelected(){
this.btnPasteItem.disable();
this.btnCopyItem.disable();
this.btnMoveItem.disable();
this.btnAddFolder.disable();
this.btnUploadArchive.disable();
this.btnUploadFile.disable();
this.btnPasteItem.disable();
this.btnDownloadFile.disable();
this.btnRemoveItem.disable();
this.btnRenameItem.disable();
@ -884,12 +806,8 @@ public class GxtToolBarItemFunctionality {
public void enableButtonForActiveBreadcrumb(FileModel parent){
if(parent!=null){
//IF TARGET IS NOT NULL AND AN ITEM IS COPIED, PASTE IS ENABLING
if(CutCopyAndPaste.getCopiedIdsFilesModel()!=null){
this.btnPasteItem.enable();
}
this.btnCopyItem.enable();
this.btnMoveItem.enable();
this.btnAddFolder.enable();
this.btnUploadArchive.enable();
this.btnUploadFile.enable();