mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
. Fix to Script command processor
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2815 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -71,18 +71,23 @@ public final class ExecuteScriptCommand implements Command
|
|||||||
"Unable to execute ExecuteScriptCommand - mandatory parameter not supplied: " + PROP_USERPERSON);
|
"Unable to execute ExecuteScriptCommand - mandatory parameter not supplied: " + PROP_USERPERSON);
|
||||||
}
|
}
|
||||||
|
|
||||||
// get the optional document context ref
|
// get the optional document and space context ref
|
||||||
|
NodeService nodeService = serviceRegistry.getNodeService();
|
||||||
NodeRef docRef = (NodeRef)properties.get(PROP_DOCUMENT);
|
NodeRef docRef = (NodeRef)properties.get(PROP_DOCUMENT);
|
||||||
|
NodeRef spaceRef = null;
|
||||||
|
if (docRef != null)
|
||||||
|
{
|
||||||
|
spaceRef = nodeService.getPrimaryParent(docRef).getParentRef();
|
||||||
|
}
|
||||||
|
|
||||||
// build the model needed to execute the script
|
// build the model needed to execute the script
|
||||||
NodeService nodeService = serviceRegistry.getNodeService();
|
|
||||||
Map<String, Object> model = RhinoScriptService.buildDefaultModel(
|
Map<String, Object> model = RhinoScriptService.buildDefaultModel(
|
||||||
serviceRegistry,
|
serviceRegistry,
|
||||||
personRef,
|
personRef,
|
||||||
new NodeRef(Repository.getStoreRef(), Application.getCompanyRootId()),
|
new NodeRef(Repository.getStoreRef(), Application.getCompanyRootId()),
|
||||||
(NodeRef)nodeService.getProperty(personRef, ContentModel.PROP_HOMEFOLDER),
|
(NodeRef)nodeService.getProperty(personRef, ContentModel.PROP_HOMEFOLDER),
|
||||||
docRef,
|
docRef,
|
||||||
nodeService.getPrimaryParent(docRef).getParentRef(),
|
spaceRef,
|
||||||
DefaultModelHelper.imageResolver);
|
DefaultModelHelper.imageResolver);
|
||||||
|
|
||||||
// execute the script and return the result
|
// execute the script and return the result
|
||||||
|
Reference in New Issue
Block a user