mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged HEAD-BUG-FIX (4.3/Cloud) to HEAD (4.3/Cloud)
59884: Merged V4.2-BUG-FIX (4.2.2) to HEAD-BUG-FIX (Cloud/4.3) 59611: Merged DEV to V4.2-BUG-FIX 58117: Added read transactions to Repository's get methods (MNT-9806) git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@62201 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -245,16 +245,24 @@ public class Repository implements ApplicationContextAware
|
|||||||
*/
|
*/
|
||||||
public NodeRef getPerson()
|
public NodeRef getPerson()
|
||||||
{
|
{
|
||||||
NodeRef person = null;
|
RetryingTransactionCallback<NodeRef> callback = new RetryingTransactionCallback<NodeRef>()
|
||||||
String currentUserName = AuthenticationUtil.getRunAsUser();
|
|
||||||
if (currentUserName != null)
|
|
||||||
{
|
{
|
||||||
if (personService.personExists(currentUserName))
|
@Override
|
||||||
|
public NodeRef execute() throws Throwable
|
||||||
{
|
{
|
||||||
person = personService.getPerson(currentUserName);
|
NodeRef person = null;
|
||||||
|
String currentUserName = AuthenticationUtil.getRunAsUser();
|
||||||
|
if (currentUserName != null)
|
||||||
|
{
|
||||||
|
if (personService.personExists(currentUserName))
|
||||||
|
{
|
||||||
|
person = personService.getPerson(currentUserName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return person;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
return person;
|
return retryingTransactionHelper.doInTransaction(callback, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -264,16 +272,24 @@ public class Repository implements ApplicationContextAware
|
|||||||
*/
|
*/
|
||||||
public NodeRef getFullyAuthenticatedPerson()
|
public NodeRef getFullyAuthenticatedPerson()
|
||||||
{
|
{
|
||||||
NodeRef person = null;
|
RetryingTransactionCallback<NodeRef> callback = new RetryingTransactionCallback<NodeRef>()
|
||||||
String currentUserName = AuthenticationUtil.getFullyAuthenticatedUser();
|
|
||||||
if (currentUserName != null)
|
|
||||||
{
|
{
|
||||||
if (personService.personExists(currentUserName))
|
@Override
|
||||||
|
public NodeRef execute() throws Throwable
|
||||||
{
|
{
|
||||||
person = personService.getPerson(currentUserName);
|
NodeRef person = null;
|
||||||
|
String currentUserName = AuthenticationUtil.getFullyAuthenticatedUser();
|
||||||
|
if (currentUserName != null)
|
||||||
|
{
|
||||||
|
if (personService.personExists(currentUserName))
|
||||||
|
{
|
||||||
|
person = personService.getPerson(currentUserName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return person;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
return person;
|
return retryingTransactionHelper.doInTransaction(callback, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -282,17 +298,25 @@ public class Repository implements ApplicationContextAware
|
|||||||
* @param person person
|
* @param person person
|
||||||
* @return user home of person
|
* @return user home of person
|
||||||
*/
|
*/
|
||||||
public NodeRef getUserHome(NodeRef person)
|
public NodeRef getUserHome(final NodeRef person)
|
||||||
{
|
{
|
||||||
NodeRef homeFolderRef = (NodeRef)nodeService.getProperty(person, ContentModel.PROP_HOMEFOLDER);
|
RetryingTransactionCallback<NodeRef> callback = new RetryingTransactionCallback<NodeRef>()
|
||||||
if (homeFolderRef != null && nodeService.exists(homeFolderRef))
|
|
||||||
{
|
{
|
||||||
return homeFolderRef;
|
@Override
|
||||||
}
|
public NodeRef execute() throws Throwable
|
||||||
else
|
{
|
||||||
{
|
NodeRef homeFolderRef = (NodeRef)nodeService.getProperty(person, ContentModel.PROP_HOMEFOLDER);
|
||||||
return null;
|
if (homeFolderRef != null && nodeService.exists(homeFolderRef))
|
||||||
}
|
{
|
||||||
|
return homeFolderRef;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return retryingTransactionHelper.doInTransaction(callback, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user