updated getBreadcrumbToParentLimit

This commit is contained in:
Francesco Mangiacrapa 2021-03-26 10:14:06 +01:00
parent b476e2af6a
commit a39e4724ac
1 changed files with 10 additions and 2 deletions

View File

@ -241,7 +241,8 @@ public class WorkspaceExplorerServiceImpl extends RemoteServiceServlet implement
public ArrayList<org.gcube.portlets.widgets.wsexplorer.shared.Item> getBreadcrumbsByItemIdentifier( public ArrayList<org.gcube.portlets.widgets.wsexplorer.shared.Item> getBreadcrumbsByItemIdentifier(
String itemIdentifier, String itemName, boolean includeItemAsParent) String itemIdentifier, String itemName, boolean includeItemAsParent)
throws Exception { throws Exception {
System.out.println("ListParents By Item id "+ itemIdentifier + " name="+itemName); _log.debug("called getBreadcrumbsByItemIdentifier id="+ itemIdentifier + ", name="+itemName);
try { try {
List<? extends Item> parents = StorageHubServiceUtil.getParents(getThreadLocalRequest(), itemIdentifier); List<? extends Item> parents = StorageHubServiceUtil.getParents(getThreadLocalRequest(), itemIdentifier);
ArrayList<org.gcube.portlets.widgets.wsexplorer.shared.Item> toReturn = new ArrayList<>(parents.size()); ArrayList<org.gcube.portlets.widgets.wsexplorer.shared.Item> toReturn = new ArrayList<>(parents.size());
@ -262,6 +263,7 @@ public class WorkspaceExplorerServiceImpl extends RemoteServiceServlet implement
String theClickedFolderName = itemName == null || itemName.equals("") ? "current folder" : itemName; String theClickedFolderName = itemName == null || itemName.equals("") ? "current folder" : itemName;
toReturn.add(new org.gcube.portlets.widgets.wsexplorer.shared.Item(itemIdentifier, theClickedFolderName, true)); //this is the last non clickable item on the BC toReturn.add(new org.gcube.portlets.widgets.wsexplorer.shared.Item(itemIdentifier, theClickedFolderName, true)); //this is the last non clickable item on the BC
_log.debug("returning breadcrumbs: "+ toReturn);
return toReturn; return toReturn;
} catch (Exception e) { } catch (Exception e) {
_log.error("Error in get List Parents By Item Identifier ", e); _log.error("Error in get List Parents By Item Identifier ", e);
@ -280,8 +282,13 @@ public class WorkspaceExplorerServiceImpl extends RemoteServiceServlet implement
*/ */
@Override @Override
public List<org.gcube.portlets.widgets.wsexplorer.shared.Item> getBreadcrumbsByItemIdentifierToParentLimit(String itemIdentifier, String parentLimit, boolean includeItemAsParent) throws Exception { public List<org.gcube.portlets.widgets.wsexplorer.shared.Item> getBreadcrumbsByItemIdentifierToParentLimit(String itemIdentifier, String parentLimit, boolean includeItemAsParent) throws Exception {
_log.trace("getBreadcrumbsByItemIdentifierToParentLimit by Item Identifier " + itemIdentifier +" and limit: "+parentLimit); _log.debug("getBreadcrumbsByItemIdentifierToParentLimit by Item Identifier: " + itemIdentifier +" and limit: "+parentLimit);
if(parentLimit==null) {
_log.debug("parentLimit is null, so calling default getBreadcrumbsByItemIdentifier");
return getBreadcrumbsByItemIdentifier(itemIdentifier, null, includeItemAsParent);
}
parentLimit = parentLimit!=null?parentLimit:""; parentLimit = parentLimit!=null?parentLimit:"";
try { try {
List<? extends Item> parents = StorageHubServiceUtil.getParents(getThreadLocalRequest(), itemIdentifier); List<? extends Item> parents = StorageHubServiceUtil.getParents(getThreadLocalRequest(), itemIdentifier);
@ -314,6 +321,7 @@ public class WorkspaceExplorerServiceImpl extends RemoteServiceServlet implement
if (found) if (found)
toReturn.add(item); toReturn.add(item);
} }
_log.debug("returning breadcrumb untit to folder: "+ toReturn);
return toReturn; return toReturn;
} catch (Exception e) { } catch (Exception e) {
_log.error("Error in get List Parents By Item Identifier ", e); _log.error("Error in get List Parents By Item Identifier ", e);