Call getNodeProperty() instead of getProperty() in NodeGet to avoid retrieving
prototype functions. Fixed skinpath conversion to Java array.
This commit is contained in:
parent
9dcf718733
commit
a19a01d19b
1 changed files with 19 additions and 7 deletions
|
@ -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 ();
|
||||
|
|
Loading…
Add table
Reference in a new issue