mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
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/HEAD/root@126445 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -34,6 +34,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
|
||||
@@ -44,6 +46,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;
|
||||
|
||||
@@ -116,14 +120,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, "");
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user