From 71875b42374951d7b42c3bf5100d4ee3891d14ed Mon Sep 17 00:00:00 2001 From: Christos Stathis Date: Thu, 12 Apr 2012 15:54:11 +0300 Subject: [PATCH] Separated public from other permissions (issue #2317) --- .../grnet/pithos/web/client/FileContextMenu.java | 4 + .../pithos/web/client/FilePermissionsDialog.java | 104 +++---- .../pithos/web/client/FilePropertiesDialog.java | 2 +- .../grnet/pithos/web/client/FilePublishDialog.java | 305 ++++++++++++++++++++ .../pithos/web/client/FileVersionsDialog.java | 2 +- src/gr/grnet/pithos/web/client/ToolsMenu.java | 1 + .../web/client/commands/PropertiesCommand.java | 12 + .../grnet/pithos/web/client/foldertree/File.java | 6 +- .../client/mysharedtree/MysharedTreeViewModel.java | 2 +- .../othersharedtree/OtherSharedTreeViewModel.java | 2 +- 10 files changed, 364 insertions(+), 76 deletions(-) create mode 100644 src/gr/grnet/pithos/web/client/FilePublishDialog.java diff --git a/src/gr/grnet/pithos/web/client/FileContextMenu.java b/src/gr/grnet/pithos/web/client/FileContextMenu.java index 19fbaa1..15528c2 100644 --- a/src/gr/grnet/pithos/web/client/FileContextMenu.java +++ b/src/gr/grnet/pithos/web/client/FileContextMenu.java @@ -170,6 +170,9 @@ public class FileContextMenu extends PopupPanel { */ @Source("gr/grnet/pithos/resources/translate.png") ImageResource selectAll(); + + @Source("gr/grnet/pithos/resources/internet.png") + ImageResource internet(); } public static native String getDate()/*-{ @@ -240,6 +243,7 @@ public class FileContextMenu extends PopupPanel { if (isFolderTreeSelected && selectedFiles.size() == 1) { contextMenu.addItem(new MenuItem("" + AbstractImagePrototype.create(newImages.viewText()).getHTML() + " Properties", true, new PropertiesCommand(app, this, selectedFiles, PropertiesCommand.PROPERTIES))); contextMenu.addItem(new MenuItem("" + AbstractImagePrototype.create(newImages.sharing()).getHTML() + " Sharing", true, new PropertiesCommand(app, this, selectedFiles, PropertiesCommand.PERMISSIONS))); + contextMenu.addItem(new MenuItem("" + AbstractImagePrototype.create(newImages.internet()).getHTML() + " Publish", true, new PropertiesCommand(app, this, selectedFiles, PropertiesCommand.PUBLISH))); contextMenu.addItem(new MenuItem("" + AbstractImagePrototype.create(newImages.versions()).getHTML() + " Versions", true, new PropertiesCommand(app, this, selectedFiles, PropertiesCommand.VERSIONS))); } diff --git a/src/gr/grnet/pithos/web/client/FilePermissionsDialog.java b/src/gr/grnet/pithos/web/client/FilePermissionsDialog.java index e632ef2..5209536 100644 --- a/src/gr/grnet/pithos/web/client/FilePermissionsDialog.java +++ b/src/gr/grnet/pithos/web/client/FilePermissionsDialog.java @@ -73,14 +73,10 @@ public class FilePermissionsDialog extends AbstractPropertiesDialog { protected PermissionsList permList; - protected CheckBox readForAll; - private HorizontalPanel pathPanel; private TextBox path; - private Dictionary otherProperties = Dictionary.getDictionary("otherProperties"); - /** * An image bundle for this widgets images. */ @@ -195,26 +191,6 @@ public class FilePermissionsDialog extends AbstractPropertiesDialog { "distribute this file and that it does not violate the Terms of Use.", true); readForAllNote.setStylePrimaryName("pithos-readForAllNote"); - readForAll = new CheckBox(); - readForAll.setValue(file.isPublished()); - readForAll.addClickHandler(new ClickHandler() { - @Override - public void onClick(ClickEvent event) { - accept(); - } - }); - - // Only show the read for all permission if the user is the owner. - if (file.getOwner().equals(app.getUsername())) { - final HorizontalPanel permForAll = new HorizontalPanel(); - permForAll.add(new Label("Public")); - permForAll.add(readForAll); - permForAll.setSpacing(8); - permForAll.addStyleName("pithos-TabPanelBottom"); - permForAll.add(readForAllNote); - permPanel.add(permForAll); - } - pathPanel = new HorizontalPanel(); pathPanel.setVisible(false); pathPanel.setWidth("100%"); @@ -244,25 +220,19 @@ public class FilePermissionsDialog extends AbstractPropertiesDialog { @Override public void execute() { - showLinkIfPublished(); + showLinkIfShared(); } }); return permPanel; } - void showLinkIfPublished() { + void showLinkIfShared() { if (file.isShared()) { UrlBuilder b = Window.Location.createUrlBuilder(); - if (file.isPublished()) { - b.setPath(file.getPublicUri()); - path.setText(b.buildString()); - } - else { - b.setPath(app.getApiPath() + file.getOwner() + file.getUri()); - String href = Window.Location.getHref(); - boolean hasParameters = href.contains("?"); - path.setText(href + (hasParameters ? "&" : "?") + "goto=" + b.buildString()); - } + b.setPath(app.getApiPath() + file.getOwner() + file.getUri()); + String href = Window.Location.getHref(); + boolean hasParameters = href.contains("?"); + path.setText(href + (hasParameters ? "&" : "?") + "goto=" + b.buildString()); pathPanel.setVisible(true); } else { @@ -275,15 +245,11 @@ public class FilePermissionsDialog extends AbstractPropertiesDialog { */ @Override protected void accept() { - Boolean published = null; - if (readForAll.getValue() != file.isPublished()) - if (file.getOwner().equals(app.getUsername())) - published = readForAll.getValue(); - updateMetaData(app.getApiPath(), app.getUsername(), file.getUri() + "?update=", published, permList.getPermissions()); + updateMetaData(app.getApiPath(), app.getUsername(), file.getUri() + "?update=", permList.getPermissions()); } - protected void updateMetaData(String api, String owner, final String path, final Boolean published, final Map newPermissions) { - if (published != null || newPermissions != null) { + protected void updateMetaData(String api, String owner, final String path, final Map newPermissions) { + if (newPermissions != null) { PostRequest updateFile = new PostRequest(api, owner, path) { @Override public void onSuccess(Resource result) { @@ -291,7 +257,7 @@ public class FilePermissionsDialog extends AbstractPropertiesDialog { @Override public void onSuccess(File _result) { - showLinkIfPublished(); + showLinkIfShared(); app.updateFolder(file.getParent(), true, new Command() { @Override @@ -331,33 +297,29 @@ public class FilePermissionsDialog extends AbstractPropertiesDialog { }; updateFile.setHeader("X-Auth-Token", app.getToken()); - if (published != null) - updateFile.setHeader("X-Object-Public", published.toString()); - if (newPermissions != null) { - String readPermHeader = "read="; - String writePermHeader = "write="; - for (String u : newPermissions.keySet()) { - Boolean[] p = newPermissions.get(u); - if (p[0] != null && p[0]) - readPermHeader += u + ","; - if (p[1] != null && p[1]) - writePermHeader += u + ","; - } - if (readPermHeader.endsWith("=")) - readPermHeader = ""; - else if (readPermHeader.endsWith(",")) - readPermHeader = readPermHeader.substring(0, readPermHeader.length() - 1); - if (writePermHeader.endsWith("=")) - writePermHeader = ""; - else if (writePermHeader.endsWith(",")) - writePermHeader = writePermHeader.substring(0, writePermHeader.length() - 1); - String permHeader = readPermHeader + ((readPermHeader.length() > 0 && writePermHeader.length() > 0) ? ";" : "") + writePermHeader; - if (permHeader.length() == 0) - permHeader="~"; - else - permHeader = URL.encodePathSegment(permHeader); - updateFile.setHeader("X-Object-Sharing", permHeader); + String readPermHeader = "read="; + String writePermHeader = "write="; + for (String u : newPermissions.keySet()) { + Boolean[] p = newPermissions.get(u); + if (p[0] != null && p[0]) + readPermHeader += u + ","; + if (p[1] != null && p[1]) + writePermHeader += u + ","; } + if (readPermHeader.endsWith("=")) + readPermHeader = ""; + else if (readPermHeader.endsWith(",")) + readPermHeader = readPermHeader.substring(0, readPermHeader.length() - 1); + if (writePermHeader.endsWith("=")) + writePermHeader = ""; + else if (writePermHeader.endsWith(",")) + writePermHeader = writePermHeader.substring(0, writePermHeader.length() - 1); + String permHeader = readPermHeader + ((readPermHeader.length() > 0 && writePermHeader.length() > 0) ? ";" : "") + writePermHeader; + if (permHeader.length() == 0) + permHeader="~"; + else + permHeader = URL.encodePathSegment(permHeader); + updateFile.setHeader("X-Object-Sharing", permHeader); Scheduler.get().scheduleDeferred(updateFile); } else @@ -365,7 +327,7 @@ public class FilePermissionsDialog extends AbstractPropertiesDialog { @Override public void execute() { - if (file.isShared()) + if (file.isSharedOrPublished()) app.updateMySharedRoot(); } }, true); diff --git a/src/gr/grnet/pithos/web/client/FilePropertiesDialog.java b/src/gr/grnet/pithos/web/client/FilePropertiesDialog.java index 12c577a..336a5ee 100644 --- a/src/gr/grnet/pithos/web/client/FilePropertiesDialog.java +++ b/src/gr/grnet/pithos/web/client/FilePropertiesDialog.java @@ -340,7 +340,7 @@ public class FilePropertiesDialog extends AbstractPropertiesDialog { @Override public void execute() { - if (file.isShared()) + if (file.isSharedOrPublished()) app.updateMySharedRoot(); } }, true); diff --git a/src/gr/grnet/pithos/web/client/FilePublishDialog.java b/src/gr/grnet/pithos/web/client/FilePublishDialog.java new file mode 100644 index 0000000..ee96121 --- /dev/null +++ b/src/gr/grnet/pithos/web/client/FilePublishDialog.java @@ -0,0 +1,305 @@ +/* + * Copyright 2011-2012 GRNET S.A. All rights reserved. + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * 1. Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and + * documentation are those of the authors and should not be + * interpreted as representing official policies, either expressed + * or implied, of GRNET S.A. + */ +package gr.grnet.pithos.web.client; + +import gr.grnet.pithos.web.client.foldertree.File; +import gr.grnet.pithos.web.client.foldertree.Resource; +import gr.grnet.pithos.web.client.rest.HeadRequest; +import gr.grnet.pithos.web.client.rest.PostRequest; + +import java.util.Map; + +import com.google.gwt.core.client.GWT; +import com.google.gwt.core.client.Scheduler; +import com.google.gwt.dom.client.NativeEvent; +import com.google.gwt.event.dom.client.ClickEvent; +import com.google.gwt.event.dom.client.ClickHandler; +import com.google.gwt.event.dom.client.KeyCodes; +import com.google.gwt.http.client.Response; +import com.google.gwt.http.client.URL; +import com.google.gwt.http.client.UrlBuilder; +import com.google.gwt.i18n.client.Dictionary; +import com.google.gwt.resources.client.ImageResource; +import com.google.gwt.user.client.Command; +import com.google.gwt.user.client.Window; +import com.google.gwt.user.client.Event.NativePreviewEvent; +import com.google.gwt.user.client.ui.Anchor; +import com.google.gwt.user.client.ui.Button; +import com.google.gwt.user.client.ui.CheckBox; +import com.google.gwt.user.client.ui.FocusPanel; +import com.google.gwt.user.client.ui.HasHorizontalAlignment; +import com.google.gwt.user.client.ui.HorizontalPanel; +import com.google.gwt.user.client.ui.Label; +import com.google.gwt.user.client.ui.TextBox; +import com.google.gwt.user.client.ui.VerticalPanel; + +/** + * The 'File properties' dialog box implementation. + * + */ +public class FilePublishDialog extends AbstractPropertiesDialog { + + protected CheckBox readForAll; + + private HorizontalPanel pathPanel; + + private TextBox path; + + /** + * An image bundle for this widgets images. + */ + public interface Images extends MessagePanel.Images { + + @Source("gr/grnet/pithos/resources/edit_user.png") + ImageResource permUser(); + + @Source("gr/grnet/pithos/resources/groups22.png") + ImageResource permGroup(); + + @Source("gr/grnet/pithos/resources/editdelete.png") + ImageResource delete(); + } + + final File file; + + Images images = GWT.create(Images.class); + + /** + * The widget's constructor. + */ + public FilePublishDialog(Pithos _app, File _file) { + super(_app); + file = _file; + + Anchor close = new Anchor(); + close.addStyleName("close"); + close.addClickHandler(new ClickHandler() { + + @Override + public void onClick(ClickEvent event) { + hide(); + } + }); + // Set the dialog's caption. + setText("Publish/Un-publish"); + setAnimationEnabled(true); + setGlassEnabled(true); + setStyleName("pithos-DialogBox"); + + // Outer contains inner and buttons. + final VerticalPanel outer = new VerticalPanel(); + outer.add(close); + final FocusPanel focusPanel = new FocusPanel(outer); + // Inner contains generalPanel and permPanel. + inner = new VerticalPanel(); + inner.addStyleName("inner"); + + inner.add(createSharingPanel()); + + outer.add(inner); + + final Button ok = new Button("Close", new ClickHandler() { + @Override + public void onClick(ClickEvent event) { + closeDialog(); + } + }); + ok.addStyleName("button"); + + outer.add(ok); + outer.setCellHorizontalAlignment(inner, HasHorizontalAlignment.ALIGN_CENTER); + + focusPanel.setFocus(true); + setWidget(outer); + } + + private VerticalPanel createSharingPanel() { + VerticalPanel permPanel = new VerticalPanel(); + + final Label readForAllNote = new Label("When this option is enabled, the file will be readable" + + " by everyone. By checking this option, you are certifying that you have the right to " + + "distribute this file and that it does not violate the Terms of Use.", true); + readForAllNote.setStylePrimaryName("pithos-readForAllNote"); + + readForAll = new CheckBox(); + readForAll.setValue(file.isPublished()); + readForAll.addClickHandler(new ClickHandler() { + @Override + public void onClick(ClickEvent event) { + accept(); + } + }); + + // Only show the read for all permission if the user is the owner. + if (file.getOwner().equals(app.getUsername())) { + final HorizontalPanel permForAll = new HorizontalPanel(); + permForAll.add(new Label("Public")); + permForAll.add(readForAll); + permForAll.setSpacing(8); + permForAll.addStyleName("pithos-TabPanelBottom"); + permForAll.add(readForAllNote); + permPanel.add(permForAll); + } + + pathPanel = new HorizontalPanel(); + pathPanel.setVisible(false); + pathPanel.setWidth("100%"); + pathPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT); + pathPanel.add(new Label("Link")); + pathPanel.setSpacing(8); + pathPanel.addStyleName("pithos-TabPanelBottom"); + + path = new TextBox(); + path.setWidth("100%"); + path.addClickHandler(new ClickHandler() { + @Override + public void onClick(ClickEvent event) { + Pithos.enableIESelection(); + ((TextBox) event.getSource()).selectAll(); + Pithos.preventIESelection(); + } + }); + path.setText(Window.Location.getHost() + file.getPublicUri()); + path.setTitle("Use this link for sharing the file via e-mail, IM, etc. (crtl-C/cmd-C to copy to system clipboard)"); + path.setWidth("100%"); + path.setReadOnly(true); + pathPanel.add(path); + permPanel.add(pathPanel); + + Scheduler.get().scheduleDeferred(new Command() { + + @Override + public void execute() { + showLinkIfPublished(); + } + }); + return permPanel; + } + + void showLinkIfPublished() { + if (file.isPublished()) { + UrlBuilder b = Window.Location.createUrlBuilder(); + b.setPath(file.getPublicUri()); + path.setText(b.buildString()); + pathPanel.setVisible(true); + } + else { + pathPanel.setVisible(false); + } + } + /** + * Accepts any change and updates the file + * + */ + @Override + protected void accept() { + Boolean published = null; + if (readForAll.getValue() != file.isPublished()) + if (file.getOwner().equals(app.getUsername())) + published = readForAll.getValue(); + updateMetaData(app.getApiPath(), app.getUsername(), file.getUri() + "?update=", published); + } + + protected void updateMetaData(String api, String owner, final String path, final Boolean published) { + if (published != null) { + PostRequest updateFile = new PostRequest(api, owner, path) { + @Override + public void onSuccess(Resource result) { + HeadRequest headFile = new HeadRequest(File.class, app.getApiPath(), file.getOwner(), path, file) { + + @Override + public void onSuccess(File _result) { + showLinkIfPublished(); + app.updateFolder(file.getParent(), true, new Command() { + + @Override + public void execute() { + app.updateMySharedRoot(); + } + }, true); + } + + @Override + public void onError(Throwable t) { + GWT.log("", t); + app.setError(t); + app.displayError("System error modifying file:" + t.getMessage()); + } + + @Override + protected void onUnauthorized(Response response) { + app.sessionExpired(); + } + }; + headFile.setHeader("X-Auth-Token", app.getToken()); + Scheduler.get().scheduleDeferred(headFile); + } + + @Override + public void onError(Throwable t) { + GWT.log("", t); + app.setError(t); + app.displayError("System error modifying file:" + t.getMessage()); + } + + @Override + protected void onUnauthorized(Response response) { + app.sessionExpired(); + } + }; + updateFile.setHeader("X-Auth-Token", app.getToken()); + updateFile.setHeader("X-Object-Public", published.toString()); + Scheduler.get().scheduleDeferred(updateFile); + } + else + app.updateFolder(file.getParent(), true, new Command() { + + @Override + public void execute() { + if (file.isSharedOrPublished()) + app.updateMySharedRoot(); + } + }, true); + } + + @Override + protected void onPreviewNativeEvent(NativePreviewEvent preview) { + super.onPreviewNativeEvent(preview); + + NativeEvent evt = preview.getNativeEvent(); + if (evt.getType().equals("keydown") && evt.getKeyCode() == KeyCodes.KEY_ENTER) + closeDialog(); + } +} diff --git a/src/gr/grnet/pithos/web/client/FileVersionsDialog.java b/src/gr/grnet/pithos/web/client/FileVersionsDialog.java index b58a9be..e79007c 100644 --- a/src/gr/grnet/pithos/web/client/FileVersionsDialog.java +++ b/src/gr/grnet/pithos/web/client/FileVersionsDialog.java @@ -193,7 +193,7 @@ public class FileVersionsDialog extends AbstractPropertiesDialog { @Override public void execute() { - if (file.isShared()) + if (file.isSharedOrPublished()) app.updateMySharedRoot(); } }, true); diff --git a/src/gr/grnet/pithos/web/client/ToolsMenu.java b/src/gr/grnet/pithos/web/client/ToolsMenu.java index febfd67..e51776e 100644 --- a/src/gr/grnet/pithos/web/client/ToolsMenu.java +++ b/src/gr/grnet/pithos/web/client/ToolsMenu.java @@ -178,6 +178,7 @@ public class ToolsMenu extends PopupPanel { if (files != null && files.size() == 1) { contextMenu.addItem(new MenuItem("" + AbstractImagePrototype.create(newImages.viewText()).getHTML() + " File properties", true, new PropertiesCommand(app, this, files, PropertiesCommand.PROPERTIES))); contextMenu.addItem(new MenuItem("" + AbstractImagePrototype.create(newImages.group()).getHTML() + " Sharing", true, new PropertiesCommand(app, this, files, PropertiesCommand.PERMISSIONS))); + contextMenu.addItem(new MenuItem("" + AbstractImagePrototype.create(newImages.internet()).getHTML() + " Publish", true, new PropertiesCommand(app, this, files, PropertiesCommand.PUBLISH))); contextMenu.addItem(new MenuItem("" + AbstractImagePrototype.create(newImages.versions()).getHTML() + " Versions", true, new PropertiesCommand(app, this, files, PropertiesCommand.VERSIONS))); empty = false; } diff --git a/src/gr/grnet/pithos/web/client/commands/PropertiesCommand.java b/src/gr/grnet/pithos/web/client/commands/PropertiesCommand.java index c4bdf83..7e40560 100644 --- a/src/gr/grnet/pithos/web/client/commands/PropertiesCommand.java +++ b/src/gr/grnet/pithos/web/client/commands/PropertiesCommand.java @@ -36,6 +36,7 @@ package gr.grnet.pithos.web.client.commands; import gr.grnet.pithos.web.client.FilePermissionsDialog; import gr.grnet.pithos.web.client.FilePropertiesDialog; +import gr.grnet.pithos.web.client.FilePublishDialog; import gr.grnet.pithos.web.client.FileVersionsDialog; import gr.grnet.pithos.web.client.FilesPropertiesDialog; import gr.grnet.pithos.web.client.FolderPermissionsDialog; @@ -59,6 +60,7 @@ public class PropertiesCommand implements Command { public static final int PROPERTIES = 0; public static final int PERMISSIONS = 1; public static final int VERSIONS = 2; + public static final int PUBLISH = 3; private PopupPanel containerPanel; @@ -139,6 +141,16 @@ public class PropertiesCommand implements Command { FileVersionsDialog dlg2 = new FileVersionsDialog(app, files.get(0)); dlg2.center(); break; + case PUBLISH: + app.scheduleFileHeadCommand(f, new Command() { + + @Override + public void execute() { + FilePublishDialog dlg = new FilePublishDialog(app, f); + dlg.center(); + } + }); + break; default: break; } diff --git a/src/gr/grnet/pithos/web/client/foldertree/File.java b/src/gr/grnet/pithos/web/client/foldertree/File.java index e1cee32..01a3215 100644 --- a/src/gr/grnet/pithos/web/client/foldertree/File.java +++ b/src/gr/grnet/pithos/web/client/foldertree/File.java @@ -139,9 +139,13 @@ public class File extends Resource { return nf.format(Double.valueOf(bytes)/(1024 * 1024 * 1024)) + " GB"; } - public boolean isShared() { + public boolean isSharedOrPublished() { return !permissions.isEmpty() || published; } + + public boolean isShared() { + return !permissions.isEmpty(); + } public void populate(Folder _parent, JSONObject o, String _owner, String _container) { this.parent = _parent; diff --git a/src/gr/grnet/pithos/web/client/mysharedtree/MysharedTreeViewModel.java b/src/gr/grnet/pithos/web/client/mysharedtree/MysharedTreeViewModel.java index 5cddcf6..6dbcc00 100644 --- a/src/gr/grnet/pithos/web/client/mysharedtree/MysharedTreeViewModel.java +++ b/src/gr/grnet/pithos/web/client/mysharedtree/MysharedTreeViewModel.java @@ -233,7 +233,7 @@ public class MysharedTreeViewModel implements TreeViewModel { public void onSuccess(Folder _result) { if (!_result.isShared()) { for (File file : _result.getFiles()) { - if (file.isShared()) + if (file.isSharedOrPublished()) sharedFiles.add(file); } Iterator iter2 = new ArrayList(result.getSubfolders()).listIterator(); diff --git a/src/gr/grnet/pithos/web/client/othersharedtree/OtherSharedTreeViewModel.java b/src/gr/grnet/pithos/web/client/othersharedtree/OtherSharedTreeViewModel.java index 8caf848..9cca940 100644 --- a/src/gr/grnet/pithos/web/client/othersharedtree/OtherSharedTreeViewModel.java +++ b/src/gr/grnet/pithos/web/client/othersharedtree/OtherSharedTreeViewModel.java @@ -380,7 +380,7 @@ public class OtherSharedTreeViewModel implements TreeViewModel { public void onSuccess(Folder _result) { if (!_result.isShared() && !_result.isContainer()) { for (File file : _result.getFiles()) { - if (file.isShared()) + if (file.isSharedOrPublished()) sharedFiles.get(username).add(file); } Iterator iter2 = _result.getSubfolders().iterator(); -- 1.7.10.4