ACS-5506 Add temporary logging

This commit is contained in:
MichalKinas
2024-02-06 21:15:14 +01:00
parent c537166f68
commit 11030f52fa
5 changed files with 21 additions and 5 deletions

View File

@@ -78,6 +78,8 @@ import org.alfresco.util.AlfrescoCollator;
import org.alfresco.util.Pair;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.extensions.surf.util.I18NUtil;
/**
@@ -94,6 +96,8 @@ public class GroupsImpl implements Groups
private static final String AUTHORITY_NAME = "authorityName";
private static final String ERR_MSG_MODIFY_FIXED_AUTHORITY = "Trying to modify a fixed authority";
protected static final Logger logger = LoggerFactory.getLogger(GroupsImpl.class);
private final static Map<String, String> SORT_PARAMS_TO_NAMES;
static
{
@@ -136,7 +140,7 @@ public class GroupsImpl implements Groups
public Group create(Group group, Parameters parameters)
{
System.out.println("Create from impl called");
logger.info("Create from impl called");
validateGroup(group, false);
// Create authority with default zones.
@@ -152,7 +156,7 @@ public class GroupsImpl implements Groups
{
props.put(ContentModel.PROP_DESCRIPTION, group.getDescription());
}
System.out.println("Before authority created");
logger.info("Before authority created");
String authority = authorityService.createAuthority(AuthorityType.GROUP, group.getId(), authorityDisplayName, authorityZones, props);
// Set a given child authority to be included by the given parent

View File

@@ -49,6 +49,9 @@ import org.junit.Test;
import org.mockito.Mock;
import jakarta.servlet.http.HttpServletResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.*;
import static org.junit.Assert.assertEquals;
@@ -70,6 +73,8 @@ public class GroupsTest extends AbstractSingleNetworkSiteTest
private static final String GROUP_EVERYONE = "GROUP_EVERYONE";
private static final String INCLUDE_DESCRIPTION_HAS_SUBGROUPS = "description,hasSubgroups";
protected static final Logger logger = LoggerFactory.getLogger(GroupsTest.class);
protected AuthorityService authorityService;
private String rootGroupName;
@@ -1426,7 +1431,7 @@ public class GroupsTest extends AbstractSingleNetworkSiteTest
Group group = generateGroup();
group.setDescription("testDesc");
System.out.println("" + otherParams);
logger.info("" + otherParams);
Group createdGroup01 = groupsProxy.createGroup(group, otherParams, HttpServletResponse.SC_CREATED);
assertNotNull(createdGroup01);

View File

@@ -37,6 +37,8 @@ import org.alfresco.rest.api.tests.client.PublicApiClient.ExpectedPaging;
import org.alfresco.rest.api.tests.client.PublicApiClient.ListResponse;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Represents a group.
@@ -48,6 +50,7 @@ public class Group extends org.alfresco.rest.api.model.Group implements Serializ
{
private static final long serialVersionUID = -3580248429177260831L;
protected static final Logger logger = LoggerFactory.getLogger(Group.class);
@Override
public void expected(Object o)
@@ -112,7 +115,7 @@ public class Group extends org.alfresco.rest.api.model.Group implements Serializ
Boolean hasSubgroups = (Boolean) jsonObject.get("hasSubgroups");
List<String> parentIds = (List<String>) jsonObject.get("parentIds");
List<String> zones = (List<String>) jsonObject.get("zones");
System.out.println("Parse group: " + description + " " + displayName);
logger.info("Parse group: " + description + " " + displayName);
Group group = new Group();
group.setId(id);
group.setDisplayName(displayName);

View File

@@ -398,6 +398,7 @@ public class AuthorityDAOImpl implements AuthorityDAO, NodeServicePolicies.Befor
}
NodeRef childRef;
NodeRef authorityContainerRef = getAuthorityContainer();
logger.info("AuthorityDAO before create node");
childRef = nodeService.createNode(authorityContainerRef, ContentModel.ASSOC_CHILDREN, QName.createQName("cm", name, namespacePrefixResolver),
ContentModel.TYPE_AUTHORITY_CONTAINER, props).getChildRef();
if (authorityZones != null)

View File

@@ -57,6 +57,8 @@ import org.alfresco.service.cmr.security.PermissionService;
import org.alfresco.service.cmr.security.PersonService;
import org.alfresco.service.namespace.QName;
import org.alfresco.util.Pair;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.extensions.surf.util.ParameterCheck;
@@ -68,6 +70,7 @@ import org.springframework.extensions.surf.util.ParameterCheck;
public class AuthorityServiceImpl implements AuthorityService, InitializingBean
{
public static final String GROUP_ALFRESCO_SYSTEM_ADMINISTRATORS_AUTHORITY = PermissionService.GROUP_PREFIX + "ALFRESCO_SYSTEM_ADMINISTRATORS";
protected static final Logger logger = LoggerFactory.getLogger(AuthorityServiceImpl.class);
private static Set<String> DEFAULT_ZONES = new HashSet<String>();
@@ -668,7 +671,7 @@ public class AuthorityServiceImpl implements AuthorityService, InitializingBean
{
checkTypeIsMutable(type);
String name = getName(type, shortName);
System.out.println("Before authority DAO created");
logger.info("Before authority DAO created");
authorityDAO.createAuthority(name, authorityDisplayName, authorityZones, properties);
return name;