diff --git a/src/main/java/org/gcube/data/access/storagehub/handlers/items/Node2ItemConverter.java b/src/main/java/org/gcube/data/access/storagehub/handlers/items/Node2ItemConverter.java index bad0e8b..546ed69 100644 --- a/src/main/java/org/gcube/data/access/storagehub/handlers/items/Node2ItemConverter.java +++ b/src/main/java/org/gcube/data/access/storagehub/handlers/items/Node2ItemConverter.java @@ -210,11 +210,11 @@ public class Node2ItemConverter { //for now it excludes only first level node //if (excludes!=null && excludes.contains(fieldNodeName)) continue; //for now it excludes only first level node - logger.info("retrieving field node {} on field {}", fieldNodeName, field.getName()); + logger.debug("retrieving field node {} on field {}", fieldNodeName, field.getName()); field.setAccessible(true); try{ Node fieldNode = node.getNode(fieldNodeName); - logger.info("looking in node {} searched with {}",fieldNode.getName(),fieldNodeName); + logger.debug("looking in node {} searched with {}",fieldNode.getName(),fieldNodeName); field.set(obj, iterateNodeAttributeFields(field.getType(), fieldNode)); }catch(PathNotFoundException e){ logger.warn("the current node dosn't contain {} node",fieldNodeName); @@ -280,7 +280,7 @@ public class Node2ItemConverter { typeToSubtypeMap.put(listType, subTypesMap); } else { - logger.info("subtypes already found in cache"); + logger.debug("subtypes already found in cache"); subTypesMap = typeToSubtypeMap.get(listType); } diff --git a/src/main/java/org/gcube/data/access/storagehub/services/admin/ScriptUtilImpl.java b/src/main/java/org/gcube/data/access/storagehub/services/admin/ScriptUtilImpl.java index e68b3c6..4a4d5e2 100644 --- a/src/main/java/org/gcube/data/access/storagehub/services/admin/ScriptUtilImpl.java +++ b/src/main/java/org/gcube/data/access/storagehub/services/admin/ScriptUtilImpl.java @@ -7,10 +7,13 @@ import javax.inject.Inject; import javax.inject.Singleton; import javax.jcr.Node; import javax.jcr.RepositoryException; +import javax.jcr.Session; import org.gcube.common.storagehub.model.exceptions.BackendGenericError; +import org.gcube.common.storagehub.model.exceptions.StorageHubException; import org.gcube.common.storagehub.model.items.Item; import org.gcube.data.access.storagehub.Utils; +import org.gcube.data.access.storagehub.handlers.TrashHandler; import org.gcube.data.access.storagehub.handlers.items.Node2ItemConverter; import org.gcube.data.access.storagehub.scripting.ScriptUtil; @@ -19,6 +22,8 @@ public class ScriptUtilImpl implements ScriptUtil { @Inject Node2ItemConverter node2Item; + @Inject TrashHandler trashHandler; + @Override public List getChildren(Predicate checker, Node parent, List excludes, boolean showHidden, Class nodeTypeToInclude) throws RepositoryException, BackendGenericError { return Utils.getItemList(checker, parent, excludes, null, showHidden, nodeTypeToInclude); @@ -28,5 +33,10 @@ public class ScriptUtilImpl implements ScriptUtil { public Item getItem(Node node, List excludes) throws RepositoryException, BackendGenericError { return node2Item.getItem(node, excludes); } - + + @Override + public void removeNodes(Session ses, List itemsToDelete) throws RepositoryException, StorageHubException{ + trashHandler.removeNodes(ses, itemsToDelete); + } + } diff --git a/src/main/resources/storage-settings.properties b/src/main/resources/storage-settings.properties index 6b8688c..221093e 100644 --- a/src/main/resources/storage-settings.properties +++ b/src/main/resources/storage-settings.properties @@ -7,4 +7,4 @@ volatile.bucketName=shub-volatile-dev volatile.key=qa4zD0QqmcG0JZNG volatile.secret=9jzHtOigmrprBYtPGIkh3Tq1Bago4zxL volatile.url=https://minio.d4science.org/ -volatile.createBucket=true \ No newline at end of file +volatile.createBucket=false \ No newline at end of file