Updated pom version at 6.14.0

Added "Get Folder Link" facility

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace@131336 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2016-09-14 10:20:44 +00:00
parent d100558011
commit 6e50d631b2
9 changed files with 389 additions and 159 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/workspace-6.13.0-SNAPSHOT/WEB-INF/classes" path="src/main/java">
<classpathentry kind="src" output="target/workspace-6.13.1-SNAPSHOT/WEB-INF/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
@ -26,5 +26,5 @@
</attributes>
</classpathentry>
<classpathentry kind="con" path="com.google.gwt.eclipse.core.GWT_CONTAINER"/>
<classpathentry kind="output" path="target/workspace-6.13.0-SNAPSHOT/WEB-INF/classes"/>
<classpathentry kind="output" path="target/workspace-6.13.1-SNAPSHOT/WEB-INF/classes"/>
</classpath>

View File

@ -5,6 +5,9 @@
<wb-resource deploy-path="/WEB-INF/classes" source-path="/target/generated-sources/gwt"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
<dependent-module archiveName="workspace-tree-widget-6.14.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/workspace-tree-widget-TRUNK/workspace-tree-widget-TRUNK">
<dependency-type>uses</dependency-type>
</dependent-module>
<property name="java-output-path" value="/${module}/target/www/WEB-INF/classes"/>
<property name="context-root" value="workspace"/>

24
pom.xml
View File

@ -11,7 +11,7 @@
<groupId>org.gcube.portlets.user</groupId>
<artifactId>workspace</artifactId>
<packaging>war</packaging>
<version>6.13.0-SNAPSHOT</version>
<version>6.14.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.
@ -143,16 +143,29 @@
<scope>compile</scope>
</dependency>
<!-- HOME LIBRARY -->
<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>home-library-model</artifactId>
<version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>home-library-jcr</artifactId>
<version>[2.5.0-SNAPSHOT,3.5.0-SNAPSHOT)</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<artifactId>asm-debug-all</artifactId>
<groupId>org.ow2.asm</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>home-library</artifactId>
<version>[2.5.0-SNAPSHOT,3.0.0-SNAPSHOT)</version>
<scope>provided</scope>
<exclusions>
<exclusion>
@ -161,12 +174,7 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>home-library-jcr</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.liferay.portal</groupId>
<artifactId>portal-service</artifactId>

View File

