Calling search with excludeTrashed = true
Added a check with instance of TrahItem
This commit is contained in:
parent
4779c04a24
commit
2e0b2afa53
|
@ -570,14 +570,14 @@ public class StorageHubClientService {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Search by text.
|
* Search for text.
|
||||||
*
|
*
|
||||||
* @param name the name
|
* @param text the text
|
||||||
* @param folderId the folder id
|
* @param folderId the folder id
|
||||||
* @return the list<? extends item>
|
* @return the list<? extends item>
|
||||||
* @throws Exception the exception
|
* @throws Exception the exception
|
||||||
*/
|
*/
|
||||||
public List<? extends Item> searchByText(String name, String folderId) throws Exception {
|
public List<? extends Item> searchForText(String text, String folderId) throws Exception {
|
||||||
|
|
||||||
Item item;
|
Item item;
|
||||||
try {
|
try {
|
||||||
|
@ -588,8 +588,8 @@ public class StorageHubClientService {
|
||||||
}
|
}
|
||||||
|
|
||||||
if(item instanceof FolderItem || item instanceof SharedFolder || item instanceof VreFolder){
|
if(item instanceof FolderItem || item instanceof SharedFolder || item instanceof VreFolder){
|
||||||
//return shcClient.open(folderId).asFolder().findByName(name).withContent().getItems();
|
//this does not return the trashed items
|
||||||
return shcClient.open(folderId).asFolder().search(name).withContent().getItems();
|
return shcClient.open(folderId).asFolder().search(text,true).withContent().getItems();
|
||||||
}else
|
}else
|
||||||
throw new Exception("The input folder id is not a folder");
|
throw new Exception("The input folder id is not a folder");
|
||||||
}
|
}
|
||||||
|
|
|
@ -667,7 +667,7 @@ public final class WorkspaceStorageHubClientService implements Workspace{
|
||||||
LOGGER.debug("called text");
|
LOGGER.debug("called text");
|
||||||
Validate.notNull(folderId,"The input folderid is null");
|
Validate.notNull(folderId,"The input folderid is null");
|
||||||
try {
|
try {
|
||||||
List<? extends Item> items = storageHubClientService.searchByText(text, folderId);
|
List<? extends Item> items = storageHubClientService.searchForText(text, folderId);
|
||||||
List<WorkspaceItem> wsItems = null;
|
List<WorkspaceItem> wsItems = null;
|
||||||
if(items!=null){
|
if(items!=null){
|
||||||
wsItems = new ArrayList<WorkspaceItem>(items.size());
|
wsItems = new ArrayList<WorkspaceItem>(items.size());
|
||||||
|
|
|
@ -296,7 +296,7 @@ public class HLMapper {
|
||||||
}
|
}
|
||||||
|
|
||||||
//CONVERTING TRASH ITEM
|
//CONVERTING TRASH ITEM
|
||||||
if(item.isTrashed()){
|
if(item.isTrashed() && item instanceof TrashItem){
|
||||||
type = WorkspaceItemType.TRASH_ITEM;
|
type = WorkspaceItemType.TRASH_ITEM;
|
||||||
TrashItem trashItem = (TrashItem) item; //??
|
TrashItem trashItem = (TrashItem) item; //??
|
||||||
theItem = new org.gcube.common.storagehubwrapper.shared.tohl.impl.TrashItem();
|
theItem = new org.gcube.common.storagehubwrapper.shared.tohl.impl.TrashItem();
|
||||||
|
|
Loading…
Reference in New Issue