bug fixed on searching

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace-tree-widget@92217 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2014-02-24 18:11:41 +00:00
parent 39d116792d
commit 8fe2a21347
2 changed files with 14 additions and 9 deletions

View File

@ -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;

View File

@ -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