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

126514 jkaabimofrad: Merged FILE-FOLDER-API (5.2.0) to HEAD (5.2)
      122926 jvonka: (Quick) Shared Links API - updates and fixes
      - A/C changed from 400 to 409 if shared link already exists
      - tweak 404 error message (entity id not found)
      - change response from sharedId to just id
      - add optional filter when finding links, eg. where=(sharedByUser/id='userId') (userId can also be -me-)
      - TODO add a few more tests (rendition download, filtered find)
      RA-708, RA-777


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@126858 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Ancuta Morarasu
2016-05-11 11:48:19 +00:00
parent c3282977ec
commit d2fa56e4b1
6 changed files with 101 additions and 81 deletions

View File

@@ -116,15 +116,20 @@ public class Node implements Comparable<Node>
this.modifiedByUser = lookupUserInfo((String)nodeProps.get(ContentModel.PROP_MODIFIER), mapUserInfo, personService);
}
public static UserInfo lookupUserInfo(String userName, Map<String, UserInfo> mapUserInfo, PersonService personService) {
public static UserInfo lookupUserInfo(String userName, Map<String, UserInfo> mapUserInfo, PersonService personService)
{
return lookupUserInfo(userName, mapUserInfo, personService, false);
}
public static UserInfo lookupUserInfo(String userName, Map<String, UserInfo> mapUserInfo, PersonService personService, boolean displayNameOnly)
{
UserInfo userInfo = mapUserInfo.get(userName);
if ((userInfo == null) && (userName != null))
{
String sysUserName = AuthenticationUtil.getSystemUserName();
if (userName.equals(sysUserName) || (AuthenticationUtil.isMtEnabled() && userName.startsWith(sysUserName + "@")))
{
userInfo = new UserInfo(userName, userName, "");
userInfo = new UserInfo((displayNameOnly ? null : userName), userName, "");
}
else
{
@@ -144,14 +149,13 @@ public class Node implements Comparable<Node>
if (pInfo != null)
{
userInfo = new UserInfo(userName, pInfo.getFirstName(), pInfo.getLastName());
userInfo = new UserInfo((displayNameOnly ? null : userName), pInfo.getFirstName(), pInfo.getLastName());
}
else
{
logger.warn("Unknown person: "+userName);
userInfo = new UserInfo(userName, userName, "");
userInfo = new UserInfo((displayNameOnly ? null : userName), userName, "");
}
}
mapUserInfo.put(userName, userInfo);