String id = null; ///< the id of this box
String redirect = null; ///< the id of the redirect target; only meaningful on a root node
- private String[] keys; ///< keys to be "put" to instances of this template; elements correspond to those of vals
+ private JS[] keys; ///< keys to be "put" to instances of this template; elements correspond to those of vals
private JS[] vals; ///< values to be "put" to instances of this template; elements correspond to those of keys
private String[] urikeys;
private String[] urivals;
for(int i=0; keys != null && i < keys.length; i++) {
if (keys[i] == null) continue;
- String key = keys[i];
+ JS key = keys[i];
JS val = vals[i];
if ("null".equals(val)) val = null;
// FIXME: should we be resolving all of these in the XML-parsing code?
}
}
- b.putAndTriggerTraps(JS.S(key), val);
+ b.putAndTriggerTraps(key, val);
}
}
public TemplateHelper(String sourceName, JS s, Ibex ibex) throws XML.Exn, IOException, JSExn {
this.sourceName = sourceName;
this.ibex = ibex;
- InputStream is = Stream.getInputStream(s);
+ InputStream is = s.getInputStream();
Ibex.Blessing b = Ibex.Blessing.getBlessing(s).parent;
while(b != null) {
- if(b.parentkey != null) initial_uri = b.parentkey + (initial_uri.equals("") ? "" : "." + initial_uri);
+ if(b.parentkey != null) initial_uri = JS.toString(b.parentkey) + (initial_uri.equals("") ? "" : "." + initial_uri);
b = b.parent;
}
initial_uri = "";
break;
}
+ // FIXME: This is all wrong
if (!("ibex://ui".equals(c.getUri()) && "box".equals(c.getLocalName()))) {
String tagname = (c.getUri().equals("") ? "" : (c.getUri() + ".")) + c.getLocalName();
// GROSS hack
try {
// GROSSER hack
// t.prev2 = (Template)t.ibex.resolveString(tagname, false).call(null, null, null, null, 9999);
- throw new Error("FIXME - 9999 thing"); // FIXME:9999 thing
+ if(t.prev2 != null) throw new Error("FIXME: t.prev2 != null");
+ t.prev2 = ((Ibex.Blessing)t.ibex.resolveString(tagname, false)).getTemplate();
} catch (Exception e) {
Log.error(Template.class, e);
}
return ((String)a).compareTo((String)b);
} });
- t.keys = new String[keys.size()];
+ t.keys = new JS[keys.size()];
t.vals = new JS[vals.size()];
- keys.copyInto(t.keys);
- vals.copyInto(t.vals);
-
+
// convert attributes to appropriate types and intern strings
for(int i=0; i<t.keys.length; i++) {
- t.keys[i] = t.keys[i].intern();
-
- String valString = t.vals[i].toString();
+ // FEATURE: Intern
+ t.keys[i] = JS.S((String)keys.elementAt(i));
+ String valString = (String) vals.elementAt(i);
if (valString.equals("true")) t.vals[i] = JS.T;
else if (valString.equals("false")) t.vals[i] = JS.F;