1808: Workspace: breadcrumb click on VRE Subfolders make the icon change to "shared folder"

Task-Url: https://support.d4science.org/issues/1808

Added code to set sharable property and fix this issue

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace-tree-widget@121822 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2015-12-14 15:56:40 +00:00
parent c823901d9f
commit c9d714da08
3 changed files with 14 additions and 3 deletions

View File

@ -8,6 +8,7 @@ import org.gcube.portlets.user.workspace.client.interfaces.GXTFolderItemTypeEnum
import org.gcube.portlets.user.workspace.client.resources.Resources;
import com.extjs.gxt.ui.client.data.BaseModelData;
import com.google.gwt.core.shared.GWT;
import com.google.gwt.user.client.ui.AbstractImagePrototype;
import com.google.gwt.user.client.ui.Image;
@ -193,7 +194,9 @@ public class FileModel extends BaseModelData implements Serializable {
else
absImgPr = Resources.getIconByFolderItemType(this.getGXTFolderItemType());
}else if(this.isShared()){ //SHARED ITEM?
}else if(this.isShared()){ //IS A SHARED FOLDER?
GWT.log("setting icon is shared: "+this.isShared() + ", this.isVreFolder() "+this.isVreFolder() +", this.isShareable() "+this.isShareable());
if(this.isVreFolder())
absImgPr = Resources.getIconVREFolder();

View File

@ -1469,7 +1469,7 @@ public class Resources {
if(type.equals(GXTFolderItemTypeEnum.FOLDER.toString()))
return Resources.getIconFolder();
//RECOVERING "mediat type name" from type / media type name [+suffix]
//RECOVERING "media type name" from type / media type name [+suffix]
int sl = type.indexOf("/");
String mediaTypeName = type.substring(sl+1, type.length());

View File

@ -23,6 +23,7 @@ import org.gcube.common.homelibary.model.items.type.WorkspaceItemType;
import org.gcube.common.homelibrary.home.User;
import org.gcube.common.homelibrary.home.exceptions.InternalErrorException;
import org.gcube.common.homelibrary.home.workspace.Properties;
import org.gcube.common.homelibrary.home.workspace.Workspace;
import org.gcube.common.homelibrary.home.workspace.WorkspaceFolder;
import org.gcube.common.homelibrary.home.workspace.WorkspaceItem;
import org.gcube.common.homelibrary.home.workspace.WorkspaceSharedFolder;
@ -40,6 +41,7 @@ import org.gcube.common.homelibrary.home.workspace.accounting.AccountingEntryRes
import org.gcube.common.homelibrary.home.workspace.accounting.AccountingEntryShare;
import org.gcube.common.homelibrary.home.workspace.accounting.AccountingEntryUnshare;
import org.gcube.common.homelibrary.home.workspace.accounting.AccountingEntryUpdate;
import org.gcube.common.homelibrary.home.workspace.exceptions.ItemNotFoundException;
import org.gcube.common.homelibrary.home.workspace.folder.FolderBulkCreator;
import org.gcube.common.homelibrary.home.workspace.folder.FolderItem;
import org.gcube.common.homelibrary.home.workspace.folder.items.ExternalFile;
@ -532,7 +534,7 @@ public class GWTWorkspaceBuilder {
List<WorkspaceItem> listItems = (List<WorkspaceItem>) workspaceFolder.getChildren();
if(listItems!=null)
logger.trace("HL return "+listItems.size()+ "items, converting...");
logger.trace("HL return "+listItems.size()+ " items, converting...");
//TEST TIME
// Long startTime = System.currentTimeMillis();
@ -713,10 +715,16 @@ public class GWTWorkspaceBuilder {
}
//SET SHARE POLICY
if(parentFolderModel!=null && parentFolderModel.isShared()){
fileModel.setShared(true);
fileModel.setShareable(false); //UPDATED TO CHANGE PERMISSIONS TO SHARED SUBFOLDERS
}else if(parentFolderModel==null && item.isShared()){ //ADDED TO FIX #1808
fileModel.setShared(true);
if(item.getParent()!=null && item.getParent().isShared())
fileModel.setShareable(false);
}
return fileModel;
}