Object[] skinpath = new Object[0]; if (res.skinpath != null && res.skinpath instanceof ArrayPrototype) { ArrayPrototype array = (ArrayPrototype) res.skinpath; skinpath = new Object[array.size()]; for (int i=0; i<skinpath.length; i++) skinpath[i] = array.getProperty(i).toJavaObject ();
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);
        public ESValue callFunction (ESObject thisObj, ESValue[] arguments) throws EcmaScriptException {            if (arguments.length < 1 || arguments.length > 2 || arguments[0] ==null || arguments[0] == ESNull.theNull)                throw new EcmaScriptException ("renderSkin requires one argument containing the skin name and an optional parameter object argument");            try {                Skin skin = null;                ESObject thisObject = global ? null : thisObj;                HashMap params = null;                if (arguments.length > 1 && arguments[1] instanceof ESObject) {                // create an parameter object to pass to the skin                    ESObject paramObject = (ESObject) arguments[1];                    params = new HashMap ();                    for (Enumeration en=paramObject.getProperties(); en.hasMoreElements(); ) {                        String propname = (String) en.nextElement();                        params.put (propname, paramObject.getProperty (propname, propname.hashCode()).toJavaObject());                    }                }                // first, see if the first argument already is a skin object. If not, it's the name of the skin to be called                if (arguments[0] instanceof ESWrapper) {                    Object obj = ((ESWrapper) arguments[0]).toJavaObject ();                    if (obj instanceof Skin)                        skin = (Skin) obj;                }                // 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;                    skinpath = new Object[array.size()];                    for (int i=0; i<skinpath.length; i++)                       skinpath[i] = array.getProperty(i).toJavaObject ();                }                // ready... retrieve the skin and render it.                Object javaObject = thisObject == null ? null : thisObject.toJavaObject ();                if (skin == null)                    skin = app.getSkin (javaObject, arguments[0].toString (), skinpath);                if (asString)                    res.pushStringBuffer ();                if (skin != null)                    skin.render (fesi.getRequestEvaluator(), javaObject, params);                else                    res.write ("[Skin not found: "+arguments[0]+"]");                if (asString)                    return  new ESString (res.popStringBuffer ());            } catch (RedirectException redir) {                // let redirect pass through                throw redir;            } catch (Exception x) {                x.printStackTrace ();                throw new EcmaScriptException ("renderSkin: "+x);            }            return ESNull.theNull;        }