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:
@@ -26,29 +26,17 @@ package org.alfresco.repo.jscript;
|
||||
|
||||
import org.alfresco.service.ServiceRegistry;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.mozilla.javascript.Scriptable;
|
||||
|
||||
/**
|
||||
* Place for general and miscellenous utility functions not already found in generic JavaScript.
|
||||
*
|
||||
* @author Kevin Roast
|
||||
*/
|
||||
public final class ScriptUtils extends BaseScriptImplementation implements Scopeable
|
||||
public final class ScriptUtils extends BaseScopableScriptImplementation
|
||||
{
|
||||
/** Root scope for this object */
|
||||
private Scriptable scope;
|
||||
|
||||
/** Services */
|
||||
private ServiceRegistry services;
|
||||
|
||||
/**
|
||||
* @see org.alfresco.repo.jscript.Scopeable#setScope(org.mozilla.javascript.Scriptable)
|
||||
*/
|
||||
public void setScope(Scriptable scope)
|
||||
{
|
||||
this.scope = scope;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the service registry
|
||||
*
|
||||
@@ -86,6 +74,6 @@ public final class ScriptUtils extends BaseScriptImplementation implements Scope
|
||||
public Node getNodeFromString(String nodeRefString)
|
||||
{
|
||||
NodeRef nodeRef = new NodeRef(nodeRefString);
|
||||
return (Node)new ValueConverter().convertValueForScript(this.services, this.scope, null, nodeRef);
|
||||
return (Node)new ValueConverter().convertValueForScript(this.services, getScope(), null, nodeRef);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user