Fix to script methods definitions taking a ScriptableObject parameter

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@3562 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast 2006-08-22 09:20:42 +00:00
parent 8473e7fc4f
commit 4005f36bfb

View File

@ -1185,7 +1185,7 @@ public class Node implements Serializable, Scopeable
* *
* @return true if the aspect was added successfully, false if an error occured. * @return true if the aspect was added successfully, false if an error occured.
*/ */
public boolean addAspect(String type, ScriptableObject properties) public boolean addAspect(String type, Object props)
{ {
boolean success = false; boolean success = false;
@ -1194,8 +1194,10 @@ public class Node implements Serializable, Scopeable
try try
{ {
Map<QName, Serializable> aspectProps = null; Map<QName, Serializable> aspectProps = null;
if (properties != null) if (props instanceof ScriptableObject)
{ {
ScriptableObject properties = (ScriptableObject)props;
// we need to get all the keys to the properties provided // we need to get all the keys to the properties provided
// and convert them to a Map of QName to Serializable objects // and convert them to a Map of QName to Serializable objects
Object[] propIds = properties.getIds(); Object[] propIds = properties.getIds();
@ -1546,9 +1548,9 @@ public class Node implements Serializable, Scopeable
* *
* @return output of the template execution * @return output of the template execution
*/ */
public String processTemplate(Node template, ScriptableObject args) public String processTemplate(Node template, Object args)
{ {
return processTemplate(template.getContent(), null, args); return processTemplate(template.getContent(), null, (ScriptableObject)args);
} }
/** /**
@ -1572,9 +1574,9 @@ public class Node implements Serializable, Scopeable
* *
* @return output of the template execution * @return output of the template execution
*/ */
public String processTemplate(String template, ScriptableObject args) public String processTemplate(String template, Object args)
{ {
return processTemplate(template, null, args); return processTemplate(template, null, (ScriptableObject)args);
} }
private String processTemplate(String template, NodeRef templateRef, ScriptableObject args) private String processTemplate(String template, NodeRef templateRef, ScriptableObject args)