ref 13226:StorageHub - Update workspace-sharing-widget to SH
https://support.d4science.org/issues/13226 Updated to StorageHub git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace-tree-widget@177230 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
9abf40926d
commit
53b6d61b8c
|
@ -13,7 +13,6 @@
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
<classpathentry kind="src" path="src/main/resources"/>
|
<classpathentry kind="src" path="src/main/resources"/>
|
||||||
<classpathentry kind="con" path="com.google.gwt.eclipse.core.GWT_CONTAINER/gwt-2.7.0"/>
|
|
||||||
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
|
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
<ReleaseNotes>
|
<ReleaseNotes>
|
||||||
|
<Changeset component="org.gcube.portlets-user.workspace-portlet-tree.6-25-0"
|
||||||
|
date="2019-02-04">
|
||||||
|
<Change>Updated to StorageHub [ticket: #13226]</Change>
|
||||||
|
</Changeset>
|
||||||
<Changeset component="org.gcube.portlets-user.workspace-portlet-tree.6-24-1"
|
<Changeset component="org.gcube.portlets-user.workspace-portlet-tree.6-24-1"
|
||||||
date="${buildDate}">
|
date="${buildDate}">
|
||||||
<Change>Updated regular expression to validate Folder and File names
|
<Change>Updated regular expression to validate Folder and File names
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -20,7 +20,7 @@ import com.extjs.gxt.ui.client.widget.form.RadioGroup;
|
||||||
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
|
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class ExplorerPanel extends LayoutContainer {
|
public class ExplorerPanel extends LayoutContainer {
|
||||||
|
|
|
@ -2,7 +2,7 @@ package org.gcube.portlets.user.workspace.client.view.sharing;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.gcube.portlets.user.workspace.client.model.InfoContactModel;
|
import org.gcube.portlets.widgets.workspacesharingwidget.shared.InfoContactModel;
|
||||||
|
|
||||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||||
|
|
||||||
|
|
|
@ -5,13 +5,14 @@ import java.util.List;
|
||||||
import org.gcube.portlets.user.workspace.client.AppControllerExplorer;
|
import org.gcube.portlets.user.workspace.client.AppControllerExplorer;
|
||||||
import org.gcube.portlets.user.workspace.client.ConstantsExplorer;
|
import org.gcube.portlets.user.workspace.client.ConstantsExplorer;
|
||||||
import org.gcube.portlets.user.workspace.client.model.FileModel;
|
import org.gcube.portlets.user.workspace.client.model.FileModel;
|
||||||
import org.gcube.portlets.user.workspace.client.model.InfoContactModel;
|
|
||||||
import org.gcube.portlets.user.workspace.client.resources.Resources;
|
import org.gcube.portlets.user.workspace.client.resources.Resources;
|
||||||
import org.gcube.portlets.user.workspace.client.view.sharing.multisuggest.MultiDragContact;
|
import org.gcube.portlets.user.workspace.client.view.sharing.multisuggest.MultiDragContact;
|
||||||
import org.gcube.portlets.user.workspace.client.view.sharing.multisuggest.MultiValuePanel;
|
import org.gcube.portlets.user.workspace.client.view.sharing.multisuggest.MultiValuePanel;
|
||||||
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.shared.ListContact;
|
import org.gcube.portlets.user.workspace.shared.ListContact;
|
||||||
import org.gcube.portlets.user.workspace.shared.WorkspaceACL;
|
import org.gcube.portlets.widgets.workspacesharingwidget.client.rpc.WorkspaceSharingServiceAsync;
|
||||||
|
import org.gcube.portlets.widgets.workspacesharingwidget.shared.InfoContactModel;
|
||||||
|
import org.gcube.portlets.widgets.workspacesharingwidget.shared.WorkspaceACL;
|
||||||
|
|
||||||
import com.extjs.gxt.ui.client.Style.HorizontalAlignment;
|
import com.extjs.gxt.ui.client.Style.HorizontalAlignment;
|
||||||
import com.extjs.gxt.ui.client.Style.Scroll;
|
import com.extjs.gxt.ui.client.Style.Scroll;
|
||||||
|
@ -39,7 +40,7 @@ import com.google.gwt.user.client.ui.Label;
|
||||||
/**
|
/**
|
||||||
* The Class DialogShareFolder.
|
* The Class DialogShareFolder.
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
* Jul 10, 2017
|
* Jul 10, 2017
|
||||||
*/
|
*/
|
||||||
public class DialogShareFolder extends Dialog {
|
public class DialogShareFolder extends Dialog {
|
||||||
|
@ -122,7 +123,7 @@ public class DialogShareFolder extends Dialog {
|
||||||
Label labelProperty = new Label("Permissions");
|
Label labelProperty = new Label("Permissions");
|
||||||
hpPermission.add(labelProperty);
|
hpPermission.add(labelProperty);
|
||||||
|
|
||||||
AppControllerExplorer.rpcWorkspaceService.getACLs(new AsyncCallback<List<WorkspaceACL>>() {
|
WorkspaceSharingServiceAsync.INSTANCE.getACLs(new AsyncCallback<List<WorkspaceACL>>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(List<WorkspaceACL> result) {
|
public void onSuccess(List<WorkspaceACL> result) {
|
||||||
|
@ -373,7 +374,7 @@ public class DialogShareFolder extends Dialog {
|
||||||
Label labelProperty = new Label("Permissions");
|
Label labelProperty = new Label("Permissions");
|
||||||
hpPermission.add(labelProperty);
|
hpPermission.add(labelProperty);
|
||||||
|
|
||||||
AppControllerExplorer.rpcWorkspaceService.getACLs(new AsyncCallback<List<WorkspaceACL>>() {
|
WorkspaceSharingServiceAsync.INSTANCE.getACLs(new AsyncCallback<List<WorkspaceACL>>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(List<WorkspaceACL> result) {
|
public void onSuccess(List<WorkspaceACL> result) {
|
||||||
|
@ -599,7 +600,7 @@ public class DialogShareFolder extends Dialog {
|
||||||
*/
|
*/
|
||||||
private void selectAclForFolder(FileModel folder){
|
private void selectAclForFolder(FileModel folder){
|
||||||
GWT.log("Loading ACL to: "+folder);
|
GWT.log("Loading ACL to: "+folder);
|
||||||
AppControllerExplorer.rpcWorkspaceService.getACLBySharedFolderId(folder.getIdentifier(), new AsyncCallback<WorkspaceACL>() {
|
WorkspaceSharingServiceAsync.INSTANCE.getACLsForSharedFolderId(folder.getIdentifier(), new AsyncCallback<WorkspaceACL>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable arg0) {
|
public void onFailure(Throwable arg0) {
|
||||||
|
@ -627,7 +628,7 @@ public class DialogShareFolder extends Dialog {
|
||||||
*/
|
*/
|
||||||
public void getUsersManagers(final String sharedFolderId,final AsyncCallback<List<InfoContactModel>> callback) {
|
public void getUsersManagers(final String sharedFolderId,final AsyncCallback<List<InfoContactModel>> callback) {
|
||||||
|
|
||||||
AppControllerExplorer.rpcWorkspaceService.getUsersManagerToSharedFolder(sharedFolderId, new AsyncCallback<List<InfoContactModel>>() {
|
WorkspaceSharingServiceAsync.INSTANCE.getAdministratorsByFolderId(sharedFolderId, new AsyncCallback<List<InfoContactModel>>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable arg0) {
|
public void onFailure(Throwable arg0) {
|
||||||
|
|
|
@ -2,8 +2,8 @@ package org.gcube.portlets.user.workspace.client.view.sharing;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.gcube.portlets.user.workspace.shared.WorkspaceACL;
|
import org.gcube.portlets.widgets.workspacesharingwidget.shared.WorkspaceACL;
|
||||||
import org.gcube.portlets.user.workspace.shared.WorkspaceACL.USER_TYPE;
|
import org.gcube.portlets.widgets.workspacesharingwidget.shared.WorkspaceACL.USER_TYPE;
|
||||||
|
|
||||||
import com.extjs.gxt.ui.client.widget.LayoutContainer;
|
import com.extjs.gxt.ui.client.widget.LayoutContainer;
|
||||||
import com.extjs.gxt.ui.client.widget.form.Radio;
|
import com.extjs.gxt.ui.client.widget.form.Radio;
|
||||||
|
|
|
@ -4,8 +4,9 @@ import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.gcube.portlets.user.workspace.client.util.GetPermissionIconByACL;
|
import org.gcube.portlets.user.workspace.client.util.GetPermissionIconByACL;
|
||||||
import org.gcube.portlets.user.workspace.shared.WorkspaceACL;
|
|
||||||
import org.gcube.portlets.user.workspace.shared.WorkspaceACL.USER_TYPE;
|
import org.gcube.portlets.widgets.workspacesharingwidget.shared.WorkspaceACL;
|
||||||
|
import org.gcube.portlets.widgets.workspacesharingwidget.shared.WorkspaceACL.USER_TYPE;
|
||||||
|
|
||||||
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;
|
||||||
|
|
|
@ -3,10 +3,10 @@ package org.gcube.portlets.user.workspace.client.view.sharing;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.gcube.portlets.user.workspace.client.AppControllerExplorer;
|
|
||||||
import org.gcube.portlets.user.workspace.client.ConstantsExplorer;
|
import org.gcube.portlets.user.workspace.client.ConstantsExplorer;
|
||||||
import org.gcube.portlets.user.workspace.client.model.InfoContactModel;
|
|
||||||
import org.gcube.portlets.user.workspace.client.view.windows.MessageBoxAlert;
|
import org.gcube.portlets.user.workspace.client.view.windows.MessageBoxAlert;
|
||||||
|
import org.gcube.portlets.widgets.workspacesharingwidget.client.rpc.WorkspaceSharingServiceAsync;
|
||||||
|
import org.gcube.portlets.widgets.workspacesharingwidget.shared.InfoContactModel;
|
||||||
|
|
||||||
import com.google.gwt.core.client.GWT;
|
import com.google.gwt.core.client.GWT;
|
||||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||||
|
@ -14,7 +14,7 @@ import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||||
/**
|
/**
|
||||||
* The Class UserStore.
|
* The Class UserStore.
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
*/
|
*/
|
||||||
public class UserStore implements ContactFetcher{
|
public class UserStore implements ContactFetcher{
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ public class UserStore implements ContactFetcher{
|
||||||
|
|
||||||
listAllContact = new ArrayList<InfoContactModel>();
|
listAllContact = new ArrayList<InfoContactModel>();
|
||||||
|
|
||||||
AppControllerExplorer.rpcWorkspaceService.getAllContacts(new AsyncCallback<List<InfoContactModel>>() {
|
WorkspaceSharingServiceAsync.INSTANCE.getAllContacts(new AsyncCallback<List<InfoContactModel>>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(List<InfoContactModel> result) {
|
public void onSuccess(List<InfoContactModel> result) {
|
||||||
|
@ -88,7 +88,7 @@ public class UserStore implements ContactFetcher{
|
||||||
|
|
||||||
// comboSharedUsers.mask("Loading users");
|
// comboSharedUsers.mask("Loading users");
|
||||||
|
|
||||||
AppControllerExplorer.rpcWorkspaceService.getListUserSharedByFolderSharedId(sharedFolderId, new AsyncCallback<List<InfoContactModel>>() {
|
WorkspaceSharingServiceAsync.INSTANCE.getListUserSharedByFolderSharedId(sharedFolderId, new AsyncCallback<List<InfoContactModel>>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
|
@ -128,7 +128,7 @@ public class UserStore implements ContactFetcher{
|
||||||
@Override
|
@Override
|
||||||
public void getOwner(final String sharedFolderId,final AsyncCallback<InfoContactModel> callback) {
|
public void getOwner(final String sharedFolderId,final AsyncCallback<InfoContactModel> callback) {
|
||||||
|
|
||||||
AppControllerExplorer.rpcWorkspaceService.getOwnerByItemId(sharedFolderId, new AsyncCallback<InfoContactModel>() {
|
WorkspaceSharingServiceAsync.INSTANCE.getOwnerByItemId(sharedFolderId, new AsyncCallback<InfoContactModel>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
|
|
|
@ -5,9 +5,9 @@ import java.util.List;
|
||||||
|
|
||||||
import org.gcube.portlets.user.workspace.client.ConstantsExplorer;
|
import org.gcube.portlets.user.workspace.client.ConstantsExplorer;
|
||||||
import org.gcube.portlets.user.workspace.client.model.ExtendedInfoContactModel;
|
import org.gcube.portlets.user.workspace.client.model.ExtendedInfoContactModel;
|
||||||
import org.gcube.portlets.user.workspace.client.model.InfoContactModel;
|
|
||||||
import org.gcube.portlets.user.workspace.client.resources.Resources;
|
import org.gcube.portlets.user.workspace.client.resources.Resources;
|
||||||
import org.gcube.portlets.user.workspace.client.view.windows.MessageBoxConfirm;
|
import org.gcube.portlets.user.workspace.client.view.windows.MessageBoxConfirm;
|
||||||
|
import org.gcube.portlets.widgets.workspacesharingwidget.shared.InfoContactModel;
|
||||||
|
|
||||||
import com.extjs.gxt.ui.client.Style.HorizontalAlignment;
|
import com.extjs.gxt.ui.client.Style.HorizontalAlignment;
|
||||||
import com.extjs.gxt.ui.client.Style.Orientation;
|
import com.extjs.gxt.ui.client.Style.Orientation;
|
||||||
|
@ -51,7 +51,7 @@ import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
|
||||||
/**
|
/**
|
||||||
* The Class MultiDragContact.
|
* The Class MultiDragContact.
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
* Jun 1, 2016
|
* Jun 1, 2016
|
||||||
*/
|
*/
|
||||||
public class MultiDragContact extends Dialog {
|
public class MultiDragContact extends Dialog {
|
||||||
|
|
|
@ -4,9 +4,10 @@ import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.gcube.portlets.user.workspace.client.model.InfoContactModel;
|
|
||||||
import org.gcube.portlets.user.workspace.client.util.MaskPanel;
|
import org.gcube.portlets.user.workspace.client.util.MaskPanel;
|
||||||
import org.gcube.portlets.user.workspace.client.view.sharing.ContactFetcher;
|
import org.gcube.portlets.user.workspace.client.view.sharing.ContactFetcher;
|
||||||
|
import org.gcube.portlets.widgets.workspacesharingwidget.shared.InfoContactModel;
|
||||||
|
|
||||||
import com.google.gwt.core.client.GWT;
|
import com.google.gwt.core.client.GWT;
|
||||||
import com.google.gwt.event.dom.client.ClickEvent;
|
import com.google.gwt.event.dom.client.ClickEvent;
|
||||||
|
|
|
@ -5,12 +5,13 @@ import java.util.List;
|
||||||
import org.gcube.portlets.user.workspace.client.AppControllerExplorer;
|
import org.gcube.portlets.user.workspace.client.AppControllerExplorer;
|
||||||
import org.gcube.portlets.user.workspace.client.event.UpdatedVREPermissionEvent;
|
import org.gcube.portlets.user.workspace.client.event.UpdatedVREPermissionEvent;
|
||||||
import org.gcube.portlets.user.workspace.client.model.FileModel;
|
import org.gcube.portlets.user.workspace.client.model.FileModel;
|
||||||
import org.gcube.portlets.user.workspace.client.model.InfoContactModel;
|
|
||||||
import org.gcube.portlets.user.workspace.client.resources.Resources;
|
import org.gcube.portlets.user.workspace.client.resources.Resources;
|
||||||
import org.gcube.portlets.user.workspace.client.view.sharing.PanelTogglePermission;
|
import org.gcube.portlets.user.workspace.client.view.sharing.PanelTogglePermission;
|
||||||
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.shared.WorkspaceACL;
|
import org.gcube.portlets.widgets.workspacesharingwidget.shared.WorkspaceACL;
|
||||||
|
import org.gcube.portlets.widgets.workspacesharingwidget.client.rpc.WorkspaceSharingServiceAsync;
|
||||||
|
import org.gcube.portlets.widgets.workspacesharingwidget.shared.InfoContactModel;
|
||||||
|
|
||||||
import com.extjs.gxt.ui.client.Style.HorizontalAlignment;
|
import com.extjs.gxt.ui.client.Style.HorizontalAlignment;
|
||||||
import com.extjs.gxt.ui.client.Style.Scroll;
|
import com.extjs.gxt.ui.client.Style.Scroll;
|
||||||
|
@ -25,7 +26,7 @@ import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||||
import com.google.gwt.user.client.ui.Label;
|
import com.google.gwt.user.client.ui.Label;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class DialogPermission extends Dialog {
|
public class DialogPermission extends Dialog {
|
||||||
|
@ -92,7 +93,7 @@ public class DialogPermission extends Dialog {
|
||||||
getUsersManagers(folder.getIdentifier(), callback);
|
getUsersManagers(folder.getIdentifier(), callback);
|
||||||
|
|
||||||
//TODO GET ACL FOR USER
|
//TODO GET ACL FOR USER
|
||||||
AppControllerExplorer.rpcWorkspaceService.getACLs(new AsyncCallback<List<WorkspaceACL>>() {
|
WorkspaceSharingServiceAsync.INSTANCE.getACLs(new AsyncCallback<List<WorkspaceACL>>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(List<WorkspaceACL> result) {
|
public void onSuccess(List<WorkspaceACL> result) {
|
||||||
|
@ -141,7 +142,7 @@ public class DialogPermission extends Dialog {
|
||||||
INSTANCE.mask("Changing permissions");
|
INSTANCE.mask("Changing permissions");
|
||||||
if(folder!=null && getSelectedACL().getId()!=null){
|
if(folder!=null && getSelectedACL().getId()!=null){
|
||||||
|
|
||||||
AppControllerExplorer.rpcWorkspaceService.updateACLForVREbyGroupName(folder.getIdentifier(), getSelectedACL().getId(), new AsyncCallback<Void>() {
|
WorkspaceSharingServiceAsync.INSTANCE.updateACLForVREbyGroupName(folder.getIdentifier(), getSelectedACL().getId(), new AsyncCallback<Void>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
|
@ -197,7 +198,7 @@ public class DialogPermission extends Dialog {
|
||||||
|
|
||||||
public void getUsersManagers(final String sharedFolderId,final AsyncCallback<List<InfoContactModel>> callback) {
|
public void getUsersManagers(final String sharedFolderId,final AsyncCallback<List<InfoContactModel>> callback) {
|
||||||
|
|
||||||
AppControllerExplorer.rpcWorkspaceService.getUsersManagerToSharedFolder(sharedFolderId, new AsyncCallback<List<InfoContactModel>>() {
|
WorkspaceSharingServiceAsync.INSTANCE.getAdministratorsByFolderId(sharedFolderId, new AsyncCallback<List<InfoContactModel>>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable arg0) {
|
public void onFailure(Throwable arg0) {
|
||||||
|
|
|
@ -20,7 +20,7 @@ import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||||
/**
|
/**
|
||||||
* The Class SmartFolderPanel.
|
* The Class SmartFolderPanel.
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
* @author Massimiliano Assante ISTI-CNR
|
* @author Massimiliano Assante ISTI-CNR
|
||||||
* @version 1.0 May 14th 2012
|
* @version 1.0 May 14th 2012
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -56,7 +56,7 @@ import com.google.gwt.user.client.ui.AbstractImagePrototype;
|
||||||
/**
|
/**
|
||||||
* The Class AsyncTreePanel.
|
* The Class AsyncTreePanel.
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
* Sep 15, 2016
|
* Sep 15, 2016
|
||||||
*/
|
*/
|
||||||
public class AsyncTreePanel extends LayoutContainer {
|
public class AsyncTreePanel extends LayoutContainer {
|
||||||
|
@ -78,7 +78,7 @@ public class AsyncTreePanel extends LayoutContainer {
|
||||||
/**
|
/**
|
||||||
* The Enum DragType.
|
* The Enum DragType.
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
* Aug 29, 2016
|
* Aug 29, 2016
|
||||||
*/
|
*/
|
||||||
private enum DragType {INSERT, APPEND};
|
private enum DragType {INSERT, APPEND};
|
||||||
|
|
|
@ -60,7 +60,7 @@ import com.google.gwt.user.client.ui.AbstractImagePrototype;
|
||||||
/**
|
/**
|
||||||
* The Class ContextMenuTree.
|
* The Class ContextMenuTree.
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
*/
|
*/
|
||||||
public class ContextMenuTree {
|
public class ContextMenuTree {
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ import com.extjs.gxt.ui.client.widget.ProgressBar;
|
||||||
//import com.google.gwt.user.client.Timer;
|
//import com.google.gwt.user.client.Timer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class BulkProgressBar extends ProgressBar {
|
public class BulkProgressBar extends ProgressBar {
|
||||||
|
|
|
@ -19,7 +19,7 @@ import com.extjs.gxt.ui.client.widget.layout.FormLayout;
|
||||||
/**
|
/**
|
||||||
* The Class DialogAddFolderAndSmart.
|
* The Class DialogAddFolderAndSmart.
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it Jul 10, 2017
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it Jul 10, 2017
|
||||||
*/
|
*/
|
||||||
public class DialogAddFolderAndSmart extends Dialog {
|
public class DialogAddFolderAndSmart extends Dialog {
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ public class DialogAddFolderAndSmart extends Dialog {
|
||||||
/**
|
/**
|
||||||
* The Enum AddType.
|
* The Enum AddType.
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it Jul 10,
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it Jul 10,
|
||||||
* 2017
|
* 2017
|
||||||
*/
|
*/
|
||||||
public enum AddType {
|
public enum AddType {
|
||||||
|
|
|
@ -21,7 +21,7 @@ import com.google.gwt.user.client.ui.Label;
|
||||||
/**
|
/**
|
||||||
* The Class DialogAddUrl.
|
* The Class DialogAddUrl.
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
* Nov 29, 2016
|
* Nov 29, 2016
|
||||||
*/
|
*/
|
||||||
public class DialogAddUrl extends Dialog {
|
public class DialogAddUrl extends Dialog {
|
||||||
|
|
|
@ -23,7 +23,7 @@ import com.google.gwt.user.client.ui.Widget;
|
||||||
/**
|
/**
|
||||||
* The Class DialogConfirm.
|
* The Class DialogConfirm.
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
* Feb 19, 2015
|
* Feb 19, 2015
|
||||||
*/
|
*/
|
||||||
public class DialogConfirm extends DialogBox implements ClickHandler {
|
public class DialogConfirm extends DialogBox implements ClickHandler {
|
||||||
|
|
|
@ -26,7 +26,7 @@ import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||||
/**
|
/**
|
||||||
* The Class DialogEditProperties.
|
* The Class DialogEditProperties.
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
* Jun 11, 2015
|
* Jun 11, 2015
|
||||||
*/
|
*/
|
||||||
public class DialogEditProperties extends Dialog{
|
public class DialogEditProperties extends Dialog{
|
||||||
|
|
|
@ -7,8 +7,9 @@ import org.gcube.portlets.user.workspace.client.AppControllerExplorer;
|
||||||
import org.gcube.portlets.user.workspace.client.ConstantsExplorer;
|
import org.gcube.portlets.user.workspace.client.ConstantsExplorer;
|
||||||
import org.gcube.portlets.user.workspace.client.model.FileGridModel;
|
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.model.FileModel;
|
||||||
import org.gcube.portlets.user.workspace.client.model.InfoContactModel;
|
|
||||||
import org.gcube.portlets.user.workspace.client.resources.Resources;
|
import org.gcube.portlets.user.workspace.client.resources.Resources;
|
||||||
|
import org.gcube.portlets.widgets.workspacesharingwidget.client.rpc.WorkspaceSharingServiceAsync;
|
||||||
|
import org.gcube.portlets.widgets.workspacesharingwidget.shared.InfoContactModel;
|
||||||
|
|
||||||
import com.extjs.gxt.ui.client.Style.HorizontalAlignment;
|
import com.extjs.gxt.ui.client.Style.HorizontalAlignment;
|
||||||
import com.extjs.gxt.ui.client.Style.Scroll;
|
import com.extjs.gxt.ui.client.Style.Scroll;
|
||||||
|
@ -31,7 +32,7 @@ import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||||
import com.google.gwt.user.client.ui.Image;
|
import com.google.gwt.user.client.ui.Image;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class DialogGetInfo extends Dialog {
|
public class DialogGetInfo extends Dialog {
|
||||||
|
@ -55,95 +56,95 @@ public class DialogGetInfo extends Dialog {
|
||||||
private TextField<String> txtIsPublic = new TextField<String>();
|
private TextField<String> txtIsPublic = new TextField<String>();
|
||||||
private TextField<String> txtThreddsSynched = new TextField<String>();
|
private TextField<String> txtThreddsSynched = new TextField<String>();
|
||||||
private TextField<String> txtShared = new TextField<String>();
|
private TextField<String> txtShared = new TextField<String>();
|
||||||
// private TextArea textAreaSharedWith = new TextArea();
|
// private TextArea textAreaSharedWith = new TextArea();
|
||||||
private Html htmlUsersWidget = new Html();
|
private Html htmlUsersWidget = new Html();
|
||||||
private Html htmlPropertiesWidget = new Html();
|
private Html htmlPropertiesWidget = new Html();
|
||||||
private final NumberFormat number = ConstantsExplorer.numberFormatterKB;
|
private final NumberFormat number = ConstantsExplorer.numberFormatterKB;
|
||||||
// private TextField<String> txtGcubeItemProperties;
|
// private TextField<String> txtGcubeItemProperties;
|
||||||
private HorizontalPanel hpGcubeProperties;
|
private HorizontalPanel hpGcubeProperties;
|
||||||
private DialogEditProperties editProperties = null;
|
private DialogEditProperties editProperties = null;
|
||||||
|
|
||||||
public DialogGetInfo(final FileModel fileModel) {
|
public DialogGetInfo(final FileModel fileModel) {
|
||||||
|
|
||||||
FormLayout layout = new FormLayout();
|
FormLayout layout = new FormLayout();
|
||||||
layout.setLabelWidth(90);
|
layout.setLabelWidth(90);
|
||||||
layout.setDefaultWidth(300);
|
layout.setDefaultWidth(300);
|
||||||
setLayout(layout);
|
setLayout(layout);
|
||||||
|
|
||||||
setIcon(fileModel.getAbstractPrototypeIcon());
|
setIcon(fileModel.getAbstractPrototypeIcon());
|
||||||
setHeading(fileModel.getName() + " Properties");
|
setHeading(fileModel.getName() + " Properties");
|
||||||
|
|
||||||
setButtonAlign(HorizontalAlignment.RIGHT);
|
setButtonAlign(HorizontalAlignment.RIGHT);
|
||||||
setModal(true);
|
setModal(true);
|
||||||
// setBodyBorder(true);
|
// setBodyBorder(true);
|
||||||
setBodyStyle("padding: 9px; background: none");
|
setBodyStyle("padding: 9px; background: none");
|
||||||
setWidth(widthDialog);
|
setWidth(widthDialog);
|
||||||
setResizable(false);
|
setResizable(false);
|
||||||
setButtons(Dialog.OK);
|
setButtons(Dialog.OK);
|
||||||
|
|
||||||
txtName = new TextField<String>();
|
txtName = new TextField<String>();
|
||||||
txtName.setFieldLabel("Name");
|
txtName.setFieldLabel("Name");
|
||||||
txtName.setReadOnly(true);
|
txtName.setReadOnly(true);
|
||||||
textFieldSetValue(txtName,fileModel.getName());
|
textFieldSetValue(txtName, fileModel.getName());
|
||||||
add(txtName);
|
add(txtName);
|
||||||
|
|
||||||
txtLocation = new TextField<String>();
|
txtLocation = new TextField<String>();
|
||||||
txtLocation.setFieldLabel("Location");
|
txtLocation.setFieldLabel("Location");
|
||||||
txtLocation.setReadOnly(true);
|
txtLocation.setReadOnly(true);
|
||||||
|
|
||||||
if(fileModel.isRoot())
|
if (fileModel.isRoot())
|
||||||
txtLocation.setValue("/");
|
txtLocation.setValue("/");
|
||||||
else
|
else
|
||||||
loadLocation(fileModel.getIdentifier());
|
loadLocation(fileModel.getIdentifier());
|
||||||
|
|
||||||
add(txtLocation);
|
add(txtLocation);
|
||||||
|
|
||||||
if(fileModel.isDirectory()){
|
if (fileModel.isDirectory()) {
|
||||||
txtIsPublic = new TextField<String>();
|
txtIsPublic = new TextField<String>();
|
||||||
txtIsPublic.setFieldLabel("Public Folder");
|
txtIsPublic.setFieldLabel("Public Folder");
|
||||||
txtIsPublic.setReadOnly(true);
|
txtIsPublic.setReadOnly(true);
|
||||||
txtIsPublic.setValue(fileModel.isPublic()+"");
|
txtIsPublic.setValue(fileModel.isPublic() + "");
|
||||||
add(txtIsPublic);
|
add(txtIsPublic);
|
||||||
|
|
||||||
if(fileModel.getSynchedThreddsStatus()!=null){
|
if (fileModel.getSynchedThreddsStatus() != null) {
|
||||||
txtThreddsSynched = new TextField<String>();
|
txtThreddsSynched = new TextField<String>();
|
||||||
txtThreddsSynched.setFieldLabel("Thredds Sync");
|
txtThreddsSynched.setFieldLabel("Thredds Sync");
|
||||||
txtThreddsSynched.setReadOnly(true);
|
txtThreddsSynched.setReadOnly(true);
|
||||||
txtThreddsSynched.setValue(fileModel.getSynchedThreddsStatus()+"");
|
txtThreddsSynched.setValue(fileModel.getSynchedThreddsStatus() + "");
|
||||||
add(txtThreddsSynched);
|
add(txtThreddsSynched);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
txtAreaDescription.setFieldLabel("Description");
|
||||||
|
txtAreaDescription.setHeight(30);
|
||||||
|
txtAreaDescription.setReadOnly(true);
|
||||||
|
add(txtAreaDescription);
|
||||||
|
|
||||||
txtAreaDescription.setFieldLabel("Description");
|
// GCUBE PROPERTIES
|
||||||
txtAreaDescription.setHeight(30);
|
|
||||||
txtAreaDescription.setReadOnly(true);
|
|
||||||
add(txtAreaDescription);
|
|
||||||
|
|
||||||
//GCUBE PROPERTIES
|
|
||||||
hpGcubeProperties = new HorizontalPanel();
|
hpGcubeProperties = new HorizontalPanel();
|
||||||
hpGcubeProperties.setStyleAttribute("padding-top", "6px");
|
hpGcubeProperties.setStyleAttribute("padding-top", "6px");
|
||||||
hpGcubeProperties.setStyleAttribute("margin-bottom", "6px");
|
hpGcubeProperties.setStyleAttribute("margin-bottom", "6px");
|
||||||
Label labelProperties = new Label("Properties");
|
Label labelProperties = new Label("Properties");
|
||||||
labelProperties.setTitle("Gcube Properties");
|
labelProperties.setTitle("Gcube Properties");
|
||||||
labelProperties.setStyleAttribute("padding-right", "47px");
|
labelProperties.setStyleAttribute("padding-right", "47px");
|
||||||
hpGcubeProperties.add(labelProperties);
|
hpGcubeProperties.add(labelProperties);
|
||||||
loadGcubeItemProperties(fileModel.getIdentifier());
|
loadGcubeItemProperties(fileModel.getIdentifier());
|
||||||
htmlPropertiesWidget.setHeight(heightTextArea);
|
htmlPropertiesWidget.setHeight(heightTextArea);
|
||||||
htmlPropertiesWidget.setWidth("275px");
|
htmlPropertiesWidget.setWidth("275px");
|
||||||
|
|
||||||
LayoutContainer lc = new LayoutContainer();
|
LayoutContainer lc = new LayoutContainer();
|
||||||
lc.addStyleName("editPermissions");
|
lc.addStyleName("editPermissions");
|
||||||
|
|
||||||
Image imgProperties = Resources.getIconEdit().createImage(); //EDIT PROPERTIES
|
Image imgProperties = Resources.getIconEdit().createImage(); // EDIT
|
||||||
imgProperties.setTitle("Edit Properties");
|
// PROPERTIES
|
||||||
lc.add(imgProperties);
|
imgProperties.setTitle("Edit Properties");
|
||||||
|
lc.add(imgProperties);
|
||||||
|
|
||||||
hpGcubeProperties.add(lc);
|
hpGcubeProperties.add(lc);
|
||||||
|
|
||||||
final Command cmdReloadProperties = new Command() {
|
final Command cmdReloadProperties = new Command() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute() {
|
public void execute() {
|
||||||
|
@ -151,112 +152,111 @@ public class DialogGetInfo extends Dialog {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
imgProperties.addClickHandler(new ClickHandler() {
|
imgProperties.addClickHandler(new ClickHandler() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(ClickEvent event) {
|
public void onClick(ClickEvent event) {
|
||||||
if(editProperties==null)
|
if (editProperties == null)
|
||||||
editProperties = new DialogEditProperties(fileModel, cmdReloadProperties);
|
editProperties = new DialogEditProperties(fileModel, cmdReloadProperties);
|
||||||
|
|
||||||
editProperties.show();
|
editProperties.show();
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
htmlPropertiesWidget.setStyleAttribute("margin-left", "5px");
|
htmlPropertiesWidget.setStyleAttribute("margin-left", "5px");
|
||||||
hpGcubeProperties.add(htmlPropertiesWidget);
|
hpGcubeProperties.add(htmlPropertiesWidget);
|
||||||
hpGcubeProperties.setScrollMode(Scroll.AUTOY);
|
hpGcubeProperties.setScrollMode(Scroll.AUTOY);
|
||||||
add(hpGcubeProperties);
|
add(hpGcubeProperties);
|
||||||
setVisibleGcubeProperties(false);
|
setVisibleGcubeProperties(false);
|
||||||
|
|
||||||
if(fileModel.isDirectory()){
|
if (fileModel.isDirectory()) {
|
||||||
txtAreaDescription.setValue(fileModel.getDescription());
|
txtAreaDescription.setValue(fileModel.getDescription());
|
||||||
// add(txtAreaDescription);
|
// add(txtAreaDescription);
|
||||||
}else
|
} else
|
||||||
loadDescription(fileModel.getIdentifier());
|
loadDescription(fileModel.getIdentifier());
|
||||||
|
|
||||||
txtType = new TextField<String>();
|
txtType = new TextField<String>();
|
||||||
txtType.setFieldLabel("Type");
|
txtType.setFieldLabel("Type");
|
||||||
txtType.setReadOnly(true);
|
txtType.setReadOnly(true);
|
||||||
textFieldSetValue(txtType,fileModel.getType());
|
textFieldSetValue(txtType, fileModel.getType());
|
||||||
add(txtType);
|
add(txtType);
|
||||||
|
|
||||||
txtCategory = new TextField<String>();
|
txtCategory = new TextField<String>();
|
||||||
txtCategory.setFieldLabel("Category");
|
txtCategory.setFieldLabel("Category");
|
||||||
txtCategory.setReadOnly(true);
|
txtCategory.setReadOnly(true);
|
||||||
if(fileModel.getShortcutCategory()!=null)
|
if (fileModel.getShortcutCategory() != null)
|
||||||
textFieldSetValue(txtCategory,fileModel.getShortcutCategory().getValue());
|
textFieldSetValue(txtCategory, fileModel.getShortcutCategory().getValue());
|
||||||
add(txtCategory);
|
add(txtCategory);
|
||||||
|
|
||||||
txtOwner = new TextField<String>();
|
txtOwner = new TextField<String>();
|
||||||
txtOwner.setFieldLabel("Owner");
|
txtOwner.setFieldLabel("Owner");
|
||||||
txtOwner.setReadOnly(true);
|
txtOwner.setReadOnly(true);
|
||||||
loadOwner(fileModel.getIdentifier());
|
loadOwner(fileModel.getIdentifier());
|
||||||
add(txtOwner);
|
add(txtOwner);
|
||||||
|
|
||||||
txtCreated = new TextField<String>();
|
txtCreated = new TextField<String>();
|
||||||
txtCreated.setFieldLabel("Created");
|
txtCreated.setFieldLabel("Created");
|
||||||
txtCreated.setReadOnly(true);
|
txtCreated.setReadOnly(true);
|
||||||
|
|
||||||
loadCreationDate(fileModel.getIdentifier());
|
loadCreationDate(fileModel.getIdentifier());
|
||||||
|
|
||||||
add(txtCreated);
|
add(txtCreated);
|
||||||
|
|
||||||
txtLastMofication = new TextField<String>();
|
txtLastMofication = new TextField<String>();
|
||||||
txtLastMofication.setFieldLabel("Last Mofication");
|
txtLastMofication.setFieldLabel("Last Mofication");
|
||||||
txtLastMofication.setReadOnly(true);
|
txtLastMofication.setReadOnly(true);
|
||||||
if(fileModel instanceof FileGridModel)
|
if (fileModel instanceof FileGridModel)
|
||||||
textFieldSetValue(txtLastMofication, ((FileGridModel) fileModel).getLastModification().toString());
|
textFieldSetValue(txtLastMofication, ((FileGridModel) fileModel).getLastModification().toString());
|
||||||
else
|
else
|
||||||
loadLastModificationDate(fileModel.getIdentifier());
|
loadLastModificationDate(fileModel.getIdentifier());
|
||||||
|
|
||||||
add(txtLastMofication);
|
add(txtLastMofication);
|
||||||
|
|
||||||
txtSize = new TextField<String>();
|
txtSize = new TextField<String>();
|
||||||
txtSize.setFieldLabel("Size");
|
txtSize.setFieldLabel("Size");
|
||||||
txtSize.setReadOnly(true);
|
txtSize.setReadOnly(true);
|
||||||
|
|
||||||
if(fileModel instanceof FileGridModel)
|
if (fileModel instanceof FileGridModel)
|
||||||
textFieldSetValue(txtSize,getFormattedSize(((FileGridModel) fileModel).getSize()));
|
textFieldSetValue(txtSize, getFormattedSize(((FileGridModel) fileModel).getSize()));
|
||||||
else
|
else
|
||||||
loadSize(fileModel.getIdentifier());
|
loadSize(fileModel.getIdentifier());
|
||||||
|
|
||||||
add(txtSize);
|
add(txtSize);
|
||||||
|
|
||||||
//SHARED
|
// SHARED
|
||||||
txtShared = new TextField<String>();
|
txtShared = new TextField<String>();
|
||||||
txtShared.setFieldLabel("Shared");
|
txtShared.setFieldLabel("Shared");
|
||||||
txtShared.setReadOnly(true);
|
txtShared.setReadOnly(true);
|
||||||
textFieldSetValue(txtShared,fileModel.isShared()+"");
|
textFieldSetValue(txtShared, fileModel.isShared() + "");
|
||||||
add(txtShared);
|
add(txtShared);
|
||||||
|
|
||||||
//USERS SHARED
|
// USERS SHARED
|
||||||
if(fileModel.isShared()){
|
if (fileModel.isShared()) {
|
||||||
|
|
||||||
HorizontalPanel hp = new HorizontalPanel();
|
HorizontalPanel hp = new HorizontalPanel();
|
||||||
hp.setStyleAttribute("padding-top", "6px");
|
hp.setStyleAttribute("padding-top", "6px");
|
||||||
Label label = new Label("Shared with");
|
Label label = new Label("Shared with");
|
||||||
label.setStyleAttribute("padding-right", "39px");
|
label.setStyleAttribute("padding-right", "39px");
|
||||||
hp.add(label);
|
hp.add(label);
|
||||||
loadACLsDescriptionForSharedFolder(fileModel.getIdentifier());
|
loadACLsDescriptionForSharedFolder(fileModel.getIdentifier());
|
||||||
htmlUsersWidget.setHeight(heightTextArea);
|
htmlUsersWidget.setHeight(heightTextArea);
|
||||||
htmlUsersWidget.setWidth("297px");
|
htmlUsersWidget.setWidth("297px");
|
||||||
hp.add(htmlUsersWidget);
|
hp.add(htmlUsersWidget);
|
||||||
hp.setScrollMode(Scroll.AUTOY);
|
hp.setScrollMode(Scroll.AUTOY);
|
||||||
add(hp);
|
add(hp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.getButtonById(Dialog.OK).addSelectionListener(new SelectionListener<ButtonEvent>() {
|
||||||
this.getButtonById(Dialog.OK).addSelectionListener(new SelectionListener<ButtonEvent>() {
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void componentSelected(ButtonEvent ce) {
|
public void componentSelected(ButtonEvent ce) {
|
||||||
hide();
|
hide();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.show();
|
this.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setVisibleGcubeProperties(boolean bool){
|
private void setVisibleGcubeProperties(boolean bool) {
|
||||||
hpGcubeProperties.setVisible(bool);
|
hpGcubeProperties.setVisible(bool);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -276,7 +276,7 @@ public class DialogGetInfo extends Dialog {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(String result) {
|
public void onSuccess(String result) {
|
||||||
if(result!=null)
|
if (result != null)
|
||||||
txtAreaDescription.setValue(result);
|
txtAreaDescription.setValue(result);
|
||||||
else
|
else
|
||||||
txtAreaDescription.setValue("");
|
txtAreaDescription.setValue("");
|
||||||
|
@ -295,7 +295,7 @@ public class DialogGetInfo extends Dialog {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
GWT.log("an error occured in loadLastModificationDateById "+itemId + " "+caught.getMessage());
|
GWT.log("an error occured in loadLastModificationDateById " + itemId + " " + caught.getMessage());
|
||||||
txtLastMofication.unmask();
|
txtLastMofication.unmask();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -303,7 +303,7 @@ public class DialogGetInfo extends Dialog {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(Date result) {
|
public void onSuccess(Date result) {
|
||||||
|
|
||||||
if(result!=null)
|
if (result != null)
|
||||||
txtLastMofication.setValue(result.toString());
|
txtLastMofication.setValue(result.toString());
|
||||||
else
|
else
|
||||||
txtLastMofication.setValue(UNKNOWN);
|
txtLastMofication.setValue(UNKNOWN);
|
||||||
|
@ -314,37 +314,35 @@ public class DialogGetInfo extends Dialog {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void textFieldSetValue(TextField<String> field, String value){
|
private void textFieldSetValue(TextField<String> field, String value) {
|
||||||
|
|
||||||
if(value==null || value.isEmpty())
|
if (value == null || value.isEmpty())
|
||||||
field.setValue(UNKNOWN);
|
field.setValue(UNKNOWN);
|
||||||
else
|
else
|
||||||
field.setValue(value);
|
field.setValue(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void loadOwner(final String itemId){
|
private void loadOwner(final String itemId) {
|
||||||
|
|
||||||
txtOwner.mask();
|
txtOwner.mask();
|
||||||
|
|
||||||
AppControllerExplorer.rpcWorkspaceService.getOwnerByItemId(itemId, new AsyncCallback<InfoContactModel>() {
|
WorkspaceSharingServiceAsync.INSTANCE.getOwnerByItemId(itemId, new AsyncCallback<InfoContactModel>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
GWT.log("an error occured in get Owner by Id "+itemId + " "+caught.getMessage());
|
GWT.log("an error occured in get Owner by Id " + itemId + " " + caught.getMessage());
|
||||||
txtOwner.unmask();
|
txtOwner.unmask();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(InfoContactModel result) {
|
public void onSuccess(InfoContactModel result) {
|
||||||
textFieldSetValue(txtOwner,result.getName());
|
textFieldSetValue(txtOwner, result.getName());
|
||||||
txtOwner.unmask();
|
txtOwner.unmask();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void loadGcubeItemProperties(final String itemId) {
|
||||||
|
|
||||||
private void loadGcubeItemProperties(final String itemId){
|
|
||||||
GWT.log("Load GcubeItemProperties");
|
GWT.log("Load GcubeItemProperties");
|
||||||
htmlPropertiesWidget.mask();
|
htmlPropertiesWidget.mask();
|
||||||
AppControllerExplorer.rpcWorkspaceService.getHTMLGcubeItemProperties(itemId, new AsyncCallback<String>() {
|
AppControllerExplorer.rpcWorkspaceService.getHTMLGcubeItemProperties(itemId, new AsyncCallback<String>() {
|
||||||
|
@ -352,135 +350,135 @@ public class DialogGetInfo extends Dialog {
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
htmlPropertiesWidget.unmask();
|
htmlPropertiesWidget.unmask();
|
||||||
GWT.log("an error occured in load properties by Id "+itemId + " "+caught.getMessage());
|
GWT.log("an error occured in load properties by Id " + itemId + " " + caught.getMessage());
|
||||||
setVisibleGcubeProperties(true);
|
setVisibleGcubeProperties(true);
|
||||||
htmlPropertiesWidget.setHtml("Error on recovering properties");
|
htmlPropertiesWidget.setHtml("Error on recovering properties");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(String result) {
|
public void onSuccess(String result) {
|
||||||
// setVisibleGcubeProperties(true);
|
// setVisibleGcubeProperties(true);
|
||||||
htmlPropertiesWidget.unmask();
|
htmlPropertiesWidget.unmask();
|
||||||
if(result!=null){
|
if (result != null) {
|
||||||
setVisibleGcubeProperties(true);
|
setVisibleGcubeProperties(true);
|
||||||
htmlPropertiesWidget.setHtml(result);
|
htmlPropertiesWidget.setHtml(result);
|
||||||
}
|
}
|
||||||
// else{
|
// else{
|
||||||
// htmlPropertiesWidget.setHeight(20);
|
// htmlPropertiesWidget.setHeight(20);
|
||||||
// htmlPropertiesWidget.setHtml("None");
|
// htmlPropertiesWidget.setHtml("None");
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void loadSize(final String itemId) {
|
||||||
private void loadSize(final String itemId){
|
|
||||||
GWT.log("Load size");
|
GWT.log("Load size");
|
||||||
txtSize.mask();
|
txtSize.mask();
|
||||||
AppControllerExplorer.rpcWorkspaceService.loadSizeByItemId(itemId, new AsyncCallback<Long>() {
|
AppControllerExplorer.rpcWorkspaceService.loadSizeByItemId(itemId, new AsyncCallback<Long>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
GWT.log("an error occured in load creation date by Id "+itemId + " "+caught.getMessage());
|
GWT.log("an error occured in load creation date by Id " + itemId + " " + caught.getMessage());
|
||||||
txtSize.unmask();
|
txtSize.unmask();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(Long result) {
|
public void onSuccess(Long result) {
|
||||||
GWT.log("Loaded size="+result);
|
GWT.log("Loaded size=" + result);
|
||||||
textFieldSetValue(txtSize,getFormattedSize(result));
|
textFieldSetValue(txtSize, getFormattedSize(result));
|
||||||
txtSize.unmask();
|
txtSize.unmask();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void loadCreationDate(final String itemId) {
|
||||||
private void loadCreationDate(final String itemId){
|
|
||||||
|
|
||||||
txtCreated.mask();
|
txtCreated.mask();
|
||||||
AppControllerExplorer.rpcWorkspaceService.getItemCreationDateById(itemId, new AsyncCallback<Date>() {
|
AppControllerExplorer.rpcWorkspaceService.getItemCreationDateById(itemId, new AsyncCallback<Date>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
GWT.log("an error occured in load creation date by Id "+itemId + " "+caught.getMessage());
|
GWT.log("an error occured in load creation date by Id " + itemId + " " + caught.getMessage());
|
||||||
txtCreated.unmask();
|
txtCreated.unmask();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(Date result) {
|
public void onSuccess(Date result) {
|
||||||
if(result!=null)
|
if (result != null)
|
||||||
textFieldSetValue(txtCreated,result.toString());
|
textFieldSetValue(txtCreated, result.toString());
|
||||||
|
|
||||||
txtCreated.unmask();
|
txtCreated.unmask();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void loadACLsDescriptionForSharedFolder(String sharedId){
|
private void loadACLsDescriptionForSharedFolder(String sharedId) {
|
||||||
|
|
||||||
htmlUsersWidget.mask();
|
htmlUsersWidget.mask();
|
||||||
|
|
||||||
AppControllerExplorer.rpcWorkspaceService.getACLsDescriptionForWorkspaceItemById(sharedId, new AsyncCallback<String>() {
|
WorkspaceSharingServiceAsync.INSTANCE.getACLsDescriptionForWorkspaceItemById(sharedId,
|
||||||
|
new AsyncCallback<String>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
htmlUsersWidget.unmask();
|
htmlUsersWidget.unmask();
|
||||||
htmlUsersWidget.setHtml("Error on recovering users");
|
htmlUsersWidget.setHtml("Error on recovering users");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(String result) {
|
public void onSuccess(String result) {
|
||||||
htmlUsersWidget.unmask();
|
htmlUsersWidget.unmask();
|
||||||
GWT.log("Loaded ACLs: "+result);
|
GWT.log("Loaded ACLs: " + result);
|
||||||
htmlUsersWidget.setHtml(result);
|
htmlUsersWidget.setHtml(result);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getFormattedSize(long value){
|
private String getFormattedSize(long value) {
|
||||||
|
|
||||||
if(value>0){
|
if (value > 0) {
|
||||||
double kb = value/1024;
|
double kb = value / 1024;
|
||||||
if(kb<1)
|
if (kb < 1)
|
||||||
kb=1;
|
kb = 1;
|
||||||
return number.format(kb);
|
return number.format(kb);
|
||||||
}else if(value==0){
|
} else if (value == 0) {
|
||||||
return EMPTY;
|
return EMPTY;
|
||||||
}else
|
} else
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
private void loadLocation(String itemId){
|
private void loadLocation(String itemId) {
|
||||||
|
|
||||||
txtLocation.mask();
|
txtLocation.mask();
|
||||||
AppControllerExplorer.rpcWorkspaceService.getListParentsByItemIdentifier(itemId, false, new AsyncCallback<List<FileModel>>() {
|
AppControllerExplorer.rpcWorkspaceService.getListParentsByItemIdentifier(itemId, false,
|
||||||
|
new AsyncCallback<List<FileModel>>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
GWT.log("failure get list parents by item identifier "+caught);
|
GWT.log("failure get list parents by item identifier " + caught);
|
||||||
txtLocation.unmask();
|
txtLocation.unmask();
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onSuccess(List<FileModel> result) {
|
|
||||||
|
|
||||||
String location="";
|
|
||||||
if(result!=null){
|
|
||||||
for (FileModel fileModel : result) {
|
|
||||||
if(fileModel!=null)
|
|
||||||
location+="/"+fileModel.getName();
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if(location.isEmpty())
|
|
||||||
location ="/";
|
|
||||||
|
|
||||||
txtLocation.setValue(location);
|
@Override
|
||||||
txtLocation.unmask();
|
public void onSuccess(List<FileModel> result) {
|
||||||
}
|
|
||||||
});
|
String location = "";
|
||||||
|
if (result != null) {
|
||||||
|
for (FileModel fileModel : result) {
|
||||||
|
if (fileModel != null)
|
||||||
|
location += "/" + fileModel.getName();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (location.isEmpty())
|
||||||
|
location = "/";
|
||||||
|
|
||||||
|
txtLocation.setValue(location);
|
||||||
|
txtLocation.unmask();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -5,9 +5,11 @@ import org.gcube.portlets.user.workspace.client.event.RefreshFolderEvent;
|
||||||
import org.gcube.portlets.user.workspace.client.event.SessionExpiredEvent;
|
import org.gcube.portlets.user.workspace.client.event.SessionExpiredEvent;
|
||||||
import org.gcube.portlets.user.workspace.client.model.FileModel;
|
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.resources.Resources;
|
||||||
import org.gcube.portlets.user.workspace.shared.AllowAccess;
|
|
||||||
import org.gcube.portlets.user.workspace.shared.PublicLink;
|
import org.gcube.portlets.user.workspace.shared.PublicLink;
|
||||||
import org.gcube.portlets.user.workspace.shared.SessionExpiredException;
|
import org.gcube.portlets.user.workspace.shared.SessionExpiredException;
|
||||||
|
import org.gcube.portlets.widgets.workspacesharingwidget.client.rpc.WorkspaceSharingServiceAsync;
|
||||||
|
import org.gcube.portlets.widgets.workspacesharingwidget.shared.AllowAccess;
|
||||||
|
|
||||||
import com.extjs.gxt.ui.client.Style.HorizontalAlignment;
|
import com.extjs.gxt.ui.client.Style.HorizontalAlignment;
|
||||||
import com.extjs.gxt.ui.client.Style.Scroll;
|
import com.extjs.gxt.ui.client.Style.Scroll;
|
||||||
|
@ -23,12 +25,10 @@ import com.google.gwt.core.client.GWT;
|
||||||
import com.google.gwt.dom.client.Style.Unit;
|
import com.google.gwt.dom.client.Style.Unit;
|
||||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Class DialogGetLink.
|
* The Class DialogGetLink.
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it Sep 13, 2016
|
||||||
* Sep 13, 2016
|
|
||||||
*/
|
*/
|
||||||
public class DialogGetLink extends Dialog {
|
public class DialogGetLink extends Dialog {
|
||||||
|
|
||||||
|
@ -43,20 +43,26 @@ public class DialogGetLink extends Dialog {
|
||||||
/**
|
/**
|
||||||
* The Enum Link_Type.
|
* The Enum Link_Type.
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it Sep 13,
|
||||||
* Sep 13, 2016
|
* 2016
|
||||||
*/
|
*/
|
||||||
public enum Link_Type {PUBLIC_LINK, FOLDER_LINK};
|
public enum Link_Type {
|
||||||
|
PUBLIC_LINK, FOLDER_LINK
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instantiates a new dialog get link.
|
* Instantiates a new dialog get link.
|
||||||
*
|
*
|
||||||
* @param headingTxt the heading txt
|
* @param headingTxt
|
||||||
* @param item the item
|
* the heading txt
|
||||||
* @param version the version
|
* @param item
|
||||||
* @param type the type
|
* the item
|
||||||
* @param setAsPublic the set as public
|
* @param version
|
||||||
|
* the version
|
||||||
|
* @param type
|
||||||
|
* the type
|
||||||
|
* @param setAsPublic
|
||||||
|
* the set as public
|
||||||
*/
|
*/
|
||||||
public DialogGetLink(String headingTxt, final FileModel item, String version, Link_Type type, boolean setAsPublic) {
|
public DialogGetLink(String headingTxt, final FileModel item, String version, Link_Type type, boolean setAsPublic) {
|
||||||
this.item = item;
|
this.item = item;
|
||||||
|
@ -74,15 +80,15 @@ public class DialogGetLink extends Dialog {
|
||||||
setButtons(Dialog.CLOSE);
|
setButtons(Dialog.CLOSE);
|
||||||
setScrollMode(Scroll.AUTOY);
|
setScrollMode(Scroll.AUTOY);
|
||||||
|
|
||||||
// label.setText(msgTitle);
|
// label.setText(msgTitle);
|
||||||
// label.setStyleName("myWebDavStyle");
|
// label.setStyleName("myWebDavStyle");
|
||||||
VerticalPanel vp1 = new VerticalPanel();
|
VerticalPanel vp1 = new VerticalPanel();
|
||||||
vp1.setStyleAttribute("margin-top", "8px");
|
vp1.setStyleAttribute("margin-top", "8px");
|
||||||
txtCompleteURL = new TextField<String>();
|
txtCompleteURL = new TextField<String>();
|
||||||
txtCompleteURL.setStyleAttribute("margin-top", "1px");
|
txtCompleteURL.setStyleAttribute("margin-top", "1px");
|
||||||
txtCompleteURL.setWidth(widht-20);
|
txtCompleteURL.setWidth(widht - 20);
|
||||||
txtCompleteURL.setReadOnly(true);
|
txtCompleteURL.setReadOnly(true);
|
||||||
// txtCompleteURL.mask("Getting Link...");
|
// txtCompleteURL.mask("Getting Link...");
|
||||||
vp1.add(new Label("Link"));
|
vp1.add(new Label("Link"));
|
||||||
vp1.add(txtCompleteURL);
|
vp1.add(txtCompleteURL);
|
||||||
|
|
||||||
|
@ -90,69 +96,70 @@ public class DialogGetLink extends Dialog {
|
||||||
vp2.setStyleAttribute("margin-top", "8px");
|
vp2.setStyleAttribute("margin-top", "8px");
|
||||||
txtShortURL = new TextField<String>();
|
txtShortURL = new TextField<String>();
|
||||||
txtShortURL.setStyleAttribute("margin-top", "1px");
|
txtShortURL.setStyleAttribute("margin-top", "1px");
|
||||||
txtShortURL.setWidth(widht-20);
|
txtShortURL.setWidth(widht - 20);
|
||||||
// txtShortURL.mask("Getting Link...");
|
// txtShortURL.mask("Getting Link...");
|
||||||
vp2.add(new Label("Short Link"));
|
vp2.add(new Label("Short Link"));
|
||||||
vp2.add(txtShortURL);
|
vp2.add(txtShortURL);
|
||||||
|
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case PUBLIC_LINK:
|
case PUBLIC_LINK:
|
||||||
|
|
||||||
vp.mask("Getting Public Link...");
|
vp.mask("Getting Public Link...");
|
||||||
setIcon(Resources.getIconPublicLink());
|
setIcon(Resources.getIconPublicLink());
|
||||||
|
|
||||||
if(item.getIdentifier()!=null && !item.getIdentifier().isEmpty()){
|
if (item.getIdentifier() != null && !item.getIdentifier().isEmpty()) {
|
||||||
|
|
||||||
if(version==null || version.isEmpty()){
|
if (version == null || version.isEmpty()) {
|
||||||
|
|
||||||
AppControllerExplorer.rpcWorkspaceService.getPublicLinkForFileItemId(item.getIdentifier(), true, new AsyncCallback<PublicLink>() {
|
AppControllerExplorer.rpcWorkspaceService.getPublicLinkForFileItemId(item.getIdentifier(), true,
|
||||||
|
new AsyncCallback<PublicLink>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(PublicLink publicLink) {
|
public void onSuccess(PublicLink publicLink) {
|
||||||
vp.unmask();
|
vp.unmask();
|
||||||
txtCompleteURL.setValue(publicLink.getCompleteURL());
|
txtCompleteURL.setValue(publicLink.getCompleteURL());
|
||||||
txtShortURL.setValue(publicLink.getShortURL());
|
txtShortURL.setValue(publicLink.getShortURL());
|
||||||
selectTxt();
|
selectTxt();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
vp.unmask();
|
vp.unmask();
|
||||||
if(caught instanceof SessionExpiredException){
|
if (caught instanceof SessionExpiredException) {
|
||||||
GWT.log("Session expired");
|
GWT.log("Session expired");
|
||||||
AppControllerExplorer.getEventBus().fireEvent(new SessionExpiredEvent());
|
AppControllerExplorer.getEventBus().fireEvent(new SessionExpiredEvent());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
new MessageBoxAlert("Error", caught.getMessage(), null);
|
new MessageBoxAlert("Error", caught.getMessage(), null);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}else{
|
} else {
|
||||||
|
|
||||||
AppControllerExplorer.rpcWorkspaceService.getPublicLinkForFileItemIdToVersion(item.getIdentifier(), version, true, new AsyncCallback<PublicLink>() {
|
AppControllerExplorer.rpcWorkspaceService.getPublicLinkForFileItemIdToVersion(item.getIdentifier(),
|
||||||
|
version, true, new AsyncCallback<PublicLink>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(PublicLink publicLink) {
|
public void onSuccess(PublicLink publicLink) {
|
||||||
vp.unmask();
|
vp.unmask();
|
||||||
txtCompleteURL.setValue(publicLink.getCompleteURL());
|
txtCompleteURL.setValue(publicLink.getCompleteURL());
|
||||||
txtShortURL.setValue(publicLink.getShortURL());
|
txtShortURL.setValue(publicLink.getShortURL());
|
||||||
selectTxt();
|
selectTxt();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
vp.unmask();
|
vp.unmask();
|
||||||
if(caught instanceof SessionExpiredException){
|
if (caught instanceof SessionExpiredException) {
|
||||||
GWT.log("Session expired");
|
GWT.log("Session expired");
|
||||||
AppControllerExplorer.getEventBus().fireEvent(new SessionExpiredEvent());
|
AppControllerExplorer.getEventBus().fireEvent(new SessionExpiredEvent());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
new MessageBoxAlert("Error", caught.getMessage(), null);
|
new MessageBoxAlert("Error", caught.getMessage(), null);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}else{
|
} else {
|
||||||
txtCompleteURL.unmask();
|
txtCompleteURL.unmask();
|
||||||
new MessageBoxAlert("Error", "The item identifier is null", null);
|
new MessageBoxAlert("Error", "The item identifier is null", null);
|
||||||
}
|
}
|
||||||
|
@ -162,41 +169,44 @@ public class DialogGetLink extends Dialog {
|
||||||
case FOLDER_LINK:
|
case FOLDER_LINK:
|
||||||
|
|
||||||
vp.mask("Updating Folder Link... checking permissions");
|
vp.mask("Updating Folder Link... checking permissions");
|
||||||
if(item.isShared()){
|
if (item.isShared()) {
|
||||||
setIcon(Resources.getIconFolderSharedPublic());
|
setIcon(Resources.getIconFolderSharedPublic());
|
||||||
}else
|
} else
|
||||||
setIcon(Resources.getIconFolderPublic());
|
setIcon(Resources.getIconFolderPublic());
|
||||||
|
|
||||||
if(item.getIdentifier()!=null && !item.getIdentifier().isEmpty()){
|
if (item.getIdentifier() != null && !item.getIdentifier().isEmpty()) {
|
||||||
AppControllerExplorer.rpcWorkspaceService.accessToFolderLink(item.getIdentifier(), new AsyncCallback<AllowAccess>() {
|
|
||||||
|
|
||||||
@Override
|
WorkspaceSharingServiceAsync.INSTANCE.accessToFolderLink(item.getIdentifier(),
|
||||||
public void onFailure(Throwable caught) {
|
new AsyncCallback<AllowAccess>() {
|
||||||
|
|
||||||
vp.unmask();
|
@Override
|
||||||
if(caught instanceof SessionExpiredException){
|
public void onFailure(Throwable caught) {
|
||||||
GWT.log("Session expired");
|
|
||||||
AppControllerExplorer.getEventBus().fireEvent(new SessionExpiredEvent());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
new MessageBoxAlert("Error", caught.getMessage(), null);
|
|
||||||
|
|
||||||
}
|
vp.unmask();
|
||||||
|
if (caught instanceof SessionExpiredException) {
|
||||||
|
GWT.log("Session expired");
|
||||||
|
AppControllerExplorer.getEventBus().fireEvent(new SessionExpiredEvent());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
new MessageBoxAlert("Error", caught.getMessage(), null);
|
||||||
|
|
||||||
@Override
|
}
|
||||||
public void onSuccess(AllowAccess result) {
|
|
||||||
GWT.log("AllowAccess? "+result);
|
|
||||||
vp.unmask();
|
|
||||||
if(result.getAccessGranted()){
|
|
||||||
String msg = DialogGetLink.this.setAsPublic?"Getting":"Removing";
|
|
||||||
msg=msg+" Folder Link... permissions granted";
|
|
||||||
vp.mask(msg);
|
|
||||||
allowAccessToFolderLink(item.getIdentifier(), DialogGetLink.this.setAsPublic);
|
|
||||||
}else
|
|
||||||
new MessageBoxAlert("Permission Denied", result.getAccessAllowDenyMotivation(), null);
|
|
||||||
|
|
||||||
}
|
@Override
|
||||||
});
|
public void onSuccess(AllowAccess result) {
|
||||||
|
GWT.log("AllowAccess? " + result);
|
||||||
|
vp.unmask();
|
||||||
|
if (result.getAccessGranted()) {
|
||||||
|
String msg = DialogGetLink.this.setAsPublic ? "Getting" : "Removing";
|
||||||
|
msg = msg + " Folder Link... permissions granted";
|
||||||
|
vp.mask(msg);
|
||||||
|
allowAccessToFolderLink(item.getIdentifier(), DialogGetLink.this.setAsPublic);
|
||||||
|
} else
|
||||||
|
new MessageBoxAlert("Permission Denied", result.getAccessAllowDenyMotivation(),
|
||||||
|
null);
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -208,13 +218,12 @@ public class DialogGetLink extends Dialog {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void componentSelected(ButtonEvent ce) {
|
public void componentSelected(ButtonEvent ce) {
|
||||||
hide();
|
hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// vp.add(label);
|
||||||
// vp.add(label);
|
|
||||||
vp.add(vp1);
|
vp.add(vp1);
|
||||||
vp.add(vp2);
|
vp.add(vp2);
|
||||||
|
|
||||||
|
@ -226,41 +235,47 @@ public class DialogGetLink extends Dialog {
|
||||||
/**
|
/**
|
||||||
* Allow access to folder link.
|
* Allow access to folder link.
|
||||||
*
|
*
|
||||||
* @param folderId the folder id
|
* @param folderId
|
||||||
* @param setIsPublic the set is public
|
* the folder id
|
||||||
|
* @param setIsPublic
|
||||||
|
* the set is public
|
||||||
*/
|
*/
|
||||||
protected void allowAccessToFolderLink(String folderId, final boolean setIsPublic){
|
protected void allowAccessToFolderLink(String folderId, final boolean setIsPublic) {
|
||||||
|
|
||||||
AppControllerExplorer.rpcWorkspaceService.markFolderAsPublicForFolderItemId(folderId, setIsPublic, new AsyncCallback<PublicLink>() {
|
AppControllerExplorer.rpcWorkspaceService.markFolderAsPublicForFolderItemId(folderId, setIsPublic,
|
||||||
|
new AsyncCallback<PublicLink>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(PublicLink publicLink) {
|
public void onSuccess(PublicLink publicLink) {
|
||||||
|
|
||||||
if(!setIsPublic && publicLink==null){
|
if (!setIsPublic && publicLink == null) {
|
||||||
DialogGetLink.this.hide();
|
DialogGetLink.this.hide();
|
||||||
MessageBox.info("Folder Link Removed", "Folder Link to the folder: "+item.getName()+ " removed correctly", null);
|
MessageBox.info("Folder Link Removed",
|
||||||
AppControllerExplorer.getEventBus().fireEvent(new RefreshFolderEvent(item.getParentFileModel(), true, false, false));
|
"Folder Link to the folder: " + item.getName() + " removed correctly", null);
|
||||||
return;
|
AppControllerExplorer.getEventBus()
|
||||||
}
|
.fireEvent(new RefreshFolderEvent(item.getParentFileModel(), true, false, false));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
vp.unmask();
|
vp.unmask();
|
||||||
txtCompleteURL.setValue(publicLink.getCompleteURL());
|
txtCompleteURL.setValue(publicLink.getCompleteURL());
|
||||||
txtShortURL.setValue(publicLink.getShortURL());
|
txtShortURL.setValue(publicLink.getShortURL());
|
||||||
selectTxt();
|
selectTxt();
|
||||||
AppControllerExplorer.getEventBus().fireEvent(new RefreshFolderEvent(item.getParentFileModel(), true, false, false));
|
AppControllerExplorer.getEventBus()
|
||||||
}
|
.fireEvent(new RefreshFolderEvent(item.getParentFileModel(), true, false, false));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
vp.unmask();
|
vp.unmask();
|
||||||
if(caught instanceof SessionExpiredException){
|
if (caught instanceof SessionExpiredException) {
|
||||||
GWT.log("Session expired");
|
GWT.log("Session expired");
|
||||||
AppControllerExplorer.getEventBus().fireEvent(new SessionExpiredEvent());
|
AppControllerExplorer.getEventBus().fireEvent(new SessionExpiredEvent());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
new MessageBoxAlert("Error", caught.getMessage(), null);
|
new MessageBoxAlert("Error", caught.getMessage(), null);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -276,9 +291,9 @@ public class DialogGetLink extends Dialog {
|
||||||
/**
|
/**
|
||||||
* Select txt.
|
* Select txt.
|
||||||
*/
|
*/
|
||||||
public void selectTxt(){
|
public void selectTxt() {
|
||||||
|
|
||||||
if(txtCompleteURL.getValue()!=null)
|
if (txtCompleteURL.getValue() != null)
|
||||||
txtCompleteURL.select(0, txtCompleteURL.getValue().length());
|
txtCompleteURL.select(0, txtCompleteURL.getValue().length());
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -15,7 +15,7 @@ import com.google.gwt.dom.client.Style.Unit;
|
||||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class DialogShareLink extends Dialog {
|
public class DialogShareLink extends Dialog {
|
||||||
|
|
|
@ -17,7 +17,7 @@ import com.extjs.gxt.ui.client.widget.layout.FormLayout;
|
||||||
/**
|
/**
|
||||||
* The Class DialogText.
|
* The Class DialogText.
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
* Jul 10, 2017
|
* Jul 10, 2017
|
||||||
*/
|
*/
|
||||||
public class DialogText extends Dialog {
|
public class DialogText extends Dialog {
|
||||||
|
|
|
@ -15,7 +15,7 @@ import com.google.gwt.dom.client.Style.Unit;
|
||||||
import com.google.gwt.user.client.ui.Anchor;
|
import com.google.gwt.user.client.ui.Anchor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class DialogWebDavUrl extends Dialog {
|
public class DialogWebDavUrl extends Dialog {
|
||||||
|
|
|
@ -22,7 +22,7 @@ import com.google.gwt.user.client.ui.Image;
|
||||||
/**
|
/**
|
||||||
* The Class ImagesPreviewController.
|
* The Class ImagesPreviewController.
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
* May 24, 2017
|
* May 24, 2017
|
||||||
*/
|
*/
|
||||||
public class ImagesPreviewController {
|
public class ImagesPreviewController {
|
||||||
|
|
|
@ -4,7 +4,7 @@ import com.extjs.gxt.ui.client.widget.Info;
|
||||||
import com.extjs.gxt.ui.client.widget.InfoConfig;
|
import com.extjs.gxt.ui.client.widget.InfoConfig;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class InfoDisplay extends Info{
|
public class InfoDisplay extends Info{
|
||||||
|
|
|
@ -4,8 +4,8 @@ package org.gcube.portlets.user.workspace.client.view.windows;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
* @Jun 25, 2013
|
* Jun 25, 2013
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class InfoDisplayMessage extends InfoDisplay{
|
public class InfoDisplayMessage extends InfoDisplay{
|
||||||
|
|
|
@ -5,7 +5,7 @@ import com.extjs.gxt.ui.client.event.MessageBoxEvent;
|
||||||
import com.extjs.gxt.ui.client.widget.MessageBox;
|
import com.extjs.gxt.ui.client.widget.MessageBox;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class MessageBoxAlert {
|
public class MessageBoxAlert {
|
||||||
|
|
|
@ -5,7 +5,7 @@ import com.extjs.gxt.ui.client.event.MessageBoxEvent;
|
||||||
import com.extjs.gxt.ui.client.widget.MessageBox;
|
import com.extjs.gxt.ui.client.widget.MessageBox;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class MessageBoxConfirm {
|
public class MessageBoxConfirm {
|
||||||
|
|
|
@ -3,7 +3,7 @@ package org.gcube.portlets.user.workspace.client.view.windows;
|
||||||
import com.extjs.gxt.ui.client.widget.MessageBox;
|
import com.extjs.gxt.ui.client.widget.MessageBox;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class MessageBoxWait {
|
public class MessageBoxWait {
|
||||||
|
|
|
@ -3,8 +3,8 @@ package org.gcube.portlets.user.workspace.client.view.windows;
|
||||||
import com.google.gwt.core.client.JavaScriptObject;
|
import com.google.gwt.core.client.JavaScriptObject;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
* @Sep 4, 2013
|
* Sep 4, 2013
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public final class NewBrowserWindow extends JavaScriptObject {
|
public final class NewBrowserWindow extends JavaScriptObject {
|
||||||
|
|
|
@ -40,7 +40,7 @@ import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
|
||||||
/**
|
/**
|
||||||
* The Class AccoutingInfoContainer.
|
* The Class AccoutingInfoContainer.
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
* Sep 28, 2016
|
* Sep 28, 2016
|
||||||
*/
|
*/
|
||||||
public class AccoutingInfoContainer extends LayoutContainer {
|
public class AccoutingInfoContainer extends LayoutContainer {
|
||||||
|
|
|
@ -16,7 +16,7 @@ import com.extjs.gxt.ui.client.widget.layout.FitLayout;
|
||||||
/**
|
/**
|
||||||
* The Class WindowAccountingInfo.
|
* The Class WindowAccountingInfo.
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
* Nov 10, 2015
|
* Nov 10, 2015
|
||||||
*/
|
*/
|
||||||
public class WindowAccountingInfo extends Window {
|
public class WindowAccountingInfo extends Window {
|
||||||
|
|
|
@ -7,7 +7,7 @@ package org.gcube.portlets.user.workspace.client.workspace.exceptions;
|
||||||
/**
|
/**
|
||||||
* The Class WrongItemTypeException.
|
* The Class WrongItemTypeException.
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
* Jun 11, 2015
|
* Jun 11, 2015
|
||||||
*/
|
*/
|
||||||
public class WrongItemTypeException extends Exception{
|
public class WrongItemTypeException extends Exception{
|
||||||
|
|
|
@ -4,8 +4,8 @@
|
||||||
package org.gcube.portlets.user.workspace.client.workspace.folder.item.gcube;
|
package org.gcube.portlets.user.workspace.client.workspace.folder.item.gcube;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
* @Feb 16, 2015
|
* Feb 16, 2015
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class WorkspaceHandledException extends Exception{
|
public class WorkspaceHandledException extends Exception{
|
||||||
|
|
|
@ -15,16 +15,16 @@ import org.gcube.common.homelibrary.home.exceptions.InternalErrorException;
|
||||||
import org.gcube.common.homelibrary.home.workspace.WorkspaceItem;
|
import org.gcube.common.homelibrary.home.workspace.WorkspaceItem;
|
||||||
import org.gcube.common.homelibrary.home.workspace.WorkspaceSharedFolder;
|
import org.gcube.common.homelibrary.home.workspace.WorkspaceSharedFolder;
|
||||||
import org.gcube.common.scope.impl.ScopeBean;
|
import org.gcube.common.scope.impl.ScopeBean;
|
||||||
import org.gcube.portlets.user.workspace.client.model.InfoContactModel;
|
|
||||||
import org.gcube.portlets.user.workspace.server.util.DifferenceBetweenInfoContactModel;
|
import org.gcube.portlets.user.workspace.server.util.DifferenceBetweenInfoContactModel;
|
||||||
import org.gcube.portlets.user.workspace.server.util.PortalContextInfo;
|
import org.gcube.portlets.user.workspace.server.util.PortalContextInfo;
|
||||||
import org.gcube.portlets.user.workspace.server.util.UserUtil;
|
import org.gcube.portlets.user.workspace.server.util.UserUtil;
|
||||||
import org.gcube.portlets.user.workspace.server.util.WsUtil;
|
import org.gcube.portlets.user.workspace.server.util.WsUtil;
|
||||||
|
import org.gcube.portlets.widgets.workspacesharingwidget.shared.InfoContactModel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Class NotificationsProducer.
|
* The Class NotificationsProducer.
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
*/
|
*/
|
||||||
public class NotificationsProducer {
|
public class NotificationsProducer {
|
||||||
|
|
||||||
|
|
|
@ -14,15 +14,15 @@ import org.gcube.common.homelibary.model.items.type.WorkspaceItemType;
|
||||||
import org.gcube.common.homelibrary.home.workspace.Workspace;
|
import org.gcube.common.homelibrary.home.workspace.Workspace;
|
||||||
import org.gcube.common.homelibrary.home.workspace.WorkspaceItem;
|
import org.gcube.common.homelibrary.home.workspace.WorkspaceItem;
|
||||||
import org.gcube.common.homelibrary.home.workspace.WorkspaceSharedFolder;
|
import org.gcube.common.homelibrary.home.workspace.WorkspaceSharedFolder;
|
||||||
import org.gcube.portlets.user.workspace.client.model.InfoContactModel;
|
|
||||||
import org.gcube.portlets.user.workspace.server.GWTWorkspaceBuilder;
|
import org.gcube.portlets.user.workspace.server.GWTWorkspaceBuilder;
|
||||||
import org.gcube.portlets.user.workspace.server.util.WsUtil;
|
import org.gcube.portlets.user.workspace.server.util.WsUtil;
|
||||||
|
import org.gcube.portlets.widgets.workspacesharingwidget.shared.InfoContactModel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Class NotificationsUtil.
|
* The Class NotificationsUtil.
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
* @May 27, 2013
|
* May 27, 2013
|
||||||
*/
|
*/
|
||||||
public class NotificationsUtil {
|
public class NotificationsUtil {
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ import org.gcube.common.storagehubwrapper.shared.tohl.WorkspaceSharedFolder;
|
||||||
/**
|
/**
|
||||||
* The Class NotificationMapper.
|
* The Class NotificationMapper.
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
|
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapaATisti.cnr.it)
|
||||||
* Oct 2, 2018
|
* Oct 2, 2018
|
||||||
*/
|
*/
|
||||||
public class NotificationMapperToStorageHub {
|
public class NotificationMapperToStorageHub {
|
||||||
|
|
|
@ -11,15 +11,15 @@ import org.gcube.common.storagehub.model.types.WorkspaceItemType;
|
||||||
import org.gcube.common.storagehubwrapper.shared.tohl.WorkspaceFolder;
|
import org.gcube.common.storagehubwrapper.shared.tohl.WorkspaceFolder;
|
||||||
import org.gcube.common.storagehubwrapper.shared.tohl.WorkspaceItem;
|
import org.gcube.common.storagehubwrapper.shared.tohl.WorkspaceItem;
|
||||||
import org.gcube.common.storagehubwrapper.shared.tohl.WorkspaceSharedFolder;
|
import org.gcube.common.storagehubwrapper.shared.tohl.WorkspaceSharedFolder;
|
||||||
import org.gcube.portlets.user.workspace.client.model.InfoContactModel;
|
|
||||||
import org.gcube.portlets.user.workspace.server.GWTWorkspaceBuilder;
|
import org.gcube.portlets.user.workspace.server.GWTWorkspaceBuilder;
|
||||||
import org.gcube.portlets.user.workspace.server.util.WsUtil;
|
import org.gcube.portlets.user.workspace.server.util.WsUtil;
|
||||||
|
import org.gcube.portlets.widgets.workspacesharingwidget.shared.InfoContactModel;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Class NotificationFromStorageHub.
|
* The Class NotificationFromStorageHub.
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
* Oct 2, 2018
|
* Oct 2, 2018
|
||||||
*/
|
*/
|
||||||
public class NotificationStorageHubUtil {
|
public class NotificationStorageHubUtil {
|
||||||
|
|
|
@ -13,15 +13,15 @@ import org.gcube.applicationsupportlayer.social.NotificationsManager;
|
||||||
import org.gcube.common.scope.impl.ScopeBean;
|
import org.gcube.common.scope.impl.ScopeBean;
|
||||||
import org.gcube.common.storagehubwrapper.shared.tohl.WorkspaceItem;
|
import org.gcube.common.storagehubwrapper.shared.tohl.WorkspaceItem;
|
||||||
import org.gcube.common.storagehubwrapper.shared.tohl.WorkspaceSharedFolder;
|
import org.gcube.common.storagehubwrapper.shared.tohl.WorkspaceSharedFolder;
|
||||||
import org.gcube.portlets.user.workspace.client.model.InfoContactModel;
|
|
||||||
import org.gcube.portlets.user.workspace.server.util.PortalContextInfo;
|
import org.gcube.portlets.user.workspace.server.util.PortalContextInfo;
|
||||||
import org.gcube.portlets.user.workspace.server.util.WsUtil;
|
import org.gcube.portlets.user.workspace.server.util.WsUtil;
|
||||||
|
import org.gcube.portlets.widgets.workspacesharingwidget.shared.InfoContactModel;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Class NotificationsProducerToStorageHub.
|
* The Class NotificationsProducerToStorageHub.
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
|
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapaATisti.cnr.it)
|
||||||
* Oct 5, 2018
|
* Oct 5, 2018
|
||||||
*/
|
*/
|
||||||
public class NotificationsProducerToStorageHub {
|
public class NotificationsProducerToStorageHub {
|
||||||
|
|
|
@ -14,7 +14,7 @@ import org.gcube.common.homelibrary.home.workspace.accessmanager.ACLType;
|
||||||
/**
|
/**
|
||||||
* The Class AclTypeComparator.
|
* The Class AclTypeComparator.
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
* Mar 5, 2015
|
* Mar 5, 2015
|
||||||
*/
|
*/
|
||||||
public class AclTypeComparator implements Comparator<ACLType>{
|
public class AclTypeComparator implements Comparator<ACLType>{
|
||||||
|
|
|
@ -3,7 +3,9 @@ package org.gcube.portlets.user.workspace.server.util;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.gcube.portlets.user.workspace.client.model.InfoContactModel;
|
import org.gcube.portlets.widgets.workspacesharingwidget.shared.InfoContactModel;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -11,7 +13,7 @@ import org.gcube.portlets.user.workspace.client.model.InfoContactModel;
|
||||||
/**
|
/**
|
||||||
* The Class DifferenceBetweenInfoContactModel.
|
* The Class DifferenceBetweenInfoContactModel.
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
* Nov 19, 2015
|
* Nov 19, 2015
|
||||||
*/
|
*/
|
||||||
public class DifferenceBetweenInfoContactModel {
|
public class DifferenceBetweenInfoContactModel {
|
||||||
|
|
|
@ -11,7 +11,7 @@ import org.apache.log4j.Logger;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
* @Apr 26, 2013
|
* @Apr 26, 2013
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -9,7 +9,7 @@ import java.io.Serializable;
|
||||||
/**
|
/**
|
||||||
* The Class PortalContextInfo.
|
* The Class PortalContextInfo.
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
* Nov 25, 2016
|
* Nov 25, 2016
|
||||||
*/
|
*/
|
||||||
public class PortalContextInfo implements Serializable{
|
public class PortalContextInfo implements Serializable{
|
||||||
|
|
|
@ -12,8 +12,8 @@ import org.apache.log4j.Logger;
|
||||||
/**
|
/**
|
||||||
* The Class StringUtil.
|
* The Class StringUtil.
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
* @Jul 9, 2013
|
* Jul 9, 2013
|
||||||
*/
|
*/
|
||||||
public class StringUtil {
|
public class StringUtil {
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ import org.apache.commons.io.IOUtils;
|
||||||
/**
|
/**
|
||||||
* The Class ThumbnailGenerator.
|
* The Class ThumbnailGenerator.
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
|
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapaATisti.cnr.it)
|
||||||
* Oct 18, 2018
|
* Oct 18, 2018
|
||||||
*/
|
*/
|
||||||
public class ThumbnailGenerator {
|
public class ThumbnailGenerator {
|
||||||
|
|
|
@ -12,7 +12,7 @@ import org.apache.log4j.Logger;
|
||||||
/**
|
/**
|
||||||
* The Class UrlEncoderUtil.
|
* The Class UrlEncoderUtil.
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
* Sep 14, 2016
|
* Sep 14, 2016
|
||||||
*/
|
*/
|
||||||
public class UrlEncoderUtil {
|
public class UrlEncoderUtil {
|
||||||
|
|
|
@ -4,7 +4,7 @@ import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.gcube.portlets.user.workspace.client.model.InfoContactModel;
|
import org.gcube.portlets.widgets.workspacesharingwidget.shared.InfoContactModel;
|
||||||
import org.gcube.vomanagement.usermanagement.UserManager;
|
import org.gcube.vomanagement.usermanagement.UserManager;
|
||||||
import org.gcube.vomanagement.usermanagement.exception.UserManagementSystemException;
|
import org.gcube.vomanagement.usermanagement.exception.UserManagementSystemException;
|
||||||
import org.gcube.vomanagement.usermanagement.exception.UserRetrievalFault;
|
import org.gcube.vomanagement.usermanagement.exception.UserRetrievalFault;
|
||||||
|
@ -16,7 +16,7 @@ import org.gcube.vomanagement.usermanagement.model.GCubeUser;
|
||||||
/**
|
/**
|
||||||
* The Class UserUtil.
|
* The Class UserUtil.
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
* Sep 14, 2016
|
* Sep 14, 2016
|
||||||
*/
|
*/
|
||||||
public class UserUtil {
|
public class UserUtil {
|
||||||
|
|
|
@ -22,7 +22,6 @@ import org.gcube.common.storagehubwrapper.shared.tohl.exceptions.InternalErrorEx
|
||||||
import org.gcube.common.storagehubwrapper.shared.tohl.exceptions.WorkspaceFolderNotFoundException;
|
import org.gcube.common.storagehubwrapper.shared.tohl.exceptions.WorkspaceFolderNotFoundException;
|
||||||
import org.gcube.portlets.user.urlshortener.UrlShortener;
|
import org.gcube.portlets.user.urlshortener.UrlShortener;
|
||||||
import org.gcube.portlets.user.workspace.client.model.FileModel;
|
import org.gcube.portlets.user.workspace.client.model.FileModel;
|
||||||
import org.gcube.portlets.user.workspace.client.model.InfoContactModel;
|
|
||||||
import org.gcube.portlets.user.workspace.server.GWTWorkspaceBuilder;
|
import org.gcube.portlets.user.workspace.server.GWTWorkspaceBuilder;
|
||||||
import org.gcube.portlets.user.workspace.server.notifications.NotificationsProducer;
|
import org.gcube.portlets.user.workspace.server.notifications.NotificationsProducer;
|
||||||
import org.gcube.portlets.user.workspace.server.notifications.tostoragehub.NotificationsProducerToStorageHub;
|
import org.gcube.portlets.user.workspace.server.notifications.tostoragehub.NotificationsProducerToStorageHub;
|
||||||
|
@ -32,14 +31,14 @@ import org.gcube.portlets.user.workspace.server.tostoragehub.StorageHubToWorkpac
|
||||||
import org.gcube.portlets.user.workspace.server.util.resource.PropertySpecialFolderReader;
|
import org.gcube.portlets.user.workspace.server.util.resource.PropertySpecialFolderReader;
|
||||||
import org.gcube.portlets.user.workspace.server.util.scope.ScopeUtilFilter;
|
import org.gcube.portlets.user.workspace.server.util.scope.ScopeUtilFilter;
|
||||||
import org.gcube.vomanagement.usermanagement.model.GCubeUser;
|
import org.gcube.vomanagement.usermanagement.model.GCubeUser;
|
||||||
|
import org.gcube.portlets.widgets.workspacesharingwidget.shared.InfoContactModel;
|
||||||
import com.liferay.portal.service.UserLocalServiceUtil;
|
import com.liferay.portal.service.UserLocalServiceUtil;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Class WsUtil.
|
* The Class WsUtil.
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
* Nov 25, 2016
|
* Nov 25, 2016
|
||||||
*/
|
*/
|
||||||
public class WsUtil {
|
public class WsUtil {
|
||||||
|
|
|
@ -11,8 +11,8 @@ import org.apache.log4j.Logger;
|
||||||
import org.gcube.portlets.user.workspace.client.ConstantsExplorer;
|
import org.gcube.portlets.user.workspace.client.ConstantsExplorer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
* @Mar 5, 2014
|
* Mar 5, 2014
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class PropertySpecialFolderReader {
|
public class PropertySpecialFolderReader {
|
||||||
|
|
|
@ -1,147 +0,0 @@
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
package org.gcube.portlets.user.workspace.shared;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
|
||||||
* Nov 29, 2016
|
|
||||||
*/
|
|
||||||
public class AllowAccess implements Serializable{
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
private static final long serialVersionUID = -2180345568585856822L;
|
|
||||||
|
|
||||||
private String itemId;
|
|
||||||
private Boolean accessGranted = false;
|
|
||||||
private String accessAllowDenyMotivation;
|
|
||||||
private String error;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public AllowAccess() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public AllowAccess(String itemId){
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param itemId
|
|
||||||
* @param accessGranted
|
|
||||||
* @param accessAllowDenyMotivation
|
|
||||||
* @param error
|
|
||||||
*/
|
|
||||||
public AllowAccess(
|
|
||||||
String itemId, Boolean accessGranted, String accessAllowDenyMotivation,
|
|
||||||
String error) {
|
|
||||||
|
|
||||||
super();
|
|
||||||
this.itemId = itemId;
|
|
||||||
this.accessGranted = accessGranted;
|
|
||||||
this.accessAllowDenyMotivation = accessAllowDenyMotivation;
|
|
||||||
this.error = error;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the itemId
|
|
||||||
*/
|
|
||||||
public String getItemId() {
|
|
||||||
|
|
||||||
return itemId;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the accessGranted
|
|
||||||
*/
|
|
||||||
public Boolean getAccessGranted() {
|
|
||||||
|
|
||||||
return accessGranted;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the accessAllowDenyMotivation
|
|
||||||
*/
|
|
||||||
public String getAccessAllowDenyMotivation() {
|
|
||||||
|
|
||||||
return accessAllowDenyMotivation;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the error
|
|
||||||
*/
|
|
||||||
public String getError() {
|
|
||||||
|
|
||||||
return error;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param itemId the itemId to set
|
|
||||||
*/
|
|
||||||
public void setItemId(String itemId) {
|
|
||||||
|
|
||||||
this.itemId = itemId;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param accessGranted the accessGranted to set
|
|
||||||
*/
|
|
||||||
public void setAccessGranted(Boolean accessGranted) {
|
|
||||||
|
|
||||||
this.accessGranted = accessGranted;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param accessAllowDenyMotivation the accessAllowDenyMotivation to set
|
|
||||||
*/
|
|
||||||
public void setAccessAllowDenyMotivation(String accessAllowDenyMotivation) {
|
|
||||||
|
|
||||||
this.accessAllowDenyMotivation = accessAllowDenyMotivation;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param error the error to set
|
|
||||||
*/
|
|
||||||
public void setError(String error) {
|
|
||||||
|
|
||||||
this.error = error;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see java.lang.Object#toString()
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
|
|
||||||
StringBuilder builder = new StringBuilder();
|
|
||||||
builder.append("AllowAccess [itemId=");
|
|
||||||
builder.append(itemId);
|
|
||||||
builder.append(", accessGranted=");
|
|
||||||
builder.append(accessGranted);
|
|
||||||
builder.append(", accessAllowDenyMotivation=");
|
|
||||||
builder.append(accessAllowDenyMotivation);
|
|
||||||
builder.append(", error=");
|
|
||||||
builder.append(error);
|
|
||||||
builder.append("]");
|
|
||||||
return builder.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
|
@ -6,7 +6,7 @@ package org.gcube.portlets.user.workspace.shared;
|
||||||
/**
|
/**
|
||||||
* The Interface ContactLogin.
|
* The Interface ContactLogin.
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
* Nov 4, 2015
|
* Nov 4, 2015
|
||||||
*/
|
*/
|
||||||
public interface ContactLogin {
|
public interface ContactLogin {
|
||||||
|
|
|
@ -1,84 +0,0 @@
|
||||||
package org.gcube.portlets.user.workspace.shared;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
|
||||||
* @Feb 21, 2014
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class ExtendedWorkspaceACL extends WorkspaceACL{
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
private static final long serialVersionUID = 5272059977475806564L;
|
|
||||||
|
|
||||||
|
|
||||||
private String loginOwner;
|
|
||||||
private String workspaceItemId;
|
|
||||||
|
|
||||||
|
|
||||||
private boolean isBaseSharedFolder;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public ExtendedWorkspaceACL() {
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param id
|
|
||||||
* @param label
|
|
||||||
* @param defaultValue
|
|
||||||
* @param userType
|
|
||||||
* @param description
|
|
||||||
* @param loginOwner
|
|
||||||
* @param workspaceItemId
|
|
||||||
*/
|
|
||||||
public ExtendedWorkspaceACL(String id, String label, boolean defaultValue, USER_TYPE userType, String description, String loginOwner, String workspaceItemId, boolean isBaseSharedFolder) {
|
|
||||||
super(id, label, defaultValue, userType, description);
|
|
||||||
this.loginOwner = loginOwner;
|
|
||||||
this.workspaceItemId = workspaceItemId;
|
|
||||||
this.isBaseSharedFolder = isBaseSharedFolder;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public String getLoginOwner() {
|
|
||||||
return loginOwner;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getWorkspaceItemId() {
|
|
||||||
return workspaceItemId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLoginOwner(String loginOwner) {
|
|
||||||
this.loginOwner = loginOwner;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setWorkspaceItemId(String workspaceItemId) {
|
|
||||||
this.workspaceItemId = workspaceItemId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isBaseSharedFolder() {
|
|
||||||
return isBaseSharedFolder;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setBaseSharedFolder(boolean isBaseSharedFolder) {
|
|
||||||
this.isBaseSharedFolder = isBaseSharedFolder;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
StringBuilder builder = new StringBuilder();
|
|
||||||
builder.append("ExtendedWorkspaceACL [loginOwner=");
|
|
||||||
builder.append(loginOwner);
|
|
||||||
builder.append(", workspaceItemId=");
|
|
||||||
builder.append(workspaceItemId);
|
|
||||||
builder.append(", isBaseSharedFolder=");
|
|
||||||
builder.append(isBaseSharedFolder);
|
|
||||||
builder.append("]");
|
|
||||||
return builder.toString();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -8,7 +8,7 @@ import java.io.Serializable;
|
||||||
/**
|
/**
|
||||||
* The Class GarbageItem.
|
* The Class GarbageItem.
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it Oct 23, 2015
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it Oct 23, 2015
|
||||||
*
|
*
|
||||||
* USED TO SEND NOTIFICATION AFTER DELETE
|
* USED TO SEND NOTIFICATION AFTER DELETE
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -6,44 +6,35 @@ package org.gcube.portlets.user.workspace.shared;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import org.gcube.portlets.widgets.workspacesharingwidget.shared.InfoContactModel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
* Nov 4, 2015
|
* Nov 4, 2015
|
||||||
*/
|
*/
|
||||||
public class ListContact<T extends ContactLogin> extends ArrayList<T> implements Serializable{
|
public class ListContact<T extends InfoContactModel> extends ArrayList<T> implements Serializable{
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
private static final long serialVersionUID = 544202687567940083L;
|
private static final long serialVersionUID = 544202687567940083L;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public ListContact() {
|
public ListContact() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
public boolean contains(InfoContactModel infoContactModel) {
|
||||||
* @see java.util.ArrayList#contains(java.lang.Object)
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public boolean contains(Object o) {
|
|
||||||
|
|
||||||
if(o==null)
|
if(infoContactModel==null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
ContactLogin contact = (ContactLogin) o;
|
|
||||||
|
|
||||||
if(contact.getLogin()==null)
|
if(infoContactModel.getLogin()==null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
||||||
for (int i = 0; i < this.size(); i++){
|
for (int i = 0; i < this.size(); i++){
|
||||||
|
|
||||||
ContactLogin log = get(i);
|
InfoContactModel log = get(i);
|
||||||
if (log.getLogin()!=null && log.getLogin().compareTo(contact.getLogin())==0)
|
if (log.getLogin()!=null && log.getLogin().compareTo(infoContactModel.getLogin())==0)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ import java.io.Serializable;
|
||||||
/**
|
/**
|
||||||
* The Class PublicLink.
|
* The Class PublicLink.
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
* Sep 13, 2016
|
* Sep 13, 2016
|
||||||
*/
|
*/
|
||||||
public class PublicLink implements Serializable {
|
public class PublicLink implements Serializable {
|
||||||
|
|
|
@ -1,88 +0,0 @@
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
package org.gcube.portlets.user.workspace.shared;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
|
||||||
* Mar 6, 2015
|
|
||||||
*/
|
|
||||||
public class ReportAssignmentACL implements Serializable{
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
private static final long serialVersionUID = -7218122043660957432L;
|
|
||||||
|
|
||||||
private List<String> validLogins;
|
|
||||||
private List<String> errors;
|
|
||||||
private String aclType;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public ReportAssignmentACL() {
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the validLogins
|
|
||||||
*/
|
|
||||||
public List<String> getValidLogins() {
|
|
||||||
return validLogins;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param validLogins the validLogins to set
|
|
||||||
*/
|
|
||||||
public void setValidLogins(List<String> validLogins) {
|
|
||||||
this.validLogins = validLogins;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the errors
|
|
||||||
*/
|
|
||||||
public List<String> getErrors() {
|
|
||||||
return errors;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param errors the errors to set
|
|
||||||
*/
|
|
||||||
public void setErrors(List<String> errors) {
|
|
||||||
this.errors = errors;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the aclType
|
|
||||||
*/
|
|
||||||
public String getAclType() {
|
|
||||||
return aclType;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param aclType the aclType to set
|
|
||||||
*/
|
|
||||||
public void setAclType(String aclType) {
|
|
||||||
this.aclType = aclType;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see java.lang.Object#toString()
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
StringBuilder builder = new StringBuilder();
|
|
||||||
builder.append("ReportValidationACL [validLogins=");
|
|
||||||
builder.append(validLogins);
|
|
||||||
builder.append(", errors=");
|
|
||||||
builder.append(errors);
|
|
||||||
builder.append(", aclType=");
|
|
||||||
builder.append(aclType);
|
|
||||||
builder.append("]");
|
|
||||||
return builder.toString();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -4,8 +4,8 @@
|
||||||
package org.gcube.portlets.user.workspace.shared;
|
package org.gcube.portlets.user.workspace.shared;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
* @Sep 4, 2013
|
* Sep 4, 2013
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class SessionExpiredException extends Exception{
|
public class SessionExpiredException extends Exception{
|
||||||
|
|
|
@ -9,8 +9,8 @@ import java.util.List;
|
||||||
import org.gcube.portlets.user.workspace.client.model.FileTrashedModel;
|
import org.gcube.portlets.user.workspace.client.model.FileTrashedModel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
* @Feb 17, 2014
|
* Feb 17, 2014
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class TrashContent implements Serializable{
|
public class TrashContent implements Serializable{
|
||||||
|
|
|
@ -6,8 +6,8 @@ package org.gcube.portlets.user.workspace.shared;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
* @Feb 17, 2014
|
* Feb 17, 2014
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class TrashOperationContent extends TrashContent{
|
public class TrashOperationContent extends TrashContent{
|
||||||
|
|
|
@ -1,100 +0,0 @@
|
||||||
package org.gcube.portlets.user.workspace.shared;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
|
||||||
* @Feb 21, 2014
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class WorkspaceACL implements Serializable{
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
private static final long serialVersionUID = -1682851324671600049L;
|
|
||||||
|
|
||||||
private String id;
|
|
||||||
private String label;
|
|
||||||
private boolean defaultValue;
|
|
||||||
private USER_TYPE userType;
|
|
||||||
|
|
||||||
private String description;
|
|
||||||
|
|
||||||
|
|
||||||
public enum USER_TYPE{ADMINISTRATOR, GROUP, OWNER, OTHER};
|
|
||||||
|
|
||||||
public WorkspaceACL(String id, String label, boolean defaultValue, USER_TYPE userType, String description) {
|
|
||||||
super();
|
|
||||||
this.id = id;
|
|
||||||
this.label = label;
|
|
||||||
this.defaultValue = defaultValue;
|
|
||||||
this.userType = userType;
|
|
||||||
this.description = description;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public WorkspaceACL() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setId(String id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getLabel() {
|
|
||||||
return label;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLabel(String label) {
|
|
||||||
this.label = label;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean getDefaultValue() {
|
|
||||||
return defaultValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDefaultValue(boolean defaultValue) {
|
|
||||||
this.defaultValue = defaultValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
public USER_TYPE getUserType() {
|
|
||||||
return userType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUserType(USER_TYPE userType) {
|
|
||||||
this.userType = userType;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public String getDescription() {
|
|
||||||
return description;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDescription(String description) {
|
|
||||||
this.description = description;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
StringBuilder builder = new StringBuilder();
|
|
||||||
builder.append("WorkspaceACL [id=");
|
|
||||||
builder.append(id);
|
|
||||||
builder.append(", label=");
|
|
||||||
builder.append(label);
|
|
||||||
builder.append(", defaultValue=");
|
|
||||||
builder.append(defaultValue);
|
|
||||||
builder.append(", userType=");
|
|
||||||
builder.append(userType);
|
|
||||||
builder.append(", description=");
|
|
||||||
builder.append(description);
|
|
||||||
builder.append("]");
|
|
||||||
return builder.toString();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -12,7 +12,7 @@ import com.google.gwt.user.client.rpc.IsSerializable;
|
||||||
/**
|
/**
|
||||||
* The Class WorkspaceOperationResult.
|
* The Class WorkspaceOperationResult.
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
|
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapaATisti.cnr.it)
|
||||||
* Oct 8, 2018
|
* Oct 8, 2018
|
||||||
*/
|
*/
|
||||||
public class WorkspaceOperationResult implements Serializable, IsSerializable{
|
public class WorkspaceOperationResult implements Serializable, IsSerializable{
|
||||||
|
|
|
@ -8,8 +8,8 @@ import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
* @Feb 17, 2014
|
* Feb 17, 2014
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public enum WorkspaceTrashOperation {
|
public enum WorkspaceTrashOperation {
|
||||||
|
|
|
@ -6,8 +6,8 @@ package org.gcube.portlets.user.workspace.shared;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
* @Oct 31, 2014
|
* Oct 31, 2014
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class WorkspaceUserQuote implements Serializable{
|
public class WorkspaceUserQuote implements Serializable{
|
||||||
|
|
|
@ -8,8 +8,8 @@ import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
* @Feb 17, 2014
|
* Feb 17, 2014
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public enum WorkspaceVersioningOperation {
|
public enum WorkspaceVersioningOperation {
|
||||||
|
|
|
@ -7,7 +7,7 @@ package org.gcube.portlets.user.workspace.shared.accounting;
|
||||||
/**
|
/**
|
||||||
* The Enum GxtAccountingEntryType.
|
* The Enum GxtAccountingEntryType.
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
* Sep 28, 2016
|
* Sep 28, 2016
|
||||||
*/
|
*/
|
||||||
public enum GxtAccountingEntryType {
|
public enum GxtAccountingEntryType {
|
||||||
|
|
|
@ -3,12 +3,14 @@ package org.gcube.portlets.user.workspace.shared.accounting;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
import org.gcube.portlets.user.workspace.client.model.InfoContactModel;
|
import org.gcube.portlets.widgets.workspacesharingwidget.shared.InfoContactModel;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
* @May 23, 2013
|
* May 23, 2013
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class GxtAccountingField implements Serializable {
|
public class GxtAccountingField implements Serializable {
|
||||||
|
|
|
@ -17,7 +17,7 @@ import com.extjs.gxt.ui.client.widget.treepanel.TreePanel;
|
||||||
import com.google.gwt.user.client.Element;
|
import com.google.gwt.user.client.Element;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class BasicDNDExample extends LayoutContainer {
|
public class BasicDNDExample extends LayoutContainer {
|
||||||
|
|
|
@ -23,7 +23,7 @@ import org.gcube.common.scope.impl.ScopeBean;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it Jul 14, 2015
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it Jul 14, 2015
|
||||||
*/
|
*/
|
||||||
public class CreateSharedFolder {
|
public class CreateSharedFolder {
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ import java.net.URL;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
* May 9, 2016
|
* May 9, 2016
|
||||||
*/
|
*/
|
||||||
public class DataMinerTest {
|
public class DataMinerTest {
|
||||||
|
|
|
@ -22,7 +22,7 @@ import org.gcube.portlets.user.workspace.server.GWTWorkspaceBuilder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
* Oct 28, 2015
|
* Oct 28, 2015
|
||||||
*/
|
*/
|
||||||
public class DeleteTest {
|
public class DeleteTest {
|
||||||
|
|
|
@ -24,7 +24,7 @@ import org.gcube.common.scope.api.ScopeProvider;
|
||||||
import org.gcube.common.scope.impl.ScopeBean;
|
import org.gcube.common.scope.impl.ScopeBean;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
* @Dec 17, 2013
|
* @Dec 17, 2013
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -16,8 +16,8 @@ import org.gcube.common.homelibrary.home.workspace.folder.FolderItem;
|
||||||
import org.gcube.common.homelibrary.home.workspace.folder.items.ExternalFile;
|
import org.gcube.common.homelibrary.home.workspace.folder.items.ExternalFile;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
* @Jun 18, 2013
|
* Jun 18, 2013
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class DonwloadServletTest {
|
public class DonwloadServletTest {
|
||||||
|
|
|
@ -1,174 +0,0 @@
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
package org.gcube.portlets.user.workspace;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import org.gcube.common.homelibrary.home.HomeLibrary;
|
|
||||||
import org.gcube.common.homelibrary.home.exceptions.HomeNotFoundException;
|
|
||||||
import org.gcube.common.homelibrary.home.exceptions.InternalErrorException;
|
|
||||||
import org.gcube.common.homelibrary.home.exceptions.UserNotFoundException;
|
|
||||||
import org.gcube.common.homelibrary.home.workspace.Workspace;
|
|
||||||
import org.gcube.common.homelibrary.home.workspace.WorkspaceFolder;
|
|
||||||
import org.gcube.common.homelibrary.home.workspace.accessmanager.ACLType;
|
|
||||||
import org.gcube.common.homelibrary.home.workspace.exceptions.ItemNotFoundException;
|
|
||||||
import org.gcube.common.homelibrary.home.workspace.exceptions.WorkspaceFolderNotFoundException;
|
|
||||||
import org.gcube.common.scope.api.ScopeProvider;
|
|
||||||
import org.gcube.common.scope.impl.ScopeBean;
|
|
||||||
import org.gcube.portlets.user.workspace.server.util.AclTypeComparator;
|
|
||||||
import org.gcube.portlets.user.workspace.shared.ReportAssignmentACL;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
|
||||||
* @Jan 29, 2014
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class EditPermissionsTest {
|
|
||||||
|
|
||||||
|
|
||||||
// public static String DEFAULT_SCOPE = "/d4science.research-infrastructures.eu/gCubeApps"; //PRODUCTION
|
|
||||||
public static String DEFAULT_SCOPE = "/gcube/devsec"; //DEV
|
|
||||||
public static String TEST_USER = "francesco.mangiacrapa";
|
|
||||||
// public static String ITEMID = "63832213-098d-42d1-8774-89b6349764c0"; //Activity T3.4 working drafts/T2-EC-IMAR-HO-14-015 iMarine Sustainability WP - Business Model tools.pdf
|
|
||||||
// public static String ITEMID = "42fa2601-39d0-4951-aabf-27d2a2f1dca7";
|
|
||||||
|
|
||||||
// protected static Logger logger = Logger.getLogger(EditPermissionsTest.class);
|
|
||||||
|
|
||||||
|
|
||||||
public static void main(String[] args) {
|
|
||||||
|
|
||||||
ScopeBean scope = new ScopeBean(DEFAULT_SCOPE);
|
|
||||||
ScopeProvider.instance.set(scope.toString());
|
|
||||||
|
|
||||||
System.out.println("init HL");
|
|
||||||
try {
|
|
||||||
|
|
||||||
Workspace ws = HomeLibrary
|
|
||||||
.getHomeManagerFactory()
|
|
||||||
.getHomeManager()
|
|
||||||
.getHome(TEST_USER)
|
|
||||||
.getWorkspace();
|
|
||||||
|
|
||||||
WorkspaceFolder sharedFolder = (WorkspaceFolder) ws.getItem("bd5fa899-225d-4547-a3c5-79b5333cde20");
|
|
||||||
|
|
||||||
System.out.println(sharedFolder.getACLOwner());
|
|
||||||
|
|
||||||
ArrayList<String> list = new ArrayList<String>();
|
|
||||||
list.add("francesco.mangiacrapa");
|
|
||||||
list.add("massimiliano.assante");
|
|
||||||
list.add("pasquale.pagano");
|
|
||||||
list.add("valentina.marioli");
|
|
||||||
|
|
||||||
validateACLToUser(sharedFolder, list, ACLType.READ_ONLY.toString());
|
|
||||||
|
|
||||||
} catch (WorkspaceFolderNotFoundException e) {
|
|
||||||
// TODO Auto-generated catch block
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (InternalErrorException e) {
|
|
||||||
// TODO Auto-generated catch block
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (HomeNotFoundException e) {
|
|
||||||
// TODO Auto-generated catch block
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (UserNotFoundException e) {
|
|
||||||
// TODO Auto-generated catch block
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (ItemNotFoundException e) {
|
|
||||||
// TODO Auto-generated catch block
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (Exception e) {
|
|
||||||
// TODO Auto-generated catch block
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private static ReportAssignmentACL validateACLToUser(WorkspaceFolder folder, List<String> listLogins, String aclType) throws Exception {
|
|
||||||
|
|
||||||
ReportAssignmentACL reportValidation = new ReportAssignmentACL();
|
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
Map<ACLType, List<String>> mapACL = folder.getACLOwner();
|
|
||||||
|
|
||||||
ACLType settingACL = ACLType.valueOf(aclType);
|
|
||||||
|
|
||||||
System.out.println("Tentative setting: "+settingACL);
|
|
||||||
System.out.println("For Logins: "+listLogins);
|
|
||||||
|
|
||||||
AclTypeComparator comparator = new AclTypeComparator();
|
|
||||||
|
|
||||||
List<String> admins = mapACL.get(ACLType.ADMINISTRATOR);
|
|
||||||
|
|
||||||
for (String admin : admins) {
|
|
||||||
listLogins.remove(admin);
|
|
||||||
System.out.println("Reject username: "+admin +" as "+ACLType.ADMINISTRATOR);
|
|
||||||
}
|
|
||||||
|
|
||||||
List<String> validLogins = new ArrayList<String>(listLogins);
|
|
||||||
List<String> errors = new ArrayList<String>();
|
|
||||||
|
|
||||||
|
|
||||||
for (String username : listLogins) {
|
|
||||||
System.out.println("\nChecking username: "+username);
|
|
||||||
for (ACLType aclHL : mapACL.keySet()) {
|
|
||||||
|
|
||||||
if(!aclHL.equals(ACLType.ADMINISTRATOR)){
|
|
||||||
List<String> loginsHL = mapACL.get(aclHL);
|
|
||||||
System.out.println("to ACLType: "+aclHL +", logins found: "+loginsHL);
|
|
||||||
|
|
||||||
if(loginsHL.contains(username)){
|
|
||||||
int cmp = comparator.compare(settingACL, aclHL);
|
|
||||||
System.out.println("Compare result between "+aclHL + " and "+settingACL +": "+cmp);
|
|
||||||
if(cmp==-1){
|
|
||||||
//CHANGE ACL IS NOT VALID
|
|
||||||
System.out.println("Reject ACL: "+settingACL+ " to "+username);
|
|
||||||
validLogins.remove(username);
|
|
||||||
//TODO FULL NAME
|
|
||||||
errors.add("Unable for "+username+ " the grant of the privilege '"+settingACL+", it's lower than (already assigned) "+ aclHL);
|
|
||||||
break;
|
|
||||||
}else if(cmp==0){
|
|
||||||
//SAME ACL
|
|
||||||
System.out.println("Skipping ACL: "+settingACL+ " to "+username);
|
|
||||||
//TODO FULL NAME
|
|
||||||
errors.add("Ignoring for "+username+ " the grant of the privilege '"+settingACL+", it's already assigned");
|
|
||||||
validLogins.remove(username);
|
|
||||||
break;
|
|
||||||
}else if(cmp==1){
|
|
||||||
//CHANGE ACL IS VALID
|
|
||||||
System.out.println("Valid ACL: "+settingACL+ " to "+username);
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
//CHANGE ACL IS VALID
|
|
||||||
System.out.println("[Login not found], Set ACL: "+settingACL+ " to "+username);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
System.out.println("\n");
|
|
||||||
for (String username : validLogins) {
|
|
||||||
System.out.println("Set ACL: "+settingACL+ " to "+username);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
System.out.println("\n");
|
|
||||||
for (String error : errors) {
|
|
||||||
System.out.println(error);
|
|
||||||
}
|
|
||||||
reportValidation.setAclType(aclType);
|
|
||||||
reportValidation.setErrors(errors);
|
|
||||||
reportValidation.setValidLogins(validLogins);
|
|
||||||
return reportValidation;
|
|
||||||
|
|
||||||
} catch (InternalErrorException e) {
|
|
||||||
throw new Exception("Sorry, an error occurred when validating ACL assignment, try again later");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -15,7 +15,7 @@ import org.gcube.common.scope.impl.ScopeBean;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
* Jun 12, 2015
|
* Jun 12, 2015
|
||||||
*/
|
*/
|
||||||
public class GcubeProperties {
|
public class GcubeProperties {
|
||||||
|
|
|
@ -4,8 +4,8 @@
|
||||||
package org.gcube.portlets.user.workspace;
|
package org.gcube.portlets.user.workspace;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
* @Jun 28, 2013
|
* Jun 28, 2013
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
|
|
|
@ -20,8 +20,8 @@ import org.apache.commons.httpclient.methods.PostMethod;
|
||||||
import org.apache.commons.httpclient.params.HttpMethodParams;
|
import org.apache.commons.httpclient.params.HttpMethodParams;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
* @Jun 4, 2013
|
* Jun 4, 2013
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class HttpCallerUtil {
|
public class HttpCallerUtil {
|
||||||
|
|
|
@ -23,8 +23,8 @@ import org.gcube.common.scope.impl.ScopeBean;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
* @Jan 29, 2014
|
* Jan 29, 2014
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class ItemCreate {
|
public class ItemCreate {
|
||||||
|
|
|
@ -22,8 +22,8 @@ import org.gcube.common.scope.impl.ScopeBean;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
* @Jan 29, 2014
|
* Jan 29, 2014
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class ItemRetrieve {
|
public class ItemRetrieve {
|
||||||
|
|
|
@ -21,8 +21,8 @@ import org.gcube.common.scope.api.ScopeProvider;
|
||||||
import org.gcube.common.scope.impl.ScopeBean;
|
import org.gcube.common.scope.impl.ScopeBean;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
* @Jul 3, 2013
|
* Jul 3, 2013
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class PublicLinkTest {
|
public class PublicLinkTest {
|
||||||
|
|
|
@ -15,8 +15,8 @@ import org.gcube.portlets.user.workspace.client.model.FileGridModel;
|
||||||
import org.gcube.portlets.user.workspace.server.GWTWorkspaceBuilder;
|
import org.gcube.portlets.user.workspace.server.GWTWorkspaceBuilder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
* @Jul 3, 2013
|
* Jul 3, 2013
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class SearchTextTest {
|
public class SearchTextTest {
|
||||||
|
|
|
@ -23,8 +23,8 @@ import org.gcube.portlets.user.workspace.server.util.HttpRequestUtil;
|
||||||
import org.gcube.portlets.user.workspace.server.util.StringUtil;
|
import org.gcube.portlets.user.workspace.server.util.StringUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
* @Jul 3, 2013
|
* Jul 3, 2013
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class SinglePublicLinkTest {
|
public class SinglePublicLinkTest {
|
||||||
|
|
|
@ -17,8 +17,8 @@ import org.gcube.portlets.user.workspace.server.GWTWorkspaceBuilder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
* @Jan 29, 2014
|
* Jan 29, 2014
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class SizeRetrieving {
|
public class SizeRetrieving {
|
||||||
|
|
|
@ -20,7 +20,7 @@ import org.gcube.portlets.user.workspace.server.GWTWorkspaceBuilder;
|
||||||
/**
|
/**
|
||||||
* The Class SmartFolderTest.
|
* The Class SmartFolderTest.
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
* Sep 29, 2016
|
* Sep 29, 2016
|
||||||
*/
|
*/
|
||||||
public class SmartFolderTest {
|
public class SmartFolderTest {
|
||||||
|
|
|
@ -11,7 +11,7 @@ import org.gcube.portlets.user.workspace.server.util.StringUtil;
|
||||||
/**
|
/**
|
||||||
* The Class TestEncodeDecodeBase64.
|
* The Class TestEncodeDecodeBase64.
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
* Sep 19, 2016
|
* Sep 19, 2016
|
||||||
*/
|
*/
|
||||||
public class TestEncodeDecodeBase64 {
|
public class TestEncodeDecodeBase64 {
|
||||||
|
|
|
@ -20,8 +20,8 @@ import org.gcube.common.scope.impl.ScopeBean;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
* @Jan 29, 2014
|
* Jan 29, 2014
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class TestSync {
|
public class TestSync {
|
||||||
|
|
|
@ -13,8 +13,8 @@ import org.gcube.common.scope.api.ScopeProvider;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
* @May 15, 2014
|
* May 15, 2014
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class TestWithTime {
|
public class TestWithTime {
|
||||||
|
|
|
@ -29,7 +29,7 @@ import org.gcube.common.scope.impl.ScopeBean;
|
||||||
/**
|
/**
|
||||||
* The Class UploadServletTest.
|
* The Class UploadServletTest.
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
|
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapaATisti.cnr.it)
|
||||||
* Jul 23, 2018
|
* Jul 23, 2018
|
||||||
*/
|
*/
|
||||||
public class UploadServletTest {
|
public class UploadServletTest {
|
||||||
|
|
|
@ -26,8 +26,8 @@ import org.gcube.common.scope.api.ScopeProvider;
|
||||||
import org.gcube.common.scope.impl.ScopeBean;
|
import org.gcube.common.scope.impl.ScopeBean;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
* @Jun 20, 2013
|
* Jun 20, 2013
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class UploadServletTestToken {
|
public class UploadServletTestToken {
|
||||||
|
|
|
@ -30,8 +30,8 @@ import org.gcube.resources.discovery.client.api.DiscoveryClient;
|
||||||
import org.gcube.resources.discovery.client.queries.impl.XQuery;
|
import org.gcube.resources.discovery.client.queries.impl.XQuery;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
* @Jun 26, 2013
|
* Jun 26, 2013
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class UriResolverReaderRR {
|
public class UriResolverReaderRR {
|
||||||
|
|
|
@ -11,8 +11,8 @@ import java.util.Map;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
* @Jun 4, 2013
|
* Jun 4, 2013
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class UrlEncoderUtil {
|
public class UrlEncoderUtil {
|
||||||
|
|
|
@ -4,8 +4,8 @@
|
||||||
package org.gcube.portlets.user.workspace;
|
package org.gcube.portlets.user.workspace;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
* @Jun 28, 2013
|
* Jun 28, 2013
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import static org.gcube.resources.discovery.icclient.ICFactory.clientFor;
|
import static org.gcube.resources.discovery.icclient.ICFactory.clientFor;
|
||||||
|
|
|
@ -16,8 +16,8 @@ import org.gcube.resources.discovery.client.api.DiscoveryClient;
|
||||||
import org.gcube.resources.discovery.client.queries.impl.XQuery;
|
import org.gcube.resources.discovery.client.queries.impl.XQuery;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
||||||
* @Jun 26, 2013
|
* Jun 26, 2013
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class UrlShortenerReaderRR {
|
public class UrlShortenerReaderRR {
|
||||||
|
|
Loading…
Reference in New Issue