mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-10-01 14:41:46 +00:00
[MNT-24127] Added Endpoint to Calculate Size of the folder with Integration Test Cases [ags][tas]
This commit is contained in:
@@ -48,8 +48,8 @@ import org.alfresco.service.cmr.security.AccessStatus;
|
|||||||
import org.alfresco.service.cmr.security.PermissionService;
|
import org.alfresco.service.cmr.security.PermissionService;
|
||||||
import org.alfresco.service.namespace.QName;
|
import org.alfresco.service.namespace.QName;
|
||||||
import org.alfresco.util.ParameterCheck;
|
import org.alfresco.util.ParameterCheck;
|
||||||
import org.apache.commons.logging.Log;
|
import org.slf4j.Logger;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.InitializingBean;
|
import org.springframework.beans.factory.InitializingBean;
|
||||||
import org.springframework.extensions.webscripts.Status;
|
import org.springframework.extensions.webscripts.Status;
|
||||||
|
|
||||||
@@ -79,7 +79,7 @@ public class NodeFolderSizeRelation implements
|
|||||||
/**
|
/**
|
||||||
* The logger
|
* The logger
|
||||||
*/
|
*/
|
||||||
private static final Log LOGGER = LogFactory.getLog(NodeFolderSizeRelation.class);
|
private static final Logger LOG = LoggerFactory.getLogger(NodeFolderSizeRelation.class);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The class that wraps the ReST APIs from core.
|
* The class that wraps the ReST APIs from core.
|
||||||
@@ -153,7 +153,7 @@ public class NodeFolderSizeRelation implements
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
LOGGER.error("Exception occured in NodeFolderSizeRelation:createById "+ex.getMessage());
|
LOG.error("Exception occured in NodeFolderSizeRelation:createById {}", ex.getMessage());
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -200,7 +200,7 @@ public class NodeFolderSizeRelation implements
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
LOGGER.error("Exception occured in NodeFolderSizeRelation:readById "+ex.getMessage());
|
LOG.error("Exception occured in NodeFolderSizeRelation:readById {}", ex.getMessage());
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@@ -33,11 +33,11 @@ import org.alfresco.rest.api.tests.client.HttpResponse;
|
|||||||
import org.alfresco.rest.api.tests.util.RestApiUtil;
|
import org.alfresco.rest.api.tests.util.RestApiUtil;
|
||||||
import org.alfresco.service.cmr.security.PermissionService;
|
import org.alfresco.service.cmr.security.PermissionService;
|
||||||
import org.alfresco.service.cmr.site.SiteVisibility;
|
import org.alfresco.service.cmr.site.SiteVisibility;
|
||||||
import org.apache.commons.logging.Log;
|
|
||||||
import org.apache.commons.logging.LogFactory;
|
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -45,7 +45,6 @@ import java.util.UUID;
|
|||||||
|
|
||||||
import static org.alfresco.rest.api.tests.util.RestApiUtil.toJsonAsStringNonNull;
|
import static org.alfresco.rest.api.tests.util.RestApiUtil.toJsonAsStringNonNull;
|
||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.Assert.assertNotNull;
|
||||||
import static org.junit.Assert.assertTrue;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* V1 REST API tests for Folder size
|
* V1 REST API tests for Folder size
|
||||||
@@ -61,6 +60,11 @@ public class NodeFolderSizeApiTest extends AbstractBaseApiTest{
|
|||||||
|
|
||||||
protected PermissionService permissionService;
|
protected PermissionService permissionService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The logger
|
||||||
|
*/
|
||||||
|
private static final Logger LOG = LoggerFactory.getLogger(NodeFolderSizeApiTest.class);
|
||||||
|
|
||||||
private String addToDocumentLibrary(Site testSite, String name, String nodeType)
|
private String addToDocumentLibrary(Site testSite, String name, String nodeType)
|
||||||
{
|
{
|
||||||
String parentId;
|
String parentId;
|
||||||
@@ -70,8 +74,9 @@ public class NodeFolderSizeApiTest extends AbstractBaseApiTest{
|
|||||||
return createNode(parentId, name, nodeType, null).getId();
|
return createNode(parentId, name, nodeType, null).getId();
|
||||||
} catch (Exception e)
|
} catch (Exception e)
|
||||||
{
|
{
|
||||||
throw new RuntimeException(e.getMessage());
|
LOG.error("Exception occured in NodeFolderSizeApiTest:addToDocumentLibrary {}", e.getMessage());
|
||||||
}
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
|
@@ -29,11 +29,11 @@ import org.alfresco.api.AlfrescoPublicApi;
|
|||||||
import org.alfresco.service.namespace.QName;
|
import org.alfresco.service.namespace.QName;
|
||||||
|
|
||||||
@AlfrescoPublicApi
|
@AlfrescoPublicApi
|
||||||
public interface FolderSizeModel {
|
public class FolderSizeModel {
|
||||||
|
|
||||||
/** Folder Model URI */
|
/** Folder Model URI */
|
||||||
String SIZE_MODEL_1_0_URI = "http://www.alfresco.org/model/size/1.0";
|
private static final String SIZE_MODEL_1_0_URI = "http://www.alfresco.org/model/size/1.0";
|
||||||
|
|
||||||
QName PROP_STATUS = QName.createQName(SIZE_MODEL_1_0_URI, "status");
|
public static final QName PROP_STATUS = QName.createQName(SIZE_MODEL_1_0_URI, "status");
|
||||||
QName PROP_OUTPUT = QName.createQName(SIZE_MODEL_1_0_URI, "result");
|
public static final QName PROP_OUTPUT = QName.createQName(SIZE_MODEL_1_0_URI, "result");
|
||||||
}
|
}
|
||||||
|
@@ -36,8 +36,8 @@ import org.alfresco.service.cmr.repository.StoreRef;
|
|||||||
import org.alfresco.service.cmr.search.ResultSet;
|
import org.alfresco.service.cmr.search.ResultSet;
|
||||||
import org.alfresco.service.cmr.search.SearchParameters;
|
import org.alfresco.service.cmr.search.SearchParameters;
|
||||||
import org.alfresco.service.cmr.search.SearchService;
|
import org.alfresco.service.cmr.search.SearchService;
|
||||||
import org.apache.commons.logging.Log;
|
import org.slf4j.Logger;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
@@ -65,7 +65,7 @@ public class NodeSizeActionExecuter extends ActionExecuterAbstractBase
|
|||||||
/**
|
/**
|
||||||
* The logger
|
* The logger
|
||||||
*/
|
*/
|
||||||
private static final Log LOGGER = LogFactory.getLog(NodeSizeActionExecuter.class);
|
private static final Logger LOG = LoggerFactory.getLogger(NodeSizeActionExecuter.class);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the node service
|
* Set the node service
|
||||||
@@ -150,7 +150,7 @@ public class NodeSizeActionExecuter extends ActionExecuterAbstractBase
|
|||||||
}
|
}
|
||||||
catch (RuntimeException ex)
|
catch (RuntimeException ex)
|
||||||
{
|
{
|
||||||
LOGGER.error("Exception occured in NodeSizeActionExecutor:results "+ex.getMessage());
|
LOG.error("Exception occured in NodeSizeActionExecutor:results {}", ex.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
final LocalDateTime eventTimestamp = LocalDateTime.ofInstant(Instant.now(), ZoneId.systemDefault());
|
final LocalDateTime eventTimestamp = LocalDateTime.ofInstant(Instant.now(), ZoneId.systemDefault());
|
||||||
|
Reference in New Issue
Block a user