mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Template extension spring configuration support
- similar pattern to existing script bean extension support - new root model helper objects and custom methods can be added via spring configuration Cleanup of script extension spring support Fix to thread safety of configured script extension beans that use the Scopable interface git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5369 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -33,22 +33,18 @@ import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.security.AuthorityService;
|
||||
import org.alfresco.service.cmr.security.AuthorityType;
|
||||
import org.alfresco.service.cmr.security.PersonService;
|
||||
import org.mozilla.javascript.Scriptable;
|
||||
|
||||
/**
|
||||
* Scripted People service for describing and executing actions against People & Groups.
|
||||
*
|
||||
* @author davidc
|
||||
*/
|
||||
public final class People extends BaseScriptImplementation implements Scopeable
|
||||
public final class People extends BaseScopableScriptImplementation
|
||||
{
|
||||
/** Repository Service Registry */
|
||||
private ServiceRegistry services;
|
||||
private AuthorityDAO authorityDAO;
|
||||
|
||||
/** Root scope for this object */
|
||||
private Scriptable scope;
|
||||
|
||||
/**
|
||||
* Set the service registry
|
||||
*
|
||||
@@ -69,14 +65,6 @@ public final class People extends BaseScriptImplementation implements Scopeable
|
||||
this.authorityDAO = authorityDAO;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.repo.jscript.Scopeable#setScope(org.mozilla.javascript.Scriptable)
|
||||
*/
|
||||
public void setScope(Scriptable scope)
|
||||
{
|
||||
this.scope = scope;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the Person given the username
|
||||
*
|
||||
@@ -90,7 +78,7 @@ public final class People extends BaseScriptImplementation implements Scopeable
|
||||
if (personService.personExists(username))
|
||||
{
|
||||
NodeRef personRef = personService.getPerson(username);
|
||||
person = new Node(personRef, services, scope);
|
||||
person = new Node(personRef, services, getScope());
|
||||
}
|
||||
return person;
|
||||
}
|
||||
@@ -107,7 +95,7 @@ public final class People extends BaseScriptImplementation implements Scopeable
|
||||
NodeRef groupRef = authorityDAO.getAuthorityNodeRefOrNull(groupName);
|
||||
if (groupRef != null)
|
||||
{
|
||||
group = new Node(groupRef, services, scope);
|
||||
group = new Node(groupRef, services, getScope());
|
||||
}
|
||||
return group;
|
||||
}
|
||||
|
Reference in New Issue
Block a user