mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-10-01 14:41:46 +00:00
[feature/MNT-24127-EndpointToCalculateFolderSize] Added Endpoint to calculate folder size
This commit is contained in:
@@ -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")})
|
||||
|
@@ -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));
|
||||
}
|
||||
}
|
||||
|
@@ -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))
|
||||
|
Reference in New Issue
Block a user