}
}
static void importResource(String path, String type) throws IOException
{
Context context = Context.getCurrent();
if(context==null)
{
Log.warn("Not in context.");
return;
}
Resource resource = new Resource(path, type);
context.getParser().getResolver().resolve(resource, context);
if(!resource.isResolved())
throw new IllegalStateException("resource not resolved.");
try
{
context.getAppContext().addImport(ApplicationContext.load(resource,
context.getParser()));
}
finally
{
Context.setCurrent(context);
}