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:
@@ -244,6 +244,11 @@ public class Repository implements ApplicationContextAware
|
||||
* @return person node ref
|
||||
*/
|
||||
public NodeRef getPerson()
|
||||
{
|
||||
RetryingTransactionCallback<NodeRef> callback = new RetryingTransactionCallback<NodeRef>()
|
||||
{
|
||||
@Override
|
||||
public NodeRef execute() throws Throwable
|
||||
{
|
||||
NodeRef person = null;
|
||||
String currentUserName = AuthenticationUtil.getRunAsUser();
|
||||
@@ -256,6 +261,9 @@ public class Repository implements ApplicationContextAware
|
||||
}
|
||||
return person;
|
||||
}
|
||||
};
|
||||
return retryingTransactionHelper.doInTransaction(callback, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the currently fully authenticated person,
|
||||
@@ -263,6 +271,11 @@ public class Repository implements ApplicationContextAware
|
||||
* @return person node ref
|
||||
*/
|
||||
public NodeRef getFullyAuthenticatedPerson()
|
||||
{
|
||||
RetryingTransactionCallback<NodeRef> callback = new RetryingTransactionCallback<NodeRef>()
|
||||
{
|
||||
@Override
|
||||
public NodeRef execute() throws Throwable
|
||||
{
|
||||
NodeRef person = null;
|
||||
String currentUserName = AuthenticationUtil.getFullyAuthenticatedUser();
|
||||
@@ -275,6 +288,9 @@ public class Repository implements ApplicationContextAware
|
||||
}
|
||||
return person;
|
||||
}
|
||||
};
|
||||
return retryingTransactionHelper.doInTransaction(callback, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the user home of the currently authenticated person
|
||||
@@ -282,7 +298,12 @@ public class Repository implements ApplicationContextAware
|
||||
* @param person person
|
||||
* @return user home of person
|
||||
*/
|
||||
public NodeRef getUserHome(NodeRef person)
|
||||
public NodeRef getUserHome(final NodeRef person)
|
||||
{
|
||||
RetryingTransactionCallback<NodeRef> callback = new RetryingTransactionCallback<NodeRef>()
|
||||
{
|
||||
@Override
|
||||
public NodeRef execute() throws Throwable
|
||||
{
|
||||
NodeRef homeFolderRef = (NodeRef)nodeService.getProperty(person, ContentModel.PROP_HOMEFOLDER);
|
||||
if (homeFolderRef != null && nodeService.exists(homeFolderRef))
|
||||
@@ -294,6 +315,9 @@ public class Repository implements ApplicationContextAware
|
||||
return null;
|
||||
}
|
||||
}
|
||||
};
|
||||
return retryingTransactionHelper.doInTransaction(callback, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper to convert a Web Script Request URL to a Node Ref
|
||||
|
Reference in New Issue
Block a user