X-Git-Url: http://git.megacz.com/?p=org.ibex.core.git;a=blobdiff_plain;f=src%2Forg%2Fibex%2Fcore%2FTemplate.java;h=7f342dd8badc06c0de00f502dcb4b795ab8c372c;hp=ddbf5b07f2c70c7e891e581330398b5c95137c52;hb=b0ec2e1d6c3bd35205dfffc6893f01157aef2ced;hpb=9bff7ae2a6824ac83fb1e0ccd455ac3b1277ef3c diff --git a/src/org/ibex/core/Template.java b/src/org/ibex/core/Template.java index ddbf5b0..7f342dd 100644 --- a/src/org/ibex/core/Template.java +++ b/src/org/ibex/core/Template.java @@ -25,7 +25,7 @@ public class Template { 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; @@ -101,7 +101,7 @@ public class Template { 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; @@ -118,7 +118,7 @@ public class Template { // FIXME: should we be resolving all of these in the XML-parsing code? } } - b.putAndTriggerTraps(JS.S(key), val); + b.putAndTriggerTraps(key, val); } } @@ -160,7 +160,7 @@ public class Template { InputStream is = Stream.getInputStream(s); 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 = ""; @@ -202,13 +202,15 @@ public class Template { 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); } @@ -253,16 +255,14 @@ public class Template { 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