Import helma.objectmodel.db.Node instead of using the fully qualified classname all the time.

This commit is contained in:
hns 2008-10-17 16:06:43 +00:00
parent 99c9b3a867
commit 1504777bcc
6 changed files with 17 additions and 13 deletions

View file

@ -19,6 +19,7 @@ package helma.objectmodel;
import helma.framework.IPathElement;
import helma.objectmodel.db.DbMapping;
import helma.objectmodel.db.Relation;
import helma.objectmodel.db.Node;
import helma.util.*;
import java.io.*;
import java.util.Date;
@ -588,7 +589,7 @@ public class TransientNode implements INode, Serializable {
}
private Property makeVirtualNode(String propname, Relation rel) {
INode node = new helma.objectmodel.db.Node(rel.getPropName(), rel.getPrototype(),
INode node = new Node(rel.getPropName(), rel.getPrototype(),
dbmap.getWrappedNodeManager());
// node.setState (TRANSIENT);

View file

@ -268,7 +268,7 @@ public class XmlWriter extends OutputStreamWriter implements XmlConstants {
throws IOException {
Enumeration e = null;
if (dbmode && node instanceof helma.objectmodel.db.Node) {
if (dbmode && node instanceof Node) {
// a newly constructed db.Node doesn't have a propMap,
// but returns an enumeration of all it's db-mapped properties
Hashtable props = ((Node) node).getPropMap();
@ -392,7 +392,7 @@ public class XmlWriter extends OutputStreamWriter implements XmlConstants {
* loop through the children-array and print them as <hop:child>
*/
private void writeChildren(INode node, int level) throws IOException {
if (dbmode && node instanceof helma.objectmodel.db.Node) {
if (dbmode && node instanceof Node) {
Node dbNode = (Node) node;
DbMapping smap = (dbNode.getDbMapping() == null) ? null
: dbNode.getDbMapping()

View file

@ -15,14 +15,15 @@
*/
package helma.scripting.rhino;
import org.mozilla.javascript.*;
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import helma.objectmodel.INode;
import helma.objectmodel.db.DbMapping;
import helma.objectmodel.db.DbKey;
import helma.objectmodel.db.Node;
import org.mozilla.javascript.*;
public class HopObjectCtor extends FunctionObject {
@ -89,8 +90,8 @@ public class HopObjectCtor extends FunctionObject {
throw new EvaluatorException(x.toString());
}
} else {
INode node = new helma.objectmodel.db.Node(protoname, protoname,
core.app.getWrappedNodeManager());
INode node = new Node(protoname, protoname,
core.app.getWrappedNodeManager());
Scriptable proto = core.getPrototype(protoname);
HopObject hobj = new HopObject(protoname, core, node, proto);

View file

@ -26,6 +26,7 @@ import helma.main.Server;
import helma.objectmodel.*;
import helma.objectmodel.db.DbMapping;
import helma.objectmodel.db.Relation;
import helma.objectmodel.db.Node;
import helma.scripting.*;
import helma.scripting.rhino.debug.Tracer;
import helma.util.StringUtils;
@ -536,8 +537,8 @@ public class RhinoEngine implements ScriptingEngine {
protected Object replaceObject(Object obj) throws IOException {
if (obj instanceof HopObject)
return new HopObjectProxy((HopObject) obj);
if (obj instanceof helma.objectmodel.db.Node)
return new HopObjectProxy((helma.objectmodel.db.Node) obj);
if (obj instanceof Node)
return new HopObjectProxy((Node) obj);
if (obj instanceof GlobalObject)
return new GlobalProxy((GlobalObject) obj);
if (obj instanceof ApplicationBean)

View file

@ -18,6 +18,7 @@ package helma.scripting.rhino;
import helma.objectmodel.INode;
import helma.objectmodel.db.NodeHandle;
import helma.objectmodel.db.Node;
import org.mozilla.javascript.Context;
import java.io.Serializable;
@ -83,8 +84,8 @@ class HopObjectProxy implements SerializationProxy {
if (n == null) {
ref = obj.getClassName();
} else {
if (n instanceof helma.objectmodel.db.Node) {
ref = new NodeHandle((helma.objectmodel.db.Node) n);
if (n instanceof Node) {
ref = new NodeHandle((Node) n);
} else {
ref = n;
}
@ -92,7 +93,7 @@ class HopObjectProxy implements SerializationProxy {
wrapped = true;
}
HopObjectProxy(helma.objectmodel.db.Node node) {
HopObjectProxy(Node node) {
ref = new NodeHandle(node.getKey());
}

View file

@ -246,7 +246,7 @@ public class XmlObject {
converter = new XmlConverter();
}
INode node = new helma.objectmodel.db.Node(null, null,
INode node = new Node(null, null,
core.getApplication().getWrappedNodeManager());
INode result = converter.convert(url, node);