Merged HEAD (5.2) to 5.2.N (5.2.1)

126445 jkaabimofrad: Merged FILE-FOLDER-API (5.2.0) to HEAD (5.2)
      121972 jvonka: Nodes (FileFolder) API - add api tests when setting owner (cm:owner prop')
      RA-706, RA-639


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@126790 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Ancuta Morarasu
2016-05-11 11:20:43 +00:00
parent 3d68aeb1ac
commit 21ea65d14a
3 changed files with 156 additions and 4 deletions

View File

@@ -41,6 +41,8 @@ import org.alfresco.service.cmr.security.PersonService;
import org.alfresco.service.namespace.QName;
import org.alfresco.util.EqualsHelper;
import org.apache.chemistry.opencmis.commons.data.PropertyData;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
* Concrete class carrying general information for <b>alf_node</b> data
@@ -51,6 +53,8 @@ import org.apache.chemistry.opencmis.commons.data.PropertyData;
*/
public class Node implements Comparable<Node>
{
private static final Log logger = LogFactory.getLog(Node.class);
protected NodeRef nodeRef;
protected String name;
@@ -123,14 +127,27 @@ public class Node implements Comparable<Node>
}
else
{
PersonService.PersonInfo pInfo = null;
try
{
PersonService.PersonInfo pInfo = personService.getPerson(personService.getPerson(userName));
userInfo = new UserInfo(userName, pInfo.getFirstName(), pInfo.getLastName());
NodeRef pNodeRef = personService.getPerson(userName, false);
if (pNodeRef != null)
{
pInfo = personService.getPerson(pNodeRef);
}
}
catch (NoSuchPersonException nspe)
{
// belts-and-braces (seen in dev/test env, eg. userName = Bobd58ba329-b702-41ee-a9ae-2b3c7029b5bc
// drop-through
}
if (pInfo != null)
{
userInfo = new UserInfo(userName, pInfo.getFirstName(), pInfo.getLastName());
}
else
{
logger.warn("Unknown person: "+userName);
userInfo = new UserInfo(userName, userName, "");
}