Call getNodeProperty() instead of getProperty() in NodeGet to avoid retrieving

prototype functions.

Fixed skinpath conversion to Java array.
This commit is contained in:
hns 2002-05-14 16:41:35 +00:00
parent 9dcf718733
commit a19a01d19b

View file

@ -198,7 +198,10 @@ public class HopExtension {
esv = thisObject.getProperty (i);
} else {
String name = arguments[0].toString ();
esv = thisObject.getProperty (name, name.hashCode ());
// call esNodeProperty() method special to ESNode because we want to avoid
// retrieving prototype functions when calling hopobject.get().
ESNode esn = (ESNode) thisObject;
esv = esn.getNodeProperty (name);
}
return (esv);
}
@ -581,13 +584,22 @@ public class HopExtension {
// if res.skinpath is set, transform it into an array of java objects
// (strings for directory names and INodes for internal, db-stored skinsets)
ResponseTrans res = fesi.getResponse();
Object[] skinpath = new Object[0];
if (res.skinpath != null && res.skinpath instanceof ArrayPrototype) {
ArrayPrototype array = (ArrayPrototype) res.skinpath;
Object[] skinpath = res.getTranslatedSkinpath ();
if (skinpath == null) {
skinpath = new Object[0];
Object rawSkinpath = res.getSkinpath ();
if (rawSkinpath != null && rawSkinpath instanceof JSWrapper) {
JSWrapper jsw = (JSWrapper) rawSkinpath;
ESObject eso = jsw.getESObject ();
if (eso instanceof ArrayPrototype) {
ArrayPrototype array = (ArrayPrototype) eso;
skinpath = new Object[array.size()];
for (int i=0; i<skinpath.length; i++)
skinpath[i] = array.getProperty(i).toJavaObject ();
}
}
res.setTranslatedSkinpath (skinpath);
}
// ready... retrieve the skin and render it.
Object javaObject = thisObject == null ? null : thisObject.toJavaObject ();