public links, completed
git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace@78960 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
b6d031570e
commit
9e80f7d2df
|
@ -30,6 +30,8 @@ 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.FilterScopeEvent;
|
||||||
import org.gcube.portlets.user.workspace.client.event.GetInfoEvent;
|
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.GetInfoEventHandler;
|
||||||
|
import org.gcube.portlets.user.workspace.client.event.GetPublicLinkEvent;
|
||||||
|
import org.gcube.portlets.user.workspace.client.event.GetPublicLinkEventHandler;
|
||||||
import org.gcube.portlets.user.workspace.client.event.GetShareLinkEvent;
|
import org.gcube.portlets.user.workspace.client.event.GetShareLinkEvent;
|
||||||
import org.gcube.portlets.user.workspace.client.event.GetSharedLinkEventHandler;
|
import org.gcube.portlets.user.workspace.client.event.GetSharedLinkEventHandler;
|
||||||
import org.gcube.portlets.user.workspace.client.event.GridElementSelectedEvent;
|
import org.gcube.portlets.user.workspace.client.event.GridElementSelectedEvent;
|
||||||
|
@ -76,6 +78,7 @@ import org.gcube.portlets.user.workspace.client.view.WorskpacePortlet;
|
||||||
import org.gcube.portlets.user.workspace.client.view.panels.GxtBorderLayoutPanel;
|
import org.gcube.portlets.user.workspace.client.view.panels.GxtBorderLayoutPanel;
|
||||||
import org.gcube.portlets.user.workspace.client.view.panels.GxtItemsPanel;
|
import org.gcube.portlets.user.workspace.client.view.panels.GxtItemsPanel;
|
||||||
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.DialogPublicLink;
|
||||||
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.wsmail.client.forms.MailForm;
|
import org.gcube.portlets.user.wsmail.client.forms.MailForm;
|
||||||
|
@ -162,6 +165,17 @@ public class AppController implements SubscriberInterface {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
eventBus.addHandler(GetPublicLinkEvent.TYPE, new GetPublicLinkEventHandler() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onGetPublicLink(GetPublicLinkEvent getPublicLinkEvent) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
if(getPublicLinkEvent.getSourceFile()!=null){
|
||||||
|
AppControllerExplorer.getEventBus().fireEvent(new GetPublicLinkEvent(getPublicLinkEvent.getSourceFile()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
eventBus.addHandler(AccountingHistoryEvent.TYPE, new AccountingHistoryEventHandler() {
|
eventBus.addHandler(AccountingHistoryEvent.TYPE, new AccountingHistoryEventHandler() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -814,7 +828,6 @@ public class AppController implements SubscriberInterface {
|
||||||
isSearchForItemId = true;
|
isSearchForItemId = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
this.wsPortlet = new WorskpacePortlet(this.appContrExplorer.getPanel(true, false, !isSearch), instanceWithGrouping);
|
this.wsPortlet = new WorskpacePortlet(this.appContrExplorer.getPanel(true, false, !isSearch), instanceWithGrouping);
|
||||||
eventBus.fireEvent(new LoadAllScopeEvent()); //LOAD ALL SCOPE EVENT
|
eventBus.fireEvent(new LoadAllScopeEvent()); //LOAD ALL SCOPE EVENT
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,7 +89,7 @@ public class GxtGridFilterGroupPanel extends LayoutContainer {
|
||||||
|
|
||||||
grid = new Grid<FileGridModel>(store, columnModel);
|
grid = new Grid<FileGridModel>(store, columnModel);
|
||||||
grid.getView().setAutoFill(true);
|
grid.getView().setAutoFill(true);
|
||||||
grid.setBorders(true);
|
// grid.setBorders(true);
|
||||||
|
|
||||||
|
|
||||||
view.setShowGroupedColumn(false);
|
view.setShowGroupedColumn(false);
|
||||||
|
|
|
@ -1,13 +1,16 @@
|
||||||
package org.gcube.portlets.user.workspace.client.view.toolbars;
|
package org.gcube.portlets.user.workspace.client.view.toolbars;
|
||||||
|
|
||||||
import org.gcube.portlets.user.workspace.client.AppController;
|
import org.gcube.portlets.user.workspace.client.AppController;
|
||||||
|
import org.gcube.portlets.user.workspace.client.ConstantsExplorer;
|
||||||
import org.gcube.portlets.user.workspace.client.ConstantsPortlet;
|
import org.gcube.portlets.user.workspace.client.ConstantsPortlet;
|
||||||
import org.gcube.portlets.user.workspace.client.ConstantsPortlet.ViewSwitchTypeInResult;
|
import org.gcube.portlets.user.workspace.client.ConstantsPortlet.ViewSwitchTypeInResult;
|
||||||
|
import org.gcube.portlets.user.workspace.client.constant.WorkspaceOperation;
|
||||||
import org.gcube.portlets.user.workspace.client.event.ActiveGroupingView;
|
import org.gcube.portlets.user.workspace.client.event.ActiveGroupingView;
|
||||||
import org.gcube.portlets.user.workspace.client.event.AddFolderEvent;
|
import org.gcube.portlets.user.workspace.client.event.AddFolderEvent;
|
||||||
import org.gcube.portlets.user.workspace.client.event.DeleteItemEvent;
|
import org.gcube.portlets.user.workspace.client.event.DeleteItemEvent;
|
||||||
import org.gcube.portlets.user.workspace.client.event.DoubleClickElementSelectedEvent;
|
import org.gcube.portlets.user.workspace.client.event.DoubleClickElementSelectedEvent;
|
||||||
import org.gcube.portlets.user.workspace.client.event.FileDownloadEvent;
|
import org.gcube.portlets.user.workspace.client.event.FileDownloadEvent;
|
||||||
|
import org.gcube.portlets.user.workspace.client.event.GetPublicLinkEvent;
|
||||||
import org.gcube.portlets.user.workspace.client.event.FileDownloadEvent.DownloadType;
|
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.FileUploadEvent;
|
||||||
import org.gcube.portlets.user.workspace.client.event.FileUploadEvent.UploadType;
|
import org.gcube.portlets.user.workspace.client.event.FileUploadEvent.UploadType;
|
||||||
|
@ -26,9 +29,11 @@ import com.extjs.gxt.ui.client.Style.ButtonArrowAlign;
|
||||||
import com.extjs.gxt.ui.client.Style.ButtonScale;
|
import com.extjs.gxt.ui.client.Style.ButtonScale;
|
||||||
import com.extjs.gxt.ui.client.Style.IconAlign;
|
import com.extjs.gxt.ui.client.Style.IconAlign;
|
||||||
import com.extjs.gxt.ui.client.event.ButtonEvent;
|
import com.extjs.gxt.ui.client.event.ButtonEvent;
|
||||||
|
import com.extjs.gxt.ui.client.event.MenuEvent;
|
||||||
import com.extjs.gxt.ui.client.event.SelectionListener;
|
import com.extjs.gxt.ui.client.event.SelectionListener;
|
||||||
import com.extjs.gxt.ui.client.widget.button.Button;
|
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.button.ToggleButton;
|
||||||
|
import com.extjs.gxt.ui.client.widget.menu.MenuItem;
|
||||||
import com.extjs.gxt.ui.client.widget.toolbar.SeparatorToolItem;
|
import com.extjs.gxt.ui.client.widget.toolbar.SeparatorToolItem;
|
||||||
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
|
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
|
||||||
|
|
||||||
|
@ -56,6 +61,7 @@ public class GxtToolBarItemFunctionality {
|
||||||
private ToggleButton btnGridView;
|
private ToggleButton btnGridView;
|
||||||
// private Button btnGetInfo;
|
// private Button btnGetInfo;
|
||||||
private Button btnGetSharedLink;
|
private Button btnGetSharedLink;
|
||||||
|
private Button btnPublicLink;
|
||||||
|
|
||||||
public GxtToolBarItemFunctionality() {
|
public GxtToolBarItemFunctionality() {
|
||||||
initToolBar();
|
initToolBar();
|
||||||
|
@ -149,6 +155,14 @@ public class GxtToolBarItemFunctionality {
|
||||||
|
|
||||||
toolBar.add(btnGetSharedLink);
|
toolBar.add(btnGetSharedLink);
|
||||||
|
|
||||||
|
btnPublicLink = new Button("Public Link", Resources.getIconPublicLink());
|
||||||
|
btnPublicLink.setScale(ButtonScale.SMALL);
|
||||||
|
btnPublicLink.setIconAlign(IconAlign.TOP);
|
||||||
|
btnPublicLink.setArrowAlign(ButtonArrowAlign.BOTTOM);
|
||||||
|
|
||||||
|
toolBar.add(btnPublicLink);
|
||||||
|
toolBar.add(new SeparatorToolItem());
|
||||||
|
|
||||||
btnAccessFromDesktop = new Button(ConstantsPortlet.TITLEACCESSWEBDAV, Resources.getIconWebDav());
|
btnAccessFromDesktop = new Button(ConstantsPortlet.TITLEACCESSWEBDAV, Resources.getIconWebDav());
|
||||||
btnAccessFromDesktop.setScale(ButtonScale.SMALL);
|
btnAccessFromDesktop.setScale(ButtonScale.SMALL);
|
||||||
btnAccessFromDesktop.setIconAlign(IconAlign.TOP);
|
btnAccessFromDesktop.setIconAlign(IconAlign.TOP);
|
||||||
|
@ -244,6 +258,20 @@ public class GxtToolBarItemFunctionality {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
btnPublicLink.addSelectionListener(new SelectionListener<ButtonEvent>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void componentSelected(ButtonEvent ce) {
|
||||||
|
|
||||||
|
final FileGridModel fileGridModel = gridGroupViewContainer.getSelectedItem();
|
||||||
|
|
||||||
|
AppController.getEventBus().fireEvent(new GetPublicLinkEvent(fileGridModel));
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
// btnGetInfo.addSelectionListener(new SelectionListener<ButtonEvent>() {
|
// btnGetInfo.addSelectionListener(new SelectionListener<ButtonEvent>() {
|
||||||
//
|
//
|
||||||
// @Override
|
// @Override
|
||||||
|
@ -407,6 +435,7 @@ public class GxtToolBarItemFunctionality {
|
||||||
public void activeButtonsOnSelectForOperation(FileModel target, boolean active) {
|
public void activeButtonsOnSelectForOperation(FileModel target, boolean active) {
|
||||||
|
|
||||||
this.btnPreview.disable();
|
this.btnPreview.disable();
|
||||||
|
this.btnPublicLink.disable();
|
||||||
this.btnOpen.enable();
|
this.btnOpen.enable();
|
||||||
|
|
||||||
if(target!=null){
|
if(target!=null){
|
||||||
|
@ -418,10 +447,13 @@ public class GxtToolBarItemFunctionality {
|
||||||
case EXTERNAL_IMAGE:
|
case EXTERNAL_IMAGE:
|
||||||
// contextMenu.getItemByItemId(ConstantsExplorer.PRW).setVisible(true);
|
// contextMenu.getItemByItemId(ConstantsExplorer.PRW).setVisible(true);
|
||||||
this.btnPreview.enable();
|
this.btnPreview.enable();
|
||||||
|
this.btnPublicLink.enable();
|
||||||
break;
|
break;
|
||||||
case EXTERNAL_FILE:
|
case EXTERNAL_FILE:
|
||||||
|
this.btnPublicLink.enable();
|
||||||
break;
|
break;
|
||||||
case EXTERNAL_PDF_FILE:
|
case EXTERNAL_PDF_FILE:
|
||||||
|
this.btnPublicLink.enable();
|
||||||
break;
|
break;
|
||||||
case EXTERNAL_URL:
|
case EXTERNAL_URL:
|
||||||
// contextMenu.getItemByItemId(ConstantsExplorer.LNK).setVisible(true);
|
// contextMenu.getItemByItemId(ConstantsExplorer.LNK).setVisible(true);
|
||||||
|
@ -476,7 +508,7 @@ public class GxtToolBarItemFunctionality {
|
||||||
this.btnDownloadFile.disable();
|
this.btnDownloadFile.disable();
|
||||||
this.btnOpen.disable();
|
this.btnOpen.disable();
|
||||||
// this.btnGetInfo.disable();
|
// this.btnGetInfo.disable();
|
||||||
this.btnGetSharedLink.disable();
|
// this.btnGetSharedLink.disable();
|
||||||
} else {
|
} else {
|
||||||
this.btnRemoveItem.enable();
|
this.btnRemoveItem.enable();
|
||||||
this.btnRenameItem.enable();
|
this.btnRenameItem.enable();
|
||||||
|
@ -501,6 +533,7 @@ public class GxtToolBarItemFunctionality {
|
||||||
btnDownloadFile.setEnabled(active);
|
btnDownloadFile.setEnabled(active);
|
||||||
btnPreview.setEnabled(active);
|
btnPreview.setEnabled(active);
|
||||||
btnOpen.setEnabled(active);
|
btnOpen.setEnabled(active);
|
||||||
|
btnPublicLink.setEnabled(active);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ToolBar getToolBar() {
|
public ToolBar getToolBar() {
|
||||||
|
|
Loading…
Reference in New Issue