mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
ACS-5506 Add temporary logging
This commit is contained in:
@@ -78,6 +78,8 @@ import org.alfresco.util.AlfrescoCollator;
|
|||||||
import org.alfresco.util.Pair;
|
import org.alfresco.util.Pair;
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.extensions.surf.util.I18NUtil;
|
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 AUTHORITY_NAME = "authorityName";
|
||||||
private static final String ERR_MSG_MODIFY_FIXED_AUTHORITY = "Trying to modify a fixed authority";
|
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;
|
private final static Map<String, String> SORT_PARAMS_TO_NAMES;
|
||||||
static
|
static
|
||||||
{
|
{
|
||||||
@@ -136,7 +140,7 @@ public class GroupsImpl implements Groups
|
|||||||
|
|
||||||
public Group create(Group group, Parameters parameters)
|
public Group create(Group group, Parameters parameters)
|
||||||
{
|
{
|
||||||
System.out.println("Create from impl called");
|
logger.info("Create from impl called");
|
||||||
validateGroup(group, false);
|
validateGroup(group, false);
|
||||||
|
|
||||||
// Create authority with default zones.
|
// Create authority with default zones.
|
||||||
@@ -152,7 +156,7 @@ public class GroupsImpl implements Groups
|
|||||||
{
|
{
|
||||||
props.put(ContentModel.PROP_DESCRIPTION, group.getDescription());
|
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);
|
String authority = authorityService.createAuthority(AuthorityType.GROUP, group.getId(), authorityDisplayName, authorityZones, props);
|
||||||
|
|
||||||
// Set a given child authority to be included by the given parent
|
// Set a given child authority to be included by the given parent
|
||||||
|
@@ -49,6 +49,9 @@ import org.junit.Test;
|
|||||||
import org.mockito.Mock;
|
import org.mockito.Mock;
|
||||||
|
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
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 GROUP_EVERYONE = "GROUP_EVERYONE";
|
||||||
private static final String INCLUDE_DESCRIPTION_HAS_SUBGROUPS = "description,hasSubgroups";
|
private static final String INCLUDE_DESCRIPTION_HAS_SUBGROUPS = "description,hasSubgroups";
|
||||||
|
|
||||||
|
protected static final Logger logger = LoggerFactory.getLogger(GroupsTest.class);
|
||||||
|
|
||||||
protected AuthorityService authorityService;
|
protected AuthorityService authorityService;
|
||||||
|
|
||||||
private String rootGroupName;
|
private String rootGroupName;
|
||||||
@@ -1426,7 +1431,7 @@ public class GroupsTest extends AbstractSingleNetworkSiteTest
|
|||||||
Group group = generateGroup();
|
Group group = generateGroup();
|
||||||
group.setDescription("testDesc");
|
group.setDescription("testDesc");
|
||||||
|
|
||||||
System.out.println("" + otherParams);
|
logger.info("" + otherParams);
|
||||||
Group createdGroup01 = groupsProxy.createGroup(group, otherParams, HttpServletResponse.SC_CREATED);
|
Group createdGroup01 = groupsProxy.createGroup(group, otherParams, HttpServletResponse.SC_CREATED);
|
||||||
|
|
||||||
assertNotNull(createdGroup01);
|
assertNotNull(createdGroup01);
|
||||||
|
@@ -37,6 +37,8 @@ import org.alfresco.rest.api.tests.client.PublicApiClient.ExpectedPaging;
|
|||||||
import org.alfresco.rest.api.tests.client.PublicApiClient.ListResponse;
|
import org.alfresco.rest.api.tests.client.PublicApiClient.ListResponse;
|
||||||
import org.json.simple.JSONArray;
|
import org.json.simple.JSONArray;
|
||||||
import org.json.simple.JSONObject;
|
import org.json.simple.JSONObject;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a group.
|
* 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;
|
private static final long serialVersionUID = -3580248429177260831L;
|
||||||
|
protected static final Logger logger = LoggerFactory.getLogger(Group.class);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void expected(Object o)
|
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");
|
Boolean hasSubgroups = (Boolean) jsonObject.get("hasSubgroups");
|
||||||
List<String> parentIds = (List<String>) jsonObject.get("parentIds");
|
List<String> parentIds = (List<String>) jsonObject.get("parentIds");
|
||||||
List<String> zones = (List<String>) jsonObject.get("zones");
|
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 group = new Group();
|
||||||
group.setId(id);
|
group.setId(id);
|
||||||
group.setDisplayName(displayName);
|
group.setDisplayName(displayName);
|
||||||
|
@@ -398,6 +398,7 @@ public class AuthorityDAOImpl implements AuthorityDAO, NodeServicePolicies.Befor
|
|||||||
}
|
}
|
||||||
NodeRef childRef;
|
NodeRef childRef;
|
||||||
NodeRef authorityContainerRef = getAuthorityContainer();
|
NodeRef authorityContainerRef = getAuthorityContainer();
|
||||||
|
logger.info("AuthorityDAO before create node");
|
||||||
childRef = nodeService.createNode(authorityContainerRef, ContentModel.ASSOC_CHILDREN, QName.createQName("cm", name, namespacePrefixResolver),
|
childRef = nodeService.createNode(authorityContainerRef, ContentModel.ASSOC_CHILDREN, QName.createQName("cm", name, namespacePrefixResolver),
|
||||||
ContentModel.TYPE_AUTHORITY_CONTAINER, props).getChildRef();
|
ContentModel.TYPE_AUTHORITY_CONTAINER, props).getChildRef();
|
||||||
if (authorityZones != null)
|
if (authorityZones != null)
|
||||||
|
@@ -57,6 +57,8 @@ import org.alfresco.service.cmr.security.PermissionService;
|
|||||||
import org.alfresco.service.cmr.security.PersonService;
|
import org.alfresco.service.cmr.security.PersonService;
|
||||||
import org.alfresco.service.namespace.QName;
|
import org.alfresco.service.namespace.QName;
|
||||||
import org.alfresco.util.Pair;
|
import org.alfresco.util.Pair;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.InitializingBean;
|
import org.springframework.beans.factory.InitializingBean;
|
||||||
import org.springframework.extensions.surf.util.ParameterCheck;
|
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 class AuthorityServiceImpl implements AuthorityService, InitializingBean
|
||||||
{
|
{
|
||||||
public static final String GROUP_ALFRESCO_SYSTEM_ADMINISTRATORS_AUTHORITY = PermissionService.GROUP_PREFIX + "ALFRESCO_SYSTEM_ADMINISTRATORS";
|
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>();
|
private static Set<String> DEFAULT_ZONES = new HashSet<String>();
|
||||||
|
|
||||||
@@ -668,7 +671,7 @@ public class AuthorityServiceImpl implements AuthorityService, InitializingBean
|
|||||||
{
|
{
|
||||||
checkTypeIsMutable(type);
|
checkTypeIsMutable(type);
|
||||||
String name = getName(type, shortName);
|
String name = getName(type, shortName);
|
||||||
System.out.println("Before authority DAO created");
|
logger.info("Before authority DAO created");
|
||||||
authorityDAO.createAuthority(name, authorityDisplayName, authorityZones, properties);
|
authorityDAO.createAuthority(name, authorityDisplayName, authorityZones, properties);
|
||||||
|
|
||||||
return name;
|
return name;
|
||||||
|
Reference in New Issue
Block a user