diff --git a/src/main/java/org/gcube/portlets/user/workspace/server/GWTWorkspaceBuilder.java b/src/main/java/org/gcube/portlets/user/workspace/server/GWTWorkspaceBuilder.java index 33b8e11..d2de1b5 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/server/GWTWorkspaceBuilder.java +++ b/src/main/java/org/gcube/portlets/user/workspace/server/GWTWorkspaceBuilder.java @@ -1025,7 +1025,7 @@ public class GWTWorkspaceBuilder { break; case FOLDER_ITEM: - SearchFolderItem folderItem = (SearchFolderItem) item; + SearchFolderItem folderItem = (SearchFolderItem) item; // fileGridModel = new FileGridModel(item.getId(), item.getName(), toDate(item.getCreationDate()), parentFileModel, folderItem.getSize(), false, false); fileGridModel = new FileGridModel(item.getId(), item.getName(), toDate(item.getLastModified()), parentFileModel, folderItem.getSize(), false, false); // FolderItem folderItem = (FolderItem) item; @@ -1034,10 +1034,13 @@ public class GWTWorkspaceBuilder { case SHARED_FOLDER: - WorkspaceSharedFolder shared = (WorkspaceSharedFolder) item; - String name = shared.isVreFolder()?shared.getDisplayName():item.getName(); + //ATTENTION: SEARCH ITEM IS NOT CASTABLE AT WorkspaceSharedFolder + +// WorkspaceSharedFolder shared = (WorkspaceSharedFolder) item; +// String name = shared.isVreFolder()?shared.getDisplayName():item.getName(); + // fileGridModel = (FolderGridModel) new FolderGridModel(item.getId(), item.getName(), toDate(item.getCreationDate()), parentFileModel, -1, true, false); - fileGridModel = (FolderGridModel) new FolderGridModel(item.getId(), name, toDate(item.getLastModified()), parentFileModel, -1, true, true,shared.isVreFolder()); + fileGridModel = (FolderGridModel) new FolderGridModel(item.getId(), item.getName(), toDate(item.getLastModified()), parentFileModel, -1, true, true, item.isVreFolder()); fileGridModel.setType(GXTFolderItemTypeEnum.SHARED_FOLDER.toString()); fileGridModel.setShortcutCategory(GXTCategoryItemInterface.SMF_DOCUMENTS); fileGridModel.setShareable(true); @@ -1053,14 +1056,14 @@ public class GWTWorkspaceBuilder { } - //TODO ISSHARED IN SEARCH ITEM IN HL + //TODO ISSHARED IN SEARCH ITEM IN HL TO RETRIEVE SHARE ON WORKSPACEITEM //ACCOUNTING // fileGridModel.setMarkAsRead(item.isMarkedAsRead()); - /* + //OWNER - if(fileGridModel.isShared()){ //IS READ FROM HL ONLY IF THE ITEM IS SHARED + /*if(fileGridModel.isShared()){ //IS READ FROM HL ONLY IF THE ITEM IS SHARED String portalLogin = item.getOwner(); if(portalLogin!=null){ String fullName = portalLogin; @@ -1074,8 +1077,8 @@ public class GWTWorkspaceBuilder { else{ if(userLogged!=null) fileGridModel.setOwnerFullName(userLogged.getName()); - } - */ + }*/ + return fileGridModel; diff --git a/src/main/java/org/gcube/portlets/user/workspace/server/LocalUploadServlet.java b/src/main/java/org/gcube/portlets/user/workspace/server/LocalUploadServlet.java index 96b42ca..cc8a471 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/server/LocalUploadServlet.java +++ b/src/main/java/org/gcube/portlets/user/workspace/server/LocalUploadServlet.java @@ -360,6 +360,8 @@ public class LocalUploadServlet extends HttpServlet { if(!isOverwrite){ //we need to recalculate the item name itemName = WorkspaceUtil.getUniqueName(itemName, destinationFolder); + logger.trace("before calling createExternalFile - itemName is: "+itemName); + logger.trace("before calling createExternalFile - contentType is: "+contentType); createdItem = WorkspaceUtil.createExternalFile(destinationFolder, itemName, "", contentType, uploadItem); } else