@ -34,6 +34,7 @@ import org.gcube.portlets.user.workspace.client.event.FileDownloadEventHandler;
import org.gcube.portlets.user.workspace.client.event.FileUploadEvent;
import org.gcube.portlets.user.workspace.client.event.FileUploadEventHandler;
import org.gcube.portlets.user.workspace.client.event.FilterScopeEvent;
import org.gcube.portlets.user.workspace.client.event.GetFolderLinkEvent;
import org.gcube.portlets.user.workspace.client.event.GetInfoEvent;
import org.gcube.portlets.user.workspace.client.event.GetInfoEventHandler;
import org.gcube.portlets.user.workspace.client.event.GetPublicLinkEvent;
@ -86,6 +87,8 @@ import org.gcube.portlets.user.workspace.client.event.VREChangePermissionsEventH
import org.gcube.portlets.user.workspace.client.event.VRESettingPermissionEvent;
import org.gcube.portlets.user.workspace.client.event.WebDavUrlEvent;
import org.gcube.portlets.user.workspace.client.event.WebDavUrlEventHandler;
import org.gcube.portlets.user.workspace.client.event.WsGetFolderLinkEvent;
import org.gcube.portlets.user.workspace.client.event.WsGetFolderLinkEventHandler;
import org.gcube.portlets.user.workspace.client.interfaces.EventsTypeEnum;
import org.gcube.portlets.user.workspace.client.interfaces.GXTFolderItemTypeEnum;
import org.gcube.portlets.user.workspace.client.interfaces.SubscriberInterface;
@ -134,11 +137,12 @@ import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HasWidgets;
/**
* The Class AppController.
*
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
* Dec 14, 2015
* Sep 13, 2016
*/
public class AppController implements SubscriberInterface {
private final static HandlerManager eventBus = new HandlerManager(null);
@ -211,6 +215,16 @@ public class AppController implements SubscriberInterface {
}
});
eventBus.addHandler(WsGetFolderLinkEvent.TYPE, new WsGetFolderLinkEventHandler() {
@Override
public void onGetFolderLink(WsGetFolderLinkEvent getFolderLinkEvent) {
AppControllerExplorer.getEventBus().fireEvent(new GetFolderLinkEvent(getFolderLinkEvent.getSourceFile()));
}
});
eventBus.addHandler(UpdateWorkspaceSizeEvent.TYPE, new UpdateWorkspaceSizeEventHandler() {
@Override

View File

@ -0,0 +1,54 @@
package org.gcube.portlets.user.workspace.client.event;
import org.gcube.portlets.user.workspace.client.model.FileModel;
import com.google.gwt.event.shared.GwtEvent;
/**
* The Class WsGetFolderLinkEvent.
*
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
* Sep 13, 2016
*/
public class WsGetFolderLinkEvent extends GwtEvent<WsGetFolderLinkEventHandler> {
public static Type<WsGetFolderLinkEventHandler> TYPE = new Type<WsGetFolderLinkEventHandler>();
private FileModel targetFile = null;
/**
* Instantiates a new gets the folder link event.
*
* @param target the target
*/
public WsGetFolderLinkEvent(FileModel target) {
this.targetFile = target;
}
/* (non-Javadoc)
* @see com.google.gwt.event.shared.GwtEvent#getAssociatedType()
*/
@Override
public Type<WsGetFolderLinkEventHandler> getAssociatedType() {
return TYPE;
}
/* (non-Javadoc)
* @see com.google.gwt.event.shared.GwtEvent#dispatch(com.google.gwt.event.shared.EventHandler)
*/
@Override
protected void dispatch(WsGetFolderLinkEventHandler handler) {
handler.onGetFolderLink(this);
}
/**
* Gets the source file.
*
* @return the source file
*/
public FileModel getSourceFile() {
return targetFile;
}
}

View File

@ -0,0 +1,20 @@
package org.gcube.portlets.user.workspace.client.event;
import com.google.gwt.event.shared.EventHandler;
/**
* The Interface GetFolderLinkEventHandler.
*
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
* Sep 13, 2016
*/
public interface WsGetFolderLinkEventHandler extends EventHandler {
/**
* On get folder link.
*
* @param getFolderLinkEvent the get folder link event
*/
void onGetFolderLink(WsGetFolderLinkEvent getFolderLinkEvent);
}

View File

@ -69,6 +69,10 @@ public class WorkspaceFeaturesView extends Composite {
private Popover overPlk = new Popover();
@UiField
Label flk; //PUBLIC LINK
private Popover overFolderlk = new Popover();
@UiField
FlowPanel fp1;
@ -129,8 +133,10 @@ public class WorkspaceFeaturesView extends Composite {
ck_features_show_again.addStyleName("margin-right-10");
shf.addStyleName("margin-right-10");
upl.addStyleName("margin-right-10");
flk.addStyleName("margin-right-10");
plk.addStyleName("margin-right-10");
initPopupShareFeature();
initPopupFlkFeature();
initPopupUploadFeature();
initPopupPlkFeature();
@ -159,6 +165,23 @@ public class WorkspaceFeaturesView extends Composite {
});
}
/**
*
*/
private void initPopupFlkFeature() {
overFolderlk.setAnimation(false);
overFolderlk.setWidget(flk);
overFolderlk.setHeading("Workspace Folder Link");
String icon = "<span style=\"margin-right:5px\">"+Resources.getIconFolderLink().getSafeHtml().asString()+"</span>";
overFolderlk.setText(icon+"The owner or administrator can use the Folder Link in order to allow 'guest' users to view contents of a folder (and its sub-folders)" +
"The 'guest' user can only access in read-only mode and download files of the folder (and its subfolders). You can send the Folder Link to anyone by pasting it into Workspace Message, your emails, instant messages, etc.");
overFolderlk.setHtml(true);
overFolderlk.setPlacement(Placement.BOTTOM);
overFolderlk.setTrigger(Trigger.HOVER);
overFolderlk.reconfigure();
}
/**
* Inits the popup share feature.
*/

View File

@ -29,6 +29,7 @@
verticalAlignment="middle">
<b:Label ui:field="shf" text="Share"></b:Label>
<b:Label ui:field="flk" text="Folder Link"></b:Label>
<b:Label ui:field="plk" text="Public Link"></b:Label>
<b:Label ui:field="upl" text="Upload"></b:Label>
<!-- <b:Label ui:field="upa" text="Upload Archive"></b:Label> -->

View File

@ -13,6 +13,7 @@ import org.gcube.portlets.user.workspace.client.event.DoubleClickElementSelected
import org.gcube.portlets.user.workspace.client.event.FileDownloadEvent;
import org.gcube.portlets.user.workspace.client.event.FileDownloadEvent.DownloadType;
import org.gcube.portlets.user.workspace.client.event.FileUploadEvent;
import org.gcube.portlets.user.workspace.client.event.WsGetFolderLinkEvent;
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;
@ -39,10 +40,12 @@ import com.extjs.gxt.ui.client.widget.button.Button;
import com.extjs.gxt.ui.client.widget.button.ToggleButton;
import com.extjs.gxt.ui.client.widget.toolbar.SeparatorToolItem;
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
import com.google.gwt.core.shared.GWT;
/**
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
* The Class GxtToolBarItemFunctionality.
*
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
*/
public class GxtToolBarItemFunctionality {
@ -66,40 +69,52 @@ public class GxtToolBarItemFunctionality {
// private Button btnGetInfo;
private Button btnGetSharedLink;
private Button btnPublicLink;
private Button btnFolderLink;
private Button btnCopyItem;
private Button btnPasteItem;
private Button btnCutItem;
private Button btnSetPermission;
/**
* Instantiates a new gxt tool bar item functionality.
*/
public GxtToolBarItemFunctionality() {
initToolBar();
addSelectionListenersOnToolBar();
}
/**
* Instantiates a new gxt tool bar item functionality.
*
* @param gridFilterGroupContainer the grid filter group container
*/
public GxtToolBarItemFunctionality(GxtGridFilterGroupPanel gridFilterGroupContainer) {
this();
this.gridGroupViewContainer = gridFilterGroupContainer;
}
/**
* Inits the tool bar.
*/
private void initToolBar() {
btnGridView = new ToggleButton(ConstantsPortlet.CATEGORIZE, Resources.getIconGridView());
btnGridView.setToolTip("Categorize");
btnGridView.setScale(ButtonScale.SMALL);
btnGridView.setIconAlign(IconAlign.TOP);
btnGridView.setScale(ButtonScale.SMALL);
btnGridView.setIconAlign(IconAlign.TOP);
btnGridView.toggle(true);
btnGridView.setArrowAlign(ButtonArrowAlign.BOTTOM);
btnGridView.setArrowAlign(ButtonArrowAlign.BOTTOM);
toolBar.add(btnGridView);
toolBar.add(new SeparatorToolItem());
btnAddFolder = new Button(ConstantsPortlet.ADDFOLDER,Resources.getIconAddFolder());
btnAddFolder.setScale(ButtonScale.SMALL);
btnAddFolder.setIconAlign(IconAlign.TOP);
btnAddFolder.setArrowAlign(ButtonArrowAlign.BOTTOM);
toolBar.add(btnAddFolder);
btnUploadFile = new Button(ConstantsPortlet.UPLOADFILE,
Resources.getIconFileUpload());
btnUploadFile.setScale(ButtonScale.SMALL);
@ -107,7 +122,7 @@ public class GxtToolBarItemFunctionality {
btnUploadFile.setArrowAlign(ButtonArrowAlign.BOTTOM);
toolBar.add(btnUploadFile);
btnRefreshFolder = new Button(ConstantsPortlet.REFRESH, Resources.getIconRefresh());
btnRefreshFolder.setScale(ButtonScale.SMALL);
btnRefreshFolder.setIconAlign(IconAlign.TOP);
@ -139,15 +154,15 @@ public class GxtToolBarItemFunctionality {
btnRenameItem.setIconAlign(IconAlign.TOP);
btnRenameItem.setArrowAlign(ButtonArrowAlign.BOTTOM);
toolBar.add(btnRenameItem);
//COPY
btnCopyItem = new Button("Copy", Resources.getIconCopy());
btnCopyItem.setScale(ButtonScale.SMALL);
btnCopyItem.setIconAlign(IconAlign.TOP);
toolBar.add(btnCopyItem);
//CUT
btnCutItem = new Button("Cut", Resources.getIconCut());
btnCutItem.setScale(ButtonScale.SMALL);
@ -159,7 +174,7 @@ public class GxtToolBarItemFunctionality {
btnPasteItem.setScale(ButtonScale.SMALL);
btnPasteItem.setIconAlign(IconAlign.TOP);
btnPasteItem.setEnabled(false); //BY DEFAULT IS DISABLED
toolBar.add(btnPasteItem);
@ -175,24 +190,24 @@ public class GxtToolBarItemFunctionality {
btnPreview.setIconAlign(IconAlign.TOP);
btnPreview.setArrowAlign(ButtonArrowAlign.BOTTOM);
toolBar.add(btnPreview);
btnOpen = new Button(ConstantsPortlet.OPEN ,Resources.getIconShow());
btnOpen.setScale(ButtonScale.SMALL);
btnOpen.setIconAlign(IconAlign.TOP);
btnOpen.setArrowAlign(ButtonArrowAlign.BOTTOM);
toolBar.add(btnOpen);
// toolBar.add(new SeparatorToolItem());
toolBar.add(new SeparatorToolItem());
btnGetSharedLink = new Button("Get Link", Resources.getIconShareLink());
btnGetSharedLink.setScale(ButtonScale.SMALL);
btnGetSharedLink.setIconAlign(IconAlign.TOP);
btnGetSharedLink.setArrowAlign(ButtonArrowAlign.BOTTOM);
toolBar.add(btnGetSharedLink);
btnPublicLink = new Button("Public Link", Resources.getIconPublicLink());
btnPublicLink.setScale(ButtonScale.SMALL);
btnPublicLink.setIconAlign(IconAlign.TOP);
@ -200,20 +215,28 @@ public class GxtToolBarItemFunctionality {
toolBar.add(btnPublicLink);
toolBar.add(new SeparatorToolItem());
btnFolderLink = new Button("Folder Link", Resources.getIconFolderLink());
btnFolderLink.setScale(ButtonScale.SMALL);
btnFolderLink.setIconAlign(IconAlign.TOP);
btnFolderLink.setArrowAlign(ButtonArrowAlign.BOTTOM);
toolBar.add(btnFolderLink);
toolBar.add(new SeparatorToolItem());
btnAccessFromDesktop = new Button(ConstantsPortlet.TITLEACCESSWEBDAV, Resources.getIconWebDav());
btnAccessFromDesktop.setScale(ButtonScale.SMALL);
btnAccessFromDesktop.setIconAlign(IconAlign.TOP);
btnAccessFromDesktop.setArrowAlign(ButtonArrowAlign.BOTTOM);
// toolBar.add(btnAccessFromDesktop);
btnAccessFromDesktop.setScale(ButtonScale.SMALL);
btnAccessFromDesktop.setIconAlign(IconAlign.TOP);
btnAccessFromDesktop.setArrowAlign(ButtonArrowAlign.BOTTOM);
// toolBar.add(btnAccessFromDesktop);
// toolBar.add(new SeparatorToolItem());
// toolBar.add(new SeparatorToolItem());
// toolBar.add(new SeparatorToolItem());
btnUploadArchive = new Button(ConstantsPortlet.UPLOADARCHIVE,
Resources.getIconArchiveUpload());
btnUploadArchive = new Button(ConstantsPortlet.UPLOADARCHIVE, Resources.getIconArchiveUpload());
btnUploadArchive.setScale(ButtonScale.SMALL);
btnUploadArchive.setIconAlign(IconAlign.TOP);
btnUploadArchive.setArrowAlign(ButtonArrowAlign.BOTTOM);
@ -221,15 +244,15 @@ public class GxtToolBarItemFunctionality {
toolBar.add(btnUploadArchive);
// toolBar.add(new SeparatorToolItem());
// toolBar.add(new SeparatorToolItem());
btnSetPermission= new Button(ConstantsPortlet.CHANGEPERMISSION,Resources.getIconWriteAll());
btnSetPermission.setScale(ButtonScale.SMALL);
btnSetPermission.setIconAlign(IconAlign.TOP);
btnSetPermission.setArrowAlign(ButtonArrowAlign.BOTTOM);
btnSetPermission.setToolTip("Change VRE Folder permissions");
toolBar.add(btnSetPermission);
//TODO OLD CODE
toggleGroup = new ToggleButton();
toggleGroup.setIcon(Resources.getIconToggleGroup());
@ -250,29 +273,37 @@ public class GxtToolBarItemFunctionality {
this.activeButtonsOnSelectForOperation(null, false);
}
/**
* Toggle grid view button.
*
* @param toogle the toogle
*/
public void toggleGridViewButton(boolean toogle){
btnGridView.toggle(toogle);
}
/**
* Adds the selection listeners on tool bar.
*/
private void addSelectionListenersOnToolBar() {
btnAddFolder.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
AppController.getEventBus().fireEvent(new AddFolderEvent(gridGroupViewContainer.getCurrentFolderView(), null));
}
});
btnGridView.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
AppController.getEventBus().fireEvent(new ActiveGroupingView(btnGridView.isPressed()));
}
});
@ -284,13 +315,13 @@ public class GxtToolBarItemFunctionality {
List<FileGridModel> listTarget = gridGroupViewContainer.getSelectedItems();
if(listTarget!=null){
if(listTarget.size()>1){ //IS MULTI
AppController.getEventBus().fireEvent(new DeleteItemEvent(listTarget));
}else{
final FileGridModel fileGridModel = gridGroupViewContainer.getSelectedItem();
AppController.getEventBus().fireEvent(new DeleteItemEvent(fileGridModel));
}
@ -298,7 +329,7 @@ public class GxtToolBarItemFunctionality {
}
});
btnGetSharedLink.addSelectionListener(new SelectionListener<ButtonEvent>() {
@ -311,74 +342,74 @@ public class GxtToolBarItemFunctionality {
}
});
btnCopyItem.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
btnCopyItem.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);
// }
}
});
btnCutItem.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
}
});
btnCutItem.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
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) {
}
});
btnPasteItem.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
final FileGridModel fileGridModel = gridGroupViewContainer.getSelectedItem();
FileModel parentTarget = getDirectoryOrParent(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);
}
});
}
});
btnRefreshFolder.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override
@ -388,7 +419,7 @@ public class GxtToolBarItemFunctionality {
}
});
btnPublicLink.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override
@ -400,8 +431,22 @@ public class GxtToolBarItemFunctionality {
}
});
btnFolderLink.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
final FileGridModel fileGridModel = gridGroupViewContainer.getSelectedItem();
GWT.log("file selected: "+fileGridModel);
if(fileGridModel.isDirectory())
AppController.getEventBus().fireEvent(new WsGetFolderLinkEvent(fileGridModel));
}
});
// btnGetInfo.addSelectionListener(new SelectionListener<ButtonEvent>() {
//
// @Override
@ -413,7 +458,7 @@ public class GxtToolBarItemFunctionality {
//
// }
// });
btnRenameItem.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override
@ -431,9 +476,9 @@ public class GxtToolBarItemFunctionality {
@Override
public void componentSelected(ButtonEvent ce) {
final FileGridModel fileGridModel = gridGroupViewContainer.getSelectedItem();
if(fileGridModel!=null)
AppController.getEventBus().fireEvent(new FileUploadEvent(fileGridModel.getParentFileModel(), WS_UPLOAD_TYPE.File));
else
@ -445,30 +490,30 @@ public class GxtToolBarItemFunctionality {
@Override
public void componentSelected(ButtonEvent ce) {
final FileGridModel fileGridModel = gridGroupViewContainer.getSelectedItem();
if(fileGridModel!=null)
AppController.getEventBus().fireEvent(new FileUploadEvent(fileGridModel.getParentFileModel(), WS_UPLOAD_TYPE.Archive));
else
AppController.getEventBus().fireEvent(new FileUploadEvent(null, WS_UPLOAD_TYPE.Archive));
}
});
btnSetPermission.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
final FileGridModel fileGridModel = gridGroupViewContainer.getSelectedItem();
if(fileGridModel!=null && fileGridModel.isVreFolder()){
AppController.getEventBus().fireEvent(new VREChangePermissionsEvent(fileGridModel));
// DialogPermission dialog = new DialogPermission(fileGridModel);
// dialog.show();
}
}
});
@ -483,7 +528,7 @@ public class GxtToolBarItemFunctionality {
AppController.getEventBus().fireEvent(new FileDownloadEvent(fileGridModel.getIdentifier(), fileGridModel.getName(), DownloadType.DOWNLOAD));
}
});
btnPreview.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override
@ -495,14 +540,14 @@ public class GxtToolBarItemFunctionality {
}
});
btnOpen.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
final FileGridModel fileGridModel = gridGroupViewContainer.getSelectedItem();
if(fileGridModel!=null){
if(fileGridModel.isDirectory())
AppController.getEventBus().fireEvent(new DoubleClickElementSelectedEvent(fileGridModel));
@ -510,20 +555,20 @@ public class GxtToolBarItemFunctionality {
AppController.getEventBus().fireEvent(new OpenReportsEvent(fileGridModel));
else
AppController.getEventBus().fireEvent(new FileDownloadEvent(fileGridModel.getIdentifier(), fileGridModel.getName(), DownloadType.SHOW));
}
}
});
btnAccessFromDesktop.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
AppController.getEventBus().fireEvent(new WebDavUrlEvent(null));
}
});
toggleGroup.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override
@ -557,6 +602,11 @@ public class GxtToolBarItemFunctionality {
});
}
/**
* Switch view.
*
* @param type the type
*/
private void switchView(ViewSwitchTypeInResult type) {
// if (type.compareTo(ViewSwitchTypeInResult.Icons) == 0) {
@ -579,11 +629,12 @@ public class GxtToolBarItemFunctionality {
// }
}
/**
* The method return input file model if is directory otherwise parent of file model
* @param fileModel
* @return
* The method return input file model if is directory otherwise parent of file model.
*
* @param fileModel the file model
* @return the directory or parent
*/
private FileModel getDirectoryOrParent(FileGridModel fileModel){
@ -597,26 +648,33 @@ public class GxtToolBarItemFunctionality {
return null;
}
/**
* Active buttons on select for operation.
*
* @param target the target
* @param active the active
*/
public void activeButtonsOnSelectForOperation(FileModel target, boolean active) {
this.btnPreview.disable();
this.btnPublicLink.disable();
this.btnFolderLink.disable();
this.btnGetSharedLink.disable();
this.btnOpen.enable();
this.btnSetPermission.disable();
//ADDED 07/03/2014
this.btnAddFolder.enable();
this.btnUploadArchive.enable();
this.btnUploadFile.enable();
if(target!=null){
if(active & target.getGXTFolderItemType()!=null){
switch(target.getGXTFolderItemType()){
case EXTERNAL_IMAGE:
case EXTERNAL_IMAGE:
// contextMenu.getItemByItemId(ConstantsExplorer.PRW).setVisible(true);
this.btnPreview.enable();
this.btnPublicLink.enable();
@ -624,78 +682,90 @@ public class GxtToolBarItemFunctionality {
case EXTERNAL_FILE:
this.btnPublicLink.enable();
break;
case EXTERNAL_PDF_FILE:
case EXTERNAL_PDF_FILE:
this.btnPublicLink.enable();
break;
case EXTERNAL_URL:
case EXTERNAL_URL:
// contextMenu.getItemByItemId(ConstantsExplorer.LNK).setVisible(true);
break;
case REPORT_TEMPLATE:
// contextMenu.getItemByItemId(ConstantsExplorer.ORT).setVisible(true);
case REPORT_TEMPLATE:
// contextMenu.getItemByItemId(ConstantsExplorer.ORT).setVisible(true);
break;
case REPORT:
case REPORT:
break;
case QUERY:
case QUERY:
break;
case TIME_SERIES:
case TIME_SERIES:
break;
case PDF_DOCUMENT:
case PDF_DOCUMENT:
break;
case IMAGE_DOCUMENT:
case IMAGE_DOCUMENT:
this.btnPreview.enable();
break;
case DOCUMENT:
case DOCUMENT:
break;
case URL_DOCUMENT:
case URL_DOCUMENT:
// contextMenu.getItemByItemId(ConstantsExplorer.LNK).setVisible(true);
break;
case METADATA:
case METADATA:
break;
case WORKFLOW_REPORT:
case WORKFLOW_REPORT:
break;
case WORKFLOW_TEMPLATE:
case WORKFLOW_TEMPLATE:
break;
default:
}
}
//HANDLER SharedLink
if(target.isShared())
activeButtonForSharing(active);
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
activeButtons(active);
//HANDLING VRE FOLDER AND SPECIAL FOLDER GRID ITEM SELECTION
if(target!=null && (target.isVreFolder() || target.isSpecialFolder())){
this.btnRemoveItem.disable();
this.btnRenameItem.disable();
if(target.isVreFolder()) //IS VRE -> ENABLING SET PERMISSION
this.btnSetPermission.enable();
if(target.isSpecialFolder()){ //IS SPECIAL FOLDER -> DISABLING COPY AND PASTE
disableButtonSpecialFolderSelected();
if(target!=null){
//HANDLING VRE FOLDER AND SPECIAL FOLDER GRID ITEM SELECTION
if(target.isVreFolder() || target.isSpecialFolder()){
this.btnRemoveItem.disable();
this.btnRenameItem.disable();
if(target.isVreFolder()) //IS VRE -> ENABLING SET PERMISSION
this.btnSetPermission.enable();
if(target.isSpecialFolder()){ //IS SPECIAL FOLDER -> DISABLING COPY AND PASTE
disableButtonSpecialFolderSelected();
}
this.btnRefreshFolder.enable();
}else if(target.isDirectory()){
this.btnFolderLink.enable();
this.btnRefreshFolder.enable();
}
this.btnRefreshFolder.enable();
}
}
/**
* Active buttons.
*
* @param active the active
*/
private void activeButtons(boolean active){
if (!active) {
this.btnRemoveItem.disable();
this.btnRenameItem.disable();
@ -703,12 +773,12 @@ public class GxtToolBarItemFunctionality {
this.btnOpen.disable();
this.btnCopyItem.disable();
this.btnCutItem.disable();
//ADDED 07/03/2104
// this.btnAddFolder.disable();
// this.btnUploadArchive.disable();
// this.btnUploadFile.disable();
// this.btnGetInfo.disable();
// this.btnGetSharedLink.disable();
} else {
@ -718,24 +788,34 @@ public class GxtToolBarItemFunctionality {
this.btnOpen.enable();
this.btnCopyItem.enable();
this.btnCutItem.enable();
//ADDED 07/03/2104
// this.btnAddFolder.enable();
// this.btnUploadArchive.enable();
// this.btnUploadFile.enable();
// this.btnGetInfo.enable();
}
}
/**
* Active button for sharing.
*
* @param active the active
*/
public void activeButtonForSharing(boolean active){
this.btnGetSharedLink.setEnabled(active);
}
/**
* Active all button without group view.
*
* @param active the active
*/
public void activeAllButtonWithoutGroupView(boolean active){
btnRemoveItem.setEnabled(active);
btnRenameItem.setEnabled(active);
btnGetSharedLink.setEnabled(active);
@ -744,37 +824,59 @@ public class GxtToolBarItemFunctionality {
btnPreview.setEnabled(active);
btnOpen.setEnabled(active);
btnPublicLink.setEnabled(active);
btnFolderLink.setEnabled(active);
}
/**
* Active button for multi selection.
*
* @param active the active
*/
public void activeButtonForMultiSelection(boolean active){
this.btnRenameItem.setEnabled(!active);
this.btnDownloadFile.setEnabled(!active);
this.btnOpen.setEnabled(!active);
this.btnGetSharedLink.setEnabled(!active);
this.btnPublicLink.setEnabled(!active);
this.btnFolderLink.setEnabled(!active);
this.btnSetPermission.setEnabled(!active);
//ONLY ENABLED
this.btnRemoveItem.setEnabled(active);
this.btnCopyItem.setEnabled(active);
this.btnCutItem.setEnabled(active);
}
/**
* Gets the tool bar.
*
* @return the tool bar
*/
public ToolBar getToolBar() {
return this.toolBar;
}
/**
* @param b
* Active buttons on search.
*
* @param b the b
*/
public void activeButtonsOnSearch(boolean b) {
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();
@ -786,15 +888,20 @@ public class GxtToolBarItemFunctionality {
this.btnRemoveItem.disable();
this.btnRenameItem.disable();
}
/**
* Enable button for active breadcrumb.
*
* @param parent the parent
*/
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.btnAddFolder.enable();
this.btnUploadArchive.enable();