mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Merged DEV\EXTENSIONS to HEAD
svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/DEV/EXTENSIONS@4843 svn://svn.alfresco.com:3691/alfresco/BRANCHES/DEV/EXTENSIONS@4848 . Allow null in setAuthentication Patch for system registry area git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4953 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -72,29 +72,6 @@ public class UserHomesFolderPatch extends AbstractPatch
|
||||
this.messageSource = messageSource;
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensure that required common properties have been set
|
||||
*/
|
||||
protected void checkCommonProperties() throws Exception
|
||||
{
|
||||
if (importerBootstrap == null)
|
||||
{
|
||||
throw new PatchException("'importerBootstrap' property has not been set");
|
||||
}
|
||||
else if (namespaceService == null)
|
||||
{
|
||||
throw new PatchException("'namespaceService' property has not been set");
|
||||
}
|
||||
else if (searchService == null)
|
||||
{
|
||||
throw new PatchException("'searchService' property has not been set");
|
||||
}
|
||||
else if (nodeService == null)
|
||||
{
|
||||
throw new PatchException("'nodeService' property has not been set");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Extracts pertinent references and properties that are common to execution
|
||||
* of this and derived patches.
|
||||
@@ -170,11 +147,8 @@ public class UserHomesFolderPatch extends AbstractPatch
|
||||
protected String applyInternal() throws Exception
|
||||
{
|
||||
// properties must be set
|
||||
checkCommonProperties();
|
||||
if (messageSource == null)
|
||||
{
|
||||
throw new PatchException("'messageSource' property has not been set");
|
||||
}
|
||||
super.checkPropertyNotNull(importerBootstrap, "importerBootstrap");
|
||||
super.checkPropertyNotNull(messageSource, "messageSource");
|
||||
|
||||
// get useful values
|
||||
setUp();
|
||||
|
@@ -116,27 +116,32 @@ public abstract class AbstractAuthenticationComponent implements AuthenticationC
|
||||
}
|
||||
|
||||
/**
|
||||
* Explicitly set the current authentication.
|
||||
*
|
||||
* @param authentication
|
||||
* Authentication
|
||||
* @inheritDoc
|
||||
*/
|
||||
public Authentication setCurrentAuthentication(Authentication authentication)
|
||||
{
|
||||
Context context = ContextHolder.getContext();
|
||||
SecureContext sc = null;
|
||||
if ((context == null) || !(context instanceof SecureContext))
|
||||
if (authentication == null)
|
||||
{
|
||||
sc = new SecureContextImpl();
|
||||
ContextHolder.setContext(sc);
|
||||
clearCurrentSecurityContext();
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
sc = (SecureContext) context;
|
||||
Context context = ContextHolder.getContext();
|
||||
SecureContext sc = null;
|
||||
if ((context == null) || !(context instanceof SecureContext))
|
||||
{
|
||||
sc = new SecureContextImpl();
|
||||
ContextHolder.setContext(sc);
|
||||
}
|
||||
else
|
||||
{
|
||||
sc = (SecureContext) context;
|
||||
}
|
||||
authentication.setAuthenticated(true);
|
||||
sc.setAuthentication(authentication);
|
||||
return authentication;
|
||||
}
|
||||
authentication.setAuthenticated(true);
|
||||
sc.setAuthentication(authentication);
|
||||
return authentication;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -52,9 +52,13 @@ public interface AuthenticationComponent
|
||||
public void clearCurrentSecurityContext();
|
||||
|
||||
/**
|
||||
* Explicitly set the current suthentication.
|
||||
* Explicitly set the current suthentication. If the authentication is <tt>null</tt> the
|
||||
* the current authentication is {@link #clearCurrentSecurityContext() cleared}.
|
||||
*
|
||||
* @param authentication the current authentication (may be <tt>null</tt>).
|
||||
*
|
||||
* @return Returns the modified authentication instance or <tt>null</tt> if it was cleared.
|
||||
*/
|
||||
|
||||
public Authentication setCurrentAuthentication(Authentication authentication);
|
||||
|
||||
/**
|
||||
|
@@ -44,11 +44,15 @@ public interface ResultSet extends Iterable<ResultSetRow> // Specfic iterator ov
|
||||
|
||||
/**
|
||||
* Get the id of the node at the given index
|
||||
*
|
||||
* @param n zero-based index
|
||||
*/
|
||||
NodeRef getNodeRef(int n);
|
||||
|
||||
/**
|
||||
* Get the score for the node at the given position
|
||||
*
|
||||
* @param n zero-based index
|
||||
*/
|
||||
float getScore(int n);
|
||||
|
||||
@@ -61,6 +65,8 @@ public interface ResultSet extends Iterable<ResultSetRow> // Specfic iterator ov
|
||||
|
||||
/**
|
||||
* Get a row from the result set by row index, starting at 0.
|
||||
*
|
||||
* @param i zero-based index
|
||||
*/
|
||||
ResultSetRow getRow(int i);
|
||||
|
||||
@@ -76,6 +82,8 @@ public interface ResultSet extends Iterable<ResultSetRow> // Specfic iterator ov
|
||||
|
||||
/**
|
||||
* Get the child assoc ref for a particular row.
|
||||
*
|
||||
* @param n zero-based index
|
||||
*/
|
||||
ChildAssociationRef getChildAssocRef(int n);
|
||||
|
||||
|
Reference in New Issue
Block a user