2099: Workspace Explorer enhancements: create a new folder

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

Fixed issue on getParent

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/widgets/workspace-explorer@122727 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2016-02-02 13:09:14 +00:00
parent ea3b77fee2
commit 379ffc008d
1 changed files with 3 additions and 8 deletions

View File

@ -614,21 +614,16 @@ public class WorkspaceExplorerServiceImpl extends RemoteServiceServlet implement
Workspace workspace = getWorkspace();
WorkspaceFolder wsFolder = workspace.createFolder(nameFolder, description, parentId);
Item itemFolder = null;
List<ItemType> allTypes = Arrays.asList(ItemType.values());
WorkspaceFolder parentFolder = null;
Item parent = null;
try{
parentFolder = wsFolder.getParent();
parent = ItemBuilder.getItem(null, wsFolder.getParent(), allTypes, null, false);
}catch(Exception e){
_log.error("Get parent thown an exception, is it the root id? "+parentId);
}
Item parent = ItemBuilder.getItem(null, parentFolder, allTypes, null, false);
if(parent!=null){
itemFolder = ItemBuilder.getItem(parent, wsFolder, allTypes, null, false);
}
return itemFolder;
return ItemBuilder.getItem(parent, wsFolder, allTypes, null, false);
} catch(InsufficientPrivilegesException e){
String error = "Insufficient Privileges to create the folder";