[feature/MNT-24127-EndpointToCalculateFolderSize] Added Endpoint to calculate folder size

This commit is contained in:
Mohit Singh
2024-07-30 09:20:29 +05:30
parent 742ab3669a
commit 0f6bb34c72
3 changed files with 9 additions and 15 deletions

View File

@@ -97,7 +97,6 @@ public class NodesEntityResource implements
private ActionService actionService;
private SimpleCache<Serializable,Object> simpleCache;
public void setNodes(Nodes nodes)
{
this.nodes = nodes;
@@ -318,7 +317,6 @@ public class NodesEntityResource implements
throw new AlfrescoRuntimeException("Exception occurred in NodesEntityResource:createById",alfrescoRuntimeError);
}
}
@Operation("get-folder-size")
@WebApiDescription(title = "Returns Folder Node Size", description = "Returning a Folder Node Size")
@WebApiParameters({@WebApiParam(name = "nodeId", title = "The unique id of Execution Job", description = "A single nodeId")})

View File

@@ -126,8 +126,6 @@ public class ResourceInspector
ALL_RELATIONSHIP_RESOURCE_INTERFACES.add(MultiPartRelationshipResourceAction.Create.class);
ALL_PROPERTY_RESOURCE_INTERFACES.add(BinaryResourceAction.Read.class);
ALL_PROPERTY_RESOURCE_INTERFACES.add(BinaryResourceAction.Delete.class);
ALL_PROPERTY_RESOURCE_INTERFACES.add(BinaryResourceAction.Update.class);
@@ -727,7 +725,15 @@ public class ResourceInspector
Map<String, Object> annotAttribs = AnnotationUtils.getAnnotationAttributes(annot);
String actionName = String.valueOf(annotAttribs.get("value"));
String actionPath = ResourceDictionary.propertyResourceKey(entityPath, actionName);
ResourceOperation ro = inspectOperation(anyClass, annotatedMethod, POST);
ResourceOperation ro;
if("/nodes/{id}/get-folder-size".equals(actionPath))
{
ro = inspectOperation(anyClass, annotatedMethod, GET);
}
else
{
ro = inspectOperation(anyClass, annotatedMethod, POST);
}
embeds.put(actionPath, new Pair<ResourceOperation, Method>(ro, annotatedMethod));
}
}

View File

@@ -238,16 +238,6 @@ public class ResourceWebScriptGet extends AbstractResourceWebScript implements P
CollectionWithPagingInfo<?> relations = relationGetter.readAll(params.getEntityId(),params);
return relations;
}
else if (RelationshipResourceAction.ReadById.class.isAssignableFrom(resource.getResource().getClass()))
{
if (resource.getMetaData().isDeleted(RelationshipResourceAction.ReadById.class))
{
throw new DeletedResourceException("(GET by id) "+resource.getMetaData().getUniqueId());
}
RelationshipResourceAction.ReadById<?> relationGetter = (RelationshipResourceAction.ReadById<?>) resource.getResource();
Object result = relationGetter.readById(params.getEntityId(), params.getRelationshipId(), params);
return result;
}
else
{
if (resource.getMetaData().isDeleted(RelationshipResourceAction.ReadWithResponse.class))