Scheduler.add(new Scheduler.Task() {
public void perform() throws IOException, JSExn {
Box b = new Box();
- Template t = Template.buildTemplate(Stream.getInputStream((JS)Main.builtin.get("org/ibex/builtin/proxy_authorization.ibex")), new Ibex(null));
+ Template t = Template.buildTemplate("org/ibex/builtin/proxy_authorization.ibex", Stream.getInputStream((JS)Main.builtin.get("org/ibex/builtin/proxy_authorization.ibex")), new Ibex(null));
t.apply(b);
b.put("realm", realm);
b.put("proxyIP", proxyIP);
// XML Parsing /////////////////////////////////////////////////////////////////
- public static Template buildTemplate(InputStream is, Ibex ibex) {
+ public static Template buildTemplate(String sourceName, InputStream is, Ibex ibex) {
try {
- return new TemplateHelper(is, ibex).t;
+ return new TemplateHelper(sourceName, is, ibex).t;
} catch (Exception e) {
Log.error(Template.class, e);
return null;
/** handles XML parsing; builds a Template tree as it goes */
static final class TemplateHelper extends XML {
+ String sourceName;
private int state = STATE_INITIAL;
private static final int STATE_INITIAL = 0;
private static final int STATE_IN_Ibex_NODE = 1;
int meta = 0;
Ibex ibex;
- public TemplateHelper(InputStream is, Ibex ibex) throws XML.Exn, IOException, JSExn {
+ public TemplateHelper(String sourceName, InputStream is, Ibex ibex) throws XML.Exn, IOException, JSExn {
+ this.sourceName = sourceName;
this.ibex = ibex;
parse(new InputStreamReader(is));
JS staticScript = parseScript(static_content, static_content_start);
private JS parseScript(StringBuffer content, int content_start) throws IOException {
if (content == null) return null;
String contentString = content.toString();
- if (contentString.trim().length() > 0) return JS.fromReader("FIXME", content_start, new StringReader(contentString));
+ if (contentString.trim().length() > 0) return JS.fromReader(sourceName, content_start, new StringReader(contentString));
return null;
}