Francesco Mangiacrapa 2019-09-20 15:13:25 +00:00
parent af5fb13d9e
commit 1f7736f7d2
8 changed files with 97 additions and 91 deletions

View File

@ -52,9 +52,9 @@ import org.gcube.portlets.user.workspace.client.event.GetFolderLinkEvent;
import org.gcube.portlets.user.workspace.client.event.GetFolderLinkEventHandler;
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;
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.GetShareableLink;
import org.gcube.portlets.user.workspace.client.event.GetSharedLinkEventHandler;
import org.gcube.portlets.user.workspace.client.event.ImagePreviewEvent;
import org.gcube.portlets.user.workspace.client.event.ImagePreviewEventHandler;
@ -916,18 +916,12 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt
}
});
eventBus.addHandler(GetPublicLinkEvent.TYPE, new GetPublicLinkEventHandler() {
eventBus.addHandler(GetShareableLink.TYPE, new GetPublicLinkEventHandler() {
@Override
public void onGetPublicLink(GetPublicLinkEvent getPublicLinkEvent) {
public void onGetPublicLink(GetShareableLink getPublicLinkEvent) {
// TODO Auto-generated method stub
if (getPublicLinkEvent.getSourceFile() != null) {
// DialogGetLink dialog = new DialogGetLink("Copy to clipboard Public Link: Ctrl+C",
// getPublicLinkEvent.getSourceFile(), getPublicLinkEvent.getVersion(), Link_Type.PUBLIC_LINK,
// false);
// dialog.show();
new DialogShareableLink(getPublicLinkEvent.getSourceFile(), getPublicLinkEvent.getVersion());
}

View File

@ -89,9 +89,9 @@ public class ConstantsExplorer {
public static final String MESSAGE_REFRESH_FOLDER = "Refresh Folder";
public static final String MESSAGE_GET_INFO = "Get Info";
public static final String FILE_VERSIONS = "Versions";
public static final String MESSAGE_PUBLIC_LINK = "Get Public Link";
public static final String MESSAGE_FOLDER_LINK = "Get Public Link";
public static final String MESSAGE_FOLDER_LINK_REMOVE = "Remove Public Link";
public static final String MESSAGE_SHAREABLE_LINK = "Get Shareable Link";
// public static final String MESSAGE_FOLDER_LINK = "Get Public Link";
// public static final String MESSAGE_FOLDER_LINK_REMOVE = "Remove Public Link";
public static final String LISTATTACHMENTSNAMES = "Attachments Names";
public static final String LISTCONTACTSTOSTRING = "ListContactToString";
public static final String STATUS = "Status";

View File

@ -28,13 +28,13 @@ public enum WorkspaceOperation {
GET_INFO("GTI", "GTI"), // GET INFO
HISTORY("HST", "HST"), // HISTORY
ACCREAD("ACR", "ACR"), // ACCOUNTING READ
SHARE_LINK("SLK", "SLK"), // SHARE URL LINK
//SHARE_LINK("SLK", "SLK"), // SHARE URL LINK
PUBLIC_LINK("PLK", "PLK"), // PUBLIC LINK
// ADD_ADMINISTRATOR("AAD", "AAD"), // ADD_ADMINISTRATOR
VRE_CHANGE_PERIMISSIONS("CHP", "CHP"),
EDIT_PERMISSIONS("EDP", "EDP"), // EDIT PERMISSIONS
FOLDER_LINK("FRL", "FRL"), // FOLDER LINK
FOLDER_LINK_REMOVE("FPR", "FPR"),
//FOLDER_LINK("FRL", "FRL"), // FOLDER LINK
//FOLDER_LINK_REMOVE("FPR", "FPR"),
VERSIONING("VRN", "VRN"), // VERSIONING
EXECUTE_DM_TASK("EDT", "EDT"), //EXECUTE DM TASK
SEND_TO_SWITCHBOARD("SDSB", "SDSB"), //SEND_TO_SWITCHBOARD

View File

@ -9,5 +9,5 @@ import com.google.gwt.event.shared.EventHandler;
*/
public interface GetPublicLinkEventHandler extends EventHandler {
void onGetPublicLink(GetPublicLinkEvent getPublicLinkEvent);
void onGetPublicLink(GetShareableLink getPublicLinkEvent);
}

View File

@ -6,12 +6,13 @@ import com.google.gwt.event.shared.GwtEvent;
/**
* The Class GetPublicLinkEvent.
* The Class GetShareableLink.
*
* @author Francesco Mangiacrapa francesco.mangiacrapa{@literal @}isti.cnr.it
* Jan 8, 2019
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
*
* Sep 20, 2019
*/
public class GetPublicLinkEvent extends GwtEvent<GetPublicLinkEventHandler> {
public class GetShareableLink extends GwtEvent<GetPublicLinkEventHandler> {
public static Type<GetPublicLinkEventHandler> TYPE = new Type<GetPublicLinkEventHandler>();
private FileModel targetFile = null;
@ -23,7 +24,7 @@ public class GetPublicLinkEvent extends GwtEvent<GetPublicLinkEventHandler> {
* @param target the target
* @param version the version
*/
public GetPublicLinkEvent(FileModel target, String version) {
public GetShareableLink(FileModel target, String version) {
this.targetFile = target;
this.version = version;
}

View File

@ -23,10 +23,8 @@ import org.gcube.portlets.user.workspace.client.event.ExecuteDataMinerTaskEvent;
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.GetFolderLinkEvent;
import org.gcube.portlets.user.workspace.client.event.GetInfoEvent;
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.GetShareableLink;
import org.gcube.portlets.user.workspace.client.event.ImagePreviewEvent;
import org.gcube.portlets.user.workspace.client.event.MoveItemsEvent;
import org.gcube.portlets.user.workspace.client.event.OpenUrlEvent;
@ -169,39 +167,41 @@ public class ContextMenuTree {
contextMenu.add(mnFileVersioning);
//SHARE LINK
MenuItem mnGetLink = new MenuItem();
mnGetLink.setId(WorkspaceOperation.SHARE_LINK.getId());
mnGetLink.setText(ConstantsExplorer.MESSAGE_SHARE_LINK);
mnGetLink.setIcon(Resources.getIconShareLink());
mnGetLink.addSelectionListener(new SelectionListener<MenuEvent>() {
public void componentSelected(MenuEvent ce) {
for (FileModel sel : listSelectedItems) {
eventBus.fireEvent(new GetShareLinkEvent(sel));
}
}
});
contextMenu.add(mnGetLink);
// //SHARE LINK
// MenuItem mnGetLink = new MenuItem();
// mnGetLink.setId(WorkspaceOperation.SHARE_LINK.getId());
// mnGetLink.setText(ConstantsExplorer.MESSAGE_SHARE_LINK);
// mnGetLink.setIcon(Resources.getIconShareLink());
//
// mnGetLink.addSelectionListener(new SelectionListener<MenuEvent>() {
// public void componentSelected(MenuEvent ce) {
//
// for (FileModel sel : listSelectedItems) {
// eventBus.fireEvent(new GetShareLinkEvent(sel));
// }
// }
// });
//
// contextMenu.add(mnGetLink);
//PUBLIC LINK
MenuItem mnPublicLink = new MenuItem();
mnPublicLink.setId(WorkspaceOperation.PUBLIC_LINK.getId());
mnPublicLink.setText(ConstantsExplorer.MESSAGE_PUBLIC_LINK);
mnPublicLink.setIcon(Resources.getIconPublicLink());
mnPublicLink.setText(ConstantsExplorer.MESSAGE_SHAREABLE_LINK);
mnPublicLink.setIcon(Resources.getIconShareLink());
mnPublicLink.addSelectionListener(new SelectionListener<MenuEvent>() {
public void componentSelected(MenuEvent ce) {
for (FileModel sel : listSelectedItems) {
//see Task #17552
if(sel.isDirectory()) {
eventBus.fireEvent(new GetFolderLinkEvent(sel, true));
}else {
eventBus.fireEvent(new GetPublicLinkEvent(sel, null));
}
// if(sel.isDirectory()) {
// eventBus.fireEvent(new GetFolderLinkEvent(sel, true));
// }else {
// eventBus.fireEvent(new GetShareableLink(sel, null));
// }
//
AppControllerExplorer.getEventBus().fireEvent(new GetShareableLink(sel, null));
}
}
});
@ -209,43 +209,43 @@ public class ContextMenuTree {
contextMenu.add(mnPublicLink);
//FOLDER LINK
MenuItem mnFolderLink = new MenuItem();
mnFolderLink.setId(WorkspaceOperation.FOLDER_LINK.getId());
mnFolderLink.setText(ConstantsExplorer.MESSAGE_FOLDER_LINK);
mnFolderLink.setIcon(Resources.getIconFolderPublic());
mnFolderLink.addSelectionListener(new SelectionListener<MenuEvent>() {
public void componentSelected(MenuEvent ce) {
for (FileModel sel : listSelectedItems) {
if(sel.isDirectory())
eventBus.fireEvent(new GetFolderLinkEvent(sel, true));
}
}
});
//see Task #17552
contextMenu.add(mnFolderLink);
// //FOLDER LINK
// MenuItem mnFolderLink = new MenuItem();
// mnFolderLink.setId(WorkspaceOperation.FOLDER_LINK.getId());
// mnFolderLink.setText(ConstantsExplorer.MESSAGE_FOLDER_LINK);
// mnFolderLink.setIcon(Resources.getIconFolderPublic());
//
// mnFolderLink.addSelectionListener(new SelectionListener<MenuEvent>() {
// public void componentSelected(MenuEvent ce) {
//
// for (FileModel sel : listSelectedItems) {
// if(sel.isDirectory())
// eventBus.fireEvent(new GetFolderLinkEvent(sel, true));
// }
// }
// });
//
// //see Task #17552
// contextMenu.add(mnFolderLink);
//FOLDER LINK REMOVE
MenuItem mnFolderLinkRemove = new MenuItem();
mnFolderLinkRemove.setId(WorkspaceOperation.FOLDER_LINK_REMOVE.getId());
mnFolderLinkRemove.setText(ConstantsExplorer.MESSAGE_FOLDER_LINK_REMOVE);
mnFolderLinkRemove.setIcon(Resources.getIconFolderPublicRemove());
// MenuItem mnFolderLinkRemove = new MenuItem();
// mnFolderLinkRemove.setId(WorkspaceOperation.FOLDER_LINK_REMOVE.getId());
// mnFolderLinkRemove.setText(ConstantsExplorer.MESSAGE_FOLDER_LINK_REMOVE);
// mnFolderLinkRemove.setIcon(Resources.getIconFolderPublicRemove());
//
// mnFolderLinkRemove.addSelectionListener(new SelectionListener<MenuEvent>() {
// public void componentSelected(MenuEvent ce) {
//
// for (FileModel sel : listSelectedItems) {
// if(sel.isDirectory())
// eventBus.fireEvent(new GetFolderLinkEvent(sel, false));
// }
// }
// });
mnFolderLinkRemove.addSelectionListener(new SelectionListener<MenuEvent>() {
public void componentSelected(MenuEvent ce) {
for (FileModel sel : listSelectedItems) {
if(sel.isDirectory())
eventBus.fireEvent(new GetFolderLinkEvent(sel, false));
}
}
});
contextMenu.add(mnFolderLinkRemove);
// contextMenu.add(mnFolderLinkRemove);
MenuItem mnHistory = new MenuItem();
mnHistory.setIcon(Resources.getIconHistory());
@ -864,6 +864,7 @@ public class ContextMenuTree {
contextMenu.getItemByItemId(WorkspaceOperation.RENAME.getId()).setVisible(true);
contextMenu.getItemByItemId(WorkspaceOperation.REMOVE.getId()).setVisible(true);
contextMenu.getItemByItemId(WorkspaceOperation.HISTORY.getId()).setVisible(true);
contextMenu.getItemByItemId(WorkspaceOperation.PUBLIC_LINK.getId()).setVisible(false);
//SELECTED ITEM IS A FOLDER
@ -875,12 +876,13 @@ public class ContextMenuTree {
contextMenu.getItemByItemId(WorkspaceOperation.SHARE.getId()).setVisible(true);
//contextMenu.getItemByItemId(WorkspaceOperation.SHOW.getId()).setVisible(false);
contextMenu.getItemByItemId(WorkspaceOperation.REFRESH_FOLDER.getId()).setVisible(true);
contextMenu.getItemByItemId(WorkspaceOperation.FOLDER_LINK.getId()).setVisible(true); //create folder link, set folder as public
//contextMenu.getItemByItemId(WorkspaceOperation.FOLDER_LINK.getId()).setVisible(true); //create folder link, set folder as public
contextMenu.getItemByItemId(WorkspaceOperation.EXECUTE_DM_TASK.getId()).setVisible(true);
contextMenu.getItemByItemId(WorkspaceOperation.PUBLIC_LINK.getId()).setVisible(true);
if(selectedItem.isShared()){//IS SHARED
contextMenu.getItemByItemId(WorkspaceOperation.INSERT_SHARED_FOLDER.getId()).setVisible(false);
contextMenu.getItemByItemId(WorkspaceOperation.SHARE_LINK.getId()).setVisible(true);
//contextMenu.getItemByItemId(WorkspaceOperation.SHARE_LINK.getId()).setVisible(true);
if(selectedItem.isShareable()){ //IS SHARABLE
contextMenu.getItemByItemId(WorkspaceOperation.UNSHARE.getId()).setVisible(true);
}else { //IS SUBFOLDER
@ -888,6 +890,7 @@ public class ContextMenuTree {
}
}
if(selectedItem.isRoot()){ //IS ROOT
contextMenu.getItemByItemId(WorkspaceOperation.SHARE.getId()).setVisible(false);
contextMenu.getItemByItemId(WorkspaceOperation.INSERT_SHARED_FOLDER.getId()).setVisible(true);
@ -896,12 +899,14 @@ public class ContextMenuTree {
contextMenu.getItemByItemId(WorkspaceOperation.REMOVE.getId()).setVisible(false);
contextMenu.getItemByItemId(WorkspaceOperation.MOVE.getId()).setVisible(false);
contextMenu.getItemByItemId(WorkspaceOperation.DOWNLOAD.getId()).setVisible(false);
contextMenu.getItemByItemId(WorkspaceOperation.FOLDER_LINK.getId()).setVisible(false);
contextMenu.getItemByItemId(WorkspaceOperation.PUBLIC_LINK.getId()).setVisible(false);
//contextMenu.getItemByItemId(WorkspaceOperation.FOLDER_LINK.getId()).setVisible(false);
showExecuteOperations(false);
}
if(selectedItem.isPublic())
contextMenu.getItemByItemId(WorkspaceOperation.FOLDER_LINK_REMOVE.getId()).setVisible(true);
if(selectedItem.isPublic()) {
//contextMenu.getItemByItemId(WorkspaceOperation.FOLDER_LINK_REMOVE.getId()).setVisible(true);
}
GWT.log("HideSharing = " + hideSharing);
//not supported in tree Reports
@ -984,7 +989,7 @@ public class ContextMenuTree {
contextMenu.getItemByItemId(WorkspaceOperation.RENAME.getId()).setVisible(false);
contextMenu.getItemByItemId(WorkspaceOperation.REMOVE.getId()).setVisible(false);
contextMenu.getItemByItemId(WorkspaceOperation.MOVE.getId()).setVisible(false);
contextMenu.getItemByItemId(WorkspaceOperation.FOLDER_LINK.getId()).setVisible(false);
contextMenu.getItemByItemId(WorkspaceOperation.PUBLIC_LINK.getId()).setVisible(false);
showExecuteOperations(false);
//ADDED 14/03/2014
@ -995,7 +1000,7 @@ public class ContextMenuTree {
showExecuteOperations(false);
showWriteOperations(false);
contextMenu.getItemByItemId(WorkspaceOperation.DOWNLOAD.getId()).setVisible(false);
contextMenu.getItemByItemId(WorkspaceOperation.FOLDER_LINK.getId()).setVisible(false);
contextMenu.getItemByItemId(WorkspaceOperation.PUBLIC_LINK.getId()).setVisible(false);
}
}
}

View File

@ -193,7 +193,7 @@ public class DialogShareableLink extends Composite {
alertFolderPublicLink.setVisible(true);
//cgRemovePublicLink.setVisible(true);
filedEnableDisableSharing.setVisible(true);
labelLinkSharing.setText("Anyone with the Public Link can access to the content");
labelLinkSharing.setText("Anyone with the Public Link can view");
cgPublicLink.setVisible(true);
acessToFolderLink(item, true);
}

View File

@ -37,6 +37,7 @@
visible="false">
<b:Icon type="ROTATE_RIGHT" spin="true" />
</b:Alert>
<b:Row ui:field="fieldPrivateSharing"
addStyleNames="{style.margin-bottom-20}">
<b:Column size="2">
@ -46,7 +47,13 @@
<citem:SwitchButton
ui:field="switchButtonPrivate" addStyleNames="{style.not-active}"></citem:SwitchButton>
</b:Column>
<b:Row>
<b:Column size="4" addStyleNames="{style.padding-left-30}">
<g:Label ui:field="labelLinkPrivateSharing">(Only the) Members belonging to the share can view</g:Label>
</b:Column>
</b:Row>
</b:Row>
<b:Fieldset ui:field="fieldSetPrivate">
<g:HTMLPanel>
<!-- <b:Legend>sharing....</b:Legend> -->
@ -54,7 +61,7 @@
<b:Well>
By sharing the following Private Link
with
to folder with
your
coworkers,
you will
@ -94,8 +101,7 @@
<b:Well ui:field="alertFolderPublicLink" visible="false">By sharing
the following Public
Link
to folder with
your coworkers, you will
to folder, you will
enact anyone
with the
link to