NodeAdmin resource added
This commit is contained in:
parent
61c84fbb11
commit
8c677df64e
|
@ -15,6 +15,7 @@ import org.gcube.data.access.storagehub.services.ItemsManager;
|
||||||
import org.gcube.data.access.storagehub.services.UserManager;
|
import org.gcube.data.access.storagehub.services.UserManager;
|
||||||
import org.gcube.data.access.storagehub.services.WorkspaceManager;
|
import org.gcube.data.access.storagehub.services.WorkspaceManager;
|
||||||
import org.gcube.data.access.storagehub.services.admin.ItemManagerAdmin;
|
import org.gcube.data.access.storagehub.services.admin.ItemManagerAdmin;
|
||||||
|
import org.gcube.data.access.storagehub.services.admin.NodeManagerAdmin;
|
||||||
import org.glassfish.jersey.media.multipart.MultiPartFeature;
|
import org.glassfish.jersey.media.multipart.MultiPartFeature;
|
||||||
|
|
||||||
@Path("workspace")
|
@Path("workspace")
|
||||||
|
@ -33,6 +34,7 @@ public class StorageHub extends Application {
|
||||||
classes.add(UserManager.class);
|
classes.add(UserManager.class);
|
||||||
classes.add(GroupManager.class);
|
classes.add(GroupManager.class);
|
||||||
classes.add(ItemManagerAdmin.class);
|
classes.add(ItemManagerAdmin.class);
|
||||||
|
classes.add(NodeManagerAdmin.class);
|
||||||
classes.add(SerializableErrorEntityTextWriter.class);
|
classes.add(SerializableErrorEntityTextWriter.class);
|
||||||
classes.add(MyApplicationListener.class);
|
classes.add(MyApplicationListener.class);
|
||||||
return classes;
|
return classes;
|
||||||
|
|
|
@ -315,6 +315,7 @@ public class Utils {
|
||||||
|
|
||||||
idsToDelete.add(((AbstractFileItem) itemToDelete).getContent().getStorageId());
|
idsToDelete.add(((AbstractFileItem) itemToDelete).getContent().getStorageId());
|
||||||
}else if (itemToDelete instanceof FolderItem) {
|
}else if (itemToDelete instanceof FolderItem) {
|
||||||
|
//only to be sure to not delete shared content
|
||||||
if (itemToDelete.isShared()) return;
|
if (itemToDelete.isShared()) return;
|
||||||
List<Item> items = Utils.getItemList(ses.getNodeByIdentifier(itemToDelete.getId()), Excludes.GET_ONLY_CONTENT , null, true, null);
|
List<Item> items = Utils.getItemList(ses.getNodeByIdentifier(itemToDelete.getId()), Excludes.GET_ONLY_CONTENT , null, true, null);
|
||||||
for (Item item: items)
|
for (Item item: items)
|
||||||
|
|
|
@ -197,7 +197,7 @@ public class GroupManager {
|
||||||
try {
|
try {
|
||||||
Node node = groupHandler.getVreFolderNode(session, group);
|
Node node = groupHandler.getVreFolderNode(session, group);
|
||||||
List<Item> workspaceItems = Utils.getItemList(node, Excludes.GET_ONLY_CONTENT, null, true, null);
|
List<Item> workspaceItems = Utils.getItemList(node, Excludes.GET_ONLY_CONTENT, null, true, null);
|
||||||
trashHandler.removeNodes(session, workspaceItems);
|
trashHandler.removeOnlyNodesContent(session, workspaceItems);
|
||||||
node.removeSharedSet();
|
node.removeSharedSet();
|
||||||
}catch (Exception e) {
|
}catch (Exception e) {
|
||||||
log.warn("vreFolder {} not found, removing only the group", group);
|
log.warn("vreFolder {} not found, removing only the group", group);
|
||||||
|
|
Loading…
Reference in New Issue