Removed boolean inherit argument from INode.get*() methods because it

was never used.
This commit is contained in:
hns 2002-11-26 14:00:04 +00:00
parent ab349a1c3c
commit 94e9a8efab
11 changed files with 94 additions and 119 deletions

View file

@ -593,7 +593,7 @@ public final class Application implements IPathElement, Runnable {
public INode getUserNode (String uid) { public INode getUserNode (String uid) {
try { try {
INode users = getUserRoot (); INode users = getUserRoot ();
return users.getNode (uid, false); return users.getNode (uid);
} catch (Exception x) { } catch (Exception x) {
return null; return null;
} }
@ -715,7 +715,7 @@ public final class Application implements IPathElement, Runnable {
// if none, try to get them from properties (internal db) // if none, try to get them from properties (internal db)
if (list.size()==0) { if (list.size()==0) {
for (Enumeration e=users.properties(); e.hasMoreElements(); ) { for (Enumeration e=users.properties(); e.hasMoreElements(); ) {
list.add (users.getNode ((String)e.nextElement (),false)); list.add (users.getNode ((String)e.nextElement ()));
} }
} }
return list; return list;
@ -764,7 +764,7 @@ public final class Application implements IPathElement, Runnable {
INode unode = null; INode unode = null;
try { try {
INode users = getUserRoot (); INode users = getUserRoot ();
unode = users.getNode (uname, false); unode = users.getNode (uname);
if (unode != null) if (unode != null)
return null; return null;
@ -799,8 +799,8 @@ public final class Application implements IPathElement, Runnable {
return false; return false;
try { try {
INode users = getUserRoot (); INode users = getUserRoot ();
Node unode = (Node)users.getNode (uname, false); Node unode = (Node) users.getNode (uname);
String pw = unode.getString ("password", false); String pw = unode.getString ("password");
if (pw != null && pw.equals (password)) { if (pw != null && pw.equals (password)) {
// let the old user-object forget about this session // let the old user-object forget about this session
logoutSession(session); logoutSession(session);

View file

@ -458,7 +458,7 @@ public final class Skin {
private void renderFromSession (RequestEvaluator reval) { private void renderFromSession (RequestEvaluator reval) {
if (reval.session == null) if (reval.session == null)
return; return;
Object value = reval.session.getCacheNode().getString (name, false); Object value = reval.session.getCacheNode().getString (name);
writeToResponse (value, reval.res, true); writeToResponse (value, reval.res, true);
} }

View file

@ -57,11 +57,11 @@ public final class SkinManager implements FilenameFilter {
// check if the skinset object is a HopObject (db based skin) // check if the skinset object is a HopObject (db based skin)
// or a String (file based skin) // or a String (file based skin)
if (skinset instanceof INode) { if (skinset instanceof INode) {
INode n = ((INode) skinset).getNode (prototype, false); INode n = ((INode) skinset).getNode (prototype);
if (n != null) { if (n != null) {
n = n.getNode (skinname, false); n = n.getNode (skinname);
if (n != null) { if (n != null) {
String skin = n.getString ("skin", false); String skin = n.getString ("skin");
if (skin != null) { if (skin != null) {
return new Skin (skin, app); return new Skin (skin, app);
} }

View file

@ -62,14 +62,14 @@ public interface INode extends INodeState, IPathElement {
*/ */
public Enumeration properties (); public Enumeration properties ();
public IProperty get (String name, boolean inherit); public IProperty get (String name);
public String getString (String name, boolean inherit); public String getString (String name);
public boolean getBoolean (String name, boolean inherit); public boolean getBoolean (String name);
public Date getDate (String name, boolean inherit); public Date getDate (String name);
public long getInteger (String name, boolean inherit); public long getInteger (String name);
public double getFloat (String name, boolean inherit); public double getFloat (String name);
public INode getNode (String name, boolean inherit); public INode getNode (String name);
public Object getJavaObject (String name, boolean inherit); public Object getJavaObject (String name);
public void setString (String name, String value); public void setString (String name, String value);
public void setBoolean (String name, boolean value); public void setBoolean (String name, boolean value);

View file

@ -32,9 +32,6 @@ public class TransientNode implements INode, Serializable {
transient String prototype; transient String prototype;
protected String contentType;
protected byte content[];
protected long created; protected long created;
protected long lastmodified; protected long lastmodified;
@ -249,14 +246,10 @@ public class TransientNode implements INode, Serializable {
} }
public IPathElement getChildElement (String name) { public IPathElement getChildElement (String name) {
return getNode (name, false); return getNode (name);
} }
public INode getSubnode (String name) { public INode getSubnode (String name) {
return getSubnode (name, false);
}
public INode getSubnode (String name, boolean inherit) {
StringTokenizer st = new StringTokenizer (name, "/"); StringTokenizer st = new StringTokenizer (name, "/");
TransientNode retval = this, runner; TransientNode retval = this, runner;
while (st.hasMoreTokens () && retval != null) { while (st.hasMoreTokens () && retval != null) {
@ -267,9 +260,7 @@ public class TransientNode implements INode, Serializable {
else else
retval = runner.nodeMap == null ? null : (TransientNode) runner.nodeMap.get (next); retval = runner.nodeMap == null ? null : (TransientNode) runner.nodeMap.get (next);
if (retval == null) if (retval == null)
retval = (TransientNode) runner.getNode (next, inherit); retval = (TransientNode) runner.getNode (next);
if (retval == null && inherit && runner == this && parent != null)
retval = (TransientNode) parent.getSubnode (next, inherit);
} }
return retval; return retval;
} }
@ -311,12 +302,6 @@ public class TransientNode implements INode, Serializable {
p.node.propMap.remove (p.propname.toLowerCase ()); p.node.propMap.remove (p.propname.toLowerCase ());
} catch (Exception ignore) {} } catch (Exception ignore) {}
} }
/* for (Enumeration e2 = n.properties (); e2.hasMoreElements (); ) {
// tell all nodes that are properties of n that they are no longer used as such
Property p = (Property) n.get ((String) e2.nextElement (), false);
if (p != null && p.type == Property.NODE)
p.unregisterNode ();
} */
// remove all subnodes, giving them a chance to destroy themselves. // remove all subnodes, giving them a chance to destroy themselves.
Vector v = new Vector (); // removeElement modifies the Vector we are enumerating, so we are extra careful. Vector v = new Vector (); // removeElement modifies the Vector we are enumerating, so we are extra careful.
for (Enumeration e3 = n.getSubnodes (); e3.hasMoreElements (); ) { for (Enumeration e3 = n.getSubnodes (); e3.hasMoreElements (); ) {
@ -326,10 +311,6 @@ public class TransientNode implements INode, Serializable {
for (int i=0; i<m; i++) { for (int i=0; i<m; i++) {
n.removeNode ((TransientNode) v.elementAt (i)); n.removeNode ((TransientNode) v.elementAt (i));
} }
if (n.content != null) {
// IServer.getLogger().log ("destroying content of node "+n.getName ());
// ObjectStore.destroy (n.content);
}
} else { } else {
// //
n.links.removeElement (this); n.links.removeElement (this);
@ -372,11 +353,8 @@ public class TransientNode implements INode, Serializable {
} }
private Property getProperty (String propname, boolean inherit) { private Property getProperty (String propname) {
Property prop = propMap == null ? null : (Property) propMap.get (propname); Property prop = propMap == null ? null : (Property) propMap.get (propname);
if (prop == null && inherit && parent != null) {
prop = parent.getProperty (propname, inherit);
}
// check if we have to create a virtual node // check if we have to create a virtual node
if (prop == null && dbmap != null) { if (prop == null && dbmap != null) {
Relation rel = dbmap.getPropertyRelation (propname); Relation rel = dbmap.getPropertyRelation (propname);
@ -400,46 +378,46 @@ public class TransientNode implements INode, Serializable {
} }
public IProperty get (String propname, boolean inherit) { public IProperty get (String propname) {
propname = propname.toLowerCase (); propname = propname.toLowerCase ();
return getProperty (propname, inherit); return getProperty (propname);
} }
public String getString (String propname, String defaultValue, boolean inherit) { public String getString (String propname, String defaultValue) {
String propValue = getString (propname, inherit); String propValue = getString (propname);
return propValue == null ? defaultValue : propValue; return propValue == null ? defaultValue : propValue;
} }
public String getString (String propname, boolean inherit) { public String getString (String propname) {
propname = propname.toLowerCase (); propname = propname.toLowerCase ();
Property prop = getProperty (propname, inherit); Property prop = getProperty (propname);
try { try {
return prop.getStringValue (); return prop.getStringValue ();
} catch (Exception ignore) {} } catch (Exception ignore) {}
return null; return null;
} }
public long getInteger (String propname, boolean inherit) { public long getInteger (String propname) {
propname = propname.toLowerCase (); propname = propname.toLowerCase ();
Property prop = getProperty (propname, inherit); Property prop = getProperty (propname);
try { try {
return prop.getIntegerValue (); return prop.getIntegerValue ();
} catch (Exception ignore) {} } catch (Exception ignore) {}
return 0; return 0;
} }
public double getFloat (String propname, boolean inherit) { public double getFloat (String propname) {
propname = propname.toLowerCase (); propname = propname.toLowerCase ();
Property prop = getProperty (propname, inherit); Property prop = getProperty (propname);
try { try {
return prop.getFloatValue (); return prop.getFloatValue ();
} catch (Exception ignore) {} } catch (Exception ignore) {}
return 0.0; return 0.0;
} }
public Date getDate (String propname, boolean inherit) { public Date getDate (String propname) {
propname = propname.toLowerCase (); propname = propname.toLowerCase ();
Property prop = getProperty (propname, inherit); Property prop = getProperty (propname);
try { try {
return prop.getDateValue (); return prop.getDateValue ();
} catch (Exception ignore) {} } catch (Exception ignore) {}
@ -447,27 +425,27 @@ public class TransientNode implements INode, Serializable {
} }
public boolean getBoolean (String propname, boolean inherit) { public boolean getBoolean (String propname) {
propname = propname.toLowerCase (); propname = propname.toLowerCase ();
Property prop = getProperty (propname, inherit); Property prop = getProperty (propname);
try { try {
return prop.getBooleanValue (); return prop.getBooleanValue ();
} catch (Exception ignore) {} } catch (Exception ignore) {}
return false; return false;
} }
public INode getNode (String propname, boolean inherit) { public INode getNode (String propname) {
propname = propname.toLowerCase (); propname = propname.toLowerCase ();
Property prop = getProperty (propname, inherit); Property prop = getProperty (propname);
try { try {
return prop.getNodeValue (); return prop.getNodeValue ();
} catch (Exception ignore) {} } catch (Exception ignore) {}
return null; return null;
} }
public Object getJavaObject (String propname, boolean inherit) { public Object getJavaObject (String propname) {
propname = propname.toLowerCase (); propname = propname.toLowerCase ();
Property prop = getProperty (propname, inherit); Property prop = getProperty (propname);
try { try {
return prop.getJavaObjectValue (); return prop.getJavaObjectValue ();
} catch (Exception ignore) {} } catch (Exception ignore) {}

View file

@ -485,7 +485,7 @@ public final class Node implements INode, Serializable {
Relation prel = parentmap.getPropertyRelation(); Relation prel = parentmap.getPropertyRelation();
if (prel != null && prel.subnodesAreProperties && prel.accessor != null) { if (prel != null && prel.subnodesAreProperties && prel.accessor != null) {
String propname = dbmap.columnNameToProperty (prel.accessor); String propname = dbmap.columnNameToProperty (prel.accessor);
String propvalue = getString (propname, false); String propvalue = getString (propname);
if (propvalue != null && propvalue.length() > 0) { if (propvalue != null && propvalue.length() > 0) {
setName (propvalue); setName (propvalue);
anonymous = false; anonymous = false;
@ -649,7 +649,7 @@ public final class Node implements INode, Serializable {
// reverse look up property used to access this via parent // reverse look up property used to access this via parent
Relation proprel = dbmap.columnNameToRelation (prel.accessor); Relation proprel = dbmap.columnNameToRelation (prel.accessor);
if (proprel != null && proprel.propName != null) if (proprel != null && proprel.propName != null)
newname = getString (proprel.propName, false); newname = getString (proprel.propName);
} }
} }
@ -687,7 +687,7 @@ public final class Node implements INode, Serializable {
// we only try to fetch a node if an explicit relation is specified for the prop name // we only try to fetch a node if an explicit relation is specified for the prop name
Relation rel = dbmap.propertyToRelation (pinfo.propname); Relation rel = dbmap.propertyToRelation (pinfo.propname);
if (rel != null && rel.reftype == Relation.REFERENCE) if (rel != null && rel.reftype == Relation.REFERENCE)
pn = getNode (pinfo.propname, false); pn = getNode (pinfo.propname);
// the parent of this node is the app's root node... // the parent of this node is the app's root node...
if (pn == null && pinfo.isroot) if (pn == null && pinfo.isroot)
pn = nmgr.getNode ("0", nmgr.getDbMapping ("root")); pn = nmgr.getNode ("0", nmgr.getDbMapping ("root"));
@ -695,13 +695,13 @@ public final class Node implements INode, Serializable {
if (pn != null) { if (pn != null) {
// see if dbmapping specifies anonymity for this node // see if dbmapping specifies anonymity for this node
if (pinfo.virtualname != null) if (pinfo.virtualname != null)
pn = pn.getNode (pinfo.virtualname, false); pn = pn.getNode (pinfo.virtualname);
DbMapping dbm = pn == null ? null : pn.getDbMapping (); DbMapping dbm = pn == null ? null : pn.getDbMapping ();
try { try {
if (dbm != null && dbm.getSubnodeGroupby () != null) { if (dbm != null && dbm.getSubnodeGroupby () != null) {
// check for groupby // check for groupby
rel = dbmap.columnNameToRelation (dbm.getSubnodeGroupby()); rel = dbmap.columnNameToRelation (dbm.getSubnodeGroupby());
pn = pn.getSubnode (getString (rel.propName, false)); pn = pn.getSubnode (getString (rel.propName));
} }
if (pn != null) { if (pn != null) {
setParent ((Node) pn); setParent ((Node) pn);
@ -784,8 +784,8 @@ public final class Node implements INode, Serializable {
Relation groupbyRel = srel.otherType.columnNameToRelation (srel.groupby); Relation groupbyRel = srel.otherType.columnNameToRelation (srel.groupby);
String groupbyProp = (groupbyRel != null) ? String groupbyProp = (groupbyRel != null) ?
groupbyRel.propName : srel.groupby; groupbyRel.propName : srel.groupby;
String groupbyValue = node.getString (groupbyProp, false); String groupbyValue = node.getString (groupbyProp);
INode groupbyNode = getNode (groupbyValue, false); INode groupbyNode = getNode (groupbyValue);
// if group-by node doesn't exist, we'll create it // if group-by node doesn't exist, we'll create it
if (groupbyNode == null) if (groupbyNode == null)
groupbyNode = getGroupbySubnode (groupbyValue, true); groupbyNode = getGroupbySubnode (groupbyValue, true);
@ -821,9 +821,9 @@ public final class Node implements INode, Serializable {
Relation localrel = node.dbmap.columnNameToRelation (prel.accessor); Relation localrel = node.dbmap.columnNameToRelation (prel.accessor);
// if no relation from db column to prop name is found, assume that both are equal // if no relation from db column to prop name is found, assume that both are equal
String propname = localrel == null ? prel.accessor : localrel.propName; String propname = localrel == null ? prel.accessor : localrel.propName;
String prop = node.getString (propname, false); String prop = node.getString (propname);
if (prop != null && prop.length() > 0) { if (prop != null && prop.length() > 0) {
INode old = getNode (prop, false); INode old = getNode (prop);
if (old != null && old != node) { if (old != null && old != node) {
unset (prop); unset (prop);
removeNode (old); removeNode (old);
@ -911,20 +911,20 @@ public final class Node implements INode, Serializable {
// getting this specific child element // getting this specific child element
Relation rel = dbmap.getExactPropertyRelation (name); Relation rel = dbmap.getExactPropertyRelation (name);
if (rel != null) if (rel != null)
return (IPathElement) getNode (name, false); return (IPathElement) getNode (name);
rel = dbmap.getSubnodeRelation (); rel = dbmap.getSubnodeRelation ();
if (rel != null && rel.groupby == null && rel.accessor != null) { if (rel != null && rel.groupby == null && rel.accessor != null) {
if (rel.otherType != null && rel.otherType.isRelational ()) if (rel.otherType != null && rel.otherType.isRelational ())
return (IPathElement) nmgr.getNode (this, name, rel); return (IPathElement) nmgr.getNode (this, name, rel);
else else
return (IPathElement) getNode (name, false); return (IPathElement) getNode (name);
} }
return (IPathElement) getSubnode (name); return (IPathElement) getSubnode (name);
} else { } else {
// no dbmapping - just try child collection first, then named property. // no dbmapping - just try child collection first, then named property.
IPathElement child = (IPathElement) getSubnode (name); IPathElement child = (IPathElement) getSubnode (name);
if (child == null) if (child == null)
child = (IPathElement) getNode (name, false); child = (IPathElement) getNode (name);
return child; return child;
} }
} }
@ -1097,8 +1097,8 @@ public final class Node implements INode, Serializable {
Relation localrel = node.dbmap.columnNameToRelation (prel.accessor); Relation localrel = node.dbmap.columnNameToRelation (prel.accessor);
// if no relation from db column to prop name is found, assume that both are equal // if no relation from db column to prop name is found, assume that both are equal
String propname = localrel == null ? prel.accessor : localrel.propName; String propname = localrel == null ? prel.accessor : localrel.propName;
String prop = node.getString (propname, false); String prop = node.getString (propname);
if (prop != null && getNode (prop, false) == node) if (prop != null && getNode (prop) == node)
unset (prop); unset (prop);
} }
} }
@ -1318,15 +1318,15 @@ public final class Node implements INode, Serializable {
return propMap; return propMap;
} }
public IProperty get (String propname, boolean inherit) { public IProperty get (String propname) {
return getProperty (propname, inherit); return getProperty (propname);
} }
public String getParentInfo () { public String getParentInfo () {
return "anonymous:"+anonymous+",parentHandle"+parentHandle+",parent:"+getParent(); return "anonymous:"+anonymous+",parentHandle"+parentHandle+",parent:"+getParent();
} }
protected Property getProperty (String propname, boolean inherit) { protected Property getProperty (String propname) {
// nmgr.logEvent ("GETTING PROPERTY: "+propname); // nmgr.logEvent ("GETTING PROPERTY: "+propname);
if (propname == null) if (propname == null)
return null; return null;
@ -1382,42 +1382,39 @@ public final class Node implements INode, Serializable {
} }
} }
if (prop == null && inherit && getParent () != null && state != TRANSIENT) {
prop = ((Node) getParent ()).getProperty (propname, inherit);
}
return prop; return prop;
} }
public String getString (String propname, boolean inherit) { public String getString (String propname) {
// propname = propname.toLowerCase (); // propname = propname.toLowerCase ();
Property prop = getProperty (propname, inherit); Property prop = getProperty (propname);
try { try {
return prop.getStringValue (); return prop.getStringValue ();
} catch (Exception ignore) {} } catch (Exception ignore) {}
return null; return null;
} }
public long getInteger (String propname, boolean inherit) { public long getInteger (String propname) {
// propname = propname.toLowerCase (); // propname = propname.toLowerCase ();
Property prop = getProperty (propname, inherit); Property prop = getProperty (propname);
try { try {
return prop.getIntegerValue (); return prop.getIntegerValue ();
} catch (Exception ignore) {} } catch (Exception ignore) {}
return 0; return 0;
} }
public double getFloat (String propname, boolean inherit) { public double getFloat (String propname) {
// propname = propname.toLowerCase (); // propname = propname.toLowerCase ();
Property prop = getProperty (propname, inherit); Property prop = getProperty (propname);
try { try {
return prop.getFloatValue (); return prop.getFloatValue ();
} catch (Exception ignore) {} } catch (Exception ignore) {}
return 0.0; return 0.0;
} }
public Date getDate (String propname, boolean inherit) { public Date getDate (String propname) {
// propname = propname.toLowerCase (); // propname = propname.toLowerCase ();
Property prop = getProperty (propname, inherit); Property prop = getProperty (propname);
try { try {
return prop.getDateValue (); return prop.getDateValue ();
} catch (Exception ignore) {} } catch (Exception ignore) {}
@ -1425,27 +1422,27 @@ public final class Node implements INode, Serializable {
} }
public boolean getBoolean (String propname, boolean inherit) { public boolean getBoolean (String propname) {
// propname = propname.toLowerCase (); // propname = propname.toLowerCase ();
Property prop = getProperty (propname, inherit); Property prop = getProperty (propname);
try { try {
return prop.getBooleanValue (); return prop.getBooleanValue ();
} catch (Exception ignore) {} } catch (Exception ignore) {}
return false; return false;
} }
public INode getNode (String propname, boolean inherit) { public INode getNode (String propname) {
// propname = propname.toLowerCase (); // propname = propname.toLowerCase ();
Property prop = getProperty (propname, inherit); Property prop = getProperty (propname);
try { try {
return prop.getNodeValue (); return prop.getNodeValue ();
} catch (Exception ignore) {} } catch (Exception ignore) {}
return null; return null;
} }
public Object getJavaObject (String propname, boolean inherit) { public Object getJavaObject (String propname) {
// propname = propname.toLowerCase (); // propname = propname.toLowerCase ();
Property prop = getProperty (propname, inherit); Property prop = getProperty (propname);
try { try {
return prop.getJavaObjectValue (); return prop.getJavaObjectValue ();
} catch (Exception ignore) {} } catch (Exception ignore) {}
@ -1489,14 +1486,14 @@ public final class Node implements INode, Serializable {
String dbcolumn = dbmap.propertyToColumnName (propname); String dbcolumn = dbmap.propertyToColumnName (propname);
if (propRel != null && propRel.accessor != null && propRel.accessor.equals (dbcolumn)) { if (propRel != null && propRel.accessor != null && propRel.accessor.equals (dbcolumn)) {
INode n = parent.getNode (value, false); INode n = parent.getNode (value);
if (n != null && n != this) { if (n != null && n != this) {
parent.unset (value); parent.unset (value);
parent.removeNode (n); parent.removeNode (n);
} }
if (oldvalue != null) { if (oldvalue != null) {
n = parent.getNode (oldvalue, false); n = parent.getNode (oldvalue);
if (n == this) { if (n == this) {
parent.unset (oldvalue); parent.unset (oldvalue);
parent.addNode (this); parent.addNode (this);
@ -1805,7 +1802,7 @@ public final class Node implements INode, Serializable {
n.makePersistentCapable (); n.makePersistentCapable ();
} }
for (Enumeration e = properties (); e.hasMoreElements (); ) { for (Enumeration e = properties (); e.hasMoreElements (); ) {
IProperty next = get ((String) e.nextElement (), false); IProperty next = get ((String) e.nextElement ());
if (next != null && next.getType () == IProperty.NODE) { if (next != null && next.getType () == IProperty.NODE) {
Node n = (Node) next.getNodeValue (); Node n = (Node) next.getNodeValue ();
if (n != null && n.state == TRANSIENT) if (n != null && n.state == TRANSIENT)

View file

@ -410,7 +410,7 @@ public final class NodeManager {
Map.Entry e = (Map.Entry) i.next (); Map.Entry e = (Map.Entry) i.next ();
String propname = (String) e.getKey (); String propname = (String) e.getKey ();
Relation rel = (Relation) e.getValue (); Relation rel = (Relation) e.getValue ();
Property p = node.getProperty (propname, false); Property p = node.getProperty (propname);
if (p != null && rel != null) { if (p != null && rel != null) {
switch (p.getType ()) { switch (p.getType ()) {
@ -493,7 +493,7 @@ public final class NodeManager {
(rel.reftype != Relation.REFERENCE && rel.reftype != Relation.PRIMITIVE))) (rel.reftype != Relation.REFERENCE && rel.reftype != Relation.PRIMITIVE)))
continue; continue;
Property p = node.getProperty (propname, false); Property p = node.getProperty (propname);
if (p != null && rel != null) { if (p != null && rel != null) {
@ -864,7 +864,7 @@ public final class NodeManager {
// group nodes. // group nodes.
String groupName = null; String groupName = null;
if (groupbyProp != null) { if (groupbyProp != null) {
groupName = node.getString (groupbyProp, false); groupName = node.getString (groupbyProp);
List sn = (List) groupbySubnodes.get (groupName); List sn = (List) groupbySubnodes.get (groupName);
if (sn == null) { if (sn == null) {
sn = new ExternalizableVector (); sn = new ExternalizableVector ();
@ -876,7 +876,7 @@ public final class NodeManager {
// if relation doesn't use primary key as accessor, get accessor value // if relation doesn't use primary key as accessor, get accessor value
String accessName = null; String accessName = null;
if (accessProp != null) { if (accessProp != null) {
accessName = node.getString (accessProp, false); accessName = node.getString (accessProp);
} }
// register new nodes with the cache. If an up-to-date copy // register new nodes with the cache. If an up-to-date copy

View file

@ -520,10 +520,10 @@ public final class Relation {
if (localName == null || localName.equalsIgnoreCase (ownType.getIDField ())) if (localName == null || localName.equalsIgnoreCase (ownType.getIDField ()))
value = home.getID (); value = home.getID ();
else if (ownType.isRelational ()) else if (ownType.isRelational ())
value = home.getString (ownType.columnNameToProperty (localName), false); value = home.getString (ownType.columnNameToProperty (localName));
else else
value = home.getString (localName, false); value = home.getString (localName);
if (value != null && !value.equals (child.getString (propname, false))) { if (value != null && !value.equals (child.getString (propname))) {
return false; return false;
} }
} }
@ -550,7 +550,7 @@ public final class Relation {
if (localName == null || localName.equalsIgnoreCase (ownType.getIDField ())) { if (localName == null || localName.equalsIgnoreCase (ownType.getIDField ())) {
// only set node if property in child object is defined as reference. // only set node if property in child object is defined as reference.
if (crel.reftype == REFERENCE) { if (crel.reftype == REFERENCE) {
INode currentValue = child.getNode (crel.propName, false); INode currentValue = child.getNode (crel.propName);
// we set the backwards reference iff the reference is currently unset, if // we set the backwards reference iff the reference is currently unset, if
// is set to a transient object, or if the new target is not transient. This // is set to a transient object, or if the new target is not transient. This
// prevents us from overwriting a persistent refererence with a transient one, // prevents us from overwriting a persistent refererence with a transient one,
@ -566,9 +566,9 @@ public final class Relation {
} else if (crel.reftype == PRIMITIVE) { } else if (crel.reftype == PRIMITIVE) {
String value = null; String value = null;
if (ownType.isRelational ()) if (ownType.isRelational ())
value = home.getString (ownType.columnNameToProperty (localName), false); value = home.getString (ownType.columnNameToProperty (localName));
else else
value = home.getString (localName, false); value = home.getString (localName);
if (value != null) { if (value != null) {
child.setString (crel.propName, value); child.setString (crel.propName, value);
} }
@ -629,7 +629,7 @@ public final class Relation {
local = ref.getID (); local = ref.getID ();
else { else {
String homeprop = ownType.columnNameToProperty (localName); String homeprop = ownType.columnNameToProperty (localName);
local = ref.getString (homeprop, false); local = ref.getString (homeprop);
} }
q.append (foreignName); q.append (foreignName);
q.append (" = "); q.append (" = ");

View file

@ -162,9 +162,9 @@ public class XmlConverter implements XmlConstants {
String prototype = helmaKey.substring (0, dot); String prototype = helmaKey.substring (0, dot);
INode node = (INode) nodeCache.get (prototype); INode node = (INode) nodeCache.get (prototype);
helmaKey = helmaKey.substring (dot+1); helmaKey = helmaKey.substring (dot+1);
if (node != null && node.getString(helmaKey, false)==null) if (node != null && node.getString(helmaKey)==null)
node.setString (helmaKey, XmlUtil.getTextContent (childNode)); node.setString (helmaKey, XmlUtil.getTextContent (childNode));
} else if ( helmaNode.getString(helmaKey,false)==null ) { } else if ( helmaNode.getString(helmaKey)==null ) {
helmaNode.setString( helmaKey, XmlUtil.getTextContent(childNode) ); helmaNode.setString( helmaKey, XmlUtil.getTextContent(childNode) );
if (DEBUG) if (DEBUG)
debug("childtext-2-property mapping, setting " + helmaKey + " as string" ); debug("childtext-2-property mapping, setting " + helmaKey + " as string" );
@ -195,10 +195,10 @@ public class XmlConverter implements XmlConstants {
if (node == null) if (node == null)
continue; continue;
if ( node.getNode(helmaKey,false)==null ) { if ( node.getNode(helmaKey)==null ) {
convert( childElement, node.createNode(helmaKey), nodeCache ); convert( childElement, node.createNode(helmaKey), nodeCache );
if (DEBUG) if (DEBUG)
debug( "read " + childElement.toString() + node.getNode(helmaKey,false).toString() ); debug( "read " + childElement.toString() + node.getNode(helmaKey).toString() );
} }
continue; continue;
} }
@ -243,7 +243,7 @@ public class XmlConverter implements XmlConstants {
if ("_children".equals (helmaKey)) { if ("_children".equals (helmaKey)) {
worknode = node; worknode = node;
} else { } else {
worknode = node.getNode( helmaKey, false ); worknode = node.getNode( helmaKey );
if ( worknode==null ) { if ( worknode==null ) {
// if virtual node doesn't exist, create it // if virtual node doesn't exist, create it
worknode = helmaNode.createNode( helmaKey ); worknode = helmaNode.createNode( helmaKey );

View file

@ -190,7 +190,7 @@ public class XmlWriter extends OutputStreamWriter implements XmlConstants {
} }
while ( e.hasMoreElements() ) { while ( e.hasMoreElements() ) {
String key = (String)e.nextElement(); String key = (String)e.nextElement();
IProperty prop = node.get(key,false); IProperty prop = node.get(key);
if ( prop!=null ) { if ( prop!=null ) {
boolean validName = isValidElementName (key); boolean validName = isValidElementName (key);
String elementName, propName; String elementName, propName;

View file

@ -318,7 +318,7 @@ public class ESNode extends ObjectPrototype {
public boolean deleteProperty(String propertyName, int hash) throws EcmaScriptException { public boolean deleteProperty(String propertyName, int hash) throws EcmaScriptException {
checkNode (); checkNode ();
// engine.app.logEvent ("delete property called: "+propertyName); // engine.app.logEvent ("delete property called: "+propertyName);
if (node.get (propertyName, false) != null) { if (node.get (propertyName) != null) {
node.unset (propertyName); node.unset (propertyName);
return true; return true;
} }
@ -389,7 +389,7 @@ public class ESNode extends ObjectPrototype {
return getInternalProperty (propertyName); return getInternalProperty (propertyName);
// this _may_ do a relational query if properties are mapped to a relational type. // this _may_ do a relational query if properties are mapped to a relational type.
IProperty p = node.get (propertyName, false); IProperty p = node.get (propertyName);
if (p != null) { if (p != null) {
if (p.getType () == IProperty.STRING) { if (p.getType () == IProperty.STRING) {
String str = p.getStringValue (); String str = p.getStringValue ();