diff --git a/src/helma/framework/core/RequestEvaluator.java b/src/helma/framework/core/RequestEvaluator.java index c90eb6be..efa0c73e 100644 --- a/src/helma/framework/core/RequestEvaluator.java +++ b/src/helma/framework/core/RequestEvaluator.java @@ -233,7 +233,7 @@ public final class RequestEvaluator implements Runnable { // try calling onRequest() function on object before // calling the actual action try { - scriptingEngine.invoke (currentElement, "onRequest", new Object[0]); + scriptingEngine.invoke (currentElement, "onRequest", new Object[0], false); } catch (RedirectException redir) { throw redir; } catch (Exception ignore) { @@ -241,7 +241,7 @@ public final class RequestEvaluator implements Runnable { } // do the actual action invocation - scriptingEngine.invoke (currentElement, action, new Object[0]); + scriptingEngine.invoke (currentElement, action, new Object[0], false); localrtx.timer.endEvent (txname+" execute"); } catch (RedirectException redirect) { @@ -347,7 +347,7 @@ public final class RequestEvaluator implements Runnable { String proto = app.getPrototypeName (currentElement); app.checkXmlRpcAccess (proto, method); - result = scriptingEngine.invoke (currentElement, method, args); + result = scriptingEngine.invoke (currentElement, method, args, true); commitTransaction (); } catch (Exception wrong) { @@ -397,7 +397,7 @@ public final class RequestEvaluator implements Runnable { scriptingEngine.enterContext (globals); - result = scriptingEngine.invoke (thisObject, method, args); + result = scriptingEngine.invoke (thisObject, method, args, false); commitTransaction (); } catch (Exception wrong) { @@ -538,7 +538,7 @@ public final class RequestEvaluator implements Runnable { } public Object invokeDirectFunction (Object obj, String functionName, Object[] args) throws Exception { - return scriptingEngine.invoke (obj, functionName, args); + return scriptingEngine.invoke (obj, functionName, args, false); } public synchronized Object invokeFunction (Object object, String functionName, Object[] args) diff --git a/src/helma/framework/core/Skin.java b/src/helma/framework/core/Skin.java index 394901b5..4428f57a 100644 --- a/src/helma/framework/core/Skin.java +++ b/src/helma/framework/core/Skin.java @@ -322,7 +322,7 @@ public final class Skin { int oldLength = reval.res.getBufferLength (); if (reval.scriptingEngine.hasFunction (handlerObject, name+"_macro")) { // System.err.println ("Getting macro from function"); - v = reval.scriptingEngine.invoke (handlerObject, name+"_macro", arguments); + v = reval.scriptingEngine.invoke (handlerObject, name+"_macro", arguments, false); } else { // System.err.println ("Getting macro from property"); v = reval.scriptingEngine.get (handlerObject, name); @@ -353,7 +353,7 @@ public final class Skin { throw timeout; } catch (Exception x) { x.printStackTrace(); - String msg = "[HopMacro error: "+x+"]"; + String msg = "[HopMacro error in "+this+": "+x+"]"; reval.res.write (" "+msg+" "); app.logEvent (msg); } diff --git a/src/helma/scripting/ScriptingEngine.java b/src/helma/scripting/ScriptingEngine.java index 7bcf4625..b01c0762 100644 --- a/src/helma/scripting/ScriptingEngine.java +++ b/src/helma/scripting/ScriptingEngine.java @@ -37,9 +37,10 @@ public interface ScriptingEngine { /** - * Invoke a function on some object, using the given arguments and global vars. + * Invoke a function on some object, using the given arguments and global vars. + * XML-RPC calls require special input and output parameter conversion. */ - public Object invoke (Object thisObject, String functionName, Object[] args) + public Object invoke (Object thisObject, String functionName, Object[] args, boolean xmlrpc) throws ScriptingException; /** diff --git a/src/helma/scripting/fesi/FesiEvaluator.java b/src/helma/scripting/fesi/FesiEvaluator.java index 93dc1555..ceee97c1 100644 --- a/src/helma/scripting/fesi/FesiEvaluator.java +++ b/src/helma/scripting/fesi/FesiEvaluator.java @@ -373,7 +373,7 @@ public final class FesiEvaluator implements ScriptingEngine { /** * Invoke a function on some object, using the given arguments and global vars. */ - public Object invoke (Object thisObject, String functionName, Object[] args) throws ScriptingException { + public Object invoke (Object thisObject, String functionName, Object[] args, boolean xmlrpc) throws ScriptingException { ESObject eso = null; if (thisObject == null) eso = global; @@ -382,15 +382,23 @@ public final class FesiEvaluator implements ScriptingEngine { try { ESValue[] esv = args == null ? new ESValue[0] : new ESValue[args.length]; for (int i=0; i