diff --git a/src/helma/framework/core/Application.java b/src/helma/framework/core/Application.java index 9af6ed21..007674e3 100644 --- a/src/helma/framework/core/Application.java +++ b/src/helma/framework/core/Application.java @@ -249,10 +249,10 @@ public class Application extends UnicastRemoteObject implements IRemoteApp, Runn } public Prototype getPrototype (INode n) { - IProperty proto = n.get ("prototype", false); - if (proto == null) + String protoname = n.getPrototype (); + if (protoname == null) return null; - return getPrototype (proto.toString ()); + return getPrototype (protoname); } @@ -290,7 +290,7 @@ public class Application extends UnicastRemoteObject implements IRemoteApp, Runn unode = new Node (uname); unode.setString ("name", uname); unode.setString ("password", password); - unode.setString ("prototype", "user"); + unode.setPrototype ("user"); unode.setDbMapping (userMapping); users.setNode (uname, unode); return users.getNode (uname, false); diff --git a/src/helma/framework/core/ESNode.java b/src/helma/framework/core/ESNode.java index 30e05276..f1d5bfbf 100644 --- a/src/helma/framework/core/ESNode.java +++ b/src/helma/framework/core/ESNode.java @@ -90,11 +90,11 @@ public class ESNode extends ObjectPrototype { public void setPrototype (String protoName) { checkNode (); this.protoName = protoName; - node.setString ("prototype", protoName); + node.setPrototype (protoName); } public String getESClassName () { - return protoName == null ? "Node" : protoName; + return protoName == null ? "HopObject" : protoName; } public String toString () { diff --git a/src/helma/framework/core/HopExtension.java b/src/helma/framework/core/HopExtension.java index 1dc20134..e98c9776 100644 --- a/src/helma/framework/core/HopExtension.java +++ b/src/helma/framework/core/HopExtension.java @@ -80,6 +80,7 @@ public class HopExtension { // methods that give access to properties and global user lists go.putHiddenProperty("Node", node); // register the constructor for a plain Node object. + go.putHiddenProperty("HopObject", node); // HopObject is the new name for node. go.putHiddenProperty("getProperty", new GlobalGetProperty ("getProperty", evaluator, fp)); go.putHiddenProperty("token", new GlobalGetProperty ("token", evaluator, fp)); go.putHiddenProperty("getUser", new GlobalGetUser ("getUser", evaluator, fp, reval)); diff --git a/src/helma/framework/core/NodeConstructor.java b/src/helma/framework/core/NodeConstructor.java index 112d3a71..5223a804 100644 --- a/src/helma/framework/core/NodeConstructor.java +++ b/src/helma/framework/core/NodeConstructor.java @@ -29,7 +29,7 @@ public class NodeConstructor extends BuiltinFunctionObject { public ESObject doConstruct(ESObject thisObject, ESValue[] arguments) throws EcmaScriptException { ESNode node = null; - if ("Node".equals (typename)) { + if ("Node".equals (typename) || "hopobject".equalsIgnoreCase (typename)) { if (arguments.length == 0) { node = new ESNode (reval.esNodePrototype, this.evaluator, null, reval); reval.objectcache.put (node.getNode (), node); diff --git a/src/helma/framework/core/RequestEvaluator.java b/src/helma/framework/core/RequestEvaluator.java index 273826e4..6ef097b7 100644 --- a/src/helma/framework/core/RequestEvaluator.java +++ b/src/helma/framework/core/RequestEvaluator.java @@ -246,8 +246,8 @@ public class RequestEvaluator implements Runnable { isProperty = false; if (currentNode != null && currentNode.getState() != INode.VIRTUAL) // add to reqPath array reqPath.putProperty (reqPath.size(), getNodeWrapper (currentNode)); - // limit path to < 20 tokens - if (i > 20) throw new RuntimeException ("Path too deep"); + // limit path to < 50 tokens + if (i > 50) throw new RuntimeException ("Path too deep"); } if (currentNode == null) @@ -384,9 +384,8 @@ public class RequestEvaluator implements Runnable { } // check XML-RPC access permissions - String proto = current.getProperty ("prototype", "prototype".hashCode ()).toString (); - if (proto != null) - app.checkXmlRpcAccess (proto, method); + String proto = ((ESNode) current).getNode().getPrototype (); + app.checkXmlRpcAccess (proto, method); ESValue esa[] = new ESValue[l]; for (int i=0; i